[FFmpeg-soc] [soc]: r1016 - eac3/eac3dec.c

bwolowiec subversion at mplayerhq.hu
Sun Aug 19 12:22:14 CEST 2007


Author: bwolowiec
Date: Sun Aug 19 12:22:14 2007
New Revision: 1016

Log:
move standard channel coupling to separate function and remove debug code.


Modified:
   eac3/eac3dec.c

Modified: eac3/eac3dec.c
==============================================================================
--- eac3/eac3dec.c	(original)
+++ eac3/eac3dec.c	Sun Aug 19 12:22:14 2007
@@ -37,6 +37,7 @@ static void get_transform_coeffs_aht_ch(
 static void dct_transform_coeffs_ch(EAC3Context *s, int ch, int blk);
 static void get_eac3_transform_coeffs_ch(GetBitContext *gbc, EAC3Context *s, int blk,
         int ch, mant_groups *m);
+static void uncouple_channels(EAC3Context *s);
 
 static int parse_bsi(GetBitContext *gbc, EAC3Context *s){
     int i, blk;
@@ -959,40 +960,8 @@ static int parse_audblk(GetBitContext *g
 
     }
 
-    if(s->cplinu[blk]){
-        // uncouple_channels(ctx);
-        {
-            //TODO (form ac3)
-            int i, j, ch, bnd, subbnd;
-
-            subbnd = s->cplbegf+1;
-            i = s->strtmant[CPL_CH];
-            av_log(NULL, AV_LOG_DEBUG, "strtmant=%i endmant=%i\n", s->strtmant[CPL_CH], s->endmant[CPL_CH]);
-            av_log(NULL, AV_LOG_DEBUG, "ncplbnd=%i ncplsubbnd=%i\n", s->ncplbnd, s->ncplsubnd);
-            /*
-               for(bnd=0; bnd<256; bnd++){
-               av_log(NULL, AV_LOG_INFO, "%i: %f\n", bnd, transform_coeffs[CPL_CH][bnd]);
-               }*/
-            for(bnd=0; bnd<s->ncplbnd; bnd++){
-                do {
-                    for(j=0; j<12; j++){
-                        for(ch=1; ch<=s->nfchans; ch++){
-                            if(s->chincpl[ch]){
-                                s->transform_coeffs[ch][i] =
-                                    s->transform_coeffs[CPL_CH][i] *
-                                    s->cplco[ch][bnd] * 8.0f;
-                            }
-                        }
-                        av_log(NULL, AV_LOG_DEBUG, "%i ", i);
-                        i++;
-                    }
-                    av_log(NULL, AV_LOG_DEBUG, "cplbndstrc[%i] = %i bnd=%i\n ", subbnd,
-                            s->cplbndstrc[subbnd], bnd);
-                } while(s->cplbndstrc[subbnd++] && subbnd<=s->cplendf);
-            }
-            av_log(NULL, AV_LOG_DEBUG, "\n");
-        }
-    }
+    if(s->cplinu[blk])
+        uncouple_channels(s);
 
     //apply spectral extension
     if(s->spxinu)
@@ -1275,6 +1244,27 @@ static void get_eac3_transform_coeffs_ch
     }
 }
 
+static void uncouple_channels(EAC3Context *s){
+    int i, j, ch, bnd, subbnd;
+
+    subbnd = s->cplbegf+1;
+    i = s->strtmant[CPL_CH];
+    for(bnd=0; bnd<s->ncplbnd; bnd++){
+        do {
+            for(j=0; j<12; j++){
+                for(ch=1; ch<=s->nfchans; ch++){
+                    if(s->chincpl[ch]){
+                        s->transform_coeffs[ch][i] =
+                            s->transform_coeffs[CPL_CH][i] *
+                            s->cplco[ch][bnd] * 8.0f;
+                    }
+                }
+                i++;
+            }
+        } while(s->cplbndstrc[subbnd++] && subbnd<=s->cplendf);
+    }
+}
+
 /**
  * Performs Inverse MDCT transform
  */



More information about the FFmpeg-soc mailing list