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 354254AFE8 for ; Wed, 26 Jun 2024 12:44:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 210B368D4DC; Wed, 26 Jun 2024 15:43:52 +0300 (EEST) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 00EFD68D3E3 for ; Wed, 26 Jun 2024 15:43:44 +0300 (EEST) Authentication-Results: mail1.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=QEdB/qaO; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 3A8EC4DE4 for ; Wed, 26 Jun 2024 14:43:42 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id 9YZKw3XluO-n for ; Wed, 26 Jun 2024 14:43:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1719405821; bh=ba5DQlTj2RNsqNkP92cDxEL8C//I+25OZdgn1Ad1TO0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QEdB/qaOJgwlq5OtCBLFmE3fbPqFDP2vMZSFBBHReL7kpMHtna0FxwHoEmxUG7LVe Ux1/fOnYNdYIbeKXgZBqnJS0spyyK0qsjHBpSW/fi+C7lcslZGQC4ZIihFSJuO63DO 92SxTxLEBmR4nPltcOKF/MUNwGMKYPmg5LZBiXrvhCuAJ+p60PSSHsCEGd7s9V3nSD 7y6cn4GtAOPZJSWoSBjIPO8fwbmQrVLGKV0irJdF3Atq6js3yskyS5QkDup5LVASCd 50KdQEnCjZcLjwAgtKoP+OyHdIrL1iOKpy9DX1nDTTvTLbuZKhYg5npPerOiUZWfar ZeJgkxlRg1U0g== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (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 "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id D44624DDB for ; Wed, 26 Jun 2024 14:43:40 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id C3E353A083A for ; Wed, 26 Jun 2024 14:43:39 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 26 Jun 2024 14:43:35 +0200 Message-ID: <20240626124337.14478-3-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240626124337.14478-1-anton@khirnov.net> References: <20240626124337.14478-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/5] lavc/hevcdec: do not pass a pixel format to set_sps() 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: It is merely copied to AVCodecContext.pix_fmt, which serves no useful purpose. set_sps() is called from two places: * when a new SPS becomes active - then the pixel format is overridden immediately after the set_sps() call by the result from ff_get_format(); * when a new SPS is propagated across frame threads - then the AVCodecContext value is already set to the same value by the generic code. --- libavcodec/hevc/hevcdec.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index 4a62170073..5136bb53d9 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -526,8 +526,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) return ff_get_format(s->avctx, pix_fmts); } -static int set_sps(HEVCContext *s, const HEVCSPS *sps, - enum AVPixelFormat pix_fmt) +static int set_sps(HEVCContext *s, const HEVCSPS *sps) { int ret, i; @@ -544,8 +543,6 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps, export_stream_params(s, sps); - s->avctx->pix_fmt = pix_fmt; - ff_hevc_pred_init(&s->hpc, sps->bit_depth); ff_hevc_dsp_init (&s->hevcdsp, sps->bit_depth); ff_videodsp_init (&s->vdsp, sps->bit_depth); @@ -2918,7 +2915,7 @@ static int hevc_frame_start(HEVCContext *s) ff_hevc_clear_refs(s); - ret = set_sps(s, sps, sps->pix_fmt); + ret = set_sps(s, sps); if (ret < 0) return ret; @@ -3592,7 +3589,7 @@ static int hevc_update_thread_context(AVCodecContext *dst, ff_refstruct_unref(&s->pps); if (s->ps.sps != s0->ps.sps) - if ((ret = set_sps(s, s0->ps.sps, src->pix_fmt)) < 0) + if ((ret = set_sps(s, s0->ps.sps)) < 0) return ret; s->seq_decode = s0->seq_decode; -- 2.43.0 _______________________________________________ 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".