]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_gradfun.c
lavfi: make formats API private on next bump.
[ffmpeg] / libavfilter / vf_gradfun.c
index 1cbf8d8c2a41b9b196c2934a0ce9ef8803036e5c..b61c06317c5d76b6c81862b02dae01b7a7d4ee8c 100644 (file)
@@ -2,20 +2,20 @@
  * Copyright (c) 2010 Nolan Lum <nol888@gmail.com>
  * Copyright (c) 2009 Loren Merritt <lorenm@u.washignton.edu>
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
  * Dither it back to 8bit.
  */
 
-#include "libavcore/imgutils.h"
+#include "libavutil/imgutils.h"
 #include "libavutil/cpu.h"
 #include "libavutil/pixdesc.h"
 #include "avfilter.h"
+#include "formats.h"
 #include "gradfun.h"
 
 DECLARE_ALIGNED(16, static const uint16_t, dither)[8][8] = {
@@ -120,7 +121,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
     GradFunContext *gf = ctx->priv;
     float thresh = 1.2;
     int radius = 16;
-    av_unused int cpu_flags = av_get_cpu_flags();
+    int cpu_flags = av_get_cpu_flags();
 
     if (args)
         sscanf(args, "%f:%d", &thresh, &radius);
@@ -160,7 +161,7 @@ static int query_formats(AVFilterContext *ctx)
         PIX_FMT_NONE
     };
 
-    avfilter_set_common_formats(ctx, avfilter_make_format_list(pix_fmts));
+    ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
 
     return 0;
 }
@@ -228,7 +229,8 @@ static void end_frame(AVFilterLink *inlink)
     avfilter_draw_slice(outlink, 0, inlink->h, 1);
     avfilter_end_frame(outlink);
     avfilter_unref_buffer(inpic);
-    avfilter_unref_buffer(outpic);
+    if (outpic != inpic)
+        avfilter_unref_buffer(outpic);
 }
 
 AVFilter avfilter_vf_gradfun = {