avfilter/ff_filter_frame_needs_framing: fix handling of AV_NOPTS_VALUE
[ffmpeg.git] / libavfilter / vf_unsharp.c
index c482d6b..240290c 100644 (file)
  * http://www.engin.umd.umich.edu/~jwvm/ece581/21_GBlur.pdf
  */
 
-#include <float.h> /* DBL_MAX */
-
 #include "avfilter.h"
 #include "formats.h"
 #include "internal.h"
 #include "video.h"
 #include "libavutil/common.h"
+#include "libavutil/imgutils.h"
 #include "libavutil/mem.h"
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
@@ -66,11 +65,7 @@ static void apply_unsharp(      uint8_t *dst, int dst_stride,
     const int32_t halfscale = fp->halfscale;
 
     if (!amount) {
-        if (dst_stride == src_stride)
-            memcpy(dst, src, src_stride * height);
-        else
-            for (y = 0; y < height; y++, dst += dst_stride, src += src_stride)
-                memcpy(dst, src, width);
+        av_image_copy_plane(dst, dst_stride, src, src_stride, width, height);
         return;
     }
 
@@ -280,7 +275,7 @@ static const AVOption unsharp_options[] = {
     { "chroma_amount",  "set chroma effect strength",        OFFSET(camount),  AV_OPT_TYPE_FLOAT, { .dbl = 0 },       -2,        5, FLAGS },
     { "ca",             "set chroma effect strength",        OFFSET(camount),  AV_OPT_TYPE_FLOAT, { .dbl = 0 },       -2,        5, FLAGS },
     { "opencl",         "use OpenCL filtering capabilities", OFFSET(opencl), AV_OPT_TYPE_INT, { .i64 = 0 },        0,        1, FLAGS },
-    { NULL },
+    { NULL }
 };
 
 AVFILTER_DEFINE_CLASS(unsharp);
@@ -304,17 +299,14 @@ static const AVFilterPad avfilter_vf_unsharp_outputs[] = {
 };
 
 AVFilter avfilter_vf_unsharp = {
-    .name      = "unsharp",
-    .description = NULL_IF_CONFIG_SMALL("Sharpen or blur the input video."),
-
-    .priv_size = sizeof(UnsharpContext),
-    .priv_class = &unsharp_class,
-
-    .init = init,
-    .uninit = uninit,
+    .name          = "unsharp",
+    .description   = NULL_IF_CONFIG_SMALL("Sharpen or blur the input video."),
+    .priv_size     = sizeof(UnsharpContext),
+    .priv_class    = &unsharp_class,
+    .init          = init,
+    .uninit        = uninit,
     .query_formats = query_formats,
-
-    .inputs    = avfilter_vf_unsharp_inputs,
-    .outputs   = avfilter_vf_unsharp_outputs,
-    .flags     = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
+    .inputs        = avfilter_vf_unsharp_inputs,
+    .outputs       = avfilter_vf_unsharp_outputs,
+    .flags         = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
 };