[Libva] [PATCH 2/4] mpeg2: fix TFF calculation (IVB).
Gwenole Beauchesne
gb.devel at gmail.com
Fri Mar 16 00:19:47 PDT 2012
---
src/gen7_mfd.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/src/gen7_mfd.c b/src/gen7_mfd.c
index c995206..706025b 100644
--- a/src/gen7_mfd.c
+++ b/src/gen7_mfd.c
@@ -1090,10 +1090,18 @@ gen7_mfd_mpeg2_pic_state(VADriverContextP ctx,
{
struct intel_batchbuffer *batch = gen7_mfd_context->base.batch;
VAPictureParameterBufferMPEG2 *pic_param;
+ unsigned int tff, pic_structure;
assert(decode_state->pic_param && decode_state->pic_param->buffer);
pic_param = (VAPictureParameterBufferMPEG2 *)decode_state->pic_param->buffer;
+ pic_structure = pic_param->picture_coding_extension.bits.picture_structure;
+ if (pic_structure == MPEG_FRAME)
+ tff = pic_param->picture_coding_extension.bits.top_field_first;
+ else
+ tff = !(pic_param->picture_coding_extension.bits.is_first_field ^
+ (pic_structure & MPEG_TOP_FIELD));
+
BEGIN_BCS_BATCH(batch, 13);
OUT_BCS_BATCH(batch, MFX_MPEG2_PIC_STATE | (13 - 2));
OUT_BCS_BATCH(batch,
@@ -1103,7 +1111,7 @@ gen7_mfd_mpeg2_pic_state(VADriverContextP ctx,
((pic_param->f_code >> 12) & 0xf) << 16 | /* f_code[0][0] */
pic_param->picture_coding_extension.bits.intra_dc_precision << 14 |
pic_param->picture_coding_extension.bits.picture_structure << 12 |
- pic_param->picture_coding_extension.bits.top_field_first << 11 |
+ tff << 11 |
pic_param->picture_coding_extension.bits.frame_pred_frame_dct << 10 |
pic_param->picture_coding_extension.bits.concealment_motion_vectors << 9 |
pic_param->picture_coding_extension.bits.q_scale_type << 8 |
--
1.7.5.4
More information about the Libva
mailing list