libavfilter/vf_unsharp.c File Reference

blur / sharpen filter, ported to FFmpeg from MPlayer libmpcodecs/unsharp.c. More...

#include "avfilter.h"
#include "libavutil/common.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"

Go to the source code of this file.

Data Structures

struct  FilterParam
struct  UnsharpContext

Defines

#define MIN_SIZE   3
#define MAX_SIZE   13
#define SHIFTUP(x, shift)   (-((-(x))>>(shift)))

Functions

static void apply_unsharp (uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int width, int height, FilterParam *fp)
static void set_filter_param (FilterParam *fp, int msize_x, int msize_y, double amount)
static av_cold int init (AVFilterContext *ctx, const char *args, void *opaque)
static int query_formats (AVFilterContext *ctx)
static void init_filter_param (AVFilterContext *ctx, FilterParam *fp, const char *effect_type, int width)
static int config_props (AVFilterLink *link)
static void free_filter_param (FilterParam *fp)
static av_cold void uninit (AVFilterContext *ctx)
static void end_frame (AVFilterLink *link)
static void draw_slice (AVFilterLink *link, int y, int h, int slice_dir)

Variables

AVFilter avfilter_vf_unsharp


Detailed Description

blur / sharpen filter, ported to FFmpeg from MPlayer libmpcodecs/unsharp.c.

This code is based on:

An Efficient algorithm for Gaussian blur using finite-state machines Frederick M. Waltz and John W. V. Miller

SPIE Conf. on Machine Vision Systems for Inspection and Metrology VII Originally published Boston, Nov 98

http://www.engin.umd.umich.edu/~jwvm/ece581/21_GBlur.pdf

Definition in file vf_unsharp.c.


Define Documentation

#define MAX_SIZE   13

Definition at line 45 of file vf_unsharp.c.

Referenced by aiff_read_packet(), apply_unsharp(), mmf_read_packet(), and sol_read_packet().

#define MIN_SIZE   3

Definition at line 44 of file vf_unsharp.c.

#define SHIFTUP ( x,
shift   )     (-((-(x))>>(shift)))

Definition at line 48 of file vf_unsharp.c.

Referenced by config_props(), and end_frame().


Function Documentation

static void apply_unsharp ( uint8_t *  dst,
int  dst_stride,
const uint8_t *  src,
int  src_stride,
int  width,
int  height,
FilterParam fp 
) [static]

Definition at line 67 of file vf_unsharp.c.

Referenced by end_frame().

static int config_props ( AVFilterLink link  )  [static]

Definition at line 184 of file vf_unsharp.c.

static void draw_slice ( AVFilterLink link,
int  y,
int  h,
int  slice_dir 
) [static]

Definition at line 231 of file vf_unsharp.c.

static void end_frame ( AVFilterLink link  )  [static]

Definition at line 213 of file vf_unsharp.c.

static void free_filter_param ( FilterParam fp  )  [static]

Definition at line 197 of file vf_unsharp.c.

Referenced by uninit().

static av_cold int init ( AVFilterContext ctx,
const char *  args,
void *  opaque 
) [static]

Definition at line 132 of file vf_unsharp.c.

static void init_filter_param ( AVFilterContext ctx,
FilterParam fp,
const char *  effect_type,
int  width 
) [static]

Definition at line 170 of file vf_unsharp.c.

Referenced by config_props().

static int query_formats ( AVFilterContext ctx  )  [static]

Definition at line 157 of file vf_unsharp.c.

static void set_filter_param ( FilterParam fp,
int  msize_x,
int  msize_y,
double  amount 
) [static]

Definition at line 120 of file vf_unsharp.c.

Referenced by init().

static av_cold void uninit ( AVFilterContext ctx  )  [static]

Definition at line 205 of file vf_unsharp.c.


Variable Documentation

Initial value:

 {
    .name      = "unsharp",
    .description = NULL_IF_CONFIG_SMALL("Sharpen or blur the input video."),

    .priv_size = sizeof(UnsharpContext),

    .init = init,
    .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}},
}

Definition at line 235 of file vf_unsharp.c.


Generated on Fri Oct 26 02:46:12 2012 for FFmpeg by  doxygen 1.5.8