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

Måns Rullgård mans
Wed Sep 15 14:15:52 CEST 2010


James Darnley <james.darnley at gmail.com> writes:

> 2010/9/15 M?ns Rullg?rd <mans at mansr.com>:
>> James Darnley <james.darnley at gmail.com> writes:
>>
>>> 2010/9/15 M?ns Rullg?rd <mans at mansr.com>:
>>>> James Darnley <james.darnley at gmail.com> writes:
>>>>
>>>>> 2010/9/14 M?ns Rullg?rd <mans at mansr.com>:
>>>>>> If a single test for a good version which has everything we need is
>>>>>> possible, do that. ?It seems like replacing lame_init with
>>>>>> hip_decode_init should do it.
>>>>>>
>>>>>
>>>>> Okay, just the one check but I left the explicit error message
>>>>>
>>>>> From 402537b93e5b7f9e09789b0d9e5180cab2b0c23d 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 ? ? ? ? ? ? ? | ? ?3 ++-
>>>>> ?libavcodec/libmp3lame.c | ? ?2 +-
>>>>> ?2 files changed, 3 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/configure b/configure
>>>>> index 26db167..d887cb1 100755
>>>>> --- a/configure
>>>>> +++ b/configure
>>>>> @@ -2714,7 +2714,8 @@ 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 hip_decode_init -lmp3lame ||
>>>>> + ? ? ? ? ? ? ? ? ? ? ? ?die "ERROR: libmp3lame version must be >= 3.98.3"; }
>>>>
>>>> Please leave this as it is, only changing the checked function.
>>>>
>>>
>>> Why do you not want an explicit error message?
>>
>> It doesn't belong in this patch, and it can be done in a better way.
>
> I guess that's okay.
>
> From e99e0f3898702dcf4646f51260a7b52dbae96e22 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               |    2 +-
>  libavcodec/libmp3lame.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index 35031a3..dc2f03d 100755
> --- a/configure
> +++ b/configure
> @@ -2715,7 +2715,7 @@ 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 && require  libmp3lame lame/lame.h hip_decode_init -lmp3lame
>  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..8420298 100644
> --- a/libavcodec/libmp3lame.c
> +++ b/libavcodec/libmp3lame.c
> @@ -61,7 +61,7 @@ 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);
> +        lame_set_VBR_quality(s->gfp, avctx->global_quality/(float)FF_QP2LAMBDA);
>      }
>      lame_set_bWriteVbrTag(s->gfp,0);
>      lame_set_disable_reservoir(s->gfp, avctx->flags2 & CODEC_FLAG2_BIT_RESERVOIR ? 0 : 1);
> -- 
> 1.7.1

OK with me.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list