[FFmpeg-devel] [PATCH] libavcodec/libfdk-aacenc: Scale VBR mode with FF_QP2LAMBDA

Gyan Doshi ffmpeg at gyani.pro
Wed Feb 22 18:46:58 EET 2023



On 2023-02-22 10:12 pm, Timo Rothenpieler wrote:
> On 22.02.2023 17:33, Gyan Doshi wrote:
>> From
>>
>> fftools\ffmpeg_mux_init.c
>> 619:        ost->enc_ctx->global_quality = FF_QP2LAMBDA * qscale
>>
>> Regards,
>> Gyan
>
> But that's only if you set the old qscale CLI options.
> If you set the global_quality option directly, there is no factor 
> applied.
>
> By dividing by FF_QP2LAMBDA you break setting this value via 
> global_quality, and instead add support for setting it via the old and 
> pretty much abandoned qscale interface.

FWIW, that's what LAME does.

libavcodec\libmp3lame.c
119:        lame_set_VBR_quality(s->gfp, avctx->global_quality / 
(float)FF_QP2LAMBDA);

global_quality semantics seem overloaded. Maybe we should just redirect 
user to priv vbr  and error out in fdk init.

Regards,
Gyan



More information about the ffmpeg-devel mailing list