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 356334AAD9 for ; Mon, 12 Aug 2024 12:29:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 74B1168DA4E; Mon, 12 Aug 2024 15:28:58 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D930068D94A for ; Mon, 12 Aug 2024 15:28:51 +0300 (EEST) Authentication-Results: mail0.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=a9s//qgJ; dkim-atps=neutral Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 77E9C240DB7 for ; Mon, 12 Aug 2024 14:28:51 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id axDc8ZPTxM3g for ; Mon, 12 Aug 2024 14:28:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1723465730; bh=Pl342RzN8WN4bmNBuXWXtPjd3jhu3Tsymw4dABlbQmc=; h=Subject:From:To:In-Reply-To:References:Date:From; b=a9s//qgJnEnY+/QLopHDN75W6/Hip4tCDHG2zzNGaMVibbVd9wh29ApnbfKxzKfIF E57r7g00nqvWMhcSnie937G7eCYzF5JjQo41PUgmUBDnVR+B0I5QM+XCCSpPJS8Exd ooroGLQ0hjRlFEslaNXteBJKB9prHbocKC/WkPKaUflDO/P3cSNDc/Cw9rMhn7bNmM amMCtR84M8bIsV/souexsv7Sb6OAD3Ve29vkx0QKL7xzRkTWP0sDs3/OADsNn7t7Av rSAn69/EZElNkCKXdTFpdL6Sg8C9765zrFObu245DAyrX0+9ajdD+J5KGl9Qu5Uaaa 6yOHiP9g/5tvA== 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 DA0E3240695 for ; Mon, 12 Aug 2024 14:28:50 +0200 (CEST) Received: by lain.khirnov.net (Postfix, from userid 1000) id B8E761601B9; Mon, 12 Aug 2024 14:28:50 +0200 (CEST) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: References: <20240716171155.31838-1-anton@khirnov.net> <20240716171155.31838-37-anton@khirnov.net> Mail-Followup-To: FFmpeg development discussions and patches Date: Mon, 12 Aug 2024 14:28:50 +0200 Message-ID: <172346573073.21344.9949045811241973787@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 37/39] lavc/hevcdec: use a ContainerFifo to hold frames scheduled for output 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: Quoting Andreas Rheinhardt (2024-08-10 01:52:36) > Anton Khirnov: > > @@ -3442,12 +3448,15 @@ static int hevc_receive_frame(AVCodecContext *avctx, AVFrame *frame) > > if (ret < 0) > > return ret; > > > > - if (s->output_frame->buf[0]) { > > - av_frame_move_ref(frame, s->output_frame); > > +do_output: > > + if (ff_container_fifo_read(s->output_fifo, frame) >= 0) { > > This looks like it adds a (several) av_frame_move_ref() for the common > case in which we only have one output frame. Can't this be avoided? Does it? Current code has av_frame_ref() into HEVCContext.output_frame, which is then av_frame_move_ref()'d into the actual output frame. New code does the same, except with a few more wrappers. > > diff --git a/libavcodec/hevc/hevcdec.h b/libavcodec/hevc/hevcdec.h > > index da4d83e661..f2705b8de2 100644 > > --- a/libavcodec/hevc/hevcdec.h > > +++ b/libavcodec/hevc/hevcdec.h > > @@ -31,6 +31,7 @@ > > #include "libavcodec/avcodec.h" > > #include "libavcodec/bswapdsp.h" > > #include "libavcodec/cabac.h" > > +#include "libavcodec/container_fifo.h" > > Unnecessary. Just use struct ContainerFifo* below. Sure, changed locally. -- 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".