aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMashiat Sarker Shakkhar <mashiat.sarker@gmail.com>2012-10-09 19:38:18 +0000
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2012-10-10 14:55:38 -0400
commiteb657ecefdeb8b2ed9bfb55d3c2c9e0f568486bf (patch)
tree6695e67a2831c6971d07c60836b3f79b7c810cdf /libavcodec
parent7cc3c4e1d4179aeabcd891090e31ee5e5bfd9692 (diff)
downloadffmpeg-eb657ecefdeb8b2ed9bfb55d3c2c9e0f568486bf.tar.gz
vc1dec: Set opposite to the correct value for 1REF field pictures
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vc1dec.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 491e200a52..40164cc9db 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -1458,10 +1458,16 @@ static inline void vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y,
}
if (v->field_mode) {
- if (num_samefield <= num_oppfield)
- opposite = 1 - pred_flag;
- else
- opposite = pred_flag;
+ if (!v->numref)
+ // REFFIELD determines if the last field or the second-last field is
+ // to be used as reference
+ opposite = 1 - v->reffield;
+ else {
+ if (num_samefield <= num_oppfield)
+ opposite = 1 - pred_flag;
+ else
+ opposite = pred_flag;
+ }
} else
opposite = 0;
if (opposite) {