aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vp3.c
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2005-05-21 01:12:41 +0000
committerMike Melanson <mike@multimedia.cx>2005-05-21 01:12:41 +0000
commit7f9926a45eeab7e25b9e381fc35b1342fde826cb (patch)
treef83017488932d78d9b530aabcd3c054df8906aa8 /libavcodec/vp3.c
parent3f2bf07ba72bf4caf24cc567916f146b7baaa7c0 (diff)
downloadffmpeg-7f9926a45eeab7e25b9e381fc35b1342fde826cb.tar.gz
another bitstream extraction to optimize: fixed-length motion vectors
Originally committed as revision 4286 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r--libavcodec/vp3.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 1f0718e3d7..160dcfb5a8 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -1540,9 +1540,15 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
motion_y[0] = get_motion_vector_vlc(gb);
#endif
} else {
+#if 1
+ motion_x[0] = fixed_motion_vector_table[get_bits(gb, 6)];
+ motion_y[0] = fixed_motion_vector_table[get_bits(gb, 6)];
+#else
motion_x[0] = get_motion_vector_fixed(gb);
motion_y[0] = get_motion_vector_fixed(gb);
+#endif
}
+
for (k = 1; k < 6; k++) {
motion_x[k] = motion_x[0];
motion_y[k] = motion_y[0];
@@ -1572,8 +1578,13 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
motion_y[k] = get_motion_vector_vlc(gb);
#endif
} else {
+#if 1
+ motion_x[k] = fixed_motion_vector_table[get_bits(gb, 6)];
+ motion_y[k] = fixed_motion_vector_table[get_bits(gb, 6)];
+#else
motion_x[k] = get_motion_vector_fixed(gb);
motion_y[k] = get_motion_vector_fixed(gb);
+#endif
}
motion_x[4] += motion_x[k];
motion_y[4] += motion_y[k];