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 0071944EBC for ; Tue, 27 Dec 2022 23:22:29 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9FB2268BD85; Wed, 28 Dec 2022 01:18:56 +0200 (EET) Received: from ssq0.pkh.me (laubervilliers-656-1-228-164.w92-154.abo.wanadoo.fr [92.154.28.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AC0AE68BD0B for ; Wed, 28 Dec 2022 01:18:36 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pkh.me; s=selector1; t=1672183100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3X3jlcSGUzRdsa6pkJ5inX3PHHvgXXbK88whrheEd2s=; b=LLqTrkLI+zqB/I9hXL+6bkuu6FzXGM6Y6L9w+Uc56M7079j7FUKnGIVqxapNYDuY1q7I7J aMG7UqecKjZBNWxTfLVEk5oAoJ4m4gurf55IwYoezB5eX2GQTB+WrdgsZBTso0j9a5G2UJ JZDoFXMNuGGP6APWgsxzirLNMhhOWjM= Received: from localhost (ssq0.pkh.me [local]) by ssq0.pkh.me (OpenSMTPD) with ESMTPA id edf66a03; Tue, 27 Dec 2022 23:18:20 +0000 (UTC) From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 28 Dec 2022 00:18:12 +0100 Message-Id: <20221227231814.2520181-31-u@pkh.me> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221227231814.2520181-1-u@pkh.me> References: <20221105152617.1809282-1-u@pkh.me> <20221227231814.2520181-1-u@pkh.me> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 30/32] avfilter/paletteuse: remove mean error tool 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: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= 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: This belongs in another filter. --- libavfilter/vf_paletteuse.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c index 690422a842..33b8e70293 100644 --- a/libavfilter/vf_paletteuse.c +++ b/libavfilter/vf_paletteuse.c @@ -121,7 +121,6 @@ static const AVOption paletteuse_options[] = { /* following are the debug options, not part of the official API */ { "debug_kdtree", "save Graphviz graph of the kdtree in specified file", OFFSET(dot_filename), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS }, - { "mean_err", "compute and print mean error", OFFSET(calc_mean_err), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS }, { NULL } }; @@ -606,34 +605,6 @@ static void load_colormap(PaletteUseContext *s) disp_tree(s->map, s->dot_filename); } -static void debug_mean_error(PaletteUseContext *s, const AVFrame *in1, - const AVFrame *in2, int frame_count) -{ - int x, y; - const uint32_t *palette = s->palette; - uint32_t *src1 = (uint32_t *)in1->data[0]; - uint8_t *src2 = in2->data[0]; - const int src1_linesize = in1->linesize[0] >> 2; - const int src2_linesize = in2->linesize[0]; - const float div = in1->width * in1->height * 3; - unsigned mean_err = 0; - - for (y = 0; y < in1->height; y++) { - for (x = 0; x < in1->width; x++) { - const struct color_info c1 = get_color_from_srgb(0xff000000 | src1[x]); - const struct color_info c2 = get_color_from_srgb(0xff000000 | palette[src2[x]]); - mean_err += diff(&c1, &c2, s->trans_thresh); - } - src1 += src1_linesize; - src2 += src2_linesize; - } - - s->total_mean_err += mean_err; - - av_log(NULL, AV_LOG_INFO, "MEP:%.3f TotalMEP:%.3f\n", - mean_err / div, s->total_mean_err / (div * frame_count)); -} - static void set_processing_window(enum diff_mode diff_mode, const AVFrame *prv_src, const AVFrame *cur_src, const AVFrame *prv_dst, AVFrame *cur_dst, @@ -759,8 +730,6 @@ static int apply_palette(AVFilterLink *inlink, AVFrame *in, AVFrame **outf) return ret; } memcpy(out->data[1], s->palette, AVPALETTE_SIZE); - if (s->calc_mean_err) - debug_mean_error(s, in, out, inlink->frame_count_out); *outf = out; return 0; } -- 2.39.0 _______________________________________________ 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".