From: Jonathan Gee <jonhgee@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] libavcodec/libfdk-aacenc: Scale VBR mode with FF_QP2LAMBDA
Date: Wed, 22 Feb 2023 10:49:52 -0800
Message-ID: <CAGYMPXjKuUjR72TS3Gt115sM44kcPYOg23_Xn6xryAOB_k9bWw@mail.gmail.com> (raw)
In-Reply-To: <ee3b7ff2-a58c-4dfe-9594-2abf9562a76a@rothenpieler.org>
I had noticed fdk is specifically looking for the qscale flag, and
otherwise does not do anything with global_quality. I suppose the change
is risky for anyone who is setting both global quality and qscale, but with
the current code, it seems incorrect to have a conditional based on the
scaled option and not account for the scaling.
if (avctx->flags & AV_CODEC_FLAG_QSCALE || s->vbr) {
int mode = s->vbr ? s->vbr : avctx->global_quality;
On Wed, Feb 22, 2023 at 9:16 AM Timo Rothenpieler <timo@rothenpieler.org>
wrote:
> On 22.02.2023 17:46, Gyan Doshi wrote:
> >
> >
> > 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
>
> It's pretty much a matter of "what did this code always do in the past".
> It then got to stick to it, cause otherwise we break downstream API and
> CLI consumers.
>
> The mp3lame code is probably old enough that qscale was still the
> default at the time.
> Nowadays it's global_quality.
>
> Both of those options mapping to the same field in avctx, one with a
> magic factor applies, is definitely and oddity.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
prev parent reply other threads:[~2023-02-22 18:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <63F57060.05FE3A.50083@loongson.cn>
2023-02-22 2:12 ` JonHGee
2023-02-22 16:09 ` Timo Rothenpieler
2023-02-22 16:33 ` Gyan Doshi
2023-02-22 16:42 ` Timo Rothenpieler
2023-02-22 16:46 ` Gyan Doshi
2023-02-22 17:15 ` Timo Rothenpieler
2023-02-22 18:49 ` Jonathan Gee [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGYMPXjKuUjR72TS3Gt115sM44kcPYOg23_Xn6xryAOB_k9bWw@mail.gmail.com \
--to=jonhgee@gmail.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git