FFmpeg
|
gradfun debanding filter, ported from MPlayer libmpcodecs/vf_gradfun.c More...
#include "libavutil/imgutils.h"
#include "libavutil/common.h"
#include "libavutil/cpu.h"
#include "libavutil/pixdesc.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "gradfun.h"
#include "internal.h"
#include "video.h"
Go to the source code of this file.
Macros | |
#define | OFFSET(x) offsetof(GradFunContext, x) |
#define | F AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM |
Functions | |
AVFILTER_DEFINE_CLASS (gradfun) | |
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) |
static av_cold void | uninit (AVFilterContext *ctx) |
static int | query_formats (AVFilterContext *ctx) |
static int | config_input (AVFilterLink *inlink) |
static int | filter_frame (AVFilterLink *inlink, AVFilterBufferRef *in) |
Variables | |
static const AVOption | gradfun_options [] |
static const uint16_t | dither [8][8] |
static const AVFilterPad | avfilter_vf_gradfun_inputs [] |
static const AVFilterPad | avfilter_vf_gradfun_outputs [] |
AVFilter | avfilter_vf_gradfun |
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.
#define OFFSET | ( | x | ) | offsetof(GradFunContext, x) |
Definition at line 46 of file vf_gradfun.c.
Definition at line 47 of file vf_gradfun.c.
AVFILTER_DEFINE_CLASS | ( | gradfun | ) |
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 68 of file vf_gradfun.c.
Referenced by init().
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 82 of file vf_gradfun.c.
Referenced by init().
|
static |
Definition at line 93 of file vf_gradfun.c.
Referenced by filter_frame().
|
static |
Definition at line 134 of file vf_gradfun.c.
|
static |
Definition at line 160 of file vf_gradfun.c.
|
static |
Definition at line 166 of file vf_gradfun.c.
|
static |
Definition at line 182 of file vf_gradfun.c.
|
static |
Definition at line 200 of file vf_gradfun.c.
|
static |
Definition at line 49 of file vf_gradfun.c.
|
static |
Definition at line 57 of file vf_gradfun.c.
Referenced by filter().
|
static |
Definition at line 241 of file vf_gradfun.c.
|
static |
Definition at line 252 of file vf_gradfun.c.
AVFilter avfilter_vf_gradfun |
Definition at line 260 of file vf_gradfun.c.