# HG changeset patch # User michael # Date 1124656020 0 # Node ID bceeca1bb30fe211c2bd1de43657239f6003d968 # Parent 22eec5a1b043c8513cd41cc6173d7688f6854cb8 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 diff -r 22eec5a1b043 -r bceeca1bb30f faac.c --- a/faac.c Sun Aug 21 19:50:22 2005 +0000 +++ b/faac.c Sun Aug 21 20:27:00 2005 +0000 @@ -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; diff -r 22eec5a1b043 -r bceeca1bb30f mp3lameaudio.c --- a/mp3lameaudio.c Sun Aug 21 19:50:22 2005 +0000 +++ b/mp3lameaudio.c Sun Aug 21 20:27:00 2005 +0000 @@ -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;