+#if CONFIG_PAL75BARS_FILTER
+
+#define pal75bars_options options
+AVFILTER_DEFINE_CLASS(pal75bars);
+
+static void pal75bars_fill_picture(AVFilterContext *ctx, AVFrame *picref)
+{
+ TestSourceContext *test = ctx->priv;
+ int r_w, i, x = 0;
+ const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(picref->format);
+
+ picref->color_range = AVCOL_RANGE_MPEG;
+ picref->colorspace = AVCOL_SPC_BT470BG;
+
+ r_w = FFALIGN((test->w + 7) / 8, 1 << pixdesc->log2_chroma_w);
+
+ draw_bar(test, white, x, 0, r_w, test->h, picref);
+ x += r_w;
+ for (i = 1; i < 7; i++) {
+ draw_bar(test, rainbow[i], x, 0, r_w, test->h, picref);
+ x += r_w;
+ }
+ draw_bar(test, black0, x, 0, r_w, test->h, picref);
+}
+
+static av_cold int pal75bars_init(AVFilterContext *ctx)
+{
+ TestSourceContext *test = ctx->priv;
+
+ test->fill_picture_fn = pal75bars_fill_picture;
+ test->draw_once = 1;
+ return init(ctx);
+}
+
+AVFilter ff_vsrc_pal75bars = {
+ .name = "pal75bars",
+ .description = NULL_IF_CONFIG_SMALL("Generate PAL 75% color bars."),
+ .priv_size = sizeof(TestSourceContext),
+ .priv_class = &pal75bars_class,
+ .init = pal75bars_init,
+ .uninit = uninit,
+ .query_formats = smptebars_query_formats,
+ .activate = activate,
+ .inputs = NULL,
+ .outputs = smptebars_outputs,
+};
+
+#endif /* CONFIG_PAL75BARS_FILTER */
+
+#if CONFIG_PAL100BARS_FILTER
+
+#define pal100bars_options options
+AVFILTER_DEFINE_CLASS(pal100bars);
+
+static void pal100bars_fill_picture(AVFilterContext *ctx, AVFrame *picref)
+{
+ TestSourceContext *test = ctx->priv;
+ int r_w, i, x = 0;
+ const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(picref->format);
+
+ picref->color_range = AVCOL_RANGE_MPEG;
+ picref->colorspace = AVCOL_SPC_BT470BG;
+
+ r_w = FFALIGN((test->w + 7) / 8, 1 << pixdesc->log2_chroma_w);
+
+ for (i = 0; i < 7; i++) {
+ draw_bar(test, rainbow100[i], x, 0, r_w, test->h, picref);
+ x += r_w;
+ }
+ draw_bar(test, black0, x, 0, r_w, test->h, picref);
+}
+
+static av_cold int pal100bars_init(AVFilterContext *ctx)
+{
+ TestSourceContext *test = ctx->priv;
+
+ test->fill_picture_fn = pal100bars_fill_picture;
+ test->draw_once = 1;
+ return init(ctx);
+}
+
+AVFilter ff_vsrc_pal100bars = {
+ .name = "pal100bars",
+ .description = NULL_IF_CONFIG_SMALL("Generate PAL 100% color bars."),
+ .priv_size = sizeof(TestSourceContext),
+ .priv_class = &pal100bars_class,
+ .init = pal100bars_init,
+ .uninit = uninit,
+ .query_formats = smptebars_query_formats,
+ .activate = activate,
+ .inputs = NULL,
+ .outputs = smptebars_outputs,
+};
+
+#endif /* CONFIG_PAL100BARS_FILTER */
+