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 C878648EBF for ; Thu, 29 Feb 2024 06:19:37 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 15EA068CF4B; Thu, 29 Feb 2024 08:19:34 +0200 (EET) Received: from sxb1plsmtpa01-13.prod.sxb1.secureserver.net (sxb1plsmtpa01-13.prod.sxb1.secureserver.net [92.204.81.234]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4E2CB68CD49 for ; Thu, 29 Feb 2024 08:19:27 +0200 (EET) Received: from localhost ([103.194.70.164]) by :SMTPAUTH: with ESMTPSA id fZlJrALGf2DnyfZlLrkuhp; Wed, 28 Feb 2024 23:19:24 -0700 X-CMAE-Analysis: v=2.4 cv=boLvB1ai c=1 sm=1 tr=0 ts=65e021ed a=qQTZsa/dkuQfrkTtuTSAyA==:117 a=qQTZsa/dkuQfrkTtuTSAyA==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=-k4_HteH1YUA:10 a=emhf11hzAAAA:8 a=NEAV23lmAAAA:8 a=e5mUnYsNAAAA:8 a=riV52Wq6DvKzTq0vfIsA:9 a=HLUCug_QN4oeKp6PugZw:22 a=Vxmtnl_E_bksehYqCbjh:22 X-SECURESERVER-ACCT: llyyr@yukari.in Message-Id: To: From: "llyyr" Date: Thu, 29 Feb 2024 11:28:35 +0530 X-CMAE-Envelope: MS4xfOohvndRxcNE4V7jT+lkh299bby9/EoXU65xZ8Da/NiZknZRyvOVf9KQhWOUP7dl3Njf+IiFN5OtgbjZiiezb0t3FgT2aqqlm5O0kGxCbaxBcoy8PHi/ Opod+H1o+i3JlTlD9B0JUKffSFJINj/L3LZuwwV7CZH4gVEjs6UybuN7Py9+w63z6VMhyBoYMbO6vg== Subject: [FFmpeg-devel] [PATCH] lavc/vp9: set update_map to 0 when segmentation.enabled is 0 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: segmentation.update_map is never reset to 0 on a new frame, and retains the value from the previous frame. This bugs out a bunch of hwaccel drivers when segmentation.enabled is 0 but update_map isn't because they don't ignore values behind switches. We also do this for vp8* so this commit is just mirroring the vp8 logic. This fixes an issue with certain samples** that causes blocky artifacts with vaapi and d3d11va (as far as known hwaccel drivers go). Mesa worked around*** this by ignoring this field if segmentation.enabled is 0, but d3d11va still doesn't work. * https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/vp8.c#l811 ** https://github.com/mpv-player/mpv/issues/13533 *** https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27816 Signed-off-by: llyyr --- libavcodec/vp9.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index 855936cdc1c7..4a628625131e 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -717,6 +717,8 @@ static int decode_frame_header(AVCodecContext *avctx, s->s.h.segmentation.feat[i].skip_enabled = get_bits1(&s->gb); } } + } else { + s->s.h.segmentation.update_map = 0; } // set qmul[] based on Y/UV, AC/DC and segmentation Q idx deltas base-commit: d263fce2b209e86a5a1e8f1b6aa33430ecc2c187 -- 2.43.2 _______________________________________________ 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".