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 33ECF40444 for ; Fri, 25 Mar 2022 17:50:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2245D68B167; Fri, 25 Mar 2022 19:50:36 +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 6A16468A2F6 for ; Fri, 25 Mar 2022 19:50:30 +0200 (EET) Received: from localhost (213-47-68-29.cable.dynamic.surfer.at [213.47.68.29]) (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 7D2011BF206 for ; Fri, 25 Mar 2022 17:50:29 +0000 (UTC) Date: Fri, 25 Mar 2022 18:50:28 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220325175028.GY2829255@pb2> References: MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 1/3] avcodec/h264_slice: Fix decoding undamaged input with slices 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: multipart/mixed; boundary="===============2833438073013259311==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2833438073013259311== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="YCboRK9ZL0MeXhQ9" Content-Disposition: inline --YCboRK9ZL0MeXhQ9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 24, 2022 at 09:20:06PM +0100, Andreas Rheinhardt wrote: > ff_er_frame_start() initializes ERContext.error_count > to three times the number of macroblocks to decode. > Later ff_er_add_slice() reduces this number by the amount > of macroblocks whose AC resp. DC resp. MV have been finished > (so every correctly decoded MB counts three times). > So the frame has been decoded correctly if error_count is zero > at the end. >=20 > The H.264 decoder uses multiple ERContexts when using > slice threading and therefore combines these error counts: > The first slice's ERContext is intended to be initialized > by ff_er_frame_start(), error_count of all the other > slice contexts is intended to be zeroed initially and > all afterwards all the error_counts are summed. >=20 > Yet commit 43b434210e597d484aef57c4139c3126d22b7e2b > (probably unintentionally) changed the code to set > the first slice's error_count to zero as well. > This leads to bogus error messages in case one decodes > an input video using multiple slices with slice threading > with error concealment enabled (which is not the default) > ("concealing 0 DC, 0 AC, 0 MV errors in [IPB] frame"); > furthermore the returned frame is marked as corrupt as well > (ffmpeg reports "corrupt decoded frame in stream %d" for this). >=20 > This can be fixed easily given that only the first ERContext > is really used since 7be2d2a70cd20d88fd826a83f87037d14681a579: > Don't reset the error_count; and don't sum the error counts as well. >=20 > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/h264_slice.c | 7 ------- > 1 file changed, 7 deletions(-) this patchset is a nice cleanup/fix to the error concealment code in h264 thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. U= ser questions about the command line tools should be sent to the ffmpeg-user ML. And questions about how to use libav* should be sent to the libav-user ML. --YCboRK9ZL0MeXhQ9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYj4A4AAKCRBhHseHBAsP q32sAKCVW1jqo7o0JqKOV188zMD07ukYvACgjMspfiRKWHwcLya/973mbswsyr8= =nntZ -----END PGP SIGNATURE----- --YCboRK9ZL0MeXhQ9-- --===============2833438073013259311== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============2833438073013259311==--