vf_deband.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. /*
  2. * Copyright (c) 2015 Niklas Haas
  3. * Copyright (c) 2015 Paul B Mahol
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6. * of this software and associated documentation files (the "Software"), to deal
  7. * in the Software without restriction, including without limitation the rights
  8. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. * copies of the Software, and to permit persons to whom the Software is
  10. * furnished to do so, subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be included in
  13. * all copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  21. * SOFTWARE.
  22. */
  23. #include "libavutil/opt.h"
  24. #include "libavutil/pixdesc.h"
  25. #include "avfilter.h"
  26. #include "internal.h"
  27. #include "video.h"
  28. typedef struct DebandContext {
  29. const AVClass *class;
  30. int coupling;
  31. float threshold[4];
  32. int range;
  33. int blur;
  34. float direction;
  35. int nb_components;
  36. int planewidth[4];
  37. int planeheight[4];
  38. int shift[2];
  39. int thr[4];
  40. int *x_pos;
  41. int *y_pos;
  42. int (*deband)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
  43. } DebandContext;
  44. #define OFFSET(x) offsetof(DebandContext, x)
  45. #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
  46. static const AVOption deband_options[] = {
  47. { "1thr", "set 1st plane threshold", OFFSET(threshold[0]), AV_OPT_TYPE_FLOAT, {.dbl=0.02}, 0.00003, 0.5, FLAGS },
  48. { "2thr", "set 2nd plane threshold", OFFSET(threshold[1]), AV_OPT_TYPE_FLOAT, {.dbl=0.02}, 0.00003, 0.5, FLAGS },
  49. { "3thr", "set 3rd plane threshold", OFFSET(threshold[2]), AV_OPT_TYPE_FLOAT, {.dbl=0.02}, 0.00003, 0.5, FLAGS },
  50. { "4thr", "set 4th plane threshold", OFFSET(threshold[3]), AV_OPT_TYPE_FLOAT, {.dbl=0.02}, 0.00003, 0.5, FLAGS },
  51. { "range", "set range", OFFSET(range), AV_OPT_TYPE_INT, {.i64=16}, INT_MIN, INT_MAX, FLAGS },
  52. { "r", "set range", OFFSET(range), AV_OPT_TYPE_INT, {.i64=16}, INT_MIN, INT_MAX, FLAGS },
  53. { "direction", "set direction", OFFSET(direction), AV_OPT_TYPE_FLOAT, {.dbl=2*M_PI},-2*M_PI, 2*M_PI, FLAGS },
  54. { "d", "set direction", OFFSET(direction), AV_OPT_TYPE_FLOAT, {.dbl=2*M_PI},-2*M_PI, 2*M_PI, FLAGS },
  55. { "blur", "set blur", OFFSET(blur), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
  56. { "b", "set blur", OFFSET(blur), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
  57. { "coupling", "set plane coupling", OFFSET(coupling), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
  58. { "c", "set plane coupling", OFFSET(coupling), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
  59. { NULL }
  60. };
  61. AVFILTER_DEFINE_CLASS(deband);
  62. static int query_formats(AVFilterContext *ctx)
  63. {
  64. DebandContext *s = ctx->priv;
  65. static const enum AVPixelFormat pix_fmts[] = {
  66. AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16,
  67. AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
  68. AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
  69. AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
  70. AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ440P,
  71. AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
  72. AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
  73. AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA444P9,
  74. AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA444P10,
  75. AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12,
  76. AV_PIX_FMT_YUV420P14, AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV444P14,
  77. AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
  78. AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
  79. AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14,
  80. AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP16,
  81. AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16,
  82. AV_PIX_FMT_YUVA420P16, AV_PIX_FMT_YUVA422P16, AV_PIX_FMT_YUVA444P16,
  83. AV_PIX_FMT_NONE
  84. };
  85. static const enum AVPixelFormat cpix_fmts[] = {
  86. AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
  87. AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P9,
  88. AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUVA444P10,
  89. AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV444P14,
  90. AV_PIX_FMT_YUV444P16, AV_PIX_FMT_YUVA444P16,
  91. AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
  92. AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
  93. AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14,
  94. AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP16,
  95. AV_PIX_FMT_NONE
  96. };
  97. AVFilterFormats *fmts_list = ff_make_format_list(s->coupling ? cpix_fmts : pix_fmts);
  98. if (!fmts_list)
  99. return AVERROR(ENOMEM);
  100. return ff_set_common_formats(ctx, fmts_list);
  101. }
  102. static float frand(int x, int y)
  103. {
  104. const float r = sinf(x * 12.9898 + y * 78.233) * 43758.545;
  105. return r - floorf(r);
  106. }
  107. static int inline get_avg(int ref0, int ref1, int ref2, int ref3)
  108. {
  109. return (ref0 + ref1 + ref2 + ref3) / 4;
  110. }
  111. typedef struct ThreadData {
  112. AVFrame *in, *out;
  113. } ThreadData;
  114. static int deband_8_c(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
  115. {
  116. DebandContext *s = ctx->priv;
  117. ThreadData *td = arg;
  118. AVFrame *in = td->in;
  119. AVFrame *out = td->out;
  120. int x, y, p;
  121. for (p = 0; p < s->nb_components; p++) {
  122. const uint8_t *src_ptr = (const uint8_t *)in->data[p];
  123. uint8_t *dst_ptr = (uint8_t *)out->data[p];
  124. const int dst_linesize = out->linesize[p];
  125. const int src_linesize = in->linesize[p];
  126. const int thr = s->thr[p];
  127. const int start = (s->planeheight[p] * jobnr ) / nb_jobs;
  128. const int end = (s->planeheight[p] * (jobnr+1)) / nb_jobs;
  129. const int w = s->planewidth[p] - 1;
  130. const int h = s->planeheight[p] - 1;
  131. for (y = start; y < end; y++) {
  132. const int pos = y * s->planewidth[0];
  133. for (x = 0; x < s->planewidth[p]; x++) {
  134. const int x_pos = s->x_pos[pos + x];
  135. const int y_pos = s->y_pos[pos + x];
  136. const int ref0 = src_ptr[av_clip(y + y_pos, 0, h) * src_linesize + av_clip(x + x_pos, 0, w)];
  137. const int ref1 = src_ptr[av_clip(y + -y_pos, 0, h) * src_linesize + av_clip(x + x_pos, 0, w)];
  138. const int ref2 = src_ptr[av_clip(y + -y_pos, 0, h) * src_linesize + av_clip(x + -x_pos, 0, w)];
  139. const int ref3 = src_ptr[av_clip(y + y_pos, 0, h) * src_linesize + av_clip(x + -x_pos, 0, w)];
  140. const int src0 = src_ptr[y * src_linesize + x];
  141. if (s->blur) {
  142. const int avg = get_avg(ref0, ref1, ref2, ref3);
  143. const int diff = FFABS(src0 - avg);
  144. dst_ptr[y * dst_linesize + x] = diff < thr ? avg : src0;
  145. } else {
  146. dst_ptr[y * dst_linesize + x] = (FFABS(src0 - ref0) < thr) &&
  147. (FFABS(src0 - ref1) < thr) &&
  148. (FFABS(src0 - ref2) < thr) &&
  149. (FFABS(src0 - ref3) < thr) ? get_avg(ref0, ref1, ref2, ref3) : src0;
  150. }
  151. }
  152. }
  153. }
  154. return 0;
  155. }
  156. static int deband_8_coupling_c(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
  157. {
  158. DebandContext *s = ctx->priv;
  159. ThreadData *td = arg;
  160. AVFrame *in = td->in;
  161. AVFrame *out = td->out;
  162. const int start = (s->planeheight[0] * jobnr ) / nb_jobs;
  163. const int end = (s->planeheight[0] * (jobnr+1)) / nb_jobs;
  164. int x, y, p;
  165. for (y = start; y < end; y++) {
  166. const int pos = y * s->planewidth[0];
  167. for (x = 0; x < s->planewidth[0]; x++) {
  168. const int x_pos = s->x_pos[pos + x];
  169. const int y_pos = s->y_pos[pos + x];
  170. int avg[4], cmp[4] = { 0 }, src[4];
  171. for (p = 0; p < s->nb_components; p++) {
  172. const uint8_t *src_ptr = (const uint8_t *)in->data[p];
  173. const int src_linesize = in->linesize[p];
  174. const int thr = s->thr[p];
  175. const int w = s->planewidth[p] - 1;
  176. const int h = s->planeheight[p] - 1;
  177. const int ref0 = src_ptr[av_clip(y + y_pos, 0, h) * src_linesize + av_clip(x + x_pos, 0, w)];
  178. const int ref1 = src_ptr[av_clip(y + -y_pos, 0, h) * src_linesize + av_clip(x + x_pos, 0, w)];
  179. const int ref2 = src_ptr[av_clip(y + -y_pos, 0, h) * src_linesize + av_clip(x + -x_pos, 0, w)];
  180. const int ref3 = src_ptr[av_clip(y + y_pos, 0, h) * src_linesize + av_clip(x + -x_pos, 0, w)];
  181. const int src0 = src_ptr[y * src_linesize + x];
  182. src[p] = src0;
  183. avg[p] = get_avg(ref0, ref1, ref2, ref3);
  184. if (s->blur) {
  185. cmp[p] = FFABS(src0 - avg[p]) < thr;
  186. } else {
  187. cmp[p] = (FFABS(src0 - ref0) < thr) &&
  188. (FFABS(src0 - ref1) < thr) &&
  189. (FFABS(src0 - ref2) < thr) &&
  190. (FFABS(src0 - ref3) < thr);
  191. }
  192. }
  193. for (p = 0; p < s->nb_components; p++)
  194. if (!cmp[p])
  195. break;
  196. if (p == s->nb_components) {
  197. for (p = 0; p < s->nb_components; p++) {
  198. const int dst_linesize = out->linesize[p];
  199. out->data[p][y * dst_linesize + x] = avg[p];
  200. }
  201. } else {
  202. for (p = 0; p < s->nb_components; p++) {
  203. const int dst_linesize = out->linesize[p];
  204. out->data[p][y * dst_linesize + x] = src[p];
  205. }
  206. }
  207. }
  208. }
  209. return 0;
  210. }
  211. static int deband_16_coupling_c(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
  212. {
  213. DebandContext *s = ctx->priv;
  214. ThreadData *td = arg;
  215. AVFrame *in = td->in;
  216. AVFrame *out = td->out;
  217. const int start = (s->planeheight[0] * jobnr ) / nb_jobs;
  218. const int end = (s->planeheight[0] * (jobnr+1)) / nb_jobs;
  219. int x, y, p, z;
  220. for (y = start; y < end; y++) {
  221. const int pos = y * s->planewidth[0];
  222. for (x = 0; x < s->planewidth[0]; x++) {
  223. const int x_pos = s->x_pos[pos + x];
  224. const int y_pos = s->y_pos[pos + x];
  225. int avg[4], cmp[4] = { 0 }, src[4];
  226. for (p = 0; p < s->nb_components; p++) {
  227. const uint16_t *src_ptr = (const uint16_t *)in->data[p];
  228. const int src_linesize = in->linesize[p] / 2;
  229. const int thr = s->thr[p];
  230. const int w = s->planewidth[p] - 1;
  231. const int h = s->planeheight[p] - 1;
  232. const int ref0 = src_ptr[av_clip(y + y_pos, 0, h) * src_linesize + av_clip(x + x_pos, 0, w)];
  233. const int ref1 = src_ptr[av_clip(y + -y_pos, 0, h) * src_linesize + av_clip(x + x_pos, 0, w)];
  234. const int ref2 = src_ptr[av_clip(y + -y_pos, 0, h) * src_linesize + av_clip(x + -x_pos, 0, w)];
  235. const int ref3 = src_ptr[av_clip(y + y_pos, 0, h) * src_linesize + av_clip(x + -x_pos, 0, w)];
  236. const int src0 = src_ptr[y * src_linesize + x];
  237. src[p] = src0;
  238. avg[p] = get_avg(ref0, ref1, ref2, ref3);
  239. if (s->blur) {
  240. cmp[p] = FFABS(src0 - avg[p]) < thr;
  241. } else {
  242. cmp[p] = (FFABS(src0 - ref0) < thr) &&
  243. (FFABS(src0 - ref1) < thr) &&
  244. (FFABS(src0 - ref2) < thr) &&
  245. (FFABS(src0 - ref3) < thr);
  246. }
  247. }
  248. for (z = 0; z < s->nb_components; z++)
  249. if (!cmp[z])
  250. break;
  251. if (z == s->nb_components) {
  252. for (p = 0; p < s->nb_components; p++) {
  253. const int dst_linesize = out->linesize[p] / 2;
  254. uint16_t *dst = (uint16_t *)out->data[p] + y * dst_linesize + x;
  255. dst[0] = avg[p];
  256. }
  257. } else {
  258. for (p = 0; p < s->nb_components; p++) {
  259. const int dst_linesize = out->linesize[p] / 2;
  260. uint16_t *dst = (uint16_t *)out->data[p] + y * dst_linesize + x;
  261. dst[0] = src[p];
  262. }
  263. }
  264. }
  265. }
  266. return 0;
  267. }
  268. static int deband_16_c(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
  269. {
  270. DebandContext *s = ctx->priv;
  271. ThreadData *td = arg;
  272. AVFrame *in = td->in;
  273. AVFrame *out = td->out;
  274. int x, y, p;
  275. for (p = 0; p < s->nb_components; p++) {
  276. const uint16_t *src_ptr = (const uint16_t *)in->data[p];
  277. uint16_t *dst_ptr = (uint16_t *)out->data[p];
  278. const int dst_linesize = out->linesize[p] / 2;
  279. const int src_linesize = in->linesize[p] / 2;
  280. const int thr = s->thr[p];
  281. const int start = (s->planeheight[p] * jobnr ) / nb_jobs;
  282. const int end = (s->planeheight[p] * (jobnr+1)) / nb_jobs;
  283. const int w = s->planewidth[p] - 1;
  284. const int h = s->planeheight[p] - 1;
  285. for (y = start; y < end; y++) {
  286. const int pos = y * s->planewidth[0];
  287. for (x = 0; x < s->planewidth[p]; x++) {
  288. const int x_pos = s->x_pos[pos + x];
  289. const int y_pos = s->y_pos[pos + x];
  290. const int ref0 = src_ptr[av_clip(y + y_pos, 0, h) * src_linesize + av_clip(x + x_pos, 0, w)];
  291. const int ref1 = src_ptr[av_clip(y + -y_pos, 0, h) * src_linesize + av_clip(x + x_pos, 0, w)];
  292. const int ref2 = src_ptr[av_clip(y + -y_pos, 0, h) * src_linesize + av_clip(x + -x_pos, 0, w)];
  293. const int ref3 = src_ptr[av_clip(y + y_pos, 0, h) * src_linesize + av_clip(x + -x_pos, 0, w)];
  294. const int src0 = src_ptr[y * src_linesize + x];
  295. if (s->blur) {
  296. const int avg = get_avg(ref0, ref1, ref2, ref3);
  297. const int diff = FFABS(src0 - avg);
  298. dst_ptr[y * dst_linesize + x] = diff < thr ? avg : src0;
  299. } else {
  300. dst_ptr[y * dst_linesize + x] = (FFABS(src0 - ref0) < thr) &&
  301. (FFABS(src0 - ref1) < thr) &&
  302. (FFABS(src0 - ref2) < thr) &&
  303. (FFABS(src0 - ref3) < thr) ? get_avg(ref0, ref1, ref2, ref3) : src0;
  304. }
  305. }
  306. }
  307. }
  308. return 0;
  309. }
  310. static int config_input(AVFilterLink *inlink)
  311. {
  312. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
  313. AVFilterContext *ctx = inlink->dst;
  314. DebandContext *s = ctx->priv;
  315. const float direction = s->direction;
  316. const int range = s->range;
  317. int x, y;
  318. s->nb_components = desc->nb_components;
  319. s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
  320. s->planeheight[0] = s->planeheight[3] = inlink->h;
  321. s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
  322. s->planewidth[0] = s->planewidth[3] = inlink->w;
  323. s->shift[0] = desc->log2_chroma_w;
  324. s->shift[1] = desc->log2_chroma_h;
  325. if (s->coupling)
  326. s->deband = desc->comp[0].depth > 8 ? deband_16_coupling_c : deband_8_coupling_c;
  327. else
  328. s->deband = desc->comp[0].depth > 8 ? deband_16_c : deband_8_c;
  329. s->thr[0] = ((1 << desc->comp[0].depth) - 1) * s->threshold[0];
  330. s->thr[1] = ((1 << desc->comp[1].depth) - 1) * s->threshold[1];
  331. s->thr[2] = ((1 << desc->comp[2].depth) - 1) * s->threshold[2];
  332. s->thr[3] = ((1 << desc->comp[3].depth) - 1) * s->threshold[3];
  333. s->x_pos = av_malloc(s->planewidth[0] * s->planeheight[0] * sizeof(*s->x_pos));
  334. s->y_pos = av_malloc(s->planewidth[0] * s->planeheight[0] * sizeof(*s->y_pos));
  335. if (!s->x_pos || !s->y_pos)
  336. return AVERROR(ENOMEM);
  337. for (y = 0; y < s->planeheight[0]; y++) {
  338. for (x = 0; x < s->planewidth[0]; x++) {
  339. const float r = frand(x, y);
  340. const float dir = direction < 0 ? -direction : r * direction;
  341. const int dist = range < 0 ? -range : r * range;
  342. s->x_pos[y * s->planewidth[0] + x] = cosf(dir) * dist;
  343. s->y_pos[y * s->planewidth[0] + x] = sinf(dir) * dist;
  344. }
  345. }
  346. return 0;
  347. }
  348. static int filter_frame(AVFilterLink *inlink, AVFrame *in)
  349. {
  350. AVFilterContext *ctx = inlink->dst;
  351. AVFilterLink *outlink = ctx->outputs[0];
  352. DebandContext *s = ctx->priv;
  353. AVFrame *out;
  354. ThreadData td;
  355. out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
  356. if (!out) {
  357. av_frame_free(&in);
  358. return AVERROR(ENOMEM);
  359. }
  360. av_frame_copy_props(out, in);
  361. td.in = in; td.out = out;
  362. ctx->internal->execute(ctx, s->deband, &td, NULL, FFMIN3(s->planeheight[1],
  363. s->planeheight[2],
  364. ff_filter_get_nb_threads(ctx)));
  365. av_frame_free(&in);
  366. return ff_filter_frame(outlink, out);
  367. }
  368. static av_cold void uninit(AVFilterContext *ctx)
  369. {
  370. DebandContext *s = ctx->priv;
  371. av_freep(&s->x_pos);
  372. av_freep(&s->y_pos);
  373. }
  374. static const AVFilterPad avfilter_vf_deband_inputs[] = {
  375. {
  376. .name = "default",
  377. .type = AVMEDIA_TYPE_VIDEO,
  378. .config_props = config_input,
  379. .filter_frame = filter_frame,
  380. },
  381. { NULL }
  382. };
  383. static const AVFilterPad avfilter_vf_deband_outputs[] = {
  384. {
  385. .name = "default",
  386. .type = AVMEDIA_TYPE_VIDEO,
  387. },
  388. { NULL }
  389. };
  390. AVFilter ff_vf_deband = {
  391. .name = "deband",
  392. .description = NULL_IF_CONFIG_SMALL("Debands video."),
  393. .priv_size = sizeof(DebandContext),
  394. .priv_class = &deband_class,
  395. .uninit = uninit,
  396. .query_formats = query_formats,
  397. .inputs = avfilter_vf_deband_inputs,
  398. .outputs = avfilter_vf_deband_outputs,
  399. .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
  400. };