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 6B17646FD9 for ; Wed, 25 Oct 2023 13:38:33 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DF28A68CAED; Wed, 25 Oct 2023 16:38:30 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 34FE768C8EA for ; Wed, 25 Oct 2023 16:38:24 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id F21E9240498; Wed, 25 Oct 2023 15:38:23 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id FOyeVYn8Btpn; Wed, 25 Oct 2023 15:38:23 +0200 (CEST) Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 281EC2400FF; Wed, 25 Oct 2023 15:38:23 +0200 (CEST) Received: by lain.khirnov.net (Postfix, from userid 1000) id 121F71601B9; Wed, 25 Oct 2023 15:38:23 +0200 (CEST) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: References: Mail-Followup-To: FFmpeg development discussions and patches , Andreas Rheinhardt Date: Wed, 25 Oct 2023 15:38:23 +0200 Message-ID: <169824110304.11195.7772246187741157568@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 38/42] avcodec/codec_internal: Remove FF_CODEC_CAP_ALLOCATE_PROGRESS 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 Cc: Andreas Rheinhardt 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: Quoting Andreas Rheinhardt (2023-09-19 21:57:30) > Before commit f025b8e110b36c1cdb4fb56c4cd57aeca1767b5b, > every frame-threaded decoder used ThreadFrames, even when > they did not have any inter-frame dependencies at all. > In order to distinguish those decoders that need the AVBuffer > for progress communication from those that do not (to avoid > the allocation for the latter), the former decoders were marked > with the FF_CODEC_CAP_ALLOCATE_PROGRESS internal codec cap. > > Yet distinguishing these two can be done in a more natural way: > Don't use ThreadFrames when not needed and split ff_thread_get_buffer() > into a core function that calls the user's get_buffer2 callback > and a wrapper around it that also allocates the progress AVBuffer. > This has been done in 02220b88fc38ef9dd4f2d519f5d3e4151258b60c > and since that commit the ALLOCATE_PROGRESS cap was nearly redundant. > > The only exception was WebP and VP8. WebP can contain VP8 > and uses the VP8 decoder directly (i.e. they share the same > AVCodecContext). Both decoders are frame-threaded and VP8 > has inter-frame dependencies (in general, not in valid WebP) > and therefore the ALLOCATE_PROGRESS cap. In order to avoid > allocating progress in case of a frame-threaded WebP decoder > the cap and the check for the cap has been kept in place. > > Yet now the VP8 decoder has been switched to use ProgressFrames > and therefore there is just no reason any more for this check > and the cap. This commit therefore removes both. > > Also change the value of FF_CODEC_CAP_USES_PROGRESSFRAMES > to leave no gaps. > > Signed-off-by: Andreas Rheinhardt > --- > doc/multithreading.txt | 8 ++++---- > libavcodec/codec_internal.h | 7 +------ > libavcodec/ffv1dec.c | 3 +-- > libavcodec/h264dec.c | 2 +- > libavcodec/hevcdec.c | 2 +- > libavcodec/mpeg4videodec.c | 3 +-- > libavcodec/pngdec.c | 3 +-- > libavcodec/pthread_frame.c | 12 +++++------- > libavcodec/rv30.c | 1 - > libavcodec/rv40.c | 1 - > libavcodec/tests/avcodec.c | 7 +------ > 11 files changed, 16 insertions(+), 33 deletions(-) LGTM -- Anton Khirnov _______________________________________________ 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".