From patchwork Fri Mar 24 00:25:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 40782 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:d046:b0:cd:afd7:272c with SMTP id hv6csp163215pzb; Thu, 23 Mar 2023 17:25:53 -0700 (PDT) X-Google-Smtp-Source: AKy350ZwOh3WuzHgzxkTkf/AX6ez/VRqGntxqoDBark5E8ggkLOVgT3ybUSuf96c05/l73R5o3A0 X-Received: by 2002:a17:906:56:b0:92e:f520:7779 with SMTP id 22-20020a170906005600b0092ef5207779mr145972ejg.0.1679617552856; Thu, 23 Mar 2023 17:25:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679617552; cv=none; d=google.com; s=arc-20160816; b=z5WoRhnjrpyaoG4sHDFN+e1ygMqYgQiMqazGHqYPoOU3H2b7ySWQqsV+GwirymojhI oa6V+yxFu+Hmrlqp7arcSG8/Q/67YEXQqEeZeSlQTPHgqEPdrwsfnGFZ/7hSKP0VOY6x sYfzm6ZSOqJPVXHZN+DENpRRDdV5Kziq5vGO7bTidXWKjVN14fMQKwRBjdZLcK1LjDTC DG5Bg86We9a6v6fG268y0YYgvNSZiZSzgmnZHYqoFDpssuh52wxspEmGCVj0rRTonhek e/STr3nqGahZk44XWZAx0wLOFj0thsQkxWe+aUhz6brkckmfC0Bhd0vqeGmUT96yzR85 T7hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to; bh=kyNpMRbT9YQcWMhb8UJdc1oPtakxaH126beMMOUMyhs=; b=BM39AkqRyuxAktEyHN9fPjP4FRBNg9FiW6iKDkpZaBNXx2KwsFutoL9ISPY6RJZPtI pgwvnY90lWLCR6H6MlusITJQDRYZVN9iVehjibgjppnmi8FCOu+H12jyoyf9lFW0GMBD wMQoL0etFinW31bBOeAhU9DNNQSYXKEc+TFsbHmCLqNA0wXKq8eTLyOL3axo9K+aNFyb SPeXQLG4srDt2Ypw2Vlu25Zdektlxbo6yyxDDmgSoTVu0Qs5TydcBwjigG0XUEvYV3lS rLcCKe8vZ1qZvlqVykrhNudcDMeP4KGKlUVzRPLrSs8xUdp4UnthrF3ry/psPXi0PQKj T8PA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id gs9-20020a1709072d0900b0093b6dc73d08si4005423ejc.780.2023.03.23.17.25.52; Thu, 23 Mar 2023 17:25:52 -0700 (PDT) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 506A668C0C8; Fri, 24 Mar 2023 02:25:49 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1F1A968C194 for ; Fri, 24 Mar 2023 02:25:42 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 34ECF20005 for ; Fri, 24 Mar 2023 00:25:40 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 24 Mar 2023 01:25:35 +0100 Message-Id: <20230324002540.3227-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH 1/6] avcodec/tests/snowenc: unbreak DWT tests 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: bTu24vELgT80 the IDWT data type mismatched current code Signed-off-by: Michael Niedermayer --- libavcodec/tests/snowenc.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/libavcodec/tests/snowenc.c b/libavcodec/tests/snowenc.c index e423ab0541..8064309144 100644 --- a/libavcodec/tests/snowenc.c +++ b/libavcodec/tests/snowenc.c @@ -31,6 +31,7 @@ int main(void){ #define width 256 #define height 256 int buffer[2][width*height]; + short obuffer[width*height]; SnowContext s; int i; AVLFG prng; @@ -49,24 +50,28 @@ int main(void){ printf("testing 5/3 DWT\n"); for(i=0; i20) printf("fsck: %6d %12d %7d\n",i, buffer[0][i], buffer[1][i]); + if(FFABS(buffer[1][i] - obuffer[i])>20) printf("fsck: %4dx%4d %12d %7d\n",i%width, i/width, buffer[1][i], obuffer[i]); { int level, orientation, x, y; @@ -87,12 +92,12 @@ int main(void){ if(orientation&1) buf+=w; if(orientation>1) buf+=stride>>1; - memset(buffer[0], 0, sizeof(int)*width*height); + memset(obuffer, 0, sizeof(short)*width*height); buf[w/2 + h/2*stride]= 256*256; - ff_spatial_idwt((IDWTELEM*)buffer[0], s.temp_idwt_buffer, width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count); + ff_spatial_idwt(obuffer, s.temp_idwt_buffer, width, height, width, s.spatial_decomposition_type, s.spatial_decomposition_count); for(y=0; y