[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec vp3.c, 1.52, 1.53 vp3data.h, 1.7, 1.8
Mike Melanson CVS
melanson
Wed May 18 02:11:52 CEST 2005
Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv11498/libavcodec
Modified Files:
vp3.c vp3data.h
Log Message:
replace get_superblock_run_length() with a VLC table
Index: vp3.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/vp3.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- vp3.c 17 May 2005 23:39:23 -0000 1.52
+++ vp3.c 18 May 2005 00:11:49 -0000 1.53
@@ -1182,7 +1182,14 @@
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 @@
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 @@
&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);
Index: vp3data.h
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/vp3data.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- vp3data.h 17 May 2005 23:39:23 -0000 1.7
+++ vp3data.h 18 May 2005 00:11:49 -0000 1.8
@@ -72,6 +72,27 @@
0, 0, 0, 0, 0, 0, 0, 0
};
+static const uint16_t superblock_run_length_vlc_table[34][2] = {
+ { 0, 1 },
+
+ { 4, 3 }, { 5, 3 },
+
+ { 0xC, 4 }, { 0xD, 4 },
+
+ { 0x38, 6 }, { 0x39, 6 }, { 0x3A, 6 }, { 0x3B, 6 },
+
+ { 0xF0, 8 }, { 0xF1, 8 }, { 0xF2, 8 }, { 0xF3, 8 },
+ { 0xF4, 8 }, { 0xF5, 8 }, { 0xF6, 8 }, { 0xF7, 8 },
+
+ { 0x3E0, 10 }, { 0x3E1, 10 }, { 0x3E2, 10 }, { 0x3E3, 10 },
+ { 0x3E4, 10 }, { 0x3E5, 10 }, { 0x3E6, 10 }, { 0x3E7, 10 },
+ { 0x3E8, 10 }, { 0x3E9, 10 }, { 0x3EA, 10 }, { 0x3EB, 10 },
+ { 0x3EC, 10 }, { 0x3ED, 10 }, { 0x3EE, 10 }, { 0x3EF, 10 },
+
+ { 0x3F, 6 } /* this last VLC is a special case for reading 12 more
+ bits from stream and adding the value 34 */
+};
+
static const uint16_t fragment_run_length_vlc_table[30][2] = {
/* 1 -> 2 */
{ 0x0, 2 }, { 0x1, 2 },
More information about the ffmpeg-cvslog
mailing list