Commit 8132d362 authored by Jerome Borsboom's avatar Jerome Borsboom Committed by Mark Thompson

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: 's avatarJerome Borsboom <jerome.borsboom@carpalis.nl>
parent daba3694
...@@ -138,8 +138,9 @@ static int vc1_get_FPTYPE(const VC1Context *v) ...@@ -138,8 +138,9 @@ static int vc1_get_FPTYPE(const VC1Context *v)
/** Reconstruct bitstream MVMODE (7.1.1.32) */ /** Reconstruct bitstream MVMODE (7.1.1.32) */
static inline VAMvModeVC1 vc1_get_MVMODE(const VC1Context *v) static inline VAMvModeVC1 vc1_get_MVMODE(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_B && !v->bi_type)) ((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 get_VAMvModeVC1(v->mv_mode);
return 0; return 0;
} }
...@@ -147,7 +148,8 @@ static inline VAMvModeVC1 vc1_get_MVMODE(const VC1Context *v) ...@@ -147,7 +148,8 @@ static inline VAMvModeVC1 vc1_get_MVMODE(const VC1Context *v)
/** Reconstruct bitstream MVMODE2 (7.1.1.33) */ /** Reconstruct bitstream MVMODE2 (7.1.1.33) */
static inline VAMvModeVC1 vc1_get_MVMODE2(const VC1Context *v) 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) v->mv_mode == MV_PMODE_INTENSITY_COMP)
return get_VAMvModeVC1(v->mv_mode2); return get_VAMvModeVC1(v->mv_mode2);
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment