From: Lynne <dev@lynne.ee>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 31/92] Vulkan patchset part 1 - common code changes
Date: Mon, 24 Apr 2023 10:27:19 +0200 (CEST)
Message-ID: <NTmMxlV--3-9@lynne.ee> (raw)
In-Reply-To: <168216708203.3843.7636239663100197135@lain.khirnov.net>
Apr 22, 2023, 14:38 by anton@khirnov.net:
> Quoting Lynne (2023-04-19 16:47:11)
>
>> Apr 17, 2023, 11:07 by anton@khirnov.net:
>>
>> > Quoting Anton Khirnov (2023-04-16 22:38:16)
>> >
>> >> Quoting Lynne (2023-03-14 07:33:43)
>> >> > From 61f412eea3fbcb1e2a8625796760c0e24fa3fb83 Mon Sep 17 00:00:00 2001
>> >> > From: Lynne <dev@lynne.ee>
>> >> > Date: Tue, 17 Jan 2023 05:01:45 +0100
>> >> > Subject: [PATCH 27/92] h264dec: add hwaccel_params_buf
>> >> >
>> >> > diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
>> >> > index 0aee724c0d..6559593195 100644
>> >> > --- a/libavcodec/h264dec.c
>> >> > +++ b/libavcodec/h264dec.c
>> >> > @@ -341,6 +341,7 @@ static av_cold int h264_decode_end(AVCodecContext *avctx)
>> >> > H264Context *h = avctx->priv_data;
>> >> > int i;
>> >> >
>> >> > + av_buffer_unref(&h->hwaccel_params_buf);
>> >> > ff_h264_remove_all_refs(h);
>> >> > ff_h264_free_tables(h);
>> >> >
>> >> > @@ -470,6 +471,7 @@ static void h264_decode_flush(AVCodecContext *avctx)
>> >> >
>> >> > ff_h264_flush_change(h);
>> >> > ff_h264_sei_uninit(&h->sei);
>> >> > + av_buffer_unref(&h->hwaccel_params_buf);
>> >> >
>> >> > for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
>> >> > ff_h264_unref_picture(h, &h->DPB[i]);
>> >> > @@ -669,6 +671,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
>> >> > avpriv_request_sample(avctx, "data partitioning");
>> >> > break;
>> >> > case H264_NAL_SEI:
>> >> > + av_buffer_unref(&h->hwaccel_params_buf);
>> >> > if (h->setup_finished) {
>> >> > avpriv_request_sample(avctx, "Late SEI");
>> >> > break;
>> >> > @@ -682,6 +685,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
>> >> > break;
>> >> > case H264_NAL_SPS: {
>> >> > GetBitContext tmp_gb = nal->gb;
>> >> > + av_buffer_unref(&h->hwaccel_params_buf);
>> >> > if (avctx->hwaccel && avctx->hwaccel->decode_params) {
>> >> > ret = avctx->hwaccel->decode_params(avctx,
>> >> > nal->type,
>> >>
>> >> Removed on SEI and SPS? That seems bizarre and highly arbitrary. Why
>> >> specifically those two?
>> >>
>> >
>> > Found the explanation in the cover letter - I assume SEI is a mistake
>> > and should really be PPS. The points where it is reset still seem highly
>> > Vulkan-specific, so I think it'd be better for the decoder to set a flag
>> > on seeing new parameter sets. Vulkan could would then check and clear
>> > the flag as needed.
>> >
>>
>> It was a typo, changed to remove it on SPS and PPS.
>> We still have to store the compiled bufferref somewhere, and synchronize
>> it between frames, and having it in the frame context itself solves
>> those issues.
>>
>
> Except the way it is handled makes no sense for anything other than
> vulkan.
>
> Having per-thread hwaccel contexts with a callback for propagating the
> data would solve this more cleanly.
>
How would that look?
_______________________________________________
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-04-24 8:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-14 6:33 Lynne
2023-03-14 11:51 ` James Almer
2023-03-15 19:41 ` Lynne
2023-04-16 19:21 ` Anton Khirnov
2023-04-16 19:26 ` Anton Khirnov
2023-04-16 20:38 ` Anton Khirnov
2023-04-17 9:07 ` Anton Khirnov
2023-04-19 14:47 ` Lynne
2023-04-22 12:38 ` Anton Khirnov
2023-04-24 8:27 ` Lynne [this message]
2023-04-17 9:25 ` Anton Khirnov
2023-04-19 14:39 ` Lynne
2023-04-22 12:41 ` Anton Khirnov
2023-04-24 8:26 ` Lynne
2023-04-17 9:46 ` Anton Khirnov
2023-04-19 14:49 ` Lynne
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=NTmMxlV--3-9@lynne.ee \
--to=dev@lynne.ee \
--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