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 962C64B4E2 for ; Fri, 7 Jun 2024 13:10:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5688F68D873; Fri, 7 Jun 2024 16:04:38 +0300 (EEST) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4252568D2A2 for ; Fri, 7 Jun 2024 16:03:52 +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=KyaSNuPm; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 2DF5D4D76 for ; Fri, 7 Jun 2024 15:03:52 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id 2xle7cKVK7Zm for ; Fri, 7 Jun 2024 15:03:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1717765423; bh=kCYiNFk8I7jqt9yzhJAmkemhXb+6n5JsA40aYc5T6lQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KyaSNuPmbrZ1c6088AbA8Vs6C1U50GfUU83kp5Wk8sw1oyNjd59Qo4IX3vxRbDGGR /+skIik4TITnLevkyc1oTA82/ilqnE7kbmbrCBorK5rq2AL3AdST/iocLBshoxoAP1 7rpdH4d+lqL6nyRehomJar66uqBXQ6wfnKCK0VqsRa6PhdYAccYE2f7HC8pSxCiuQ4 Fbf/MApn8+GHCwLen4aY1a2NweN7TEMZDnFEXUeb9gWHndbU5Vg54+WEthArBN6GIQ hlt+XWsWJnz7p46hvLEbzE8oac/scr57ZhXvpT6TB7zjkHXzwAkGAofEtlogfMUJel woUodSE8O+FWA== 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 F1BAD4DFC for ; Fri, 7 Jun 2024 15:03:42 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id CE9463A1ABC for ; Fri, 07 Jun 2024 15:03:35 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 7 Jun 2024 15:01:28 +0200 Message-ID: <20240607130135.9088-32-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240607130135.9088-1-anton@khirnov.net> References: <20240607130135.9088-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 32/39] lavc/hevcdec: move sequence increment/IDR handling 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 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: >From hls_slice_header(). It is only done once per frame, so that is a more appropriate place for this code. --- libavcodec/hevc/hevcdec.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index 9abae3260d..b13e3e06a3 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -604,11 +604,6 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) return 1; // This slice will be skipped later, do not corrupt state } - if ((IS_IDR(s) || IS_BLA(s)) && sh->first_slice_in_pic_flag) { - s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; - if (IS_IDR(s)) - ff_hevc_clear_refs(s); - } sh->no_output_of_prior_pics_flag = 0; if (IS_IRAP(s)) sh->no_output_of_prior_pics_flag = get_bits1(gb); @@ -2949,6 +2944,12 @@ static int hevc_frame_start(HEVCContext *s) memset(s->is_pcm, 0, (sps->min_pu_width + 1) * (sps->min_pu_height + 1)); memset(s->tab_slice_address, -1, pic_size_in_ctb * sizeof(*s->tab_slice_address)); + if ((IS_IDR(s) || IS_BLA(s))) { + s->seq_decode = (s->seq_decode + 1) & HEVC_SEQUENCE_COUNTER_MASK; + if (IS_IDR(s)) + ff_hevc_clear_refs(s); + } + s->is_decoded = 0; s->slice_idx = 0; s->first_nal_type = s->nal_unit_type; -- 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".