[FFmpeg-cvslog] r19429 - trunk/libavcodec/psymodel.c

alexc subversion
Tue Jul 14 07:22:24 CEST 2009


Author: alexc
Date: Tue Jul 14 07:22:23 2009
New Revision: 19429

Log:
Use cutoff frequency to adjust bandwidth in the generic psymodel preprocess.

Modified:
   trunk/libavcodec/psymodel.c

Modified: trunk/libavcodec/psymodel.c
==============================================================================
--- trunk/libavcodec/psymodel.c	Tue Jul 14 00:46:10 2009	(r19428)
+++ trunk/libavcodec/psymodel.c	Tue Jul 14 07:22:23 2009	(r19429)
@@ -84,7 +84,9 @@ av_cold struct FFPsyPreprocessContext* f
     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);



More information about the ffmpeg-cvslog mailing list