]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_unsharp.c
libm: add fallbacks for various single-precision functions
[ffmpeg] / libavfilter / vf_unsharp.c
index 7db76d43d8d873867fb6715feb255549b02cb130..7e50bb8609826db56ffa2c04b1c1701449f25f36 100644 (file)
@@ -187,9 +187,10 @@ static void init_filter_param(AVFilterContext *ctx, FilterParam *fp, const char
 static int config_props(AVFilterLink *link)
 {
     UnsharpContext *unsharp = link->dst->priv;
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
 
-    unsharp->hsub = av_pix_fmt_descriptors[link->format].log2_chroma_w;
-    unsharp->vsub = av_pix_fmt_descriptors[link->format].log2_chroma_h;
+    unsharp->hsub = desc->log2_chroma_w;
+    unsharp->vsub = desc->log2_chroma_h;
 
     init_filter_param(link->dst, &unsharp->luma,   "luma",   link->w);
     init_filter_param(link->dst, &unsharp->chroma, "chroma", SHIFTUP(link->w, unsharp->hsub));
@@ -237,6 +238,26 @@ static int draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
     return 0;
 }
 
+static const AVFilterPad avfilter_vf_unsharp_inputs[] = {
+    {
+        .name         = "default",
+        .type         = AVMEDIA_TYPE_VIDEO,
+        .draw_slice   = draw_slice,
+        .end_frame    = end_frame,
+        .config_props = config_props,
+        .min_perms    = AV_PERM_READ,
+    },
+    { NULL }
+};
+
+static const AVFilterPad avfilter_vf_unsharp_outputs[] = {
+    {
+        .name = "default",
+        .type = AVMEDIA_TYPE_VIDEO,
+    },
+    { NULL }
+};
+
 AVFilter avfilter_vf_unsharp = {
     .name      = "unsharp",
     .description = NULL_IF_CONFIG_SMALL("Sharpen or blur the input video."),
@@ -247,15 +268,7 @@ AVFilter avfilter_vf_unsharp = {
     .uninit = uninit,
     .query_formats = query_formats,
 
-    .inputs    = (const AVFilterPad[]) {{ .name             = "default",
-                                          .type             = AVMEDIA_TYPE_VIDEO,
-                                          .draw_slice       = draw_slice,
-                                          .end_frame        = end_frame,
-                                          .config_props     = config_props,
-                                          .min_perms        = AV_PERM_READ, },
-                                        { .name = NULL}},
-
-    .outputs   = (const AVFilterPad[]) {{ .name             = "default",
-                                          .type             = AVMEDIA_TYPE_VIDEO, },
-                                        { .name = NULL}},
+    .inputs    = avfilter_vf_unsharp_inputs,
+
+    .outputs   = avfilter_vf_unsharp_outputs,
 };