diff options
author | carpalis <jerome.borsboom@carpalis.nl> | 2017-11-01 19:45:42 +0100 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2018-01-05 14:57:31 +0800 |
commit | fb65a37b90f35abed8b628da060246daad7ec4ca (patch) | |
tree | 26962b742a1a03b1d369fe0874f96ae991ea8afd /src/gen8_mfd.c | |
parent | 30da278c3ce4d80afa35e37154cf32c585c3e3a9 (diff) | |
download | libva-intel-driver-fb65a37b90f35abed8b628da060246daad7ec4ca.tar.gz |
genX_mfd: clean up the use of profile bitstream element
Only gen6 needs mapping from input range to the hardware range for
the profile bitstream element. For gen7 and up there is no need for a
mapping as the hardware uses only one bit indicating simple/main profile
or advanced profile. Therefore, we can remove the mapping for gen7 and
clean up the code a bit.
Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
Diffstat (limited to 'src/gen8_mfd.c')
-rw-r--r-- | src/gen8_mfd.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/gen8_mfd.c b/src/gen8_mfd.c index 6d4efbad..12af5dba 100644 --- a/src/gen8_mfd.c +++ b/src/gen8_mfd.c @@ -1246,13 +1246,6 @@ static const int va_to_gen7_vc1_condover[3] = { 3 }; -static const int va_to_gen7_vc1_profile[4] = { - GEN7_VC1_SIMPLE_PROFILE, - GEN7_VC1_MAIN_PROFILE, - GEN7_VC1_RESERVED_PROFILE, - GEN7_VC1_ADVANCED_PROFILE -}; - static const int fptype_to_picture_type[8][2] = { {GEN7_VC1_I_PICTURE, GEN7_VC1_I_PICTURE}, {GEN7_VC1_I_PICTURE, GEN7_VC1_P_PICTURE}, @@ -1658,7 +1651,6 @@ gen8_mfd_vc1_pic_state(VADriverContextP ctx, int fcm = 0; int picture_type; int ptype; - int profile; int overlap = 0; int interpolation_mode = 0; int height_in_mbs; @@ -1683,7 +1675,6 @@ gen8_mfd_vc1_pic_state(VADriverContextP ctx, height_in_mbs = ALIGN(pic_param->coded_height, 32) / 32; } - profile = va_to_gen7_vc1_profile[pic_param->sequence_fields.bits.profile]; dquant = pic_param->pic_quantizer_fields.bits.dquant; dquantfrm = pic_param->pic_quantizer_fields.bits.dq_frame; dqprofile = pic_param->pic_quantizer_fields.bits.dq_profile; @@ -1742,7 +1733,7 @@ gen8_mfd_vc1_pic_state(VADriverContextP ctx, } } - if (profile == GEN7_VC1_MAIN_PROFILE && + if (pic_param->sequence_fields.bits.profile == 1 && /* Main Profile */ pic_param->sequence_fields.bits.rangered) { obj_surface = decode_state->reference_objects[0]; @@ -1898,7 +1889,7 @@ gen8_mfd_vc1_pic_state(VADriverContextP ctx, } if (pic_param->sequence_fields.bits.overlap) { - if (profile == GEN7_VC1_ADVANCED_PROFILE) { + if (pic_param->sequence_fields.bits.profile == 3) { /* Advanced Profile */ if (picture_type == GEN7_VC1_P_PICTURE && pic_param->pic_quantizer_fields.bits.pic_quantizer_scale >= 9) { overlap = 1; @@ -1944,7 +1935,7 @@ gen8_mfd_vc1_pic_state(VADriverContextP ctx, loopfilter << 5 | overlap << 4 | !is_first_field << 3 | - (pic_param->sequence_fields.bits.profile == 3) << 0); + (pic_param->sequence_fields.bits.profile == 3) << 0); /* Advanced Profile */ OUT_BCS_BATCH(batch, va_to_gen7_vc1_condover[pic_param->conditional_overlap_flag] << 29 | ptype << 26 | @@ -2217,9 +2208,7 @@ gen8_mfd_vc1_get_macroblock_bit_offset(uint8_t *buf, int in_slice_data_bit_offse int slice_header_size = in_slice_data_bit_offset / 8; int i, j; - if (profile != 3) - out_slice_data_bit_offset = in_slice_data_bit_offset; - else { + if (profile == 3) { /* Advanced Profile */ for (i = 0, j = 0; i < slice_header_size; i++, j++) { if (!buf[j] && !buf[j + 1] && buf[j + 2] == 3 && buf[j + 3] < 4) { if (i < slice_header_size - 1) @@ -2232,7 +2221,8 @@ gen8_mfd_vc1_get_macroblock_bit_offset(uint8_t *buf, int in_slice_data_bit_offse } out_slice_data_bit_offset = 8 * j + in_slice_data_bit_offset % 8; - } + } else /* Simple or Main Profile */ + out_slice_data_bit_offset = in_slice_data_bit_offset; return out_slice_data_bit_offset; } |