[FFmpeg-soc] [soc]: r1676 - eac3/eac3.h

jbr subversion at mplayerhq.hu
Sat Dec 29 00:53:39 CET 2007


Author: jbr
Date: Sat Dec 29 00:53:39 2007
New Revision: 1676

Log:
reorder context struct members and define new groups

Modified:
   eac3/eac3.h

Modified: eac3/eac3.h
==============================================================================
--- eac3/eac3.h	(original)
+++ eac3/eac3.h	Sat Dec 29 00:53:39 2007
@@ -39,8 +39,11 @@
 
 typedef struct EAC3Context{
     AVCodecContext *avctx;           ///< Parent context
-    int syncword;
+    GetBitContext *gbc;              ///< Bitstream reader
 
+///@defgroup bsi Bit Stream Information
+///@{
+    int syncword;
     int stream_type;                 ///< Stream type (strmtyp)
     int substreamid;                 ///< Substream identification
     int frame_size;                  ///< Frame size, in bytes
@@ -50,42 +53,63 @@ typedef struct EAC3Context{
     int channel_mode;                ///< Channel mode (acmod)
     int lfe_on;                      ///< Low frequency effect channel on (lfeon)
     int bitstream_id;                ///< Bit stream identification (bsid)
+///@}
 
+///@defgroup audfrm Frame Syntax Parameters
     int snr_offset_strategy;         ///< SNR offset strategy (snroffststr)
-    int snr_offset[AC3_MAX_CHANNELS];///< SNR offset (snroffst)
     int block_switch_syntax;         ///< Block switch syntax enabled (blkswe)
     int dither_flag_syntax;          ///< Dither flag syntax enabled (dithflage)
     int bit_allocation_syntax;       ///< Bit allocation model syntax enabled (bamode)
     int fast_gain_syntax;            ///< Fast gain codes enabled (frmfgaincode)
     int dba_syntax;                  ///< Delta bit allocation syntax enabled (dbaflde)
     int skip_syntax;                 ///< Skip Filed syntax enabled (skipflde)
+///@}
+
+///@defgroup cpl Standard Coupling
     int cpl_in_use[MAX_BLOCKS];      ///< Coupling in use (cplinu)
     int cpl_strategy_exists[MAX_BLOCKS];            ///< Coupling strategy exists (cplstre)
-    int exp_strategy[MAX_BLOCKS][AC3_MAX_CHANNELS]; ///< Channel exponent strategy (chexpstr)
+    int channel_in_cpl[AC3_MAX_CHANNELS];   ///< Channel in coupling (chincpl)
+    int phase_flags_in_use;                 ///< Phase flag in use (phsflginu)
+    int phase_flags[18];             ///< Phase flag
+    int num_cpl_subbands;              ///< Number of coupling sub bands (ncplsubnd)
+    int num_cpl_bands;                 ///< Number of coupling bands (ncplbnd)
+    int cpl_band_struct[18];         ///< Coupling band structure (cplbndstrc)
+    int firstchincpl;
+    int first_cpl_coords[AC3_MAX_CHANNELS];         ///< First coupling coordinates states (firstcplcos)
+    float   cpl_coords[AC3_MAX_CHANNELS][18];       ///< coupling coordinates (cplco)
+///@}
+
+///@defgroup aht Adaptive Hybrid Transform
     int channel_uses_aht[AC3_MAX_CHANNELS];         ///< Channel AHT in use (chahtinu)
+    int chgaqgain[256];                             ///< Channel gain adaptive quantization gain
+    float pre_chmant[6][AC3_MAX_CHANNELS][256];     ///< Pre channel mantissas
+///@}
+
+///@defgroup spx Spectral Extension
     int channel_uses_spx[AC3_MAX_CHANNELS];         ///< Channel in spectral extension attenuation process (chinspxatten)
     int spx_atten_code[AC3_MAX_CHANNELS];           ///< spectral extension attenuation code (spxattencod)
-
-    int block_switch[AC3_MAX_CHANNELS];         ///< Block switch flag (blksw)
-    int dither_flag[AC3_MAX_CHANNELS];          ///< Dither flag (dithflag)
-    float dynamic_range[2];          ///< Dynamic range gain (dynrng)
-    float downmix_coeffs[AC3_MAX_CHANNELS][2];  ///< stereo downmix coefficients
     int spxinu;                      ///< spectral extension in use
     int chinspx[AC3_MAX_CHANNELS];   ///< Channel in spectral extension
     int spxstrtf;                    ///< Spectral extension start copy frequency code
     int spxbegf;                     ///< Spectral extension begin frequency code
     int spxendf;                     ///< Spectral extension end frequency code
+    int nspxbnds;                      ///< Number of structured spectral extension bands
+    int spxbndsztab[MAX_SPX_CODES];    ///< Sizes of spectral extension bands
     int spxbndstrc[MAX_SPX_CODES];   ///< Spectral extension band structure
     int spxcoe[AC3_MAX_CHANNELS];    ///< Spectral extension coordinates exists
     int spxblnd[AC3_MAX_CHANNELS];   ///< Spectral extension blend
+    int firstspxcos[AC3_MAX_CHANNELS];              ///< First spectral extension coordinates states
+    float   spxco[AC3_MAX_CHANNELS][18];            ///< Spectral extension coordinates
+///@}
+
+///@defgroup ecpl Enhanced Coupling
     int ecpl_in_use;                 ///< Enhanced coupling in use
-    int channel_in_cpl[AC3_MAX_CHANNELS];   ///< Channel in coupling (chincpl)
-    int phase_flags_in_use;                 ///< Phase flag in use (phsflginu)
-    int cpl_band_struct[18];         ///< Coupling band structure (cplbndstrc)
     int ecplbegf;                    ///< Enhanced coupling begin frequency code
     int ecplendf;                    ///< Enhanced coupling end frequency code
+    int ecpl_start_subbnd;             ///< Enhanced coupling begin frequency
+    int ecpl_end_subbnd;               ///< Enhanced coupling end frequency
+    int necplbnd;                      ///< Number of structured enhanced coupling bands
     int ecplbndstrc[23];             ///< Enhanced coupling band structure
-    int phase_flags[18];             ///< Phase flag
     int ecplangleintrp;              ///< Enhanced coupling angle interpolation flag
     int ecplparam1e[AC3_MAX_CHANNELS];   ///< Enhanced coupling parameters 1 exists
     int ecplparam2e[AC3_MAX_CHANNELS];   ///< Enhanced coupling parameters 2 exists
@@ -93,61 +117,68 @@ typedef struct EAC3Context{
     int ecplangle[AC3_MAX_CHANNELS][23]; ///< Enhanced coupling angle
     int ecplchaos[AC3_MAX_CHANNELS][23]; ///< Enhanced coupling chaos
     int ecpltrans[AC3_MAX_CHANNELS];     ///< Enhanced coupling transient present
-    int rematflg[4];                 ///< Rematrixing flag
+///@}
 
-    int fgain[AC3_MAX_CHANNELS];     ///< Channel fast gain
-    uint8_t deltbae[AC3_MAX_CHANNELS];   ///< Delta bit allocation exists
-    uint8_t deltnseg[AC3_MAX_CHANNELS];  ///< Channel delta bit allocation number of segments
-    uint8_t deltoffst[AC3_MAX_CHANNELS][9]; ///< Channel delta bit allocation offset
-    uint8_t deltlen[AC3_MAX_CHANNELS][9];   ///< Channel delta bit allocation length
-    uint8_t deltba[AC3_MAX_CHANNELS][9];    ///< Channel delta bit allocation
+///@defgroup channel Channel
+    int fbw_channels;                  ///< Number of fbw channels
+    int num_channels;                ///< Total of all channels
+    int lfe_channel;                 ///< Index of LFE channel
+    float downmix_coeffs[AC3_MAX_CHANNELS][2];  ///< stereo downmix coefficients
+///@}
 
-    int chgaqgain[256];                             ///< Channel gain adaptive quantization gain
-    float pre_chmant[6][AC3_MAX_CHANNELS][256];     ///< Pre channel mantissas
+///@defgroup dynrng Dynamic Range
+    float dynamic_range[2];          ///< Dynamic range gain (dynrng)
+///@}
 
-    int firstspxcos[AC3_MAX_CHANNELS];              ///< First spectral extension coordinates states
-    int first_cpl_coords[AC3_MAX_CHANNELS];         ///< First coupling coordinates states (firstcplcos)
-    int first_cpl_leak;                             ///< First coupling leak state (firstcplleak)
+///@defgroup bandwidth Bandwidth
+    int start_freq[AC3_MAX_CHANNELS];   ///< Start frequency bin (strtmant)
+    int end_freq[AC3_MAX_CHANNELS];     ///< End frequency bin (endmant)
+///@}
 
+///@defgroup rematrixing Rematrixing
     int nrematbnds;                    ///< Number of rematrixing bands
-    int num_cpl_subbands;              ///< Number of coupling sub bands (ncplsubnd)
-    int num_cpl_bands;                 ///< Number of coupling bands (ncplbnd)
+    int rematflg[4];                 ///< Rematrixing flag
+///@}
 
+///@defgroup exponents Exponents
     int nchgrps[AC3_MAX_CHANNELS];                  ///< Number of fbw channel exponent groups
     uint8_t dexps[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< Differential exponents
+    int exp_strategy[MAX_BLOCKS][AC3_MAX_CHANNELS]; ///< Channel exponent strategy (chexpstr)
+///@}
 
-    int start_freq[AC3_MAX_CHANNELS];   ///< Start frequency bin (strtmant)
-    int end_freq[AC3_MAX_CHANNELS];     ///< End frequency bin (endmant)
-    int firstchincpl;
-    int ecpl_start_subbnd;             ///< Enhanced coupling begin frequency
-    int ecpl_end_subbnd;               ///< Enhanced coupling end frequency
-
-    int necplbnd;                      ///< Number of structured enhanced coupling bands
-    int nspxbnds;                      ///< Number of structured spectral extension bands
-    int spxbndsztab[MAX_SPX_CODES];    ///< Sizes of spectral extension bands
-    int fbw_channels;                  ///< Number of fbw channels
-
+///@defgroup bitalloc Bit Allocation
+    AC3BitAllocParameters bit_alloc_params;         ///< Bit allocation parameters
+    int first_cpl_leak;                             ///< First coupling leak state (firstcplleak)
+    int snr_offset[AC3_MAX_CHANNELS];///< SNR offset (snroffst)
+    int fgain[AC3_MAX_CHANNELS];     ///< Channel fast gain
     uint8_t bap[AC3_MAX_CHANNELS][AC3_MAX_COEFS];   ///< bit allocation pointers
     uint8_t hebap[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< high-efficiency bit allocation pointers for AHT
     int16_t psd[AC3_MAX_CHANNELS][AC3_MAX_COEFS];   ///< scaled exponents
     int16_t bndpsd[AC3_MAX_CHANNELS][50];           ///< interpolated exponents
     int16_t mask[AC3_MAX_CHANNELS][50];             ///< masking values
+    uint8_t deltbae[AC3_MAX_CHANNELS];   ///< Delta bit allocation exists
+    uint8_t deltnseg[AC3_MAX_CHANNELS];  ///< Channel delta bit allocation number of segments
+    uint8_t deltoffst[AC3_MAX_CHANNELS][9]; ///< Channel delta bit allocation offset
+    uint8_t deltlen[AC3_MAX_CHANNELS][9];   ///< Channel delta bit allocation length
+    uint8_t deltba[AC3_MAX_CHANNELS][9];    ///< Channel delta bit allocation
+///@}
 
-    float   cpl_coords[AC3_MAX_CHANNELS][18];       ///< coupling coordinates (cplco)
-    float   spxco[AC3_MAX_CHANNELS][18];            ///< Spectral extension coordinates
-
-    AC3BitAllocParameters bit_alloc_params;         ///< Bit allocation parameters
-
+///@defgroup dithering Zero-Mantissa Dithering
+    int dither_flag[AC3_MAX_CHANNELS];          ///< Dither flag (dithflag)
     AVRandomState dith_state;        ///< for dither generation
+///@}
 
-    int num_channels;                ///< Total of all channels
-    int lfe_channel;                 ///< Index of LFE channel
-
-    GetBitContext *gbc;              ///< Bitstream reader
-
+///@defgroup imdct IMDCT
+    int block_switch[AC3_MAX_CHANNELS];         ///< Block switch flag (blksw)
     MDCTContext imdct_512;           ///< for 512 sample imdct transform
     MDCTContext imdct_256;           ///< for 256 sample imdct transform
+///@}
+
+///@defgroup opt Optimization
     DSPContext  dsp;                 ///< for optimization
+    float add_bias;                  ///< offset for float_to_int16 conversion
+    float mul_bias;                  ///< scaling for float_to_int16 conversion
+///@}
 
     DECLARE_ALIGNED_16(float, transform_coeffs[AC3_MAX_CHANNELS][AC3_MAX_COEFS]);
     DECLARE_ALIGNED_16(float, delay[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]);  ///< delay - added to the next block
@@ -156,10 +187,6 @@ typedef struct EAC3Context{
     DECLARE_ALIGNED_16(float, tmp_imdct[AC3_BLOCK_SIZE * 24]);       ///< temp storage for imdct transform
     DECLARE_ALIGNED_16(float, output[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]); ///< output after imdct transform and windowing
     DECLARE_ALIGNED_16(int16_t, int_output[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]);///< final 16-bit integer output
-
-
-    float add_bias;                  ///< offset for float_to_int16 conversion
-    float mul_bias;                  ///< scaling for float_to_int16 conversion
 }EAC3Context;
 
 /** Channel gain adaptive quantization mode */



More information about the FFmpeg-soc mailing list