1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge commit '27631796c9d1b8146ad4a16e6539ecc08afa7565'

* commit '27631796c9d1b8146ad4a16e6539ecc08afa7565':
  ac3: Only initialize float_dsp for the float encoder variant

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-06-13 19:10:19 +02:00
commit 97c285e61b
4 changed files with 9 additions and 3 deletions

View File

@ -2479,7 +2479,6 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
goto init_fail; goto init_fail;
ff_dsputil_init(&s->dsp, avctx); 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); ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
dprint_options(s); dprint_options(s);

View File

@ -266,6 +266,7 @@ typedef struct AC3EncodeContext {
extern const uint64_t ff_ac3_channel_layouts[19]; extern const uint64_t ff_ac3_channel_layouts[19];
int ff_ac3_encode_init(AVCodecContext *avctx); int ff_ac3_encode_init(AVCodecContext *avctx);
int ff_ac3_float_encode_init(AVCodecContext *avctx);
int ff_ac3_encode_close(AVCodecContext *avctx); int ff_ac3_encode_close(AVCodecContext *avctx);

View File

@ -134,6 +134,12 @@ static CoefType calc_cpl_coord(CoefSumType energy_ch, CoefSumType energy_cpl)
return FFMIN(coord, COEF_MAX); return FFMIN(coord, COEF_MAX);
} }
av_cold int ff_ac3_float_encode_init(AVCodecContext *avctx)
{
AC3EncodeContext *s = avctx->priv_data;
avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
return ff_ac3_encode_init(avctx);
}
AVCodec ff_ac3_encoder = { AVCodec ff_ac3_encoder = {
.name = "ac3", .name = "ac3",
@ -141,7 +147,7 @@ AVCodec ff_ac3_encoder = {
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AC3, .id = AV_CODEC_ID_AC3,
.priv_data_size = sizeof(AC3EncodeContext), .priv_data_size = sizeof(AC3EncodeContext),
.init = ff_ac3_encode_init, .init = ff_ac3_float_encode_init,
.encode2 = ff_ac3_float_encode_frame, .encode2 = ff_ac3_float_encode_frame,
.close = ff_ac3_encode_close, .close = ff_ac3_encode_close,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,

View File

@ -257,7 +257,7 @@ AVCodec ff_eac3_encoder = {
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_EAC3, .id = AV_CODEC_ID_EAC3,
.priv_data_size = sizeof(AC3EncodeContext), .priv_data_size = sizeof(AC3EncodeContext),
.init = ff_ac3_encode_init, .init = ff_ac3_float_encode_init,
.encode2 = ff_ac3_float_encode_frame, .encode2 = ff_ac3_float_encode_frame,
.close = ff_ac3_encode_close, .close = ff_ac3_encode_close,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,