[FFmpeg-cvslog] vaapi: mpeg2: fix slice_vertical_position calculation.

Gwenole Beauchesne git at videolan.org
Sun Apr 8 21:08:02 CEST 2012


ffmpeg | branch: master | Gwenole Beauchesne <gb.devel at gmail.com> | Sun Mar 18 09:30:05 2012 +0100| [58e1032d8fddab10fc2cae845aa84c5772d4cdca] | committer: Martin Storsjö

vaapi: mpeg2: fix slice_vertical_position calculation.

VASliceParameterBufferMPEG2.slice_vertical_position shall express
the slice vertical position from the original bitstream. The HW
decoder will correctly decode to the right line computed from the
appropriate top_field_first and is_first_field flags.

This patch aligns with DXVA's definition, which is what most HW and
drivers expect. In particular, Intel PowerVR (Cedarview et al.) and
NVIDIA (through VA-to-VDPAU layer). Since it looks more complex to fix
binary drivers, I aligned the Intel Gen driver (Sandy Bridge et al.)
to this behaviour, while maintaining compatibility with codec layers
not providing this patch yet.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne at intel.com>
Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58e1032d8fddab10fc2cae845aa84c5772d4cdca
---

 libavcodec/vaapi_mpeg2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/vaapi_mpeg2.c b/libavcodec/vaapi_mpeg2.c
index 95107c8..ee7b536 100644
--- a/libavcodec/vaapi_mpeg2.c
+++ b/libavcodec/vaapi_mpeg2.c
@@ -132,7 +132,7 @@ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer
         return -1;
     slice_param->macroblock_offset              = macroblock_offset;
     slice_param->slice_horizontal_position      = s->mb_x;
-    slice_param->slice_vertical_position        = s->mb_y;
+    slice_param->slice_vertical_position        = s->mb_y >> (s->picture_structure != PICT_FRAME);
     slice_param->quantiser_scale_code           = quantiser_scale_code;
     slice_param->intra_slice_flag               = intra_slice_flag;
     return 0;



More information about the ffmpeg-cvslog mailing list