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.

537 lines
18KB

  1. /*
  2. * Copyright (c) 2007 Nicolas George <nicolas.george@normalesup.org>
  3. * Copyright (c) 2011 Stefano Sabatini
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * FFmpeg is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. /**
  22. * @file
  23. * Misc test sources.
  24. *
  25. * testsrc is based on the test pattern generator demuxer by Nicolas George:
  26. * http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2007-October/037845.html
  27. *
  28. * rgbtestsrc is ported from MPlayer libmpcodecs/vf_rgbtest.c by
  29. * Michael Niedermayer.
  30. */
  31. #include <float.h>
  32. #include "libavutil/opt.h"
  33. #include "libavutil/intreadwrite.h"
  34. #include "libavutil/parseutils.h"
  35. #include "avfilter.h"
  36. #include "formats.h"
  37. #include "video.h"
  38. typedef struct {
  39. const AVClass *class;
  40. int w, h;
  41. unsigned int nb_frame;
  42. AVRational time_base;
  43. int64_t pts, max_pts;
  44. char *rate; ///< video frame rate
  45. char *duration; ///< total duration of the generated video
  46. AVRational sar; ///< sample aspect ratio
  47. int nb_decimals;
  48. void (* fill_picture_fn)(AVFilterContext *ctx, AVFilterBufferRef *picref);
  49. /* only used by rgbtest */
  50. int rgba_map[4];
  51. } TestSourceContext;
  52. #define OFFSET(x) offsetof(TestSourceContext, x)
  53. static const AVOption testsrc_options[]= {
  54. { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0 },
  55. { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0 },
  56. { "rate", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0 },
  57. { "r", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0 },
  58. { "duration", "set video duration", OFFSET(duration), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 },
  59. { "d", "set video duration", OFFSET(duration), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 },
  60. { "sar", "set video sample aspect ratio", OFFSET(sar), AV_OPT_TYPE_RATIONAL, {.dbl= 1}, 0, INT_MAX },
  61. { "decimals", "set number of decimals to show", OFFSET(nb_decimals), AV_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX },
  62. { "n", "set number of decimals to show", OFFSET(nb_decimals), AV_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX },
  63. { NULL },
  64. };
  65. static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
  66. {
  67. TestSourceContext *test = ctx->priv;
  68. AVRational frame_rate_q;
  69. int64_t duration = -1;
  70. int ret = 0;
  71. av_opt_set_defaults(test);
  72. if ((ret = (av_set_options_string(test, args, "=", ":"))) < 0) {
  73. av_log(ctx, AV_LOG_ERROR, "Error parsing options string: '%s'\n", args);
  74. return ret;
  75. }
  76. if ((ret = av_parse_video_rate(&frame_rate_q, test->rate)) < 0 ||
  77. frame_rate_q.den <= 0 || frame_rate_q.num <= 0) {
  78. av_log(ctx, AV_LOG_ERROR, "Invalid frame rate: '%s'\n", test->rate);
  79. return ret;
  80. }
  81. av_freep(&test->rate);
  82. if ((test->duration) && (ret = av_parse_time(&duration, test->duration, 1)) < 0) {
  83. av_log(ctx, AV_LOG_ERROR, "Invalid duration: '%s'\n", test->duration);
  84. return ret;
  85. }
  86. av_freep(&test->duration);
  87. if (test->nb_decimals && strcmp(ctx->filter->name, "testsrc")) {
  88. av_log(ctx, AV_LOG_WARNING,
  89. "Option 'decimals' is ignored with source '%s'\n",
  90. ctx->filter->name);
  91. }
  92. test->time_base.num = frame_rate_q.den;
  93. test->time_base.den = frame_rate_q.num;
  94. test->max_pts = duration >= 0 ?
  95. av_rescale_q(duration, AV_TIME_BASE_Q, test->time_base) : -1;
  96. test->nb_frame = 0;
  97. test->pts = 0;
  98. av_log(ctx, AV_LOG_INFO, "size:%dx%d rate:%d/%d duration:%f sar:%d/%d\n",
  99. test->w, test->h, frame_rate_q.num, frame_rate_q.den,
  100. duration < 0 ? -1 : test->max_pts * av_q2d(test->time_base),
  101. test->sar.num, test->sar.den);
  102. return 0;
  103. }
  104. static int config_props(AVFilterLink *outlink)
  105. {
  106. TestSourceContext *test = outlink->src->priv;
  107. outlink->w = test->w;
  108. outlink->h = test->h;
  109. outlink->sample_aspect_ratio = test->sar;
  110. outlink->time_base = test->time_base;
  111. return 0;
  112. }
  113. static int request_frame(AVFilterLink *outlink)
  114. {
  115. TestSourceContext *test = outlink->src->priv;
  116. AVFilterBufferRef *picref;
  117. if (test->max_pts >= 0 && test->pts >= test->max_pts)
  118. return AVERROR_EOF;
  119. picref = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
  120. test->w, test->h);
  121. picref->pts = test->pts++;
  122. picref->pos = -1;
  123. picref->video->key_frame = 1;
  124. picref->video->interlaced = 0;
  125. picref->video->pict_type = AV_PICTURE_TYPE_I;
  126. picref->video->sample_aspect_ratio = test->sar;
  127. test->fill_picture_fn(outlink->src, picref);
  128. test->nb_frame++;
  129. ff_start_frame(outlink, avfilter_ref_buffer(picref, ~0));
  130. ff_draw_slice(outlink, 0, picref->video->h, 1);
  131. ff_end_frame(outlink);
  132. avfilter_unref_buffer(picref);
  133. return 0;
  134. }
  135. #if CONFIG_NULLSRC_FILTER
  136. static const AVClass nullsrc_class = {
  137. .class_name = "NullSourceContext",
  138. .item_name = av_default_item_name,
  139. .option = testsrc_options,
  140. };
  141. static void nullsrc_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref) { }
  142. static av_cold int nullsrc_init(AVFilterContext *ctx, const char *args, void *opaque)
  143. {
  144. TestSourceContext *test = ctx->priv;
  145. test->class = &nullsrc_class;
  146. test->fill_picture_fn = nullsrc_fill_picture;
  147. return init(ctx, args, opaque);
  148. }
  149. AVFilter avfilter_vsrc_nullsrc = {
  150. .name = "nullsrc",
  151. .description = NULL_IF_CONFIG_SMALL("Null video source, return unprocessed video frames."),
  152. .init = nullsrc_init,
  153. .priv_size = sizeof(TestSourceContext),
  154. .inputs = (const AVFilterPad[]) {{ .name = NULL}},
  155. .outputs = (const AVFilterPad[]) {{ .name = "default",
  156. .type = AVMEDIA_TYPE_VIDEO,
  157. .request_frame = request_frame,
  158. .config_props = config_props, },
  159. { .name = NULL}},
  160. };
  161. #endif /* CONFIG_NULLSRC_FILTER */
  162. #if CONFIG_TESTSRC_FILTER
  163. static const AVClass testsrc_class = {
  164. .class_name = "TestSourceContext",
  165. .item_name = av_default_item_name,
  166. .option = testsrc_options,
  167. };
  168. /**
  169. * Fill a rectangle with value val.
  170. *
  171. * @param val the RGB value to set
  172. * @param dst pointer to the destination buffer to fill
  173. * @param dst_linesize linesize of destination
  174. * @param segment_width width of the segment
  175. * @param x horizontal coordinate where to draw the rectangle in the destination buffer
  176. * @param y horizontal coordinate where to draw the rectangle in the destination buffer
  177. * @param w width of the rectangle to draw, expressed as a number of segment_width units
  178. * @param h height of the rectangle to draw, expressed as a number of segment_width units
  179. */
  180. static void draw_rectangle(unsigned val, uint8_t *dst, int dst_linesize, unsigned segment_width,
  181. unsigned x, unsigned y, unsigned w, unsigned h)
  182. {
  183. int i;
  184. int step = 3;
  185. dst += segment_width * (step * x + y * dst_linesize);
  186. w *= segment_width * step;
  187. h *= segment_width;
  188. for (i = 0; i < h; i++) {
  189. memset(dst, val, w);
  190. dst += dst_linesize;
  191. }
  192. }
  193. static void draw_digit(int digit, uint8_t *dst, unsigned dst_linesize,
  194. unsigned segment_width)
  195. {
  196. #define TOP_HBAR 1
  197. #define MID_HBAR 2
  198. #define BOT_HBAR 4
  199. #define LEFT_TOP_VBAR 8
  200. #define LEFT_BOT_VBAR 16
  201. #define RIGHT_TOP_VBAR 32
  202. #define RIGHT_BOT_VBAR 64
  203. struct {
  204. int x, y, w, h;
  205. } segments[] = {
  206. { 1, 0, 5, 1 }, /* TOP_HBAR */
  207. { 1, 6, 5, 1 }, /* MID_HBAR */
  208. { 1, 12, 5, 1 }, /* BOT_HBAR */
  209. { 0, 1, 1, 5 }, /* LEFT_TOP_VBAR */
  210. { 0, 7, 1, 5 }, /* LEFT_BOT_VBAR */
  211. { 6, 1, 1, 5 }, /* RIGHT_TOP_VBAR */
  212. { 6, 7, 1, 5 } /* RIGHT_BOT_VBAR */
  213. };
  214. static const unsigned char masks[10] = {
  215. /* 0 */ TOP_HBAR |BOT_HBAR|LEFT_TOP_VBAR|LEFT_BOT_VBAR|RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
  216. /* 1 */ RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
  217. /* 2 */ TOP_HBAR|MID_HBAR|BOT_HBAR|LEFT_BOT_VBAR |RIGHT_TOP_VBAR,
  218. /* 3 */ TOP_HBAR|MID_HBAR|BOT_HBAR |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
  219. /* 4 */ MID_HBAR |LEFT_TOP_VBAR |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
  220. /* 5 */ TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR |RIGHT_BOT_VBAR,
  221. /* 6 */ TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR|LEFT_BOT_VBAR |RIGHT_BOT_VBAR,
  222. /* 7 */ TOP_HBAR |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
  223. /* 8 */ TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR|LEFT_BOT_VBAR|RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
  224. /* 9 */ TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
  225. };
  226. unsigned mask = masks[digit];
  227. int i;
  228. draw_rectangle(0, dst, dst_linesize, segment_width, 0, 0, 8, 13);
  229. for (i = 0; i < FF_ARRAY_ELEMS(segments); i++)
  230. if (mask & (1<<i))
  231. draw_rectangle(255, dst, dst_linesize, segment_width,
  232. segments[i].x, segments[i].y, segments[i].w, segments[i].h);
  233. }
  234. #define GRADIENT_SIZE (6 * 256)
  235. static void test_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref)
  236. {
  237. TestSourceContext *test = ctx->priv;
  238. uint8_t *p, *p0;
  239. int x, y;
  240. int color, color_rest;
  241. int icolor;
  242. int radius;
  243. int quad0, quad;
  244. int dquad_x, dquad_y;
  245. int grad, dgrad, rgrad, drgrad;
  246. int seg_size;
  247. int second;
  248. int i;
  249. uint8_t *data = picref->data[0];
  250. int width = picref->video->w;
  251. int height = picref->video->h;
  252. /* draw colored bars and circle */
  253. radius = (width + height) / 4;
  254. quad0 = width * width / 4 + height * height / 4 - radius * radius;
  255. dquad_y = 1 - height;
  256. p0 = data;
  257. for (y = 0; y < height; y++) {
  258. p = p0;
  259. color = 0;
  260. color_rest = 0;
  261. quad = quad0;
  262. dquad_x = 1 - width;
  263. for (x = 0; x < width; x++) {
  264. icolor = color;
  265. if (quad < 0)
  266. icolor ^= 7;
  267. quad += dquad_x;
  268. dquad_x += 2;
  269. *(p++) = icolor & 1 ? 255 : 0;
  270. *(p++) = icolor & 2 ? 255 : 0;
  271. *(p++) = icolor & 4 ? 255 : 0;
  272. color_rest += 8;
  273. if (color_rest >= width) {
  274. color_rest -= width;
  275. color++;
  276. }
  277. }
  278. quad0 += dquad_y;
  279. dquad_y += 2;
  280. p0 += picref->linesize[0];
  281. }
  282. /* draw sliding color line */
  283. p0 = p = data + picref->linesize[0] * height * 3/4;
  284. grad = (256 * test->nb_frame * test->time_base.num / test->time_base.den) %
  285. GRADIENT_SIZE;
  286. rgrad = 0;
  287. dgrad = GRADIENT_SIZE / width;
  288. drgrad = GRADIENT_SIZE % width;
  289. for (x = 0; x < width; x++) {
  290. *(p++) =
  291. grad < 256 || grad >= 5 * 256 ? 255 :
  292. grad >= 2 * 256 && grad < 4 * 256 ? 0 :
  293. grad < 2 * 256 ? 2 * 256 - 1 - grad : grad - 4 * 256;
  294. *(p++) =
  295. grad >= 4 * 256 ? 0 :
  296. grad >= 1 * 256 && grad < 3 * 256 ? 255 :
  297. grad < 1 * 256 ? grad : 4 * 256 - 1 - grad;
  298. *(p++) =
  299. grad < 2 * 256 ? 0 :
  300. grad >= 3 * 256 && grad < 5 * 256 ? 255 :
  301. grad < 3 * 256 ? grad - 2 * 256 : 6 * 256 - 1 - grad;
  302. grad += dgrad;
  303. rgrad += drgrad;
  304. if (rgrad >= GRADIENT_SIZE) {
  305. grad++;
  306. rgrad -= GRADIENT_SIZE;
  307. }
  308. if (grad >= GRADIENT_SIZE)
  309. grad -= GRADIENT_SIZE;
  310. }
  311. p = p0;
  312. for (y = height / 8; y > 0; y--) {
  313. memcpy(p+picref->linesize[0], p, 3 * width);
  314. p += picref->linesize[0];
  315. }
  316. /* draw digits */
  317. seg_size = width / 80;
  318. if (seg_size >= 1 && height >= 13 * seg_size) {
  319. double time = av_q2d(test->time_base) * test->nb_frame *
  320. pow(10, test->nb_decimals);
  321. if (time > INT_MAX)
  322. return;
  323. second = (int)time;
  324. x = width - (width - seg_size * 64) / 2;
  325. y = (height - seg_size * 13) / 2;
  326. p = data + (x*3 + y * picref->linesize[0]);
  327. for (i = 0; i < 8; i++) {
  328. p -= 3 * 8 * seg_size;
  329. draw_digit(second % 10, p, picref->linesize[0], seg_size);
  330. second /= 10;
  331. if (second == 0)
  332. break;
  333. }
  334. }
  335. }
  336. static av_cold int test_init(AVFilterContext *ctx, const char *args, void *opaque)
  337. {
  338. TestSourceContext *test = ctx->priv;
  339. test->class = &testsrc_class;
  340. test->fill_picture_fn = test_fill_picture;
  341. return init(ctx, args, opaque);
  342. }
  343. static int test_query_formats(AVFilterContext *ctx)
  344. {
  345. static const enum PixelFormat pix_fmts[] = {
  346. PIX_FMT_RGB24, PIX_FMT_NONE
  347. };
  348. ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
  349. return 0;
  350. }
  351. AVFilter avfilter_vsrc_testsrc = {
  352. .name = "testsrc",
  353. .description = NULL_IF_CONFIG_SMALL("Generate test pattern."),
  354. .priv_size = sizeof(TestSourceContext),
  355. .init = test_init,
  356. .query_formats = test_query_formats,
  357. .inputs = (const AVFilterPad[]) {{ .name = NULL}},
  358. .outputs = (const AVFilterPad[]) {{ .name = "default",
  359. .type = AVMEDIA_TYPE_VIDEO,
  360. .request_frame = request_frame,
  361. .config_props = config_props, },
  362. { .name = NULL }},
  363. };
  364. #endif /* CONFIG_TESTSRC_FILTER */
  365. #if CONFIG_RGBTESTSRC_FILTER
  366. static const AVClass rgbtestsrc_class = {
  367. .class_name = "RGBTestSourceContext",
  368. .item_name = av_default_item_name,
  369. .option = testsrc_options,
  370. };
  371. #define R 0
  372. #define G 1
  373. #define B 2
  374. #define A 3
  375. static void rgbtest_put_pixel(uint8_t *dst, int dst_linesize,
  376. int x, int y, int r, int g, int b, enum PixelFormat fmt,
  377. int rgba_map[4])
  378. {
  379. int32_t v;
  380. uint8_t *p;
  381. switch (fmt) {
  382. case PIX_FMT_BGR444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r >> 4) << 8) | ((g >> 4) << 4) | (b >> 4); break;
  383. case PIX_FMT_RGB444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b >> 4) << 8) | ((g >> 4) << 4) | (r >> 4); break;
  384. case PIX_FMT_BGR555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<10) | ((g>>3)<<5) | (b>>3); break;
  385. case PIX_FMT_RGB555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<10) | ((g>>3)<<5) | (r>>3); break;
  386. case PIX_FMT_BGR565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<11) | ((g>>2)<<5) | (b>>3); break;
  387. case PIX_FMT_RGB565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<11) | ((g>>2)<<5) | (r>>3); break;
  388. case PIX_FMT_RGB24:
  389. case PIX_FMT_BGR24:
  390. v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8));
  391. p = dst + 3*x + y*dst_linesize;
  392. AV_WL24(p, v);
  393. break;
  394. case PIX_FMT_RGBA:
  395. case PIX_FMT_BGRA:
  396. case PIX_FMT_ARGB:
  397. case PIX_FMT_ABGR:
  398. v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8)) + (255 << (rgba_map[A]*8));
  399. p = dst + 4*x + y*dst_linesize;
  400. AV_WL32(p, v);
  401. break;
  402. }
  403. }
  404. static void rgbtest_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref)
  405. {
  406. TestSourceContext *test = ctx->priv;
  407. int x, y, w = picref->video->w, h = picref->video->h;
  408. for (y = 0; y < h; y++) {
  409. for (x = 0; x < picref->video->w; x++) {
  410. int c = 256*x/w;
  411. int r = 0, g = 0, b = 0;
  412. if (3*y < h ) r = c;
  413. else if (3*y < 2*h) g = c;
  414. else b = c;
  415. rgbtest_put_pixel(picref->data[0], picref->linesize[0], x, y, r, g, b,
  416. ctx->outputs[0]->format, test->rgba_map);
  417. }
  418. }
  419. }
  420. static av_cold int rgbtest_init(AVFilterContext *ctx, const char *args, void *opaque)
  421. {
  422. TestSourceContext *test = ctx->priv;
  423. test->class = &rgbtestsrc_class;
  424. test->fill_picture_fn = rgbtest_fill_picture;
  425. return init(ctx, args, opaque);
  426. }
  427. static int rgbtest_query_formats(AVFilterContext *ctx)
  428. {
  429. static const enum PixelFormat pix_fmts[] = {
  430. PIX_FMT_RGBA, PIX_FMT_ARGB, PIX_FMT_BGRA, PIX_FMT_ABGR,
  431. PIX_FMT_BGR24, PIX_FMT_RGB24,
  432. PIX_FMT_RGB444, PIX_FMT_BGR444,
  433. PIX_FMT_RGB565, PIX_FMT_BGR565,
  434. PIX_FMT_RGB555, PIX_FMT_BGR555,
  435. PIX_FMT_NONE
  436. };
  437. ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
  438. return 0;
  439. }
  440. static int rgbtest_config_props(AVFilterLink *outlink)
  441. {
  442. TestSourceContext *test = outlink->src->priv;
  443. switch (outlink->format) {
  444. case PIX_FMT_ARGB: test->rgba_map[A] = 0; test->rgba_map[R] = 1; test->rgba_map[G] = 2; test->rgba_map[B] = 3; break;
  445. case PIX_FMT_ABGR: test->rgba_map[A] = 0; test->rgba_map[B] = 1; test->rgba_map[G] = 2; test->rgba_map[R] = 3; break;
  446. case PIX_FMT_RGBA:
  447. case PIX_FMT_RGB24: test->rgba_map[R] = 0; test->rgba_map[G] = 1; test->rgba_map[B] = 2; test->rgba_map[A] = 3; break;
  448. case PIX_FMT_BGRA:
  449. case PIX_FMT_BGR24: test->rgba_map[B] = 0; test->rgba_map[G] = 1; test->rgba_map[R] = 2; test->rgba_map[A] = 3; break;
  450. }
  451. return config_props(outlink);
  452. }
  453. AVFilter avfilter_vsrc_rgbtestsrc = {
  454. .name = "rgbtestsrc",
  455. .description = NULL_IF_CONFIG_SMALL("Generate RGB test pattern."),
  456. .priv_size = sizeof(TestSourceContext),
  457. .init = rgbtest_init,
  458. .query_formats = rgbtest_query_formats,
  459. .inputs = (const AVFilterPad[]) {{ .name = NULL}},
  460. .outputs = (const AVFilterPad[]) {{ .name = "default",
  461. .type = AVMEDIA_TYPE_VIDEO,
  462. .request_frame = request_frame,
  463. .config_props = rgbtest_config_props, },
  464. { .name = NULL }},
  465. };
  466. #endif /* CONFIG_RGBTESTSRC_FILTER */