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 A9B32432DC for ; Tue, 21 May 2024 01:24:59 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 85C6668D293; Tue, 21 May 2024 04:24:56 +0300 (EEST) Received: from a27-217.smtp-out.us-west-2.amazonses.com (a27-217.smtp-out.us-west-2.amazonses.com [54.240.27.217]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A0EE168BA20 for ; Tue, 21 May 2024 04:24:49 +0300 (EEST) To: =?UTF-8?Q?ffmpeg-devel=40ffmpeg=2Eorg?= Date: Tue, 21 May 2024 01:17:33 +0000 Mime-Version: 1.0 In-Reply-To: <20240521011728.29347-1-cosmin@cosmin.at> References: <20240521011728.29347-1-cosmin@cosmin.at> <20240521011728.29347-2-cosmin@cosmin.at> X-Mailer: Amazon WorkMail Thread-Index: AQHaqxymBDX4oF7lSnaZQt5sN2k4MAAAAGCb Thread-Topic: [PATCH] avcodec/libsvtav1: send the EOS signal without a one frame delay to allow for the library to operate in a low-delay mode X-Original-Mailer: git-send-email 2.42.1 X-Wm-Sent-Timestamp: 1716254252 Message-ID: <0101018f98b9a2c9-01b87943-0e31-4780-a2a7-d2f58757741e-000000@us-west-2.amazonses.com> Feedback-ID: ::1.us-west-2.An468LAV0jCjQDrDLvlZjeAthld7qrhZr+vow8irkvU=:AmazonSES X-SES-Outgoing: 2024.05.21-54.240.27.217 Subject: [FFmpeg-devel] [PATCH] avcodec/libsvtav1: send the EOS signal without a one frame delay to allow for the library to operate in a low-delay mode 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: , From: Cosmin Stejerean via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: =?UTF-8?Q?Cosmin_Stejerean?= 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: Cosmin Stejerean Co-authored-by: Amir Naghdinezhad Signed-off-by: Cosmin Stejerean --- libavcodec/libsvtav1.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c index 3b41f5a39e..1eda63200c 100644 --- a/libavcodec/libsvtav1.c +++ b/libavcodec/libsvtav1.c @@ -539,6 +539,14 @@ static int eb_receive_packet(AVCodecContext *avctx, AVPacket *pkt) if (svt_ret == EB_NoErrorEmptyQueue) return AVERROR(EAGAIN); +#if SVT_AV1_CHECK_VERSION(2, 0, 0) + if (headerPtr->flags & EB_BUFFERFLAG_EOS) { + svt_enc->eos_flag = EOS_RECEIVED; + svt_av1_enc_release_out_buffer(&headerPtr); + return AVERROR_EOF; + } +#endif + ref = get_output_ref(avctx, svt_enc, headerPtr->n_filled_len); if (!ref) { av_log(avctx, AV_LOG_ERROR, "Failed to allocate output packet.\n"); @@ -573,8 +581,10 @@ static int eb_receive_packet(AVCodecContext *avctx, AVPacket *pkt) if (headerPtr->pic_type == EB_AV1_NON_REF_PICTURE) pkt->flags |= AV_PKT_FLAG_DISPOSABLE; +#if !(SVT_AV1_CHECK_VERSION(2, 0, 0)) if (headerPtr->flags & EB_BUFFERFLAG_EOS) svt_enc->eos_flag = EOS_RECEIVED; +#endif ff_side_data_set_encoder_stats(pkt, headerPtr->qp * FF_QP2LAMBDA, NULL, 0, pict_type); -- 2.42.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".