[FFmpeg-cvslog] r14873 - in trunk: Changelog doc/general.texi libavcodec/Makefile libavcodec/aac.c libavcodec/allcodecs.c libavcodec/avcodec.h

superdump subversion
Thu Aug 21 09:21:27 CEST 2008


Author: superdump
Date: Thu Aug 21 09:21:26 2008
New Revision: 14873

Log:
Last hunk of the AAC decoder code to be OKed and build system and documentation
alterations as appropriate


Modified:
   trunk/Changelog
   trunk/doc/general.texi
   trunk/libavcodec/Makefile
   trunk/libavcodec/aac.c
   trunk/libavcodec/allcodecs.c
   trunk/libavcodec/avcodec.h

Modified: trunk/Changelog
==============================================================================
--- trunk/Changelog	(original)
+++ trunk/Changelog	Thu Aug 21 09:21:26 2008
@@ -130,6 +130,7 @@ version <next>
 - D-Cinema audio muxer
 - Electronic Arts TGV decoder
 - Apple Lossless Audio Codec (ALAC) encoder
+- AAC decoder
 
 version 0.4.9-pre1:
 

Modified: trunk/doc/general.texi
==============================================================================
--- trunk/doc/general.texi	(original)
+++ trunk/doc/general.texi	Thu Aug 21 09:21:26 2008
@@ -337,7 +337,7 @@ following image formats are supported:
 @item 4X IMA ADPCM           @tab     @tab  X
 @item 8SVX audio             @tab     @tab  X
 @item AAC                    @tab  X  @tab  X
-    @tab Supported through the external library libfaac/libfaad.
+    @tab Encoding is supported through the external library libfaac.
 @item AC-3                   @tab IX  @tab IX
     @tab liba52 can be used alternatively for decoding.
 @item AMR-NB                 @tab  X  @tab  X

Modified: trunk/libavcodec/Makefile
==============================================================================
--- trunk/libavcodec/Makefile	(original)
+++ trunk/libavcodec/Makefile	Thu Aug 21 09:21:26 2008
@@ -25,6 +25,7 @@ HEADERS = avcodec.h opt.h
 
 OBJS-$(CONFIG_ENCODERS)                += faandct.o jfdctfst.o jfdctint.o
 
+OBJS-$(CONFIG_AAC_DECODER)             += aac.o aactab.o mdct.o fft.o
 OBJS-$(CONFIG_AASC_DECODER)            += aasc.o
 OBJS-$(CONFIG_AC3_DECODER)             += ac3dec.o ac3tab.o ac3dec_data.o ac3.o mdct.o fft.o
 OBJS-$(CONFIG_AC3_ENCODER)             += ac3enc.o ac3tab.o ac3.o

Modified: trunk/libavcodec/aac.c
==============================================================================
--- trunk/libavcodec/aac.c	(original)
+++ trunk/libavcodec/aac.c	Thu Aug 21 09:21:26 2008
@@ -1104,6 +1104,42 @@ static int decode_extension_payload(AACC
     return res;
 }
 
+/**
+ * Decode Temporal Noise Shaping filter coefficients and apply all-pole filters; reference: 4.6.9.3.
+ *
+ * @param   decode  1 if tool is used normally, 0 if tool is used in LTP.
+ * @param   coef    spectral coefficients
+ */
+static void apply_tns(float coef[1024], TemporalNoiseShaping * tns, IndividualChannelStream * ics, int decode) {
+    const int mmm = FFMIN(ics->tns_max_bands,  ics->max_sfb);
+    int w, filt, m, i, ib;
+    int bottom, top, order, start, end, size, inc;
+    float lpc[TNS_MAX_ORDER];
+
+    for (w = 0; w < ics->num_windows; w++) {
+        bottom = ics->num_swb;
+        for (filt = 0; filt < tns->n_filt[w]; filt++) {
+            top    = bottom;
+            bottom = FFMAX(0, top - tns->length[w][filt]);
+            order  = tns->order[w][filt];
+            if (order == 0)
+                continue;
+
+            /* tns_decode_coef
+             * FIXME: This duplicates the functionality of some double code in lpc.c.
+             */
+            for (m = 0; m < order; m++) {
+               float tmp;
+               lpc[m] = tns->coef[w][filt][m];
+               for (i = 0; i < m/2; i++) {
+                   tmp = lpc[i];
+                   lpc[i]     += lpc[m] * lpc[m-1-i];
+                   lpc[m-1-i] += lpc[m] * tmp;
+               }
+               if(m & 1)
+                   lpc[i]     += lpc[m] * lpc[i];
+            }
+
             start = ics->swb_offset[FFMIN(bottom, mmm)];
             end   = ics->swb_offset[FFMIN(   top, mmm)];
             if ((size = end - start) <= 0)
@@ -1118,7 +1154,7 @@ static int decode_extension_payload(AACC
             // ar filter
             for (m = 0; m < size; m++, start += inc)
                 for (i = 1; i <= FFMIN(m, order); i++)
-                    coef[start] -= coef[start - i*inc] * lpc[i];
+                    coef[start] -= coef[start - i*inc] * lpc[i-1];
         }
     }
 }

Modified: trunk/libavcodec/allcodecs.c
==============================================================================
--- trunk/libavcodec/allcodecs.c	(original)
+++ trunk/libavcodec/allcodecs.c	Thu Aug 21 09:21:26 2008
@@ -181,6 +181,7 @@ void avcodec_register_all(void)
     REGISTER_ENCDEC  (ZMBV, zmbv);
 
     /* audio codecs */
+    REGISTER_DECODER (AAC, aac);
     REGISTER_ENCDEC  (AC3, ac3);
     REGISTER_ENCDEC  (ALAC, alac);
     REGISTER_DECODER (APE, ape);

Modified: trunk/libavcodec/avcodec.h
==============================================================================
--- trunk/libavcodec/avcodec.h	(original)
+++ trunk/libavcodec/avcodec.h	Thu Aug 21 09:21:26 2008
@@ -30,7 +30,7 @@
 #include "libavutil/avutil.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 51
-#define LIBAVCODEC_VERSION_MINOR 68
+#define LIBAVCODEC_VERSION_MINOR 69
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \




More information about the ffmpeg-cvslog mailing list