#define EXTMIXLEV_NUM_OPTIONS 8
static const float extmixlev_options[EXTMIXLEV_NUM_OPTIONS] = {
- LEVEL_PLUS_3DB, LEVEL_PLUS_1POINT5DB, LEVEL_ONE, LEVEL_MINUS_4POINT5DB,
+ LEVEL_PLUS_3DB, LEVEL_PLUS_1POINT5DB, LEVEL_ONE, LEVEL_MINUS_1POINT5DB,
LEVEL_MINUS_3DB, LEVEL_MINUS_4POINT5DB, LEVEL_MINUS_6DB, LEVEL_ZERO
};
*/
static void count_frame_bits_fixed(AC3EncodeContext *s)
{
- static const int frame_bits_inc[8] = { 0, 0, 2, 2, 2, 4, 2, 4 };
+ static const uint8_t frame_bits_inc[8] = { 0, 0, 2, 2, 2, 4, 2, 4 };
int blk;
int frame_bits;
{
int blk, ch;
- snr_offset = (snr_offset - 240) << 2;
+ snr_offset = (snr_offset - 240) * 4;
reset_block_bap(s);
for (blk = 0; blk < s->num_blocks; blk++) {
/* set bitstream id for alternate bitstream syntax */
if (!s->eac3 && (opt->extended_bsi_1 || opt->extended_bsi_2)) {
if (s->bitstream_id > 8 && s->bitstream_id < 11) {
- static int warn_once = 1;
- if (warn_once) {
+ if (!s->warned_alternate_bitstream) {
av_log(avctx, AV_LOG_WARNING, "alternate bitstream syntax is "
"not compatible with reduced samplerates. writing of "
"extended bitstream information will be disabled.\n");
- warn_once = 0;
+ s->warned_alternate_bitstream = 1;
}
} else {
s->bitstream_id = 6;
av_freep(&block->cpl_coord_mant);
}
- s->mdct_end(s);
+ if (s->mdct_end)
+ s->mdct_end(s);
return 0;
}
ret = validate_options(s);
if (ret)
- return ret;
+ goto init_fail;
avctx->frame_size = AC3_BLOCK_SIZE * s->num_blocks;
avctx->initial_padding = AC3_BLOCK_SIZE;