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 69CCA457F7 for ; Mon, 24 Apr 2023 08:27:22 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 30D5A68BF5F; Mon, 24 Apr 2023 11:27:21 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 07B5668B2C3 for ; Mon, 24 Apr 2023 11:27:19 +0300 (EEST) Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id A13BC10602E0 for ; Mon, 24 Apr 2023 08:27:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1682324839; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=qUQVK2f3Q/fhW6U4Lxy2TtWtERCcSUfTH15A3li40QY=; b=tjMIMmtZ6KlOfvoAD4NrYMLeDqa3CD+EGiCKBwx0n+H8UztKHk+qcYu9wBAKCMSU h4fryfKMxzU/cI9Fhpkf5XjmC0zHFdi9Hroc/jfEzSC6WsGv0ghm0YsKZtSx7Gkl+Qz AXHs/HzbryYFzz8mLPyUHbNkh2y7vMkXCQKyaUM4rJ3NipXoGc1jD90fTPgnolkL5jS 4GNBWgq7JtE5jOmOO2s7qlWjEhPV5W2e1mbX+FoydPoo+lwOVylrCv5IlY1NbZSOT+9 9xK+jOPmmSRMDXcQKfi0F5+KtVMXhp0kmgTWC7VWEa6iKUlXTcAEPWYXLWkdWGBsaOK S2uAYG3/+g== Date: Mon, 24 Apr 2023 10:27:19 +0200 (CEST) From: Lynne To: FFmpeg development discussions and patches Message-ID: In-Reply-To: <168216708203.3843.7636239663100197135@lain.khirnov.net> References: <168167749696.3843.15600454333051309232@lain.khirnov.net> <168172242060.3843.13556775994320990575@lain.khirnov.net> <168216708203.3843.7636239663100197135@lain.khirnov.net> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 31/92] Vulkan patchset part 1 - common code changes 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 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 >> >> > 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".