]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_slicify.c
lavfi/drawbox: reindent after previous commit
[ffmpeg] / libavfilter / vf_slicify.c
index 347943098be2150643a5b434871cb7de5d469dba..d010cc5a600637c50fc55a95e2c5a7b24b76a45f 100644 (file)
@@ -54,8 +54,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
 static int config_props(AVFilterLink *link)
 {
     SliceContext *slice = link->dst->priv;
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
 
-    slice->vshift = av_pix_fmt_descriptors[link->format].log2_chroma_h;
+    slice->vshift = desc->log2_chroma_h;
 
     return 0;
 }
@@ -106,6 +107,27 @@ static int draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
     return 0;
 }
 
+static const AVFilterPad avfilter_vf_slicify_inputs[] = {
+    {
+        .name             = "default",
+        .type             = AVMEDIA_TYPE_VIDEO,
+        .get_video_buffer = ff_null_get_video_buffer,
+        .start_frame      = start_frame,
+        .draw_slice       = draw_slice,
+        .config_props     = config_props,
+        .end_frame        = ff_null_end_frame,
+    },
+    { NULL }
+};
+
+static const AVFilterPad avfilter_vf_slicify_outputs[] = {
+    {
+        .name = "default",
+        .type = AVMEDIA_TYPE_VIDEO,
+    },
+    { NULL }
+};
+
 AVFilter avfilter_vf_slicify = {
     .name      = "slicify",
     .description = NULL_IF_CONFIG_SMALL("Pass the images of input video on to next video filter as multiple slices."),
@@ -114,15 +136,6 @@ AVFilter avfilter_vf_slicify = {
 
     .priv_size = sizeof(SliceContext),
 
-    .inputs    = (const AVFilterPad[]) {{ .name             = "default",
-                                          .type             = AVMEDIA_TYPE_VIDEO,
-                                          .get_video_buffer = ff_null_get_video_buffer,
-                                          .start_frame      = start_frame,
-                                          .draw_slice       = draw_slice,
-                                          .config_props     = config_props,
-                                          .end_frame        = ff_null_end_frame, },
-                                        { .name = NULL}},
-    .outputs   = (const AVFilterPad[]) {{ .name            = "default",
-                                          .type            = AVMEDIA_TYPE_VIDEO, },
-                                        { .name = NULL}},
+    .inputs    = avfilter_vf_slicify_inputs,
+    .outputs   = avfilter_vf_slicify_outputs,
 };