Mercurial > libavcodec.hg
changeset 9953:a79d7debe431 libavcodec
Use cutoff frequency to adjust bandwidth in the generic psymodel preprocess.
author | alexc |
---|---|
date | Tue, 14 Jul 2009 05:22:23 +0000 |
parents | 4b3abcad0628 |
children | 50327500e065 |
files | psymodel.c |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/psymodel.c Mon Jul 13 01:59:48 2009 +0000 +++ b/psymodel.c Tue Jul 14 05:22:23 2009 +0000 @@ -84,7 +84,9 @@ ctx = av_mallocz(sizeof(FFPsyPreprocessContext)); ctx->avctx = avctx; - if (avctx->flags & CODEC_FLAG_QSCALE) + if (avctx->cutoff > 0) + cutoff_coeff = 2.0 * avctx->cutoff / avctx->sample_rate; + else if (avctx->flags & CODEC_FLAG_QSCALE) cutoff_coeff = 1.0f / av_clip(1 + avctx->global_quality / FF_QUALITY_SCALE, 1, 8); else cutoff_coeff = avctx->bit_rate / (4.0f * avctx->sample_rate * avctx->channels);