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 7DF6140BF7 for ; Tue, 28 Dec 2021 23:08:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2BE9468AF71; Wed, 29 Dec 2021 01:08:50 +0200 (EET) Received: from mail-vk1-f169.google.com (mail-vk1-f169.google.com [209.85.221.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A8E1B68AB42 for ; Wed, 29 Dec 2021 01:08:44 +0200 (EET) Received: by mail-vk1-f169.google.com with SMTP id x17so10257872vkx.3 for ; Tue, 28 Dec 2021 15:08:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=/X4kNamiZBlWSolwOfXaEhJeZVUhoEMDNGjaITR9Omc=; b=J0qFOv9/o5ysWcPnrVJGqVTwH5PKAhsbm/f2ZY8nDx+NC2jAfGiOBazSoHsh4Jn471 +Kud03wLzDw02bGtkywD5lh93DwdQ/qs5M3wjj4HpOdsAHSUrS1kLc2a+lu68ww/aX+0 mZnOuXYPVwhVSV484AgjFwgNljIGLcfueI4VA88eW10Rbg7LSuslzFKCKa1LtTfTK47n DCSzP7eRwnfrjqTJR3cJTTQBXRA0i4v7pA6C+gt5kJc/C/VjUuKnqznhoc2VYwAd/q6J 69mD1NkH+ulOPsfJBc+PCJSsBri9IfbpKeueSp7HNPffCBkjM+z9/ztHrqONlu500Yhx 5edA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=/X4kNamiZBlWSolwOfXaEhJeZVUhoEMDNGjaITR9Omc=; b=W4gNsxy/go+E48NdD+KK60bVedO5g8kwsoTv8K7mgwBK9xf9GV8/VuQcfWWeLGGKG8 1+BGMyP7bJEduWAw2tISUTF2/XxTxHu8XlZeO5MCyjwNqMeNxVgKrrgBJ7hGwvNupGXo 7zgL695gQE9S/i7m916SL/xuceKhQi6+OO5kG0E+wLUCmfQMkcmtW3oSvmcyJRl2FhFo 7GWEoVrGbj5EDNW/3hrDsW6Cl0SwsUpMqI7g3KgCB0VvuH8qeBh0tKgw7JSD3jACJ5A3 wq8DH8uVeV3D1+cLbZYYS0irdPU+fny6A8YJHZfPfqEMLDeAVC+QLtUdzPbjAIqoFEDJ g3ZQ== X-Gm-Message-State: AOAM5301K3IEEvChGuleyEiY9RD9ZGbZt/up7igAlRrc02Sy0LcNkAt8 xx7KkiJD5MRqblvd4Ys3Ew0EDzBnszf9nw== X-Google-Smtp-Source: ABdhPJzkpS/JzdSD4dZXzs5g8lNL9SUmASZYdG+wLQxuZUKaWvn98yvoDjpPtJh4Sw9GThBCy0F/JQ== X-Received: by 2002:a05:6122:a29:: with SMTP id 41mr7581171vkn.25.1640732922871; Tue, 28 Dec 2021 15:08:42 -0800 (PST) Received: from [192.168.0.13] ([181.170.250.138]) by smtp.gmail.com with ESMTPSA id 126sm3822719vku.25.2021.12.28.15.08.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Dec 2021 15:08:42 -0800 (PST) Message-ID: Date: Tue, 28 Dec 2021 20:08:40 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20211228134929.1164-1-h.leppkes@gmail.com> From: James Almer In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] hevcdec: skip slices with missing PPS instead of skipping the entire packet 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 12/28/2021 7:01 PM, Hendrik Leppkes wrote: > On Tue, Dec 28, 2021 at 3:26 PM James Almer wrote: >> >> On 12/28/2021 10:49 AM, Hendrik Leppkes wrote: >>> Aborting decoding of the entire packet on a missing PPS can result in >>> missing the actual PPS on streams with badly ordered NALs, where the >>> SPS/PPS/VPS are stitched to the back of the previous frame, instead of >>> the beginning of the next frame. >>> >>> Instead, skip the undecodable slice, and let the decoder process further >>> NALs in the same packet. >>> --- >>> libavcodec/hevcdec.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c >>> index 3aa70e2245..c2451d682e 100644 >>> --- a/libavcodec/hevcdec.c >>> +++ b/libavcodec/hevcdec.c >>> @@ -575,7 +575,7 @@ static int hls_slice_header(HEVCContext *s) >>> sh->pps_id = get_ue_golomb_long(gb); >>> if (sh->pps_id >= HEVC_MAX_PPS_COUNT || !s->ps.pps_list[sh->pps_id]) { >>> av_log(s->avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", sh->pps_id); >>> - return AVERROR_INVALIDDATA; >>> + return 1; // skip slice with missing PPS >> >> The decoder should IMO also set the output frame's decode_error_flags to >> FF_DECODE_ERROR_DECODE_SLICES in this scenario. >> > > There is a variety of error conditions that can lead to a slice being > skipped, not just this one. I can potentially add it here, but it > won't be a very exhaustive flag. > If its also the first slice, the frame will fail to decode entirely as > well, although the point primarily here is to allow parsing of > non-image NALs. What h264 does is set an internal flag on any kind of slice error at assorted places, then set the AVFrame one before returning it based on that (Needed because of frame threading). It's not a blocker in any case. But even if it's just set at this point for the time being, it would at least be a start. > > - Hendrik > _______________________________________________ > 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". _______________________________________________ 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".