You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

591 lines
20KB

  1. /*
  2. * Copyright (c) 2003 LeFunGus, lefungus@altern.org
  3. *
  4. * This file is part of FFmpeg
  5. *
  6. * FFmpeg is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * FFmpeg is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. */
  20. #include <float.h>
  21. #include "libavutil/imgutils.h"
  22. #include "libavutil/attributes.h"
  23. #include "libavutil/common.h"
  24. #include "libavutil/pixdesc.h"
  25. #include "libavutil/intreadwrite.h"
  26. #include "libavutil/opt.h"
  27. #include "avfilter.h"
  28. #include "formats.h"
  29. #include "internal.h"
  30. #include "video.h"
  31. typedef struct VagueDenoiserContext {
  32. const AVClass *class;
  33. float threshold;
  34. float percent;
  35. int method;
  36. int nsteps;
  37. int planes;
  38. int depth;
  39. int bpc;
  40. int peak;
  41. int nb_planes;
  42. int planeheight[4];
  43. int planewidth[4];
  44. float *block;
  45. float *in;
  46. float *out;
  47. float *tmp;
  48. int hlowsize[4][32];
  49. int hhighsize[4][32];
  50. int vlowsize[4][32];
  51. int vhighsize[4][32];
  52. void (*thresholding)(float *block, const int width, const int height,
  53. const int stride, const float threshold,
  54. const float percent, const int nsteps);
  55. } VagueDenoiserContext;
  56. #define OFFSET(x) offsetof(VagueDenoiserContext, x)
  57. #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
  58. static const AVOption vaguedenoiser_options[] = {
  59. { "threshold", "set filtering strength", OFFSET(threshold), AV_OPT_TYPE_FLOAT, {.dbl=2.}, 0,DBL_MAX, FLAGS },
  60. { "method", "set filtering method", OFFSET(method), AV_OPT_TYPE_INT, {.i64=2 }, 0, 2, FLAGS, "method" },
  61. { "hard", "hard thresholding", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "method" },
  62. { "soft", "soft thresholding", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "method" },
  63. { "garrote", "garotte thresholding", 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "method" },
  64. { "nsteps", "set number of steps", OFFSET(nsteps), AV_OPT_TYPE_INT, {.i64=6 }, 1, 32, FLAGS },
  65. { "percent", "set percent of full denoising", OFFSET(percent),AV_OPT_TYPE_FLOAT, {.dbl=85}, 0,100, FLAGS },
  66. { "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=15 }, 0, 15, FLAGS },
  67. { NULL }
  68. };
  69. AVFILTER_DEFINE_CLASS(vaguedenoiser);
  70. #define NPAD 10
  71. static const float analysis_low[9] = {
  72. 0.037828455506995f, -0.023849465019380f, -0.110624404418423f, 0.377402855612654f,
  73. 0.852698679009403f, 0.377402855612654f, -0.110624404418423f, -0.023849465019380f, 0.037828455506995f
  74. };
  75. static const float analysis_high[7] = {
  76. -0.064538882628938f, 0.040689417609558f, 0.418092273222212f, -0.788485616405664f,
  77. 0.418092273222212f, 0.040689417609558f, -0.064538882628938f
  78. };
  79. static const float synthesis_low[7] = {
  80. -0.064538882628938f, -0.040689417609558f, 0.418092273222212f, 0.788485616405664f,
  81. 0.418092273222212f, -0.040689417609558f, -0.064538882628938f
  82. };
  83. static const float synthesis_high[9] = {
  84. -0.037828455506995f, -0.023849465019380f, 0.110624404418423f, 0.377402855612654f,
  85. -0.852698679009403f, 0.377402855612654f, 0.110624404418423f, -0.023849465019380f, -0.037828455506995f
  86. };
  87. static int query_formats(AVFilterContext *ctx)
  88. {
  89. static const enum AVPixelFormat pix_fmts[] = {
  90. AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY9, AV_PIX_FMT_GRAY10,
  91. AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_GRAY16,
  92. AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
  93. AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
  94. AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
  95. AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
  96. AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
  97. AV_PIX_FMT_YUVJ411P,
  98. AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
  99. AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
  100. AV_PIX_FMT_YUV440P10,
  101. AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV420P12,
  102. AV_PIX_FMT_YUV440P12,
  103. AV_PIX_FMT_YUV444P14, AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV420P14,
  104. AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16,
  105. AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
  106. AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16,
  107. AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
  108. AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_YUVA444P12, AV_PIX_FMT_YUVA444P16,
  109. AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA422P12, AV_PIX_FMT_YUVA422P16,
  110. AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA420P16,
  111. AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16,
  112. AV_PIX_FMT_NONE
  113. };
  114. AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
  115. if (!fmts_list)
  116. return AVERROR(ENOMEM);
  117. return ff_set_common_formats(ctx, fmts_list);
  118. }
  119. static int config_input(AVFilterLink *inlink)
  120. {
  121. VagueDenoiserContext *s = inlink->dst->priv;
  122. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
  123. int p, i, nsteps_width, nsteps_height, nsteps_max;
  124. s->depth = desc->comp[0].depth;
  125. s->bpc = (s->depth + 7) / 8;
  126. s->nb_planes = desc->nb_components;
  127. s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
  128. s->planeheight[0] = s->planeheight[3] = inlink->h;
  129. s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
  130. s->planewidth[0] = s->planewidth[3] = inlink->w;
  131. s->block = av_malloc_array(inlink->w * inlink->h, sizeof(*s->block));
  132. s->in = av_malloc_array(32 + FFMAX(inlink->w, inlink->h), sizeof(*s->in));
  133. s->out = av_malloc_array(32 + FFMAX(inlink->w, inlink->h), sizeof(*s->out));
  134. s->tmp = av_malloc_array(32 + FFMAX(inlink->w, inlink->h), sizeof(*s->tmp));
  135. if (!s->block || !s->in || !s->out || !s->tmp)
  136. return AVERROR(ENOMEM);
  137. s->threshold *= 1 << (s->depth - 8);
  138. s->peak = (1 << s->depth) - 1;
  139. nsteps_width = ((s->planes & 2 || s->planes & 4) && s->nb_planes > 1) ? s->planewidth[1] : s->planewidth[0];
  140. nsteps_height = ((s->planes & 2 || s->planes & 4) && s->nb_planes > 1) ? s->planeheight[1] : s->planeheight[0];
  141. for (nsteps_max = 1; nsteps_max < 15; nsteps_max++) {
  142. if (pow(2, nsteps_max) >= nsteps_width || pow(2, nsteps_max) >= nsteps_height)
  143. break;
  144. }
  145. s->nsteps = FFMIN(s->nsteps, nsteps_max - 2);
  146. for (p = 0; p < 4; p++) {
  147. s->hlowsize[p][0] = (s->planewidth[p] + 1) >> 1;
  148. s->hhighsize[p][0] = s->planewidth[p] >> 1;
  149. s->vlowsize[p][0] = (s->planeheight[p] + 1) >> 1;
  150. s->vhighsize[p][0] = s->planeheight[p] >> 1;
  151. for (i = 1; i < s->nsteps; i++) {
  152. s->hlowsize[p][i] = (s->hlowsize[p][i - 1] + 1) >> 1;
  153. s->hhighsize[p][i] = s->hlowsize[p][i - 1] >> 1;
  154. s->vlowsize[p][i] = (s->vlowsize[p][i - 1] + 1) >> 1;
  155. s->vhighsize[p][i] = s->vlowsize[p][i - 1] >> 1;
  156. }
  157. }
  158. return 0;
  159. }
  160. static inline void copy(const float *p1, float *p2, const int length)
  161. {
  162. memcpy(p2, p1, length * sizeof(float));
  163. }
  164. static inline void copyv(const float *p1, const int stride1, float *p2, const int length)
  165. {
  166. int i;
  167. for (i = 0; i < length; i++) {
  168. p2[i] = *p1;
  169. p1 += stride1;
  170. }
  171. }
  172. static inline void copyh(const float *p1, float *p2, const int stride2, const int length)
  173. {
  174. int i;
  175. for (i = 0; i < length; i++) {
  176. *p2 = p1[i];
  177. p2 += stride2;
  178. }
  179. }
  180. // Do symmetric extension of data using prescribed symmetries
  181. // Original values are in output[npad] through output[npad+size-1]
  182. // New values will be placed in output[0] through output[npad] and in output[npad+size] through output[2*npad+size-1] (note: end values may not be filled in)
  183. // extension at left bdry is ... 3 2 1 0 | 0 1 2 3 ...
  184. // same for right boundary
  185. // if right_ext=1 then ... 3 2 1 0 | 1 2 3
  186. static void symmetric_extension(float *output, const int size, const int left_ext, const int right_ext)
  187. {
  188. int first = NPAD;
  189. int last = NPAD - 1 + size;
  190. const int originalLast = last;
  191. int i, nextend, idx;
  192. if (left_ext == 2)
  193. output[--first] = output[NPAD];
  194. if (right_ext == 2)
  195. output[++last] = output[originalLast];
  196. // extend left end
  197. nextend = first;
  198. for (i = 0; i < nextend; i++)
  199. output[--first] = output[NPAD + 1 + i];
  200. idx = NPAD + NPAD - 1 + size;
  201. // extend right end
  202. nextend = idx - last;
  203. for (i = 0; i < nextend; i++)
  204. output[++last] = output[originalLast - 1 - i];
  205. }
  206. static void transform_step(float *input, float *output, const int size, const int low_size, VagueDenoiserContext *s)
  207. {
  208. int i;
  209. symmetric_extension(input, size, 1, 1);
  210. for (i = NPAD; i < NPAD + low_size; i++) {
  211. const float a = input[2 * i - 14] * analysis_low[0];
  212. const float b = input[2 * i - 13] * analysis_low[1];
  213. const float c = input[2 * i - 12] * analysis_low[2];
  214. const float d = input[2 * i - 11] * analysis_low[3];
  215. const float e = input[2 * i - 10] * analysis_low[4];
  216. const float f = input[2 * i - 9] * analysis_low[3];
  217. const float g = input[2 * i - 8] * analysis_low[2];
  218. const float h = input[2 * i - 7] * analysis_low[1];
  219. const float k = input[2 * i - 6] * analysis_low[0];
  220. output[i] = a + b + c + d + e + f + g + h + k;
  221. }
  222. for (i = NPAD; i < NPAD + low_size; i++) {
  223. const float a = input[2 * i - 12] * analysis_high[0];
  224. const float b = input[2 * i - 11] * analysis_high[1];
  225. const float c = input[2 * i - 10] * analysis_high[2];
  226. const float d = input[2 * i - 9] * analysis_high[3];
  227. const float e = input[2 * i - 8] * analysis_high[2];
  228. const float f = input[2 * i - 7] * analysis_high[1];
  229. const float g = input[2 * i - 6] * analysis_high[0];
  230. output[i + low_size] = a + b + c + d + e + f + g;
  231. }
  232. }
  233. static void invert_step(const float *input, float *output, float *temp, const int size, VagueDenoiserContext *s)
  234. {
  235. const int low_size = (size + 1) >> 1;
  236. const int high_size = size >> 1;
  237. int left_ext = 1, right_ext, i;
  238. int findex;
  239. memcpy(temp + NPAD, input + NPAD, low_size * sizeof(float));
  240. right_ext = (size % 2 == 0) ? 2 : 1;
  241. symmetric_extension(temp, low_size, left_ext, right_ext);
  242. memset(output, 0, (NPAD + NPAD + size) * sizeof(float));
  243. findex = (size + 2) >> 1;
  244. for (i = 9; i < findex + 11; i++) {
  245. const float a = temp[i] * synthesis_low[0];
  246. const float b = temp[i] * synthesis_low[1];
  247. const float c = temp[i] * synthesis_low[2];
  248. const float d = temp[i] * synthesis_low[3];
  249. output[2 * i - 13] += a;
  250. output[2 * i - 12] += b;
  251. output[2 * i - 11] += c;
  252. output[2 * i - 10] += d;
  253. output[2 * i - 9] += c;
  254. output[2 * i - 8] += b;
  255. output[2 * i - 7] += a;
  256. }
  257. memcpy(temp + NPAD, input + NPAD + low_size, high_size * sizeof(float));
  258. left_ext = 2;
  259. right_ext = (size % 2 == 0) ? 1 : 2;
  260. symmetric_extension(temp, high_size, left_ext, right_ext);
  261. for (i = 8; i < findex + 11; i++) {
  262. const float a = temp[i] * synthesis_high[0];
  263. const float b = temp[i] * synthesis_high[1];
  264. const float c = temp[i] * synthesis_high[2];
  265. const float d = temp[i] * synthesis_high[3];
  266. const float e = temp[i] * synthesis_high[4];
  267. output[2 * i - 13] += a;
  268. output[2 * i - 12] += b;
  269. output[2 * i - 11] += c;
  270. output[2 * i - 10] += d;
  271. output[2 * i - 9] += e;
  272. output[2 * i - 8] += d;
  273. output[2 * i - 7] += c;
  274. output[2 * i - 6] += b;
  275. output[2 * i - 5] += a;
  276. }
  277. }
  278. static void hard_thresholding(float *block, const int width, const int height,
  279. const int stride, const float threshold,
  280. const float percent, const int unused)
  281. {
  282. const float frac = 1.f - percent * 0.01f;
  283. int y, x;
  284. for (y = 0; y < height; y++) {
  285. for (x = 0; x < width; x++) {
  286. if (FFABS(block[x]) <= threshold)
  287. block[x] *= frac;
  288. }
  289. block += stride;
  290. }
  291. }
  292. static void soft_thresholding(float *block, const int width, const int height, const int stride,
  293. const float threshold, const float percent, const int nsteps)
  294. {
  295. const float frac = 1.f - percent * 0.01f;
  296. const float shift = threshold * 0.01f * percent;
  297. int w = width;
  298. int h = height;
  299. int y, x, l;
  300. for (l = 0; l < nsteps; l++) {
  301. w = (w + 1) >> 1;
  302. h = (h + 1) >> 1;
  303. }
  304. for (y = 0; y < height; y++) {
  305. const int x0 = (y < h) ? w : 0;
  306. for (x = x0; x < width; x++) {
  307. const float temp = FFABS(block[x]);
  308. if (temp <= threshold)
  309. block[x] *= frac;
  310. else
  311. block[x] = (block[x] < 0.f ? -1.f : (block[x] > 0.f ? 1.f : 0.f)) * (temp - shift);
  312. }
  313. block += stride;
  314. }
  315. }
  316. static void qian_thresholding(float *block, const int width, const int height,
  317. const int stride, const float threshold,
  318. const float percent, const int unused)
  319. {
  320. const float percent01 = percent * 0.01f;
  321. const float tr2 = threshold * threshold * percent01;
  322. const float frac = 1.f - percent01;
  323. int y, x;
  324. for (y = 0; y < height; y++) {
  325. for (x = 0; x < width; x++) {
  326. const float temp = FFABS(block[x]);
  327. if (temp <= threshold) {
  328. block[x] *= frac;
  329. } else {
  330. const float tp2 = temp * temp;
  331. block[x] *= (tp2 - tr2) / tp2;
  332. }
  333. }
  334. block += stride;
  335. }
  336. }
  337. static void filter(VagueDenoiserContext *s, AVFrame *in, AVFrame *out)
  338. {
  339. int p, y, x, i, j;
  340. for (p = 0; p < s->nb_planes; p++) {
  341. const int height = s->planeheight[p];
  342. const int width = s->planewidth[p];
  343. const uint8_t *srcp8 = in->data[p];
  344. const uint16_t *srcp16 = (const uint16_t *)in->data[p];
  345. uint8_t *dstp8 = out->data[p];
  346. uint16_t *dstp16 = (uint16_t *)out->data[p];
  347. float *output = s->block;
  348. int h_low_size0 = width;
  349. int v_low_size0 = height;
  350. int nsteps_transform = s->nsteps;
  351. int nsteps_invert = s->nsteps;
  352. const float *input = s->block;
  353. if (!((1 << p) & s->planes)) {
  354. av_image_copy_plane(out->data[p], out->linesize[p], in->data[p], in->linesize[p],
  355. s->planewidth[p] * s->bpc, s->planeheight[p]);
  356. continue;
  357. }
  358. if (s->depth <= 8) {
  359. for (y = 0; y < height; y++) {
  360. for (x = 0; x < width; x++)
  361. output[x] = srcp8[x];
  362. srcp8 += in->linesize[p];
  363. output += width;
  364. }
  365. } else {
  366. for (y = 0; y < height; y++) {
  367. for (x = 0; x < width; x++)
  368. output[x] = srcp16[x];
  369. srcp16 += in->linesize[p] / 2;
  370. output += width;
  371. }
  372. }
  373. while (nsteps_transform--) {
  374. int low_size = (h_low_size0 + 1) >> 1;
  375. float *input = s->block;
  376. for (j = 0; j < v_low_size0; j++) {
  377. copy(input, s->in + NPAD, h_low_size0);
  378. transform_step(s->in, s->out, h_low_size0, low_size, s);
  379. copy(s->out + NPAD, input, h_low_size0);
  380. input += width;
  381. }
  382. low_size = (v_low_size0 + 1) >> 1;
  383. input = s->block;
  384. for (j = 0; j < h_low_size0; j++) {
  385. copyv(input, width, s->in + NPAD, v_low_size0);
  386. transform_step(s->in, s->out, v_low_size0, low_size, s);
  387. copyh(s->out + NPAD, input, width, v_low_size0);
  388. input++;
  389. }
  390. h_low_size0 = (h_low_size0 + 1) >> 1;
  391. v_low_size0 = (v_low_size0 + 1) >> 1;
  392. }
  393. s->thresholding(s->block, width, height, width, s->threshold, s->percent, s->nsteps);
  394. while (nsteps_invert--) {
  395. const int idx = s->vlowsize[p][nsteps_invert] + s->vhighsize[p][nsteps_invert];
  396. const int idx2 = s->hlowsize[p][nsteps_invert] + s->hhighsize[p][nsteps_invert];
  397. float * idx3 = s->block;
  398. for (i = 0; i < idx2; i++) {
  399. copyv(idx3, width, s->in + NPAD, idx);
  400. invert_step(s->in, s->out, s->tmp, idx, s);
  401. copyh(s->out + NPAD, idx3, width, idx);
  402. idx3++;
  403. }
  404. idx3 = s->block;
  405. for (i = 0; i < idx; i++) {
  406. copy(idx3, s->in + NPAD, idx2);
  407. invert_step(s->in, s->out, s->tmp, idx2, s);
  408. copy(s->out + NPAD, idx3, idx2);
  409. idx3 += width;
  410. }
  411. }
  412. if (s->depth <= 8) {
  413. for (y = 0; y < height; y++) {
  414. for (x = 0; x < width; x++)
  415. dstp8[x] = av_clip_uint8(input[x] + 0.5f);
  416. input += width;
  417. dstp8 += out->linesize[p];
  418. }
  419. } else {
  420. for (y = 0; y < height; y++) {
  421. for (x = 0; x < width; x++)
  422. dstp16[x] = av_clip(input[x] + 0.5f, 0, s->peak);
  423. input += width;
  424. dstp16 += out->linesize[p] / 2;
  425. }
  426. }
  427. }
  428. }
  429. static int filter_frame(AVFilterLink *inlink, AVFrame *in)
  430. {
  431. AVFilterContext *ctx = inlink->dst;
  432. VagueDenoiserContext *s = ctx->priv;
  433. AVFilterLink *outlink = ctx->outputs[0];
  434. AVFrame *out;
  435. int direct = av_frame_is_writable(in);
  436. if (direct) {
  437. out = in;
  438. } else {
  439. out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
  440. if (!out) {
  441. av_frame_free(&in);
  442. return AVERROR(ENOMEM);
  443. }
  444. av_frame_copy_props(out, in);
  445. }
  446. filter(s, in, out);
  447. if (!direct)
  448. av_frame_free(&in);
  449. return ff_filter_frame(outlink, out);
  450. }
  451. static av_cold int init(AVFilterContext *ctx)
  452. {
  453. VagueDenoiserContext *s = ctx->priv;
  454. switch (s->method) {
  455. case 0:
  456. s->thresholding = hard_thresholding;
  457. break;
  458. case 1:
  459. s->thresholding = soft_thresholding;
  460. break;
  461. case 2:
  462. s->thresholding = qian_thresholding;
  463. break;
  464. }
  465. return 0;
  466. }
  467. static av_cold void uninit(AVFilterContext *ctx)
  468. {
  469. VagueDenoiserContext *s = ctx->priv;
  470. av_freep(&s->block);
  471. av_freep(&s->in);
  472. av_freep(&s->out);
  473. av_freep(&s->tmp);
  474. }
  475. static const AVFilterPad vaguedenoiser_inputs[] = {
  476. {
  477. .name = "default",
  478. .type = AVMEDIA_TYPE_VIDEO,
  479. .config_props = config_input,
  480. .filter_frame = filter_frame,
  481. },
  482. { NULL }
  483. };
  484. static const AVFilterPad vaguedenoiser_outputs[] = {
  485. {
  486. .name = "default",
  487. .type = AVMEDIA_TYPE_VIDEO
  488. },
  489. { NULL }
  490. };
  491. AVFilter ff_vf_vaguedenoiser = {
  492. .name = "vaguedenoiser",
  493. .description = NULL_IF_CONFIG_SMALL("Apply a Wavelet based Denoiser."),
  494. .priv_size = sizeof(VagueDenoiserContext),
  495. .priv_class = &vaguedenoiser_class,
  496. .init = init,
  497. .uninit = uninit,
  498. .query_formats = query_formats,
  499. .inputs = vaguedenoiser_inputs,
  500. .outputs = vaguedenoiser_outputs,
  501. .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
  502. };