libavfilter/vf_gradfun.c File Reference

gradfun debanding filter, ported from MPlayer libmpcodecs/vf_gradfun.c More...

#include "libavutil/imgutils.h"
#include "libavutil/cpu.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "gradfun.h"

Go to the source code of this file.

Functions

void ff_gradfun_filter_line_c (uint8_t *dst, const uint8_t *src, const uint16_t *dc, int width, int thresh, const uint16_t *dithers)
void ff_gradfun_blur_line_c (uint16_t *dc, uint16_t *buf, const uint16_t *buf1, const uint8_t *src, int src_linesize, int width)
static void filter (GradFunContext *ctx, uint8_t *dst, const uint8_t *src, int width, int height, int dst_linesize, int src_linesize, int r)
static av_cold int init (AVFilterContext *ctx, const char *args, void *opaque)
static av_cold void uninit (AVFilterContext *ctx)
static int query_formats (AVFilterContext *ctx)
static int config_input (AVFilterLink *inlink)
static void start_frame (AVFilterLink *inlink, AVFilterBufferRef *inpicref)
static void null_draw_slice (AVFilterLink *link, int y, int h, int slice_dir)
static void end_frame (AVFilterLink *inlink)

Variables

static const uint16_t dither [8][8]
AVFilter avfilter_vf_gradfun


Detailed Description

gradfun debanding filter, ported from MPlayer libmpcodecs/vf_gradfun.c

Apply a boxblur debanding algorithm (based on the gradfun2db Avisynth filter by prunedtree). Foreach pixel, if it's within threshold of the blurred value, make it closer. So now we have a smoothed and higher bitdepth version of all the shallow gradients, while leaving detailed areas untouched. Dither it back to 8bit.

Definition in file vf_gradfun.c.


Function Documentation

static int config_input ( AVFilterLink inlink  )  [static]

Definition at line 168 of file vf_gradfun.c.

static void end_frame ( AVFilterLink inlink  )  [static]

Definition at line 204 of file vf_gradfun.c.

void ff_gradfun_blur_line_c ( uint16_t *  dc,
uint16_t *  buf,
const uint16_t *  buf1,
const uint8_t *  src,
int  src_linesize,
int  width 
)

Definition at line 66 of file vf_gradfun.c.

Referenced by init().

void ff_gradfun_filter_line_c ( uint8_t *  dst,
const uint8_t *  src,
const uint16_t *  dc,
int  width,
int  thresh,
const uint16_t *  dithers 
)

Definition at line 52 of file vf_gradfun.c.

Referenced by ff_gradfun_filter_line_mmx2(), ff_gradfun_filter_line_ssse3(), and init().

static void filter ( GradFunContext ctx,
uint8_t *  dst,
const uint8_t *  src,
int  width,
int  height,
int  dst_linesize,
int  src_linesize,
int  r 
) [static]

Definition at line 77 of file vf_gradfun.c.

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

Definition at line 118 of file vf_gradfun.c.

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

Definition at line 202 of file vf_gradfun.c.

static int query_formats ( AVFilterContext ctx  )  [static]

Definition at line 153 of file vf_gradfun.c.

static void start_frame ( AVFilterLink inlink,
AVFilterBufferRef inpicref 
) [static]

Definition at line 185 of file vf_gradfun.c.

static av_cold void uninit ( AVFilterContext ctx  )  [static]

Definition at line 147 of file vf_gradfun.c.


Variable Documentation

Initial value:

 {
    .name          = "gradfun",
    .description   = NULL_IF_CONFIG_SMALL("Debands video quickly using gradients."),
    .priv_size     = sizeof(GradFunContext),
    .init          = init,
    .uninit        = uninit,
    .query_formats = query_formats,

    .inputs    = (const AVFilterPad[]) {{ .name       = "default",
                                    .type             = AVMEDIA_TYPE_VIDEO,
                                    .config_props     = config_input,
                                    .start_frame      = start_frame,
                                    .draw_slice       = null_draw_slice,
                                    .end_frame        = end_frame,
                                    .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_gradfun.c.

const uint16_t dither[8][8] [static]

Initial value:

 {
    {0x00,0x60,0x18,0x78,0x06,0x66,0x1E,0x7E},
    {0x40,0x20,0x58,0x38,0x46,0x26,0x5E,0x3E},
    {0x10,0x70,0x08,0x68,0x16,0x76,0x0E,0x6E},
    {0x50,0x30,0x48,0x28,0x56,0x36,0x4E,0x2E},
    {0x04,0x64,0x1C,0x7C,0x02,0x62,0x1A,0x7A},
    {0x44,0x24,0x5C,0x3C,0x42,0x22,0x5A,0x3A},
    {0x14,0x74,0x0C,0x6C,0x12,0x72,0x0A,0x6A},
    {0x54,0x34,0x4C,0x2C,0x52,0x32,0x4A,0x2A},
}

Definition at line 41 of file vf_gradfun.c.


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