#include <stdint.h>
-#include "libavutil/audioconvert.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
+#include "libavutil/channel_layout.h"
#include "libavutil/crc.h"
+#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "put_bits.h"
-#include "dsputil.h"
#include "ac3dsp.h"
#include "ac3.h"
-#include "audioconvert.h"
#include "fft.h"
#include "ac3enc.h"
#include "eac3enc.h"
* bit allocation parameters do not change between blocks
* no delta bit allocation
* no skipped data
- * no auxilliary data
+ * no auxiliary data
* no E-AC-3 metadata
*/
s->mdct_end(s);
-#if FF_API_OLD_ENCODE_AUDIO
- av_freep(&avctx->coded_frame);
-#endif
return 0;
}
return AVERROR(EINVAL);
ch_layout = *channel_layout;
if (!ch_layout)
- ch_layout = avcodec_guess_channel_layout(channels, CODEC_ID_AC3, NULL);
+ ch_layout = av_get_default_channel_layout(channels);
s->lfe_on = !!(ch_layout & AV_CH_LOW_FREQUENCY);
s->channels = channels;
s->avctx = avctx;
- s->eac3 = avctx->codec_id == CODEC_ID_EAC3;
+ s->eac3 = avctx->codec_id == AV_CODEC_ID_EAC3;
ff_ac3_common_init();
if (ret)
goto init_fail;
-#if FF_API_OLD_ENCODE_AUDIO
- avctx->coded_frame= avcodec_alloc_frame();
- if (!avctx->coded_frame) {
- ret = AVERROR(ENOMEM);
- goto init_fail;
- }
-#endif
-
ff_dsputil_init(&s->dsp, avctx);
+ avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
dprint_options(s);