diff options
author | Jerome Borsboom <jerome.borsboom@carpalis.nl> | 2018-03-29 13:43:34 +0200 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2018-04-23 23:11:29 +0100 |
commit | 8132d362facd6bde7dd158733bf2b4723295ec5b (patch) | |
tree | aa81fb3694fce0cc1705b8b8a7c1be470c92986c | |
parent | daba369471376953ee558dabe100d5eca0d89b02 (diff) | |
download | ffmpeg-8132d362facd6bde7dd158733bf2b4723295ec5b.tar.gz |
avcodec/vaapi: do not parse MVMODE for VC-1 interlaced frame pictures
Interlaced frame pictures do not contain the MVMODE or MVMODE2 bitstream
element. Trying to parse this element and passing a nonzero value to the
hardware decoder results in small inaccuracies in the decoded picture.
Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
-rw-r--r-- | libavcodec/vaapi_vc1.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c index 74ba783141..bdb5e24cc5 100644 --- a/libavcodec/vaapi_vc1.c +++ b/libavcodec/vaapi_vc1.c @@ -138,8 +138,9 @@ static int vc1_get_FPTYPE(const VC1Context *v) /** Reconstruct bitstream MVMODE (7.1.1.32) */ static inline VAMvModeVC1 vc1_get_MVMODE(const VC1Context *v) { - if ((v->s.pict_type == AV_PICTURE_TYPE_P && !v->p_frame_skipped) || - (v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type)) + if ((v->fcm == PROGRESSIVE || v->fcm == ILACE_FIELD) && + ((v->s.pict_type == AV_PICTURE_TYPE_P && !v->p_frame_skipped) || + (v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type))) return get_VAMvModeVC1(v->mv_mode); return 0; } @@ -147,7 +148,8 @@ static inline VAMvModeVC1 vc1_get_MVMODE(const VC1Context *v) /** Reconstruct bitstream MVMODE2 (7.1.1.33) */ static inline VAMvModeVC1 vc1_get_MVMODE2(const VC1Context *v) { - if ((v->s.pict_type == AV_PICTURE_TYPE_P && !v->p_frame_skipped) && + if ((v->fcm == PROGRESSIVE || v->fcm == ILACE_FIELD) && + (v->s.pict_type == AV_PICTURE_TYPE_P && !v->p_frame_skipped) && v->mv_mode == MV_PMODE_INTENSITY_COMP) return get_VAMvModeVC1(v->mv_mode2); return 0; |