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 A22FF47C6D for ; Tue, 14 Nov 2023 17:21:10 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1435368CD55; Tue, 14 Nov 2023 19:21:01 +0200 (EET) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EA76368CBCB for ; Tue, 14 Nov 2023 19:20:53 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 310571BF203 for ; Tue, 14 Nov 2023 17:20:52 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 14 Nov 2023 18:20:47 +0100 Message-Id: <20231114172051.13872-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231114172051.13872-1-michael@niedermayer.cc> References: <20231114172051.13872-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/6] avcodec/h264: Use FRAME_RECOVERED_HEURISTIC instead of IDR/SEI 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 MIME-Version: 1.0 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: This keeps IDR/SEI and heuristically detected recovery points cleaner seperated Signed-off-by: Michael Niedermayer --- libavcodec/h264_refs.c | 4 ++-- libavcodec/h264dec.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c index 25e521dafc0..92778e737a5 100644 --- a/libavcodec/h264_refs.c +++ b/libavcodec/h264_refs.c @@ -822,9 +822,9 @@ int ff_h264_execute_ref_pic_marking(H264Context *h) || pps_ref_count[0] <= 1 + (h->picture_structure != PICT_FRAME) && pps_ref_count[1] <= 1) && pps_ref_count[0]<=2 + (h->picture_structure != PICT_FRAME) + (2*!h->has_recovery_point) && h->cur_pic_ptr->f->pict_type == AV_PICTURE_TYPE_I){ - h->cur_pic_ptr->recovered |= FRAME_RECOVERED_IDR; + h->cur_pic_ptr->recovered |= FRAME_RECOVERED_HEURISTIC; if(!h->avctx->has_b_frames) - h->frame_recovered |= FRAME_RECOVERED_SEI; + h->frame_recovered |= FRAME_RECOVERED_HEURISTIC; } out: diff --git a/libavcodec/h264dec.h b/libavcodec/h264dec.h index 5ce3a6be735..b0c54ad82fb 100644 --- a/libavcodec/h264dec.h +++ b/libavcodec/h264dec.h @@ -519,6 +519,10 @@ typedef struct H264Context { * so all the following frames in presentation order are correct. */ #define FRAME_RECOVERED_SEI (1 << 1) +/** + * Recovery point detected by heuristic + */ +#define FRAME_RECOVERED_HEURISTIC (1 << 2) int frame_recovered; ///< Initial frame has been completely recovered -- 2.17.1 _______________________________________________ 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".