From patchwork Sun Jul 9 01:52:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4271 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp1954653vsb; Sat, 8 Jul 2017 18:52:26 -0700 (PDT) X-Received: by 10.223.175.229 with SMTP id y37mr4373091wrd.61.1499565146577; Sat, 08 Jul 2017 18:52:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499565146; cv=none; d=google.com; s=arc-20160816; b=mrr6GpKWGvIJO9YCow6Oa6lgrsLtXNLZXEUoedmV23ozgwGcYdZykg2Nri8R164tJd c38QotJL82rKf+XOQx+Jrjjx8a1/lWb7qn0akGMiaEf9ekjkK9U5Ia/n7/heakTbpMGJ cEGaI5mkFfdFZ2IfFl/MyAwvVe8Qp2VGJc10m+tSFJWY9eppC1JI3yghwc/VT5C9N5Uk vnWD4xe3Bb9etqhr5fPFqxMWXRUE960/mpzslw3ajM87lEMjtWOOTABgHYNVed4pU1Kl gvM9tJLebn9TkPv73tKYgsqw/zR5xPWuLSD6sTls0CG4WuRedTjSEzzW383GX1ehdMpS c84A== 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:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=lCmPyBxPAYAacZ4vXCvnsG8rSFEpxAoqqQZSVpG3ClM=; b=UtHqFp6IB2oeooUAYaZZZpV+gCVE3Iunyrjm+U/+u0bU0MnXxxOBWPVUzo49zWAPFT 6YmK9CIVFGHJU7cYmcOzYbLwPmHfQP1C6icshYcEC7C/YsZqc8Ot1aad3MLtBktc45pN f6+aFRxQ0oMLb2MXAAUC46BeEcF1eVql3HKb9vPzpCQrJdisRQcNaSKKgN3XzuDleONB ToRERc4uvUNMC12tEIH0FS357LySX5r/nLMLlH/izvRltp8+lkvwGfNPpn5p3Br1LtBT WD4bddf2jKdJGHga5GZP21V4dUgS6bgJkJehuvnhEVZUqVqtDtZH03nCAe8Q2gkCBOFt Owdg== 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 w3si3108623wmb.191.2017.07.08.18.52.25; Sat, 08 Jul 2017 18:52:26 -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 06D95689BAF; Sun, 9 Jul 2017 04:52:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe05-1.mx.upcmail.net (vie01a-dmta-pe08-1.mx.upcmail.net [84.116.36.20]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 17FE1689BAF for ; Sun, 9 Jul 2017 04:52:13 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe08.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dU1OS-0000FR-55 for ffmpeg-devel@ffmpeg.org; Sun, 09 Jul 2017 03:52:16 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id iRsC1v0010S5wYM01RsD3u; Sun, 09 Jul 2017 03:52:13 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 9 Jul 2017 03:52:09 +0200 Message-Id: <20170709015209.19207-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170709015209.19207-1-michael@niedermayer.cc> References: <20170709015209.19207-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/tests/dct: Add Mean square error test X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" based on quotes of IEEE 1180 / ISO/IEC 23002-1 Signed-off-by: Michael Niedermayer --- libavcodec/tests/dct.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libavcodec/tests/dct.c b/libavcodec/tests/dct.c index cf71b96508..b44c66f427 100644 --- a/libavcodec/tests/dct.c +++ b/libavcodec/tests/dct.c @@ -182,6 +182,7 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c int err_inf, v; int64_t err2, ti, ti1, it1, err_sum = 0; int64_t sysErr[64], sysErrMax = 0; + int64_t err2_matrix[64], err2_max = 0; int maxout = 0; int blockSumErrMax = 0, blockSumErr; AVLFG prng; @@ -194,7 +195,7 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c err_inf = 0; err2 = 0; for (i = 0; i < 64; i++) - sysErr[i] = 0; + err2_matrix[i] = sysErr[i] = 0; for (it = 0; it < NB_ITS; it++) { init_block(block1, test, is_idct, &prng, vals); permute(block, block1, dct->perm_type); @@ -221,6 +222,7 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c v = abs(err); if (v > err_inf) err_inf = v; + err2_matrix[i] += v * v; err2 += v * v; sysErr[i] += block[i] - block1[i]; blockSumErr += v; @@ -230,8 +232,10 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c if (blockSumErrMax < blockSumErr) blockSumErrMax = blockSumErr; } - for (i = 0; i < 64; i++) + for (i = 0; i < 64; i++) { sysErrMax = FFMAX(sysErrMax, FFABS(sysErr[i])); + err2_max = FFMAX(err2_max , FFABS(err2_matrix[i])); + } for (i = 0; i < 64; i++) { if (i % 8 == 0) @@ -245,7 +249,7 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c spec_err = is_idct && (err_inf > 1 || omse > 0.02 || fabs(ome) > 0.0015); if (test < 2) - spec_err = is_idct && ((double) sysErrMax / NB_ITS > 0.015); + spec_err = is_idct && ((double) err2_max / NB_ITS > 0.06 || (double) sysErrMax / NB_ITS > 0.015); printf("%s %s: max_err=%d omse=%0.8f ome=%0.8f syserr=%0.8f maxout=%d blockSumErr=%d\n", is_idct ? "IDCT" : "DCT", dct->name, err_inf,