From patchwork Fri Nov 8 11:51:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Lauss X-Patchwork-Id: 52637 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:2fe5:b0:4a6:1c7:11b7 with SMTP id kw5csp2122387vqb; Fri, 8 Nov 2024 04:01:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVaQjFo+tcWOJN2gPO7bSoDhoS3/e3fy2FwpA3b1hfE+Lnimuu5EBHljLmbBB2s28jZCDH99MmtSJlDjFQGnmXE@gmail.com X-Google-Smtp-Source: AGHT+IFgk3NwIOdbRobZeINjhsDC70e0iI0L7bTDRYH3X/cYu3znS4I3zYp2jeKklwakqBjBWy5f X-Received: by 2002:ac2:4c4f:0:b0:53a:16b:f14f with SMTP id 2adb3069b0e04-53d862c5a61mr1532312e87.19.1731067299738; Fri, 08 Nov 2024 04:01:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731067299; cv=none; d=google.com; s=arc-20240605; b=TaCAVlAJVONFoNCzIG3brWEfBqI6QeNef+cUE9xHcYp3KkgoxeKnSE7v1BV9RlaSmz UkDh/a8AS+VaJuShs5U6GOYa0P7wqXMNbyJ1LoIdYjsQI1vgHEFShTDka+hu4iQmLz9X z5bDoezb2fvzBPDuPJden6NJ3HNKuGsrAcDYEXj6VUyYmxl42KqY+Hpx+nn4NKhCCzrx wMoPydZjOW2vZEFJgu/8E62807YaHdfXKlp7TCxjNXewI9XQ/p5sS7I1xuCfBCRTsH7a RD0Gii1EoZiSlwmamFksB4NTXiQKcW9LjAy6Ccx2vIXooS05Sx5D5lLnke3wfgIFDHPe VAvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=z8bExwmAfugA4s49MUdXnIeCja2t/vI0XF6asKvprT8=; fh=ylA7vB/iA8muFUzvlzUImw+rp2ODCCq9hl3kedSTahY=; b=AY+axjlEUbZR2GgzOPWgnXyj7HqB1wLwfUD18ZG6taayAevv/obSYl7Po3EPz+gBpj dDmtKn89eXn1E5ZeExIKz6HN8N93ot5glHW8GjW746X3TlMnsOjJqWWbaZxmLUnyO8Ht PBWO9rTdSjhptcYroFUMIR0ctv9EGZEx93+1bqqj7r8tMUJnsGujLEb896Hg2lx9yn+/ w8/5bfPmOeEOFSyBklo5KcIlXKUfIdX8mYI4ZUBYxNynyr4B+KloJ/3QR/AtykT+lfOo KjbBkC6yju5rc9RrQbWRNq2alE+el1SAx5eFuBziVbiztQNCHAzARNAIgT+k3iYRauMp dK/g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=fRK8xxTv; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTPS id 2adb3069b0e04-53d826a8826si1404244e87.200.2024.11.08.04.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 04:01:39 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=fRK8xxTv; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5E02B68DDD2; Fri, 8 Nov 2024 13:51:27 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F245168C7E5 for ; Fri, 8 Nov 2024 13:51:19 +0200 (EET) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4315df7b43fso17407285e9.0 for ; Fri, 08 Nov 2024 03:51:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731066679; x=1731671479; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0KLmDimOVcPefG/CcLLZ4re+huRHm118aOE/UWucttA=; b=fRK8xxTv1L1bNcEx69VfhZOebNIDBeHrPXZYBZbh+aM47eCE38CrJIcRQaO+mYnc7r RPYO4XNLRFO1j31kr6JJIFM2u26/bMhMnio2dhcUivSvA/lqPbyYXWNSiOFQNnZXmw2y UjfC6lMpahGe32IDQgFGMBrUsLIN42wYYEcVR8ajZrkxoD+92SxG8zcmpZhVrpVHzZSF IXANnpMjAEwlCuiEC6wJyFnljqqoo5ytaDMwV3B/h9Lnu4DVTAPgu13xI6S8cbkPJOmr OnesVCBepOADg/Se009GeO1gD2Z0nVjajHXaFEbkWr4Mfk36s3fyadmdYt8CxW7TDqfd C5NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731066679; x=1731671479; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0KLmDimOVcPefG/CcLLZ4re+huRHm118aOE/UWucttA=; b=KaAwspQIxUYNsaoljIFe0xulxWrQjXDhMX93afhVLn212ttsPzRfrWfNKLjO3YgFDJ C36woYR29HYfl8hL07wyLmDIU8wOhxxmZDC2kWEvVtTCcBtQ7JYtSldmQJ43cN5dpDud sUBadSsiUgVWbT7sHA5jb3dENvo2ysu9vl8X4Im2CH5zTC+chWW/B5RIkWgZAngBtwQn aUPNAQdLBVYkUbxbYCiz+j7cxIqWkudReAy7IUln4a4ZiQWsmySPR600YNIQpv2JJMdY YDI3l2YSPOw5nPE+NinvmYWjJLndSHxPcFgOC5CFb4m+gOP1t7ZtUg7vFJVBJtB4KQ7+ llNw== X-Gm-Message-State: AOJu0YzbIPTDVDei1zbsjnRO3Cohy4bCo2BwosMdUlr2+ACdgs1cg0Kg YcNIyrcKES0m+fB6LUY3KcG46k1m2J5Ukv9ym0bLwYk8lq1Av7g45nM5Tg== X-Received: by 2002:a05:600c:5251:b0:431:5a0e:fa2e with SMTP id 5b1f17b1804b1-432b7515a08mr18678625e9.21.1731066679049; Fri, 08 Nov 2024 03:51:19 -0800 (PST) Received: from flagship3.deu.mlau.at (p200300c0270310006fc1140db6601414.dip0.t-ipconnect.de. [2003:c0:2703:1000:6fc1:140d:b660:1414]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432aa70a1d8sm100585895e9.27.2024.11.08.03.51.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 03:51:18 -0800 (PST) From: Manuel Lauss To: ffmpeg-devel@ffmpeg.org Date: Fri, 8 Nov 2024 12:51:15 +0100 Message-ID: <20241108115115.134858-2-manuel.lauss@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241108115115.134858-1-manuel.lauss@gmail.com> References: <20241108115115.134858-1-manuel.lauss@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] libavcodec/sanm: codec47: apply top offset also to diff buffers 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 Cc: Manuel Lauss Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: vHyCYFip8OBn SAN FRME objects specify width/height as well as offsets from top/left. These offsets need to be taken into account for the diff buffers as well. Fixes playback of all SAN videos of "Shadows of the Empire", which have a constant top offset of 60 (640x272 video on a 640x480 window) and show tons of ghosting and block artifacts. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index fcf6234d8a..8bcffb1e90 100644 --- a/libavcodec/sanm.c +++ b/libavcodec/sanm.c @@ -913,8 +913,8 @@ static int old_codec47(SANMVideoContext *ctx, int top, int i, j; ptrdiff_t stride = ctx->pitch; uint8_t *dst = (uint8_t *)ctx->frm0 + left + top * stride; - uint8_t *prev1 = (uint8_t *)ctx->frm1; - uint8_t *prev2 = (uint8_t *)ctx->frm2; + uint8_t *prev1 = (uint8_t *)ctx->frm1 + left + top * stride; + uint8_t *prev2 = (uint8_t *)ctx->frm2 + left + top * stride; uint8_t auxcol[2]; int tbl_pos = bytestream2_tell(&ctx->gb); int seq = bytestream2_get_le16(&ctx->gb); @@ -940,8 +940,8 @@ static int old_codec47(SANMVideoContext *ctx, int top, } if (!seq) { ctx->prev_seq = -1; - memset(prev1, auxcol[0], ctx->height * stride); - memset(prev2, auxcol[1], ctx->height * stride); + memset(prev1, auxcol[0], (ctx->height - top) * stride); + memset(prev2, auxcol[1], (ctx->height - top) * stride); } switch (compr) {