aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vp3.c
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2005-05-18 00:11:49 +0000
committerMike Melanson <mike@multimedia.cx>2005-05-18 00:11:49 +0000
commitd8278bab79ffc82f449522766fbd505dd64b6c1c (patch)
tree46776cd86fa0e1178cad1d6b1cde5871e1a932c0 /libavcodec/vp3.c
parent0ad72bdd5cb493df78c660b9859a8b890018926a (diff)
downloadffmpeg-d8278bab79ffc82f449522766fbd505dd64b6c1c.tar.gz
replace get_superblock_run_length() with a VLC table
Originally committed as revision 4267 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r--libavcodec/vp3.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index ad72965e4c..9e9939abb9 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -1182,7 +1182,14 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
while (current_superblock < s->superblock_count) {
if (current_run == 0) {
bit ^= 1;
+#if 1
+ current_run = get_vlc2(gb,
+ s->superblock_run_length_vlc.table, 6, 2) + 1;
+ if (current_run == 34)
+ current_run += get_bits(gb, 12);
+#else
current_run = get_superblock_run_length(gb);
+#endif
debug_block_coding(" setting superblocks %d..%d to %s\n",
current_superblock,
current_superblock + current_run - 1,
@@ -1221,7 +1228,14 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
if (current_run == 0) {
bit ^= 1;
+#if 1
+ current_run = get_vlc2(gb,
+ s->superblock_run_length_vlc.table, 6, 2) + 1;
+ if (current_run == 34)
+ current_run += get_bits(gb, 12);
+#else
current_run = get_superblock_run_length(gb);
+#endif
}
debug_block_coding(" setting superblock %d to %s\n",
@@ -2630,6 +2644,10 @@ static int vp3_decode_init(AVCodecContext *avctx)
&ac_bias_3[i][0][0], 4, 2, 0);
}
+ init_vlc(&s->superblock_run_length_vlc, 6, 34,
+ &superblock_run_length_vlc_table[0][1], 4, 2,
+ &superblock_run_length_vlc_table[0][0], 4, 2, 0);
+
init_vlc(&s->fragment_run_length_vlc, 5, 31,
&fragment_run_length_vlc_table[0][1], 4, 2,
&fragment_run_length_vlc_table[0][0], 4, 2, 0);