[FFmpeg-devel] [PATCH 2/3 v1.2] avcodec/vaapi: add fields for VAAPI VC-1 interlaced decoding

Mark Thompson sw at jkqxz.net
Fri Mar 2 00:43:13 EET 2018


On 01/03/18 08:07, Jerome Borsboom wrote:
> v1.1->v1.2: Changed ifdefs around vc1_get_INTCOMPFIELD, vc1_get_LUMSCALE2,
> and vc1_get_LUMSHIFT2 to av_unused.
> 
> avcodec/vaapi: add fields for VAAPI VC-1 interlaced decoding
> 
> Pass necessary bitstream elements to the VAAPI VC-1 decoder in order
> to start doing interlaced decoding in hardware.
> 
> Signed-off-by: Jerome Borsboom <jerome.borsboom at carpalis.nl>
> ---
>  libavcodec/vaapi_vc1.c | 163 ++++++++++++++++++++++++++++++++++++++++---------
>  1 file changed, 134 insertions(+), 29 deletions(-)

Wrt hashes, here is fate/vc1/ilaced_twomv.vc1 from a few different decoders:

libavcodec software decoder:

0,          0,          0,        1,  3110400, 0x764f8856
0,          2,          2,        1,  3110400, 0x3b615b79
0,          3,          3,        1,  3110400, 0x4fbb6f84
0,          4,          4,        1,  3110400, 0xc1ca8532
0,          5,          5,        1,  3110400, 0xb6e7d363
0,          6,          6,        1,  3110400, 0x1beb5c34
0,          7,          7,        1,  3110400, 0xcb8cb061
0,          8,          8,        1,  3110400, 0x13ddbd61
0,          9,          9,        1,  3110400, 0xde8f052f
0,         10,         10,        1,  3110400, 0x4d4072db
0,         11,         11,        1,  3110400, 0x4e5d29e3
0,         12,         12,        1,  3110400, 0x75300531
0,         13,         13,        1,  3110400, 0x1114285a

VAAPI, "Intel i965 driver for Intel(R) Coffee Lake - 2.1.1.pre1 (2.0.0-140-gff23e69)":

0,          0,          0,        1,  3110400, 0xc95e8861
0,          2,          2,        1,  3110400, 0xf58b5cbf
0,          3,          3,        1,  3110400, 0x2f866f33
0,          4,          4,        1,  3110400, 0x05c18415
0,          5,          5,        1,  3110400, 0x94dff199
0,          6,          6,        1,  3110400, 0xf31fda77
0,          7,          7,        1,  3110400, 0x60b1b2da
0,          8,          8,        1,  3110400, 0x748993f5
0,          9,          9,        1,  3110400, 0x750fdf14
0,         10,         10,        1,  3110400, 0x0879792c
0,         11,         11,        1,  3110400, 0x7e0e60fa
0,         12,         12,        1,  3110400, 0xda5bd837
0,         13,         13,        1,  3110400, 0xb6346ccf

VAAPI, "Mesa Gallium driver 18.1.0-devel for AMD Radeon (TM) RX 460 Graphics (POLARIS11 / DRM 3.23.0 / 4.15.7, LLVM 4.0.1)":

0,          0,          0,        1,  3110400, 0xc95e8861
0,          2,          2,        1,  3110400, 0xafefc967
0,          3,          3,        1,  3110400, 0x1d736d3b
0,          4,          4,        1,  3110400, 0x4f0fe807
0,          5,          5,        1,  3110400, 0x758c6e9b
0,          6,          6,        1,  3110400, 0x56a5c92a
0,          7,          7,        1,  3110400, 0xa60fcf66
0,          8,          8,        1,  3110400, 0x0c638017
0,          9,          9,        1,  3110400, 0x3fe3310c
0,         10,         10,        1,  3110400, 0x3d2ea8de
0,         11,         11,        1,  3110400, 0xe2f8de62
0,         12,         12,        1,  3110400, 0xa309cd68
0,         13,         13,        1,  3110400, 0x8602abb1

Microsoft decoder (thanks to Hendrik for these):

0,          0,          0,        1,  3110400, 0xc95e8861
0,          2,          2,        1,  3110400, 0xf58b5cbf
0,          3,          3,        1,  3110400, 0x2f866f33
0,          4,          4,        1,  3110400, 0x05c18415
0,          5,          5,        1,  3110400, 0x4077ca93
0,          6,          6,        1,  3110400, 0x44d105fc
0,          7,          7,        1,  3110400, 0xa0608374
0,          8,          8,        1,  3110400, 0x407689dc
0,          9,          9,        1,  3110400, 0x4707d00a
0,         10,         10,        1,  3110400, 0x74986831
0,         11,         11,        1,  3110400, 0xa5912619
0,         12,         12,        1,  3110400, 0x44aa5565
0,         13,         13,        1,  3110400, 0xb9752774

The VAAPI hardware implementations agree with the Microsoft decoder for the initial four (Intel) or one (AMD) frames, while the software decoder doesn't agree at all.  Unfortunately the AMD output is completely broken after the first frame, but the Intel output does look sensible through the whole sequence.  So, while this could probably be improved in drivers just as it could in the software decoder, the FATE test is not relevant here so this discussion shouldn't block anything.

As such, I'm happy to apply all of this as it is now.  Does anyone have any further comments, especially about the VC-1 parts of this change?  If not, I'll apply the whole set this weekend.

Thanks,

- Mark


More information about the ffmpeg-devel mailing list