diff dsputil.c @ 200:6ab301aaa652 libavcodec

(commit by michael) dequantizers skip trailing zeros msmpeg4 non-intra decoder has its dequantizer "build in" now
author arpi_esp
date Sun, 13 Jan 2002 04:59:37 +0000
parents 9e0e56869d05
children c0d8ecae7ac5
line wrap: on
line diff
--- a/dsputil.c	Sat Jan 12 20:21:51 2002 +0000
+++ b/dsputil.c	Sun Jan 13 04:59:37 2002 +0000
@@ -83,9 +83,24 @@
 	0x32, 0x3A, 0x33, 0x3B, 0x36, 0x3E, 0x37, 0x3F,
 };
 
+/* used to skip zeros at the end */
+UINT8 zigzag_end[64];
+
 UINT8 permutation[64];
 //UINT8 invPermutation[64];
 
+static void build_zigzag_end()
+{
+    int lastIndex;
+    int lastIndexAfterPerm=0;
+    for(lastIndex=0; lastIndex<64; lastIndex++)
+    {
+        if(zigzag_direct[lastIndex] > lastIndexAfterPerm) 
+            lastIndexAfterPerm= zigzag_direct[lastIndex];
+        zigzag_end[lastIndex]= lastIndexAfterPerm + 1;
+    }
+}
+
 void get_pixels_c(DCTELEM *block, const UINT8 *pixels, int line_size)
 {
     DCTELEM *p;
@@ -509,4 +524,6 @@
         block_permute(default_intra_matrix);
         block_permute(default_non_intra_matrix);
     }
+    
+    build_zigzag_end();
 }