|
|
|
@ -561,12 +561,16 @@ static void extract_exponents(AC3EncodeContext *s) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Calculate exponent strategies for all blocks in a single channel. |
|
|
|
|
* Calculate exponent strategies for all channels. |
|
|
|
|
* Array arrangement is reversed to simplify the per-channel calculation. |
|
|
|
|
*/ |
|
|
|
|
static void compute_exp_strategy_ch(AC3EncodeContext *s, uint8_t *exp_strategy, |
|
|
|
|
uint8_t *exp) |
|
|
|
|
static void compute_exp_strategy(AC3EncodeContext *s) |
|
|
|
|
{ |
|
|
|
|
int blk, blk1; |
|
|
|
|
int ch, blk, blk1; |
|
|
|
|
|
|
|
|
|
for (ch = 0; ch < s->fbw_channels; ch++) { |
|
|
|
|
uint8_t *exp_strategy = s->exp_strategy[ch]; |
|
|
|
|
uint8_t *exp = s->blocks[0].exp[ch]; |
|
|
|
|
int exp_diff; |
|
|
|
|
|
|
|
|
|
/* estimate if the exponent variation & decide if they should be
|
|
|
|
@ -598,19 +602,6 @@ static void compute_exp_strategy_ch(AC3EncodeContext *s, uint8_t *exp_strategy, |
|
|
|
|
blk = blk1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Calculate exponent strategies for all channels. |
|
|
|
|
* Array arrangement is reversed to simplify the per-channel calculation. |
|
|
|
|
*/ |
|
|
|
|
static void compute_exp_strategy(AC3EncodeContext *s) |
|
|
|
|
{ |
|
|
|
|
int ch, blk; |
|
|
|
|
|
|
|
|
|
for (ch = 0; ch < s->fbw_channels; ch++) { |
|
|
|
|
compute_exp_strategy_ch(s, s->exp_strategy[ch], s->blocks[0].exp[ch]); |
|
|
|
|
} |
|
|
|
|
if (s->lfe_on) { |
|
|
|
|
ch = s->lfe_channel; |
|
|
|
|
s->exp_strategy[ch][0] = EXP_D15; |
|
|
|
|