From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 5/6] avcodec/h264: Avoid using gray gap frames as references
Date: Wed, 22 Nov 2023 01:09:49 +0100
Message-ID: <20231122000949.GD3543730@pb2> (raw)
In-Reply-To: <f3d457e0-d1d4-4ee0-8a48-2a4f41e99243@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2951 bytes --]
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 <michael@niedermayer.cc>
> > ---
> > libavcodec/h264_refs.c | 11 +++++++++++
> > libavcodec/h264dec.c | 1 +
> > libavcodec/h264dec.h | 1 +
> > 3 files changed, 13 insertions(+)
> >
> > 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, H264SliceContext *sl)
> > else
> > return -1;
> > }
> > + if (h->noref_gray>0 && sl->ref_list[list][index].parent->gray && h->non_gray) {
> > + for (int j=0; j<sl->list_count; j++) {
> > + int list2 = (list+j)&1;
> > + if (h->default_ref[list2].parent && !h->default_ref[list2].parent->gray
> > + && !(!FIELD_PICTURE(h) && (h->default_ref[list2].reference&3) != 3)) {
> > + sl->ref_list[list][index] = h->default_ref[list2];
> > + av_log(h, AV_LOG_DEBUG, "replacement of gray gap frame\n");
> > + break;
> > + }
> > + }
> > + }
> > av_assert0(av_buffer_get_ref_count(sl->ref_list[list][index].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[] = {
> > { "nal_length_size", "nal_length_size", OFFSET(nal_length_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 4, VDX },
> > { "enable_er", "Enable error resilience on damaged frames (unsafe)", OFFSET(enable_er), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VD },
> > { "x264_build", "Assume this x264 version if no x264 version found in any SEI", OFFSET(x264_build), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, VD },
> > + { "noref_gray", "Avoid using gray gap frames as references", OFFSET(noref_gray), AV_OPT_TYPE_INT, {.i64 = 1}, -1, 1, VD },
>
> 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 from
> 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
[...]
--
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.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
next prev parent reply other threads:[~2023-11-22 0:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 17:20 [FFmpeg-devel] [PATCH 1/6] avcodec/h264: Seperate SEI and IDR recovery handling Michael Niedermayer
2023-11-14 17:20 ` [FFmpeg-devel] [PATCH 2/6] avcodec/h264: Use FRAME_RECOVERED_HEURISTIC instead of IDR/SEI Michael Niedermayer
2023-11-14 17:20 ` [FFmpeg-devel] [PATCH 3/6] avcodec/h264dec: More elaborate documentation for frame_recovered Michael Niedermayer
2023-11-14 17:20 ` [FFmpeg-devel] [PATCH 4/6] avcodec/h264: keep track of which frames used gray references Michael Niedermayer
2023-11-14 17:32 ` Hendrik Leppkes
2023-11-14 18:46 ` Michael Niedermayer
2023-11-20 0:11 ` Michael Niedermayer
2023-11-20 3:01 ` Vittorio Giovara
2023-11-20 23:53 ` Michael Niedermayer
2023-11-14 17:20 ` [FFmpeg-devel] [PATCH 5/6] avcodec/h264: Avoid using gray gap frames as references Michael Niedermayer
2023-11-21 12:27 ` James Almer
2023-11-22 0:09 ` Michael Niedermayer [this message]
2023-11-14 17:20 ` [FFmpeg-devel] [PATCH 6/6] avcodec/h264dec: Support skipping frames that used gray gap frames Michael Niedermayer
2023-11-21 12:28 ` James Almer
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=20231122000949.GD3543730@pb2 \
--to=michael@niedermayer.cc \
--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