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 331EB4844A for ; Wed, 3 Apr 2024 08:32:31 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 28D4D68D0B7; Wed, 3 Apr 2024 11:32:29 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1C17B68CD0F for ; Wed, 3 Apr 2024 11:32:23 +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=czzy0bBY; dkim-atps=neutral Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id B4EE7240DAC for ; Wed, 3 Apr 2024 10:32:21 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id Ik6f_FBH35HY for ; Wed, 3 Apr 2024 10:32:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1712133139; bh=8ffiqiKKNvjNpblpS1zawPhMW86g8MlAzj/3BVWwD04=; h=Subject:From:To:In-Reply-To:References:Date:From; b=czzy0bBYK8u+RycFaT86w2Mktz9r4bPnAuiPPXLzVbu7qLF/3fgSGqR9mTUg6DiYY kYl9ZCvpzyNBlmrdy0ulMdqMMJ+m4+HRfrQPCBJccPKb+SIvzlFrH4lZ3z50JPXk72 atYeIWtVbEYBh5IMFi17pFl7cdWH9zakluC1L4nQn6c4ymo+l4+lb2HooY98U0hAwu FbpigM/8Kr/CiSiEcrcunDZzBPQUM9m1rXCVpDqk35zlyDtPezemqbIzASpF08Mi6X stkdH8SSqthEi+dqIwQetp0odni8ZsbdnQNFBuIW5wjMkPqraAaiAoxBQfxjx9+2ac ulnoVD3Q6ZHZA== 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 8D3122404E5 for ; Wed, 3 Apr 2024 10:32:19 +0200 (CEST) Received: by lain.khirnov.net (Postfix, from userid 1000) id 7879B1601B9; Wed, 3 Apr 2024 10:32:19 +0200 (CEST) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <20240328165250.64259-7-jamrial@gmail.com> References: <20240328165250.64259-1-jamrial@gmail.com> <20240328165250.64259-7-jamrial@gmail.com> Mail-Followup-To: FFmpeg development discussions and patches Date: Wed, 03 Apr 2024 10:32:19 +0200 Message-ID: <171213313946.28449.14791803443405725197@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 7/7 v5] avcodec/hevcdec: export global side data in AVCodecContext 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 James Almer (2024-03-28 17:52:50) > diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c > index fd356bd190..a693e12670 100644 > --- a/libavcodec/pthread_frame.c > +++ b/libavcodec/pthread_frame.c > @@ -334,6 +334,15 @@ FF_ENABLE_DEPRECATION_WARNINGS > if (for_user) { > if (codec->update_thread_context_for_user) > err = codec->update_thread_context_for_user(dst, src); > + > + av_frame_side_data_free(&dst->decoded_side_data, &dst->nb_decoded_side_data); > + for (int i = 0; i < src->nb_decoded_side_data; i++) { > + int ret = av_frame_side_data_clone(&dst->decoded_side_data, > + &dst->nb_decoded_side_data, > + src->decoded_side_data[i], 0); > + if (ret < 0) > + return ret; > + } Seems wasteful to do this for every frame, when it only needs to be done once. Is there a reason not to put this code in init_thread()? -- 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".