[FFmpeg-soc] [soc]: r1053 - in jpeg2000: j2k.c j2k.h

k.nowosad subversion at mplayerhq.hu
Mon Aug 20 16:35:39 CEST 2007


Author: k.nowosad
Date: Mon Aug 20 16:35:38 2007
New Revision: 1053

Log:
inlined the wrapper functions using luts 


Modified:
   jpeg2000/j2k.c
   jpeg2000/j2k.h

Modified: jpeg2000/j2k.c
==============================================================================
--- jpeg2000/j2k.c	(original)
+++ jpeg2000/j2k.c	Mon Aug 20 16:35:38 2007
@@ -83,12 +83,7 @@ J2kTgtNode *ff_j2k_tag_tree_init(int w, 
     return res;
 }
 
-static uint8_t nbctxno_lut[256][4];
-
-int ff_j2k_getnbctxno(int flag, int bandno)
-{
-    return nbctxno_lut[flag&255][bandno];
-}
+uint8_t ff_j2k_nbctxno_lut[256][4];
 
 static int getnbctxno(int flag, int bandno)
 {
@@ -146,19 +141,7 @@ static int getnbctxno(int flag, int band
     assert(0);
 }
 
-int ff_j2k_getrefctxno(int flag)
-{
-    static const uint8_t refctxno_lut[2][2] = {{14, 15}, {16, 16}};
-    return refctxno_lut[flag>>14][(flag & 255) != 0];
-}
-
-static uint8_t sgnctxno_lut[16][16], xorbit_lut[16][16];
-
-int ff_j2k_getsgnctxno(int flag, int *xorbit)
-{
-    *xorbit = xorbit_lut[flag&15][(flag>>8)&15];
-    return  sgnctxno_lut[flag&15][(flag>>8)&15];
-}
+uint8_t ff_j2k_sgnctxno_lut[16][16], ff_j2k_xorbit_lut[16][16];
 
 static int getsgnctxno(int flag, uint8_t *xorbit)
 {
@@ -180,10 +163,10 @@ void ff_j2k_init_tier1_luts()
     int i, j;
     for (i = 0; i < 256; i++)
         for (j = 0; j < 4; j++)
-            nbctxno_lut[i][j] = getnbctxno(i, j);
+            ff_j2k_nbctxno_lut[i][j] = getnbctxno(i, j);
     for (i = 0; i < 16; i++)
         for (j = 0; j < 16; j++)
-            sgnctxno_lut[i][j] = getsgnctxno(i + (j << 8), &xorbit_lut[i][j]);
+            ff_j2k_sgnctxno_lut[i][j] = getsgnctxno(i + (j << 8), &ff_j2k_xorbit_lut[i][j]);
 }
 
 void ff_j2k_set_significant(J2kT1Context *t1, int x, int y)

Modified: jpeg2000/j2k.h
==============================================================================
--- jpeg2000/j2k.h	(original)
+++ jpeg2000/j2k.h	Mon Aug 20 16:35:38 2007
@@ -124,11 +124,29 @@ static inline int ff_j2k_ceildiv(int a, 
 J2kTgtNode *ff_j2k_tag_tree_init(int w, int h);
 
 /** TIER-1 routines */
-int ff_j2k_getnbctxno(int flag, int bandno);
-int ff_j2k_getrefctxno(int flag);
-int ff_j2k_getsgnctxno(int flag, int *xorbit);
 void ff_j2k_init_tier1_luts();
 
 void ff_j2k_set_significant(J2kT1Context *t1, int x, int y);
 
+extern uint8_t ff_j2k_nbctxno_lut[256][4];
+
+static inline int ff_j2k_getnbctxno(int flag, int bandno)
+{
+    return ff_j2k_nbctxno_lut[flag&255][bandno];
+}
+
+static inline int ff_j2k_getrefctxno(int flag)
+{
+    static const uint8_t refctxno_lut[2][2] = {{14, 15}, {16, 16}};
+    return refctxno_lut[flag>>14][(flag & 255) != 0];
+}
+
+extern uint8_t ff_j2k_sgnctxno_lut[16][16], ff_j2k_xorbit_lut[16][16];
+
+static inline int ff_j2k_getsgnctxno(int flag, int *xorbit)
+{
+    *xorbit = ff_j2k_xorbit_lut[flag&15][(flag>>8)&15];
+    return  ff_j2k_sgnctxno_lut[flag&15][(flag>>8)&15];
+}
+
 #endif



More information about the FFmpeg-soc mailing list