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 B0F0F457FB for ; Wed, 22 Feb 2023 16:10:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6763D68C007; Wed, 22 Feb 2023 18:09:57 +0200 (EET) Received: from btbn.de (btbn.de [136.243.74.85]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D4EE66801DD for ; Wed, 22 Feb 2023 18:09:50 +0200 (EET) Received: from [authenticated] by btbn.de (Postfix) with ESMTPSA id 49816162275 for ; Wed, 22 Feb 2023 17:09:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothenpieler.org; s=mail; t=1677082188; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rnDb2JAHIWXDaYNqGnqQ9lqF/AFELQ5AUt7il+RpnQ0=; b=oHk1EKaCK+Be7CfrO0qpYMLwaQ69Ypp4mRI+soAlhb6HB6B/KVJwsvMRm4zHQg1i83QWPl ReVtAqGwAELVNIcN7uZg2QKkOth/GCDFFsofIsRODCgUq6nucfBxRGgFahnsdFbPv3GXAu X48PNVqc+7icqiFL1hM6I3qgo7sLLQ7oP9HS7jmZ1W9loN6N96Yk7asgT56MD2LBHSgTa3 90jO7ERGalrtoI36qocLrU/1S8ohkGPpX+3erh3V31SRUZG+ZlPGgcfmDrPBy+KIZ3T1Nt qTMjJsPt+XUw7iiMw3i/U1VZIHgH8J2mlrLUXCZSHNG/774Rdwg8F+hkCaTB1A== Message-ID: <58c99b7b-c5f2-5541-5bd1-cce58ddfb204@rothenpieler.org> Date: Wed, 22 Feb 2023 17:09:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 To: ffmpeg-devel@ffmpeg.org References: <63F57060.05FE3A.50083@loongson.cn> <20230222021240.2370954-1-JonHGee@gmail.com> Content-Language: en-US From: Timo Rothenpieler In-Reply-To: <20230222021240.2370954-1-JonHGee@gmail.com> 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 22.02.2023 03:12, JonHGee wrote: > libavcodec/libfdk-aacenc: VBR mode currently does not account for scaling when using -aq options with libfdk, resulting in clamping to vbr mode 5 whenever a value >0 is provided. Adjusting for the scaling factor for proper VBR support. > > --- > libavcodec/libfdk-aacenc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c > index 54549de473..da211baf51 100644 > --- a/libavcodec/libfdk-aacenc.c > +++ b/libavcodec/libfdk-aacenc.c > @@ -230,7 +230,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) > } > > if (avctx->flags & AV_CODEC_FLAG_QSCALE || s->vbr) { > - int mode = s->vbr ? s->vbr : avctx->global_quality; > + int mode = s->vbr ? s->vbr : avctx->global_quality / FF_QP2LAMBDA; > if (mode < 1 || mode > 5) { > av_log(avctx, AV_LOG_WARNING, > "VBR quality %d out of range, should be 1-5\n", mode); Won't this break every existing command line and API client that has passed a value according to the current scale? Also, what binds stronger here? It this "(s->vbr ? s->vbr : avctx->global_quality) / FF_QP2LAMBDA" or "s->vbr ? s->vbr : (avctx->global_quality / FF_QP2LAMBDA)"? In any case, this does not look correct to me. Where would the sudden multiplication with FF_QP2LAMBDA come from in the first place? _______________________________________________ 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".