From: Lynne via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Cc: Lynne <dev@lynne.ee> Subject: Re: [FFmpeg-devel] [PATCH v13 06/15] avcodec/vaapi_encode: move the dpb logic from VAAPI to base layer Date: Fri, 14 Jun 2024 09:09:24 +0200 Message-ID: <3498433c-94e8-48d3-97b2-0f1fe328e7e8@lynne.ee> (raw) In-Reply-To: <CH3PR11MB8659B196341B4C89945666B9C0C02@CH3PR11MB8659.namprd11.prod.outlook.com> [-- Attachment #1.1.1.1: Type: text/plain, Size: 4252 bytes --] On 12/06/2024 10:44, Wu, Tong1 wrote: >> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Lynne >> via ffmpeg-devel >> Sent: Monday, June 10, 2024 10:01 AM >> To: FFmpeg development discussions and patches <ffmpeg- >> devel@ffmpeg.org> >> Cc: Lynne <dev@lynne.ee> >> Subject: Re: [FFmpeg-devel] [PATCH v13 06/15] avcodec/vaapi_encode: move >> the dpb logic from VAAPI to base layer >> >> On 07/06/2024 18:48, Lynne wrote: >>> On 07/06/2024 17:22, Wu, Tong1 wrote: >>>>> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of >> Lynne >>>>> via ffmpeg-devel >>>>> Sent: Friday, June 7, 2024 11:10 PM >>>>> To: ffmpeg-devel@ffmpeg.org >>>>> Cc: Lynne <dev@lynne.ee> >>>>> Subject: Re: [FFmpeg-devel] [PATCH v13 06/15] avcodec/vaapi_encode: >> move >>>>> the dpb logic from VAAPI to base layer >>>>> >>>>> On 03/06/2024 11:18, tong1.wu-at-intel.com@ffmpeg.org wrote: >>>>>> From: Tong Wu <tong1.wu@intel.com> >>>>>> >>>>>> Move receive_packet function to base. This requires adding *alloc, >>>>>> *issue, *output, *free as hardware callbacks. HWBaseEncodePicture is >>>>>> introduced as the base layer structure. The related parameters in >>>>>> VAAPIEncodeContext are also extracted to HWBaseEncodeContext. Then >> DPB >>>>>> management logic can be fully extracted to base layer as-is. >>>>>> >>>>>> Signed-off-by: Tong Wu <tong1.wu@intel.com> >>>>>> --- >>>>>> libavcodec/Makefile | 2 +- >>>>>> libavcodec/hw_base_encode.c | 594 ++++++++++++++++++++++++ >>>>>> libavcodec/hw_base_encode.h | 124 +++++ >>>>>> libavcodec/vaapi_encode.c | 793 +++++ >>>>>> --------------------------- >>>>>> libavcodec/vaapi_encode.h | 102 +--- >>>>>> libavcodec/vaapi_encode_av1.c | 35 +- >>>>>> libavcodec/vaapi_encode_h264.c | 84 ++-- >>>>>> libavcodec/vaapi_encode_h265.c | 53 ++- >>>>>> libavcodec/vaapi_encode_mjpeg.c | 13 +- >>>>>> libavcodec/vaapi_encode_mpeg2.c | 33 +- >>>>>> libavcodec/vaapi_encode_vp8.c | 18 +- >>>>>> libavcodec/vaapi_encode_vp9.c | 24 +- >>>>>> 12 files changed, 985 insertions(+), 890 deletions(-) >>>>>> create mode 100644 libavcodec/hw_base_encode.c >>>>> >>>>> This patch doesn't apply, >>>>> >>>>> error: sha1 information is lacking or useless (libavcodec/ >>>>> hw_base_encode.c). >>>>> error: could not build fake ancestor >>>>> >>>>> Could you resent the patchset or link me a repo so I can work with it? >>>> >>>> https://github.com/intel-media-ci/ffmpeg/pull/689 This is the same as >>>> v13 please have a try. >>> >>> That worked, thanks. >> >> I don't think the behaviour is correct when the encoding length is less >> than the decode delay. In my old Vulkan code, I had this piece of code >> in the initialization function: >> >>> if (!src) { >>> ctx->end_of_stream = 1; >>> /* Fix timestamps if we hit end-of-stream before the initial >>> * decode delay has elapsed. */ >>> if (ctx->input_order < ctx->decode_delay) >>> ctx->dts_pts_diff = ctx->pic_end->pts - ctx->first_pts; >>> return AVERROR_EOF; >>> } >> >> I think a flush function should be added, to be called by each encoder, >> to make sure the timestamps remain correct. >> > > For the current patch set, this piece is in hw_base_encode_send_frame and works well for vaapi and d3d12 except when the encoding length is equal to the decode delay, which I'll sent a fix later. Do you mean Vulkan cannot integrate into this part and we have to make a callback for it? No, I was just curious. Fair enough, it can be implemented in a later patch. > >> Also, the D3D12VA structures need an FF prefix, e.g. >> D3D12VAEncodeContext -> FFD3D12VAEncodeContext. > > The current VAAPIEncodeContext has existed for a long time. Does it have any difference for D3D12VAEncodeContext? I mean both VAAPIEncodeContext and D3D12VAEncodeContext are parallel and only referenced in vaapi_encode_*.c (d3d12va_encode_*.c). > > Thanks, > Tong I'm finishing up on the Vulkan test implementation, I'll see to pushing this patch over the weekend. [-- Attachment #1.1.1.2: OpenPGP public key --] [-- Type: application/pgp-keys, Size: 637 bytes --] [-- Attachment #1.2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 236 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:[~2024-06-14 7:09 UTC|newest] Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-06-03 9:18 [FFmpeg-devel] [PATCH v13 01/15] avcodec/vaapi_encode: introduce a base layer for vaapi encode tong1.wu-at-intel.com 2024-06-03 9:18 ` [FFmpeg-devel] [PATCH v13 02/15] avcodec/hw_base_encode: add FF_HW_ prefix for two enums tong1.wu-at-intel.com 2024-06-03 9:18 ` [FFmpeg-devel] [PATCH v13 03/15] avcodec/vaapi_encode: add async_depth to common options tong1.wu-at-intel.com 2024-06-03 9:18 ` [FFmpeg-devel] [PATCH v13 04/15] avcodec/vaapi_encode: add picture type name to base tong1.wu-at-intel.com 2024-06-03 9:18 ` [FFmpeg-devel] [PATCH v13 05/15] avcodec/vaapi_encode: move pic->input_surface initialization to encode_alloc tong1.wu-at-intel.com 2024-06-03 9:18 ` [FFmpeg-devel] [PATCH v13 06/15] avcodec/vaapi_encode: move the dpb logic from VAAPI to base layer tong1.wu-at-intel.com 2024-06-07 15:09 ` Lynne via ffmpeg-devel 2024-06-07 15:22 ` Wu, Tong1 2024-06-07 16:48 ` Lynne via ffmpeg-devel 2024-06-10 2:00 ` Lynne via ffmpeg-devel 2024-06-12 8:44 ` Wu, Tong1 2024-06-14 7:09 ` Lynne via ffmpeg-devel [this message] 2024-06-15 16:05 ` Tong Wu 2024-06-23 4:46 ` Wu Tong 2024-07-02 12:22 ` Lynne via ffmpeg-devel 2024-06-03 9:19 ` [FFmpeg-devel] [PATCH v13 07/15] avcodec/vaapi_encode: extract the init and close function " tong1.wu-at-intel.com 2024-06-03 9:19 ` [FFmpeg-devel] [PATCH v13 08/15] avcodec/vaapi_encode: extract gop configuration and two options " tong1.wu-at-intel.com 2024-06-03 9:19 ` [FFmpeg-devel] [PATCH v13 09/15] avcodec/vaapi_encode: extract set_output_property " tong1.wu-at-intel.com 2024-06-03 9:19 ` [FFmpeg-devel] [PATCH v13 10/15] avcodec/vaapi_encode: extract a get_recon_format function " tong1.wu-at-intel.com 2024-06-03 9:19 ` [FFmpeg-devel] [PATCH v13 11/15] avcodec/vaapi_encode: extract a free funtion " tong1.wu-at-intel.com 2024-06-03 9:19 ` [FFmpeg-devel] [PATCH v13 12/15] avutil/hwcontext_d3d12va: add Flags for resource creation tong1.wu-at-intel.com 2024-06-03 9:19 ` [FFmpeg-devel] [PATCH v13 13/15] avcodec: add D3D12VA hardware HEVC encoder tong1.wu-at-intel.com 2024-06-03 9:19 ` [FFmpeg-devel] [PATCH v13 14/15] Changelog: add D3D12VA HEVC encoder changelog tong1.wu-at-intel.com 2024-06-03 9:19 ` [FFmpeg-devel] [PATCH v13 15/15] avcodec/hw_base_encode: avoid getting FFHWBaseEncodeContext from avctx tong1.wu-at-intel.com 2024-06-06 6:10 ` Lynne via ffmpeg-devel 2024-06-06 6:46 ` Wu, Tong1 2024-06-06 12:30 ` Lynne via ffmpeg-devel 2024-06-06 13:12 ` Wu, Tong1
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=3498433c-94e8-48d3-97b2-0f1fe328e7e8@lynne.ee \ --to=ffmpeg-devel@ffmpeg.org \ --cc=dev@lynne.ee \ /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