diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-05-07 07:20:32 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-15 09:42:39 -0300 |
commit | 494760f971a41851630d7940abe914cd1115737e (patch) | |
tree | 33e017519b761fc8e6776fdc15b5fca627d02f68 /libavcodec/aacpsy.c | |
parent | 2350a50bed6bd71c67947604f117a4dff73ebe35 (diff) | |
download | ffmpeg-494760f971a41851630d7940abe914cd1115737e.tar.gz |
aac: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/aacpsy.c')
-rw-r--r-- | libavcodec/aacpsy.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c index 0c64f2c7b0..4c5ab2c9d5 100644 --- a/libavcodec/aacpsy.c +++ b/libavcodec/aacpsy.c @@ -263,13 +263,13 @@ static av_cold void lame_window_init(AacPsyContext *ctx, AVCodecContext *avctx) { int i, j; - for (i = 0; i < avctx->channels; i++) { + for (i = 0; i < avctx->ch_layout.nb_channels; i++) { AacPsyChannel *pch = &ctx->ch[i]; if (avctx->flags & AV_CODEC_FLAG_QSCALE) pch->attack_threshold = psy_vbr_map[avctx->global_quality / FF_QP2LAMBDA].st_lrm; else - pch->attack_threshold = lame_calc_attack_threshold(avctx->bit_rate / avctx->channels / 1000); + pch->attack_threshold = lame_calc_attack_threshold(avctx->bit_rate / avctx->ch_layout.nb_channels / 1000); for (j = 0; j < AAC_NUM_BLOCKS_SHORT * PSY_LAME_NUM_SUBBLOCKS; j++) pch->prev_energy_subshort[j] = 10.0f; @@ -303,7 +303,7 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) { float bark; int i, j, g, start; float prev, minscale, minath, minsnr, pe_min; - int chan_bitrate = ctx->avctx->bit_rate / ((ctx->avctx->flags & AV_CODEC_FLAG_QSCALE) ? 2.0f : ctx->avctx->channels); + int chan_bitrate = ctx->avctx->bit_rate / ((ctx->avctx->flags & AV_CODEC_FLAG_QSCALE) ? 2.0f : ctx->avctx->ch_layout.nb_channels); const int bandwidth = ctx->cutoff ? ctx->cutoff : AAC_CUTOFF(ctx->avctx); const float num_bark = calc_bark((float)bandwidth); @@ -370,7 +370,7 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) { } } - pctx->ch = av_calloc(ctx->avctx->channels, sizeof(*pctx->ch)); + pctx->ch = av_calloc(ctx->avctx->ch_layout.nb_channels, sizeof(*pctx->ch)); if (!pctx->ch) { av_freep(&ctx->model_priv_data); return AVERROR(ENOMEM); |