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 5EBCE41335 for ; Wed, 22 Nov 2023 00:10:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B38F968CC70; Wed, 22 Nov 2023 02:09:57 +0200 (EET) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BBF4268CC45 for ; Wed, 22 Nov 2023 02:09:50 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id E669E60004 for ; Wed, 22 Nov 2023 00:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1700611790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Di/fz6Zpu9EqHOakOpXsDnj6Nm8xqZRV1tB1OmeVEMc=; b=Zqajju+VftgmhkbvaWcClp7gp7ax5jJ4XQgqs5oMQJ6a+DsXK0ZuJa+N5z6acLnQMUy6pg 1X5gLHyTsFlobz1l2mEOuskwE9VwYAmXv0CmakOU7GIPWVFkxoRsPNEVj5GefEgG+0WI4J gcYEWO6vwGzOpVH78AuoxjWFuxGRAYbh5M43skzYQjZYBSmMrWrFY33dRlFERDwH/3EXgt YmgH/A288RZwq/zE8VDBXwt5hHZnppm/HzuCy2IzeDoOfgjEFPlva5ggzV5FIZIMWprwPa mGC6tj0BwEWiRG7sFgSDrHIlsW2Paf1VhHxryj5SXDHyNiMu9waqWngP0/CiCA== Date: Wed, 22 Nov 2023 01:09:49 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20231122000949.GD3543730@pb2> References: <20231114172051.13872-1-michael@niedermayer.cc> <20231114172051.13872-5-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 5/6] avcodec/h264: Avoid using gray gap frames as references 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: multipart/mixed; boundary="===============3514504031164674653==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============3514504031164674653== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="A9ze8FpSlcDV9qRo" Content-Disposition: inline --A9ze8FpSlcDV9qRo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 21, 2023 at 09:27:59AM -0300, James Almer wrote: > On 11/14/2023 2:20 PM, Michael Niedermayer wrote: > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/h264_refs.c | 11 +++++++++++ > > libavcodec/h264dec.c | 1 + > > libavcodec/h264dec.h | 1 + > > 3 files changed, 13 insertions(+) > >=20 > > diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c > > index 92778e737a5..9bc7b20988f 100644 > > --- a/libavcodec/h264_refs.c > > +++ b/libavcodec/h264_refs.c > > @@ -410,6 +410,17 @@ int ff_h264_build_ref_list(H264Context *h, H264Sli= ceContext *sl) > > else > > return -1; > > } > > + if (h->noref_gray>0 && sl->ref_list[list][index].parent->g= ray && h->non_gray) { > > + for (int j=3D0; jlist_count; j++) { > > + int list2 =3D (list+j)&1; > > + if (h->default_ref[list2].parent && !h->default_re= f[list2].parent->gray > > + && !(!FIELD_PICTURE(h) && (h->default_ref[list= 2].reference&3) !=3D 3)) { > > + sl->ref_list[list][index] =3D h->default_ref[l= ist2]; > > + av_log(h, AV_LOG_DEBUG, "replacement of gray g= ap frame\n"); > > + break; > > + } > > + } > > + } > > av_assert0(av_buffer_get_ref_count(sl->ref_list[list][ind= ex].parent->f->buf[0]) > 0); > > } > > } > > diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c > > index 7ea55db75dd..b48821db244 100644 > > --- a/libavcodec/h264dec.c > > +++ b/libavcodec/h264dec.c > > @@ -1091,6 +1091,7 @@ static const AVOption h264_options[] =3D { > > { "nal_length_size", "nal_length_size", OFFSET(nal_length_size), = AV_OPT_TYPE_INT, {.i64 =3D 0}, 0, 4, VDX }, > > { "enable_er", "Enable error resilience on damaged frames (unsafe= )", OFFSET(enable_er), AV_OPT_TYPE_BOOL, { .i64 =3D -1 }, -1, 1, VD }, > > { "x264_build", "Assume this x264 version if no x264 version foun= d in any SEI", OFFSET(x264_build), AV_OPT_TYPE_INT, {.i64 =3D -1}, -1, INT_= MAX, VD }, > > + { "noref_gray", "Avoid using gray gap frames as references", OFFSE= T(noref_gray), AV_OPT_TYPE_INT, {.i64 =3D 1}, -1, 1, VD }, >=20 > Should be AV_OPT_TYPE_BOOL, and there's no point allowing -1. That's only > useful for example when used with external modules as "use the default fr= om > the external library". I was thinking that we may want to choose this depending on the detected encoder when i wrote it. But as is, true it makes no sense ATM I will change it thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many things microsoft did are stupid, but not doing something just because microsoft did it is even more stupid. If everything ms did were stupid they would be bankrupt already. --A9ze8FpSlcDV9qRo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZV1GyQAKCRBhHseHBAsP q7phAJ9V/3RLljqJAUEdvX9I2O/u6kPSHwCdG/0fF4vJ94k1uVpadycFQKhGUXk= =tbor -----END PGP SIGNATURE----- --A9ze8FpSlcDV9qRo-- --===============3514504031164674653== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============3514504031164674653==--