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@intel.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
User-provided data should never trigger an assert; return error instead.
Also fix an instance of get_bits where get_bits_long should have been used.
This eliminates the following warning:
libavcodec/vaapi_mpeg2.c:112:14: warning: variable 'start_code' set but not used
down to ~60 bytes vs. a few KBs before, and gets rid of explicit VA data types.
Originally committed as revision 18256 to svn://svn.ffmpeg.org/ffmpeg/trunk