[FFmpeg-cvslog] Merge commit 'd316f9cefcd854071985c6f524a9a15348240264'
James Almer
git at videolan.org
Fri Mar 31 22:34:31 EEST 2017
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Mar 31 16:33:48 2017 -0300| [fc2a94219df7eccd540e0dac42c27cd9e35148de] | committer: James Almer
Merge commit 'd316f9cefcd854071985c6f524a9a15348240264'
* commit 'd316f9cefcd854071985c6f524a9a15348240264':
aac: Drop pointless cast
Merged-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fc2a94219df7eccd540e0dac42c27cd9e35148de
---
libavcodec/aacpsy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
index e32faaa..fca692c 100644
--- a/libavcodec/aacpsy.c
+++ b/libavcodec/aacpsy.c
@@ -311,7 +311,7 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
ctx->model_priv_data = av_mallocz(sizeof(AacPsyContext));
if (!ctx->model_priv_data)
return AVERROR(ENOMEM);
- pctx = (AacPsyContext*) ctx->model_priv_data;
+ pctx = ctx->model_priv_data;
pctx->global_quality = (ctx->avctx->global_quality ? ctx->avctx->global_quality : 120) * 0.01f;
if (ctx->avctx->flags & AV_CODEC_FLAG_QSCALE) {
======================================================================
diff --cc libavcodec/aacpsy.c
index e32faaa,272be9f..fca692c
--- a/libavcodec/aacpsy.c
+++ b/libavcodec/aacpsy.c
@@@ -311,16 -300,10 +311,16 @@@ static av_cold int psy_3gpp_init(FFPsyC
ctx->model_priv_data = av_mallocz(sizeof(AacPsyContext));
if (!ctx->model_priv_data)
return AVERROR(ENOMEM);
- pctx = (AacPsyContext*) ctx->model_priv_data;
+ pctx = ctx->model_priv_data;
+ pctx->global_quality = (ctx->avctx->global_quality ? ctx->avctx->global_quality : 120) * 0.01f;
+
+ if (ctx->avctx->flags & AV_CODEC_FLAG_QSCALE) {
+ /* Use the target average bitrate to compute spread parameters */
+ chan_bitrate = (int)(chan_bitrate / 120.0 * (ctx->avctx->global_quality ? ctx->avctx->global_quality : 120));
+ }
pctx->chan_bitrate = chan_bitrate;
- pctx->frame_bits = chan_bitrate * AAC_BLOCK_SIZE_LONG / ctx->avctx->sample_rate;
+ pctx->frame_bits = FFMIN(2560, chan_bitrate * AAC_BLOCK_SIZE_LONG / ctx->avctx->sample_rate);
pctx->pe.min = 8.0f * AAC_BLOCK_SIZE_LONG * bandwidth / (ctx->avctx->sample_rate * 2.0f);
pctx->pe.max = 12.0f * AAC_BLOCK_SIZE_LONG * bandwidth / (ctx->avctx->sample_rate * 2.0f);
ctx->bitres.size = 6144 - pctx->frame_bits;
More information about the ffmpeg-cvslog
mailing list