[FFmpeg-soc] [soc]: r299 - in jpeg2000: aec.h aecenc.c j2kenc.c

k.nowosad subversion at mplayerhq.hu
Sun Jul 1 16:51:22 CEST 2007


Author: k.nowosad
Date: Sun Jul  1 16:51:22 2007
New Revision: 299

Log:
added ff_ prefix to arithmetic encoder functions


Modified:
   jpeg2000/aec.h
   jpeg2000/aecenc.c
   jpeg2000/j2kenc.c

Modified: jpeg2000/aec.h
==============================================================================
--- jpeg2000/aec.h	(original)
+++ jpeg2000/aec.h	Sun Jul  1 16:51:22 2007
@@ -108,16 +108,16 @@ typedef struct {
     AecContext *curctx;
 } AecState;
 
-void aec_initenc(AecState *aec, uint8_t *bp);
+void ff_aec_initenc(AecState *aec, uint8_t *bp);
 
 /**
  * code bit d with context cx
  * */
-void aec_encode(AecState *aec, int cx, int d);
+void ff_aec_encode(AecState *aec, int cx, int d);
 
 /**
  * flush the encoder [returns number of bytes encoded]
  * */
-int aec_flush(AecState *aec);
+int ff_aec_flush(AecState *aec);
 
 #endif

Modified: jpeg2000/aecenc.c
==============================================================================
--- jpeg2000/aecenc.c	(original)
+++ jpeg2000/aecenc.c	Sun Jul  1 16:51:22 2007
@@ -68,7 +68,7 @@ static void setbits(AecState *aec)
         aec->c -= 0x8000;
 }
 
-void aec_initenc(AecState *aec, uint8_t *bp)
+void ff_aec_initenc(AecState *aec, uint8_t *bp)
 {
     bzero(aec->contexts, 19*sizeof(AecContext));
     aec->contexts[AEC_CX_UNI].state = 46;
@@ -83,7 +83,7 @@ void aec_initenc(AecState *aec, uint8_t 
     aec->ct = 12 + (*aec->bp == 0xff);
 }
 
-void aec_encode(AecState *aec, int cx, int d)
+void ff_aec_encode(AecState *aec, int cx, int d)
 {
     int qe;
 
@@ -113,7 +113,7 @@ void aec_encode(AecState *aec, int cx, i
     }
 }
 
-int aec_flush(AecState *aec)
+int ff_aec_flush(AecState *aec)
 {
     setbits(aec);
     aec->c = aec->c << aec->ct;

Modified: jpeg2000/j2kenc.c
==============================================================================
--- jpeg2000/j2kenc.c	(original)
+++ jpeg2000/j2kenc.c	Sun Jul  1 16:51:22 2007
@@ -753,11 +753,11 @@ static void encode_sigpass(J2kT1Context 
                 if (!(t1->flags[k+1][j+1] & J2K_T1_SIG) && (t1->flags[k+1][j+1] & J2K_T1_SIG_NB)){
                     int ctxno = getnbctxno(t1->flags[k+1][j+1], bandno),
                         bit = abs(t1->data[k][j]) & mask ? 1 : 0;
-                    aec_encode(&t1->aec, ctxno, bit);
+                    ff_aec_encode(&t1->aec, ctxno, bit);
                     if (bit){
                         int xorbit;
                         int ctxno = getsgnctxno(t1->flags[k+1][j+1], &xorbit);
-                        aec_encode(&t1->aec, ctxno, (t1->data[k][j] < 0 ? 1:0) ^ xorbit);
+                        ff_aec_encode(&t1->aec, ctxno, (t1->data[k][j] < 0 ? 1:0) ^ xorbit);
                         set_significant(t1, j, k);
                     }
                     t1->flags[k+1][j+1] |= J2K_T1_VIS;
@@ -773,7 +773,7 @@ static void encode_refpass(J2kT1Context 
             for (k = i; k < height && k < i+4; k++)
                 if ((t1->flags[k+1][j+1] & (J2K_T1_SIG | J2K_T1_VIS)) == J2K_T1_SIG){
                     int ctxno = getrefctxno(t1->flags[k+1][j+1]);
-                    aec_encode(&t1->aec, ctxno, abs(t1->data[k][j]) & mask ? 1:0);
+                    ff_aec_encode(&t1->aec, ctxno, abs(t1->data[k][j]) & mask ? 1:0);
                     t1->flags[k+1][j+1] |= J2K_T1_REF;
                 }
 }
@@ -794,20 +794,20 @@ static void encode_clnpass(J2kT1Context 
                 for (rlen = 0; rlen < 4; rlen++)
                     if (abs(t1->data[i+rlen][j]) & mask)
                         break;
-                aec_encode(&t1->aec, AEC_CX_RL, rlen != 4);
+                ff_aec_encode(&t1->aec, AEC_CX_RL, rlen != 4);
                 if (rlen == 4)
                     continue;
-                aec_encode(&t1->aec, AEC_CX_UNI, rlen >> 1);
-                aec_encode(&t1->aec, AEC_CX_UNI, rlen & 1);
+                ff_aec_encode(&t1->aec, AEC_CX_UNI, rlen >> 1);
+                ff_aec_encode(&t1->aec, AEC_CX_UNI, rlen & 1);
                 for (k = i + rlen; k < i + 4; k++){
                     if (!(t1->flags[k+1][j+1] & (J2K_T1_SIG | J2K_T1_VIS))){
                         int ctxno = getnbctxno(t1->flags[k+1][j+1], bandno);
                         if (k > i + rlen)
-                            aec_encode(&t1->aec, ctxno, abs(t1->data[k][j]) & mask ? 1:0);
+                            ff_aec_encode(&t1->aec, ctxno, abs(t1->data[k][j]) & mask ? 1:0);
                         if (abs(t1->data[k][j]) & mask){ // newly significant
                             int xorbit;
                             int ctxno = getsgnctxno(t1->flags[k+1][j+1], &xorbit);
-                            aec_encode(&t1->aec, ctxno, (t1->data[k][j] < 0 ? 1:0) ^ xorbit);
+                            ff_aec_encode(&t1->aec, ctxno, (t1->data[k][j] < 0 ? 1:0) ^ xorbit);
                             set_significant(t1, j, k);
                         }
                     }
@@ -818,11 +818,11 @@ static void encode_clnpass(J2kT1Context 
                 for (k = i; k < i + 4 && k < height; k++){
                     if (!(t1->flags[k+1][j+1] & (J2K_T1_SIG | J2K_T1_VIS))){
                         int ctxno = getnbctxno(t1->flags[k+1][j+1], bandno);
-                        aec_encode(&t1->aec, ctxno, abs(t1->data[k][j]) & mask ? 1:0);
+                        ff_aec_encode(&t1->aec, ctxno, abs(t1->data[k][j]) & mask ? 1:0);
                         if (abs(t1->data[k][j]) & mask){ // newly significant
                             int xorbit;
                             int ctxno = getsgnctxno(t1->flags[k+1][j+1], &xorbit);
-                            aec_encode(&t1->aec, ctxno, (t1->data[k][j] < 0 ? 1:0) ^ xorbit);
+                            ff_aec_encode(&t1->aec, ctxno, (t1->data[k][j] < 0 ? 1:0) ^ xorbit);
                             set_significant(t1, j, k);
                         }
                     }
@@ -855,7 +855,7 @@ static void encode_cblk(J2kEncoderContex
         mask = 1 << (nonzerobits - 1);
     }
 
-    aec_initenc(&t1->aec, cblk->data);
+    ff_aec_initenc(&t1->aec, cblk->data);
 
     cblk->zerobits = s->expn + s->nguardbits - 1 - nonzerobits;
 
@@ -876,7 +876,7 @@ static void encode_cblk(J2kEncoderContex
     cblk->npassess = passno;
 
     // TODO: optional flush on each pass
-    cblk->length = aec_flush(&t1->aec);
+    cblk->length = ff_aec_flush(&t1->aec);
 }
 
 /* tier-2 routines: */



More information about the FFmpeg-soc mailing list