From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id A8BC345815 for ; Wed, 22 Feb 2023 18:50:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7852468C056; Wed, 22 Feb 2023 20:50:11 +0200 (EET) Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com [209.85.128.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 998A068BEF9 for ; Wed, 22 Feb 2023 20:50:05 +0200 (EET) Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-536c02eea4dso126140497b3.4 for ; Wed, 22 Feb 2023 10:50:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=Whlvyp44ZqJI8rEvF6U03F6YddX5dg67rBeXHS/7R5k=; b=VLgWHRZGgCw0kqI3/ZWU0zamEiyanomgQJMESNiajdhxgPHlmzKwfW0rGgs4skhNIU czp7OCCRil+EIMK+nF7gl1DIajLIxLhoNSIMylgjqNLVBs19pG3hXlPDsYMwa/bYZqCp 6YvJdH7ya1ByUj2+Htz3x2Q/IhQ3nnxMz3xinq7K4tHLbMCtqs6G+NnW4utKJgjzYnRP GGMf1n3kPy9BYtEq1pnQpKD9fJQUHo7oFpDLYrq4QucoSOLvIDpjWAJLZ4cywVLGP+U9 gtwHmi2Xcsdt/T3nWfP4KWSgtArEpvtnCSMDkUJMvX0DdB8ZMAQNkw4P+iiD4DGMcpJx 8ZlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Whlvyp44ZqJI8rEvF6U03F6YddX5dg67rBeXHS/7R5k=; b=5QQ/a54i1ibpB4c6Sk0vFFy8qLvlQS888n5H9NfPzgQJJuu/KSJmEFU3vtM+suj/lD W1aob7TZ4GZcA3rnAmNpb5DfOILnWoQcIxeRocmP8wkqMzUUlS9t+rPdw0cvtOM3Dglh jMwOWO3/340Eqfs7GoYtlluk0CKTUjSH2EuPyk7b8khkGs81LZ7koTH+6jjfgFdlNkA8 BncDuf31ToOc6Cm759YssQZ5HDtoa6JfabaNmRnbHYyOogdoZdlHhgKCOeCsEh/cNTTu zxzXgI1ltBWXgCUahLrTvfevzkt5nDlytU0IuEOnqsKNsUgChhwdggaRiceSpZgVHO67 LEuA== X-Gm-Message-State: AO0yUKUNUVrMo+HGWH8CoBcwWOQWxrrrCrfumBGG3OIMhvuL5DQjb0S1 R83oViTlaOvmcXpBpzxqNNiYL0Af0Vj9kPKQFWoRG4P3 X-Google-Smtp-Source: AK7set8bxzBmBfB80TzhMeTOSCs9ulrmtPda9JscMjQedpw1KOq8VgnhikiRjsCHdqiA0eD7KhDUieY9O5rf5oc5CUg= X-Received: by 2002:a0d:d915:0:b0:536:44ba:c4c9 with SMTP id b21-20020a0dd915000000b0053644bac4c9mr257122ywe.152.1677091803526; Wed, 22 Feb 2023 10:50:03 -0800 (PST) MIME-Version: 1.0 References: <63F57060.05FE3A.50083@loongson.cn> <20230222021240.2370954-1-JonHGee@gmail.com> <58c99b7b-c5f2-5541-5bd1-cce58ddfb204@rothenpieler.org> <7334fb72-bb26-de45-f0a1-c33180f210b0@gyani.pro> <74946841-b63a-d301-9013-bc32c33e31d2@gyani.pro> In-Reply-To: From: Jonathan Gee Date: Wed, 22 Feb 2023 10:49:52 -0800 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] libavcodec/libfdk-aacenc: Scale VBR mode with FF_QP2LAMBDA X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 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 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".