[FFmpeg-soc] [soc]: r1771 - in eac3: ac3dec.c ac3dec.h
jbr
subversion at mplayerhq.hu
Sun Jan 6 01:42:46 CET 2008
Author: jbr
Date: Sun Jan 6 01:42:46 2008
New Revision: 1771
Log:
clean up unneeded items from ac3dec.h
Modified:
eac3/ac3dec.c
eac3/ac3dec.h
Modified: eac3/ac3dec.c
==============================================================================
--- eac3/ac3dec.c (original)
+++ eac3/ac3dec.c Sun Jan 6 01:42:46 2008
@@ -69,7 +69,18 @@ static const uint8_t quantization_tab[16
/** dynamic range table. converts codes to scale factors. */
float ff_ac3_dynamic_range_tab[256];
-const float ff_ac3_mix_levels[9] = {
+/** Adjustments in dB gain */
+#define LEVEL_PLUS_3DB 1.4142135623730950
+#define LEVEL_PLUS_1POINT5DB 1.1892071150027209
+#define LEVEL_MINUS_1POINT5DB 0.8408964152537145
+#define LEVEL_MINUS_3DB 0.7071067811865476
+#define LEVEL_MINUS_4POINT5DB 0.5946035575013605
+#define LEVEL_MINUS_6DB 0.5000000000000000
+#define LEVEL_MINUS_9DB 0.3535533905932738
+#define LEVEL_ZERO 0.0000000000000000
+#define LEVEL_ONE 1.0000000000000000
+
+static const float gain_levels[9] = {
LEVEL_PLUS_3DB,
LEVEL_PLUS_1POINT5DB,
LEVEL_ONE,
@@ -97,7 +108,7 @@ static const uint8_t surround_levels[4]
* Table for default stereo downmixing coefficients
* reference: Section 7.8.2 Downmixing Into Two Channels
*/
-const uint8_t ff_ac3_default_coeffs[8][5][2] = {
+static const uint8_t ac3_default_coeffs[8][5][2] = {
{ { 2, 7 }, { 7, 2 }, },
{ { 4, 4 }, },
{ { 2, 7 }, { 7, 2 }, },
@@ -353,12 +364,12 @@ int ff_ac3_parse_frame_header(AC3DecodeC
void ff_ac3_set_downmix_coeffs(AC3DecodeContext *s)
{
int i;
- float cmix = ff_ac3_mix_levels[s->center_mix_level];
- float smix = ff_ac3_mix_levels[s->surround_mix_level];
+ float cmix = gain_levels[s->center_mix_level];
+ float smix = gain_levels[s->surround_mix_level];
for(i=0; i<s->fbw_channels; i++) {
- s->downmix_coeffs[i][0] = ff_ac3_mix_levels[ff_ac3_default_coeffs[s->channel_mode][i][0]];
- s->downmix_coeffs[i][1] = ff_ac3_mix_levels[ff_ac3_default_coeffs[s->channel_mode][i][1]];
+ s->downmix_coeffs[i][0] = gain_levels[ac3_default_coeffs[s->channel_mode][i][0]];
+ s->downmix_coeffs[i][1] = gain_levels[ac3_default_coeffs[s->channel_mode][i][1]];
}
if(s->channel_mode > 1 && s->channel_mode & 1) {
s->downmix_coeffs[1][0] = s->downmix_coeffs[1][1] = cmix;
@@ -429,6 +440,18 @@ void ff_ac3_uncouple_channels(AC3DecodeC
}
/**
+ * Grouped mantissas for 3-level 5-level and 11-level quantization
+ */
+typedef struct {
+ float b1_mant[3];
+ float b2_mant[3];
+ float b4_mant[2];
+ int b1ptr;
+ int b2ptr;
+ int b4ptr;
+} mant_groups;
+
+/**
* Get the transform coefficients for a particular channel
* reference: Section 7.3 Quantization and Decoding of Mantissas
*/
Modified: eac3/ac3dec.h
==============================================================================
--- eac3/ac3dec.h (original)
+++ eac3/ac3dec.h Sun Jan 6 01:42:46 2008
@@ -48,27 +48,15 @@
#define MAX_BLOCKS 6
#define MAX_SPX_CODES 18
-void ff_ac3_window_init(float *window);
-void ff_ac3_tables_init(void);
-
/** dynamic range table. converts codes to scale factors. */
extern float ff_ac3_dynamic_range_tab[256];
-/** dialog normalization table */
-extern float ff_ac3_dialog_norm_tab[32];
-
/**
* table for exponent to scale_factor mapping
* ff_ac3_scale_factors[i] = 2 ^ -i
*/
extern float ff_ac3_scale_factors[25];
-/** channel mix levels */
-extern const float ff_ac3_mix_levels[9];
-
-/** default stereo downmixing coefficients */
-extern const uint8_t ff_ac3_default_coeffs[8][5][2];
-
typedef struct AC3DecodeContext {
AVCodecContext *avctx; ///< Parent context
GetBitContext gbc; ///< Bitstream reader
@@ -241,20 +229,6 @@ typedef struct AC3DecodeContext {
void ff_ac3_decode_exponents(GetBitContext *gb, int exp_strategy, int ngrps,
uint8_t absexp, int8_t *dexps);
-/**
- * Grouped mantissas for 3-level 5-level and 11-level quantization
- */
-typedef struct {
- float b1_mant[3];
- float b2_mant[3];
- float b4_mant[2];
- int b1ptr;
- int b2ptr;
- int b4ptr;
-} mant_groups;
-
-int ff_ac3_parse_frame_header(AC3DecodeContext *s);
-
/* TEMPORARY SOLUTION */
int ff_eac3_parse_header(AC3DecodeContext *s);
int ff_eac3_parse_audio_block(AC3DecodeContext *s, int blk);
@@ -264,28 +238,4 @@ void ff_eac3_tables_init(void);
int ff_ac3_get_transform_coeffs(AC3DecodeContext *s, int blk);
-void ff_ac3_uncouple_channels(AC3DecodeContext *s);
-
-void ff_ac3_remove_dithering(AC3DecodeContext *s);
-
-void ff_ac3_do_rematrixing(AC3DecodeContext *s);
-
-void ff_ac3_do_imdct(AC3DecodeContext *s);
-
-void ff_ac3_downmix(AC3DecodeContext *s);
-
-void ff_ac3_set_downmix_coeffs(AC3DecodeContext *s);
-
-/** Adjustments in dB gain */
-#define LEVEL_PLUS_3DB 1.4142135623730950
-#define LEVEL_PLUS_1POINT5DB 1.1892071150027209
-#define LEVEL_MINUS_1POINT5DB 0.8408964152537145
-#define LEVEL_MINUS_3DB 0.7071067811865476
-#define LEVEL_MINUS_4POINT5DB 0.5946035575013605
-#define LEVEL_MINUS_6DB 0.5000000000000000
-#define LEVEL_MINUS_9DB 0.3535533905932738
-#define LEVEL_ZERO 0.0000000000000000
-#define LEVEL_ONE 1.0000000000000000
-
-
#endif /* AC3DEC_H */
More information about the FFmpeg-soc
mailing list