aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJason Garrett-Glaser <darkshikari@gmail.com>2009-12-06 15:33:48 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2009-12-06 15:33:48 +0000
commit50ba3fd7133e0b57216a9a1c2b8a1300fa1f8434 (patch)
treecc2d41bc58a92aaf8a050a59892123e5ae487f6d /libavcodec
parentc11cb375207751ff1defc0a0493efe0d63a92651 (diff)
downloadffmpeg-50ba3fd7133e0b57216a9a1c2b8a1300fa1f8434.tar.gz
Faster checks in reverse_dc_prediction.
Patch by Dark Shikari Originally committed as revision 20750 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vp3.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index cc5bc3c01f..f0fe9c13a9 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -1233,7 +1233,6 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)
*/
#define COMPATIBLE_FRAME(x) \
(compatible_frame[s->all_fragments[x].coding_method] == current_frame_type)
-#define FRAME_CODED(x) (s->all_fragments[x].coding_method != MODE_COPY)
#define DC_COEFF(u) (s->coeffs[u].index ? 0 : s->coeffs[u].coeff) //FIXME do somethin to simplify this
static void reverse_dc_prediction(Vp3DecodeContext *s,
@@ -1290,7 +1289,7 @@ static void reverse_dc_prediction(Vp3DecodeContext *s,
* from other INTRA blocks. There are 2 golden frame coding types;
* blocks encoding in these modes can only predict from other blocks
* that were encoded with these 1 of these 2 modes. */
- static const unsigned char compatible_frame[8] = {
+ static const unsigned char compatible_frame[9] = {
1, /* MODE_INTER_NO_MV */
0, /* MODE_INTRA */
1, /* MODE_INTER_PLUS_MV */
@@ -1298,7 +1297,8 @@ static void reverse_dc_prediction(Vp3DecodeContext *s,
1, /* MODE_INTER_PRIOR_MV */
2, /* MODE_USING_GOLDEN */
2, /* MODE_GOLDEN_MV */
- 1 /* MODE_INTER_FOUR_MV */
+ 1, /* MODE_INTER_FOUR_MV */
+ 3 /* MODE_COPY */
};
int current_frame_type;
@@ -1326,24 +1326,24 @@ static void reverse_dc_prediction(Vp3DecodeContext *s,
if(x){
l= i-1;
vl = DC_COEFF(l);
- if(FRAME_CODED(l) && COMPATIBLE_FRAME(l))
+ if(COMPATIBLE_FRAME(l))
transform |= PL;
}
if(y){
u= i-fragment_width;
vu = DC_COEFF(u);
- if(FRAME_CODED(u) && COMPATIBLE_FRAME(u))
+ if(COMPATIBLE_FRAME(u))
transform |= PU;
if(x){
ul= i-fragment_width-1;
vul = DC_COEFF(ul);
- if(FRAME_CODED(ul) && COMPATIBLE_FRAME(ul))
+ if(COMPATIBLE_FRAME(ul))
transform |= PUL;
}
if(x + 1 < fragment_width){
ur= i-fragment_width+1;
vur = DC_COEFF(ur);
- if(FRAME_CODED(ur) && COMPATIBLE_FRAME(ur))
+ if(COMPATIBLE_FRAME(ur))
transform |= PUR;
}
}