diff options
author | Clément Bœsch <u@pkh.me> | 2022-12-27 18:05:28 +0100 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2023-01-03 17:18:55 +0100 |
commit | 1ae1b707e257150b02c9d64f94d72c8cf7f09de8 (patch) | |
tree | cbe2ed95bfe1a20f847531b0418362e7f7bd23b2 /libavfilter | |
parent | 8789a9e05b5a5581b718fd59740d8ba9e0d90659 (diff) | |
download | ffmpeg-1ae1b707e257150b02c9d64f94d72c8cf7f09de8.tar.gz |
avfilter/paletteuse: remove mean error tool
This belongs in another filter.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_paletteuse.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c index a188bc6097..b60234e995 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; } |