[FFmpeg-devel] [PATCH] float values for libmp3lame quality

James Darnley james.darnley
Tue Sep 14 23:27:31 CEST 2010


2010/9/14 M?ns Rullg?rd <mans at mansr.com>:
> James Darnley <james.darnley at gmail.com> writes:
>> New patch with the scaling removed
>>
>> From 0e130a14baa9f65eba4cd2151e5cbf1785c936ec Mon Sep 17 00:00:00 2001
>> From: James Darnley <james.darnley at gmail.com>
>> Date: Tue, 14 Sep 2010 10:57:19 +0200
>> Subject: [PATCH 3/3] float values for libmp3lame quality
>>
>> ---
>> ?configure ? ? ? ? ? ? ? | ? ?7 ++++++-
>> ?libavcodec/libmp3lame.c | ? ?3 ++-
>> ?2 files changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/configure b/configure
>> index ae3d738..f5445d7 100755
>> --- a/configure
>> +++ b/configure
>> @@ -2709,7 +2709,12 @@ enabled libdirac ? && add_cflags $(pkg-config --cflags dirac) &&
>> ? ? ? ? ? ? ? ? ? ? ? ?require ?libdirac libdirac_encoder/dirac_encoder.h dirac_encoder_init $(pkg-config --libs dirac)
>> ?enabled libfaac ? ?&& require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
>> ?enabled libgsm ? ? && require ?libgsm gsm/gsm.h gsm_create -lgsm
>> -enabled libmp3lame && require ?libmp3lame lame/lame.h lame_init -lmp3lame
>> +enabled libmp3lame && { check_lib lame/lame.h lame_get_VBR_quality -lmp3lame &&
>> + ? ? ? ? ? ? ? ? ? ? ? ?check_lib lame/lame.h hip_decode_init -lmp3lame ||
>> + ? ? ? ? ? ? ? ? ? ? ? ?die "ERROR: libmp3lame version must be >= 3.98.3"; }
>> +# check for both functions to make sure it has the required feature but is newer
>> +# than the fix to a bug in 3.98 through 3.98.2
>
> Please explain.
>

I refer to the bug/issue that causes the error on
libavcodec/libmp3lame.c:181 "lame: output buffer too small (buffer
index: %d, free bytes: %d)"

I forget what the real problem is but lame say they've solve it on
their end with 3.98.3.  Their changelog has this message: "Workaround
for FFMPEG bug, which uses to call lame_encode_flush more than once in
a loop"

People in #ffmpeg on IRC used to have to tell people to stop using
3.98 through 3.98.2.  I haven't seen this in a while so it looks as
though most have updated.

The first function was introduced with 3.98.  The second function was
added to the header in 3.98.3 so I could check for it alone but I
don't know what would be preferred.

>> ?enabled libnut ? ? && require ?libnut libnut.h nut_demuxer_init -lnut
>> ?enabled libopencore_amrnb ?&& require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
>> ?enabled libopencore_amrwb ?&& require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
>> diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
>> index 1d74d6d..92b4024 100644
>> --- a/libavcodec/libmp3lame.c
>> +++ b/libavcodec/libmp3lame.c
>> @@ -61,7 +61,8 @@ static av_cold int MP3lame_encode_init(AVCodecContext *avctx)
>> ? ? ?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);
>> + ? ? ? ?/* requires lame 3.98 or later */
>
> Pointless comment.
>

gone
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-float-values-for-libmp3lame-quality.patch
Type: application/octet-stream
Size: 2207 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100914/847ff80a/attachment.obj>



More information about the ffmpeg-devel mailing list