[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec faac.c, 1.2, 1.3 mp3lameaudio.c, 1.14, 1.15

Michael Niedermayer CVS michael
Sun Aug 21 22:27:02 CEST 2005


Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv14929/libavcodec

Modified Files:
	faac.c mp3lameaudio.c 
Log Message:
vbr audio encode patch by (Justin Ruggles: jruggle, earthlink net)
with changes by me
    int->float as video uses float too
    remove silent cliping to some per codec range, this should result in an error instead
    remove change to utils.c as its inconsistant with video


Index: faac.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/faac.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- faac.c	23 Feb 2004 16:07:30 -0000	1.2
+++ faac.c	21 Aug 2005 20:27:00 -0000	1.3
@@ -56,7 +56,11 @@
     faac_cfg->mpegVersion = MPEG4;
     faac_cfg->useTns = 0;
     faac_cfg->allowMidside = 1;
-    faac_cfg->bitRate = avctx->bit_rate;
+    faac_cfg->bitRate = avctx->bit_rate / avctx->channels;
+    if(avctx->flags & CODEC_FLAG_QSCALE) {
+        faac_cfg->bitRate = 0;
+        faac_cfg->quantqual = avctx->global_quality / FF_QP2LAMBDA;
+    }
     faac_cfg->outputFormat = 0;
     faac_cfg->inputFormat = FAAC_INPUT_16BIT;
 

Index: mp3lameaudio.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mp3lameaudio.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- mp3lameaudio.c	24 Feb 2005 19:08:50 -0000	1.14
+++ mp3lameaudio.c	21 Aug 2005 20:27:00 -0000	1.15
@@ -53,6 +53,11 @@
 	/* lame 3.91 doesn't work in mono */
 	lame_set_mode(s->gfp, JOINT_STEREO);
 	lame_set_brate(s->gfp, avctx->bit_rate/1000);
+    if(avctx->flags & CODEC_FLAG_QSCALE) {
+        lame_set_brate(s->gfp, 0);
+        lame_set_VBR(s->gfp, vbr_default);
+        lame_set_VBR_q(s->gfp, avctx->global_quality / (float)FF_QP2LAMBDA);
+    }
         lame_set_bWriteVbrTag(s->gfp,0);
 	if (lame_init_params(s->gfp) < 0)
 		goto err_close;





More information about the ffmpeg-cvslog mailing list