[FFmpeg-soc] [soc]: r3182 - in aacenc: aacenc.c aacpsy.c aacpsy.h

kostya subversion at mplayerhq.hu
Tue Aug 12 11:07:12 CEST 2008


Author: kostya
Date: Tue Aug 12 11:07:12 2008
New Revision: 3182

Log:
Correct existing documentation and add a bit of new one

Modified:
   aacenc/aacenc.c
   aacenc/aacpsy.c
   aacenc/aacpsy.h

Modified: aacenc/aacenc.c
==============================================================================
--- aacenc/aacenc.c	(original)
+++ aacenc/aacenc.c	Tue Aug 12 11:07:12 2008
@@ -150,28 +150,31 @@ static const uint8_t aac_chan_configs[6]
  {4, ID_SCE, ID_CPE, ID_CPE, ID_LFE}, // 6 channels - front center + stereo + back stereo + LFE
 };
 
+/**
+ * AAC encoder context
+ */
 typedef struct {
     PutBitContext pb;
-    MDCTContext mdct1024;
-    MDCTContext mdct128;
+    MDCTContext mdct1024;                        ///< long (1024 samples) frame transform context
+    MDCTContext mdct128;                         ///< short (128 samples) frame transform context
     DSPContext  dsp;
-    DECLARE_ALIGNED_16(FFTSample, output[2048]);
-    DECLARE_ALIGNED_16(FFTSample, tmp[1024]);
-    int16_t* samples;
+    DECLARE_ALIGNED_16(FFTSample, output[2048]); ///< temporary buffer for MDCT input coefficients
+    DECLARE_ALIGNED_16(FFTSample, tmp[1024]);    ///< temporary buffer used by MDCT
+    int16_t* samples;                            ///< saved preprocessed input
 
-    int samplerate_index;
-    const uint8_t *swb_sizes1024;
-    int swb_num1024;
-    const uint8_t *swb_sizes128;
-    int swb_num128;
+    int samplerate_index;                        ///< MPEG-4 samplerate index
+    const uint8_t *swb_sizes1024;                ///< scalefactor band sizes for long frame
+    int swb_num1024;                             ///< number of scalefactor bands for long frame
+    const uint8_t *swb_sizes128;                 ///< scalefactor band sizes for short frame
+    int swb_num128;                              ///< number of scalefactor bands for short frame
 
-    ChannelElement *cpe;
-    AACPsyContext psy;
+    ChannelElement *cpe;                         ///< channel elements
+    AACPsyContext psy;                           ///< psychoacoustic model context
 } AACEncContext;
 
 /**
  * Make AAC audio config object.
- * @see 1.6.2.1
+ * @see 1.6.2.1 "Syntax - AudioSpecificConfig"
  */
 static void put_audio_specific_config(AVCodecContext *avctx)
 {
@@ -289,7 +292,7 @@ static void analyze(AVCodecContext *avct
 
 /**
  * Encode ics_info element.
- * @see Table 4.6
+ * @see Table 4.6 (syntax of ics_info)
  */
 static void put_ics_info(AVCodecContext *avctx, IndividualChannelStream *info)
 {
@@ -311,7 +314,7 @@ static void put_ics_info(AVCodecContext 
 
 /**
  * Encode MS data.
- * @see 4.6.8.1
+ * @see 4.6.8.1 "Joint Coding - M/S Stereo"
  */
 static void encode_ms_info(PutBitContext *pb, ChannelElement *cpe)
 {
@@ -327,7 +330,15 @@ static void encode_ms_info(PutBitContext
 }
 
 /**
- * Scan spectral band and determine optimal codebook for it.
+ * Scan scalefactor band and determine optimal codebook for it.
+ *
+ * @param s       encoder context
+ * @param cpe     channel element
+ * @param channel channel number inside channel pair
+ * @param win     window group start number
+ * @param band    scalefactor band to analyze
+ * @param start   scalefactor band position in spectral coefficients
+ * @param size    scalefactor band size
  */
 static int determine_section_info(AACEncContext *s, ChannelElement *cpe, int channel, int win, int band, int start, int size)
 {
@@ -446,7 +457,7 @@ static void encode_codebook(AACEncContex
 }
 
 /**
- * Encode information about codebooks used for scalefactor bands coding.
+ * Encode scalefactor band coding type.
  */
 static void encode_section_data(AVCodecContext *avctx, AACEncContext *s, ChannelElement *cpe, int channel)
 {
@@ -619,7 +630,7 @@ static int encode_individual_channel(AVC
 }
 
 /**
- * Write some auxiliary information about created AAC file.
+ * Write some auxiliary information about the created AAC file.
  */
 static void put_bitstream_info(AVCodecContext *avctx, AACEncContext *s, const char *name)
 {

Modified: aacenc/aacpsy.c
==============================================================================
--- aacenc/aacpsy.c	(original)
+++ aacenc/aacpsy.c	Tue Aug 12 11:07:12 2008
@@ -34,7 +34,7 @@ static float pow2sf_tab[340];
 /**
  * Convert coefficients to integers.
  * @return sum of coefficients
- * @see 3GPP TS26.403 5.6.2
+ * @see 3GPP TS26.403 5.6.2 "Scalefactor determination"
  */
 static inline int convert_coeffs(float *in, int *out, int size, int scale_idx)
 {
@@ -68,7 +68,7 @@ static inline float calc_distortion(floa
 }
 
 /**
- * Produce integer coefficients from scalefactors provided by model.
+ * Produce integer coefficients from scalefactors provided by the model.
  */
 static void psy_create_output(AACPsyContext *apc, ChannelElement *cpe, int chans, int search_pulses)
 {

Modified: aacenc/aacpsy.h
==============================================================================
--- aacenc/aacpsy.h	(original)
+++ aacenc/aacpsy.h	Tue Aug 12 11:07:12 2008
@@ -26,11 +26,11 @@
 #include "aac.h"
 
 enum AACPsyModelType{
-    AAC_PSY_NULL,              ///< do nothing on frequencies
-    AAC_PSY_NULL8,             ///< do nothing on frequencies but work with short windows
+    AAC_PSY_NULL,              ///< do nothing with frequencies
+    AAC_PSY_NULL8,             ///< do nothing with frequencies but work with short windows
     AAC_PSY_3GPP,              ///< model following recommendations from 3GPP TS 26.403
 
-    AAC_NB_PSY_MODELS          ///< total number of psychoacoustic models
+    AAC_NB_PSY_MODELS          ///< total number of psychoacoustic models, since it's not a part of the ABI new models can be added freely
 };
 
 enum AACPsyModelMode{
@@ -53,20 +53,20 @@ enum AACPsyModelMode{
  * context used by psychoacoustic model
  */
 typedef struct AACPsyContext {
-    AVCodecContext *avctx;
+    AVCodecContext *avctx;            ///< encoder context
 
-    int flags;
-    const uint8_t *bands1024;
-    int num_bands1024;
-    const uint8_t *bands128;
-    int num_bands128;
+    int flags;                        ///< model flags
+    const uint8_t *bands1024;         ///< scalefactor band sizes for long (1024 samples) frame
+    int num_bands1024;                ///< number of scalefactor bands for long frame
+    const uint8_t *bands128;          ///< scalefactor band sizes for short (128 samples) frame
+    int num_bands128;                 ///< number of scalefactor bands for short frame
 
-    const struct AACPsyModel *model;
-    void* model_priv_data;
+    const struct AACPsyModel *model;  ///< pointer to the psychoacoustic model implementation
+    void* model_priv_data;            ///< psychoacoustic model implementation private data
 
-    float stereo_att;
-    int   cutoff;
-    void* lp_state;
+    float stereo_att;                 ///< stereo attenuation factor
+    int   cutoff;                     ///< cutoff frequency index used for lowpass filtering
+    void* lp_state;                   ///< lowpass filter state
 }AACPsyContext;
 
 typedef struct AACPsyModel {



More information about the FFmpeg-soc mailing list