changeset 1986:c8e866f4515f libavcodec

simplify
author michael
date Tue, 27 Apr 2004 13:50:41 +0000
parents b2bc62fdecc0
children d9e067853051
files mpeg12.c mpeg12data.h
diffstat 2 files changed, 1 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/mpeg12.c	Tue Apr 27 04:06:24 2004 +0000
+++ b/mpeg12.c	Tue Apr 27 13:50:41 2004 +0000
@@ -777,7 +777,7 @@
 
 		adiff = ABS(diff);
 		if(diff<0) diff--;
-		index = vlc_dc_table[adiff];
+		index = av_log2(2*adiff);
 
 		bits= vlc_dc_lum_bits[index] + index;
 		code= (vlc_dc_lum_code[index]<<index) + (diff & ((1 << index) - 1));
--- a/mpeg12data.h	Tue Apr 27 04:06:24 2004 +0000
+++ b/mpeg12data.h	Tue Apr 27 13:50:41 2004 +0000
@@ -25,29 +25,6 @@
     16, 16, 16, 16, 16, 16, 16, 16,
 };
 
-static const unsigned char vlc_dc_table[256] = {
-    0, 1, 2, 2,
-    3, 3, 3, 3,
-    4, 4, 4, 4, 4, 4, 4, 4,
-    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
-    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
-
-    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
-
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
-};
-
 static const uint16_t vlc_dc_lum_code[12] = {
     0x4, 0x0, 0x1, 0x5, 0x6, 0xe, 0x1e, 0x3e, 0x7e, 0xfe, 0x1fe, 0x1ff,
 };