From patchwork Wed Jun 26 12:43:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 50159 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:ccd2:0:b0:482:c625:d099 with SMTP id q18csp405791vqv; Wed, 26 Jun 2024 05:43:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXlcP9WNyDv9kpLAvp5jRw0RJHGXHIgOD5M7w/+4GU01xk9dJW/sC+ymHdZYHhqYCFUafW7sjyGGd1sSxAxNq5JVaWP0tQhsOfy5Q== X-Google-Smtp-Source: AGHT+IHE79QKxi2DekILqU5LsmlYWFfGicrYFWH+a1ROC4pIbBAyj15l8F/SZrcuX9EFl/jQrzmu X-Received: by 2002:a17:906:9c94:b0:a72:8320:e75f with SMTP id a640c23a62f3a-a728320f193mr222768766b.47.1719405836030; Wed, 26 Jun 2024 05:43:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719405836; cv=none; d=google.com; s=arc-20160816; b=VGV5ejKGioshSfZxffkAQNjgO77SYm1tBYqsLhIzHLytl89gLlORCdP/i67tzokoM7 8srwEtrzoDDdm5opSKJFWzgGOQnleZxS10WDlcRnJPvaLzkHnnFkH7wBa63yYcJKl4Sh eULo1URpDdKccaYTP62UdtNyFK7ybduGBIHRXo8cn4QIkXVzK3zlM2v0JdE/e3Oujvl1 FXML0zRvEEABV6VCLU0pZLGoL6nrrBt7CWsC9d66DSu/cAPlwIV6tE5ny/xjLTRlISO4 88veUnAjJb3kploVSaBIBx26DypVQnPHUH+RnRUuLXVDCupC8iezg/wVezv1nCbZGE6D PgdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=diTEh39o58nyWwa9keo5Ip8F/okgZjxfYAXauOotRcU=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=A7V8uyEgEPZTdEU4AgzBT4JrZOh8y+lBRM2VTGcPpeCp4C3orS83qrCCxk00z0oBHn 9zIE4DbIvGezEE2QiWbGFdTTqWX7a8PnUcvN8R0Vvge/mKaL1vKtukAKa22ulrJ0CLuf 2O2Qh+WHCmKkUriIy4hK6YKDlQB2pIpuXgVZIo1wAdZRHBgIeYQOeIu78AFEQrbQ2sBb uhxLXcfBCrQ/h5Lu5LU0++iEUcOQmfOffPI7M+Vb1UKrnhzGIPnijfjrLVBpvX4PdlIx bDAFrmF+2eqpN1eChk1mlVO2YJqYi89gyd8VEy/BBEaRtBAQkMPlIb4NF+PxV4i9qSzG GKwg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=QVWyI3FX; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a7291faef11si19935366b.844.2024.06.26.05.43.55; Wed, 26 Jun 2024 05:43:56 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=QVWyI3FX; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2A15868D3C6; Wed, 26 Jun 2024 15:43:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E2A4B68C41D 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=QVWyI3FX; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 1CB824DE2 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 fgj15y7mCBNQ 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=1719405820; bh=6UTU3UgBb5Z4yEmrdoTT7ZmGhgZJra3IJY8FpYCS46Q=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QVWyI3FXzJ6K1+VzWSuL04iGhpjDBTh8aVPI6vnGQKSRlnPefeQGe+lst2TJ2AvA8 86TzXjHjCBo4l5+kOAsADO1r5aORbBQeTAGmO1JfUgN2S4NcU7wjApDdH8SS8n6D08 TXHt7CdJr2g+1Ytjf4GyJ1vcvbNN2ZBBt/yAvXUwDkkVTqoB941yYQEQ2UsXzO+JJi 1zkdhN47CygE1tRJkOGTCbk2+ZAFXORmAoxK6nhaH78FpyYtsFNOAQu48+FFyE18+T whnEsDYzQlPeEbu7ywNrroHdDziBJBRLzJqr8gsAJ+roKHq9UBUDr/4BvXMgHep42p 9HrlZ5wy3mE8w== 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 81EC84DBC 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 D07D33A083F 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:36 +0200 Message-ID: <20240626124337.14478-4-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 4/5] lavc/hevcdec: move export_stream_params() from set_sps() to hevc_frame_start() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Rvq0XiMuyXjJ The only other caller of set_sps() --- hevc_update_thread_context() --- does not need to call export_stream_params(), since it only updates AVCodecContext fields that have already been updated by generic code. --- libavcodec/hevc/hevcdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index 5136bb53d9..01d32086f2 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -541,8 +541,6 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps) if (ret < 0) goto fail; - export_stream_params(s, sps); - 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); @@ -2919,6 +2917,8 @@ static int hevc_frame_start(HEVCContext *s) if (ret < 0) return ret; + export_stream_params(s, sps); + pix_fmt = get_format(s, sps); if (pix_fmt < 0) return pix_fmt;