summaryrefslogtreecommitdiff
path: root/src/gen6_mfd.c
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-02-27 13:57:09 +0100
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-03-18 09:10:11 +0100
commit01c37fad8c991714026d6a995e9e35cc7865933e (patch)
tree9645eba8becd2844c1e20b2b2440c15003c40ddf /src/gen6_mfd.c
parent298dc939835e3080c9330b4e52e8dfac25bf3060 (diff)
downloadlibva-intel-driver-01c37fad8c991714026d6a995e9e35cc7865933e.tar.gz
mpeg2: fix TFF calculation (SNB).
Gen6 has specific requirements for the TFF flag, and thus has different semantics than Gen7 (IVB). In particular, HW uses picture_structure and TFF flag to determine the correct field to render. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Diffstat (limited to 'src/gen6_mfd.c')
-rw-r--r--src/gen6_mfd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gen6_mfd.c b/src/gen6_mfd.c
index 5d52d763..367294f3 100644
--- a/src/gen6_mfd.c
+++ b/src/gen6_mfd.c
@@ -1142,10 +1142,18 @@ gen6_mfd_mpeg2_pic_state(VADriverContextP ctx,
{
struct intel_batchbuffer *batch = gen6_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, 4);
OUT_BCS_BATCH(batch, MFX_MPEG2_PIC_STATE | (4 - 2));
OUT_BCS_BATCH(batch,
@@ -1155,7 +1163,7 @@ gen6_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 |