summaryrefslogtreecommitdiff
path: root/libavcodec/vc1dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-20 02:23:36 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-20 02:34:51 +0200
commitd0492578c805cfd41673aa2cdadf52efde40e307 (patch)
tree14fa2c0efa9f3a2c16d946cad36bc10edf0b39f6 /libavcodec/vc1dec.c
parent9ef714328c9527f67be193a120821048b1fe86b5 (diff)
parent8096fdf0b6886305ea1a8cb2c869ab2732cd8e11 (diff)
downloadffmpeg-d0492578c805cfd41673aa2cdadf52efde40e307.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: presets: rename presets directory lavc: make avcodec_get_context_defaults3 "officially" public lavf: replace av_new_stream->avformat_new_stream part II. lavf,lavd: replace av_new_stream->avformat_new_stream part I. lavf: add avformat_new_stream as a replacement for av_new_stream. Use correct scaling table for bwd-pred MVs in second B-field Ut Video decoder Makefile: change presets extension to .avpreset lavfi: add rgbtestsrc source, ported from MPlayer libmpcodecs lavfi: add testsrc source AVOptions: add documentation. presets: update libx264 ffpresets Conflicts: Changelog doc/APIchanges doc/ffmpeg.texi ffpresets/libx264-ipod320.ffpreset ffpresets/libx264-ipod640.ffpreset ffserver.c libavcodec/avcodec.h libavcodec/options.c libavcodec/version.h libavdevice/libdc1394.c libavfilter/avfilter.h libavfilter/vsrc_testsrc.c libavformat/flvdec.c libavformat/riff.c libavformat/version.h libavformat/wtv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r--libavcodec/vc1dec.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index d23d04c3c8..69fd5be7be 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -1291,6 +1291,7 @@ static av_always_inline int scaleforsame_x(VC1Context *v, int n /* MV */, int di
int scaledvalue, refdist;
int scalesame1, scalesame2;
int scalezone1_x, zone1offset_x;
+ int table_index = dir ^ v->second_field;
if (v->s.pict_type != AV_PICTURE_TYPE_B)
refdist = v->refdist;
@@ -1298,10 +1299,10 @@ static av_always_inline int scaleforsame_x(VC1Context *v, int n /* MV */, int di
refdist = dir ? v->brfd : v->frfd;
if (refdist > 3)
refdist = 3;
- scalesame1 = vc1_field_mvpred_scales[v->second_field][1][refdist];
- scalesame2 = vc1_field_mvpred_scales[v->second_field][2][refdist];
- scalezone1_x = vc1_field_mvpred_scales[v->second_field][3][refdist];
- zone1offset_x = vc1_field_mvpred_scales[v->second_field][5][refdist];
+ scalesame1 = vc1_field_mvpred_scales[table_index][1][refdist];
+ scalesame2 = vc1_field_mvpred_scales[table_index][2][refdist];
+ scalezone1_x = vc1_field_mvpred_scales[table_index][3][refdist];
+ zone1offset_x = vc1_field_mvpred_scales[table_index][5][refdist];
if (FFABS(n) > 255)
scaledvalue = n;
@@ -1323,6 +1324,7 @@ static av_always_inline int scaleforsame_y(VC1Context *v, int i, int n /* MV */,
int scaledvalue, refdist;
int scalesame1, scalesame2;
int scalezone1_y, zone1offset_y;
+ int table_index = dir ^ v->second_field;
if (v->s.pict_type != AV_PICTURE_TYPE_B)
refdist = v->refdist;
@@ -1330,10 +1332,10 @@ static av_always_inline int scaleforsame_y(VC1Context *v, int i, int n /* MV */,
refdist = dir ? v->brfd : v->frfd;
if (refdist > 3)
refdist = 3;
- scalesame1 = vc1_field_mvpred_scales[v->second_field][1][refdist];
- scalesame2 = vc1_field_mvpred_scales[v->second_field][2][refdist];
- scalezone1_y = vc1_field_mvpred_scales[v->second_field][4][refdist];
- zone1offset_y = vc1_field_mvpred_scales[v->second_field][6][refdist];
+ scalesame1 = vc1_field_mvpred_scales[table_index][1][refdist];
+ scalesame2 = vc1_field_mvpred_scales[table_index][2][refdist];
+ scalezone1_y = vc1_field_mvpred_scales[table_index][4][refdist];
+ zone1offset_y = vc1_field_mvpred_scales[table_index][6][refdist];
if (FFABS(n) > 63)
scaledvalue = n;
@@ -1444,7 +1446,7 @@ static av_always_inline int scaleforopp(VC1Context *v, int n /* MV */,
refdist = FFMIN(v->refdist, 3);
else
refdist = dir ? v->brfd : v->frfd;
- scaleopp = vc1_field_mvpred_scales[v->second_field][0][refdist];
+ scaleopp = vc1_field_mvpred_scales[dir ^ v->second_field][0][refdist];
return n * scaleopp >> 8;
}