FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vf_convolution.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  ConvolutionContext
 
struct  ThreadData
 

Macros

#define OFFSET(x)   offsetof(ConvolutionContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (convolution)
 
static int query_formats (AVFilterContext *ctx)
 
static void line_copy8 (uint8_t *line, const uint8_t *srcp, int width, int mergin)
 
static void line_copy16 (uint16_t *line, const uint16_t *srcp, int width, int mergin)
 
static int filter16_prewitt (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter16_roberts (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter16_sobel (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_prewitt (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_roberts (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_sobel (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter16_3x3 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter16_5x5 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_3x3 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_5x5 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption convolution_options []
 
static const int same3x3 [9]
 
static const int same5x5 [25]
 
static const AVFilterPad convolution_inputs []
 
static const AVFilterPad convolution_outputs []
 

Macro Definition Documentation

#define OFFSET (   x)    offsetof(ConvolutionContext, x)

Definition at line 58 of file vf_convolution.c.

Definition at line 59 of file vf_convolution.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( convolution  )
static int query_formats ( AVFilterContext ctx)
static

Definition at line 89 of file vf_convolution.c.

static void line_copy8 ( uint8_t line,
const uint8_t srcp,
int  width,
int  mergin 
)
inlinestatic
static void line_copy16 ( uint16_t *  line,
const uint16_t *  srcp,
int  width,
int  mergin 
)
inlinestatic
static int filter16_prewitt ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 144 of file vf_convolution.c.

Referenced by config_input().

static int filter16_roberts ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 201 of file vf_convolution.c.

Referenced by config_input().

static int filter16_sobel ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 250 of file vf_convolution.c.

Referenced by config_input().

static int filter_prewitt ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 307 of file vf_convolution.c.

Referenced by init().

static int filter_roberts ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 363 of file vf_convolution.c.

Referenced by init().

static int filter_sobel ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 411 of file vf_convolution.c.

Referenced by init().

static int filter16_3x3 ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 467 of file vf_convolution.c.

Referenced by config_input().

static int filter16_5x5 ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 522 of file vf_convolution.c.

Referenced by config_input().

static int filter_3x3 ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 588 of file vf_convolution.c.

Referenced by init().

static int filter_5x5 ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 642 of file vf_convolution.c.

Referenced by init().

static int config_input ( AVFilterLink inlink)
static

Definition at line 708 of file vf_convolution.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 764 of file vf_convolution.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 800 of file vf_convolution.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 862 of file vf_convolution.c.

Variable Documentation

const AVOption convolution_options[]
static
Initial value:
= {
{ "0m", "set matrix for 1st plane", OFFSET(matrix_str[0]), AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
{ "1m", "set matrix for 2nd plane", OFFSET(matrix_str[1]), AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
{ "2m", "set matrix for 3rd plane", OFFSET(matrix_str[2]), AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
{ "3m", "set matrix for 4th plane", OFFSET(matrix_str[3]), AV_OPT_TYPE_STRING, {.str="0 0 0 0 1 0 0 0 0"}, 0, 0, FLAGS },
{ "0rdiv", "set rdiv for 1st plane", OFFSET(rdiv[0]), AV_OPT_TYPE_FLOAT, {.dbl=1.0}, 0.0, INT_MAX, FLAGS},
{ "1rdiv", "set rdiv for 2nd plane", OFFSET(rdiv[1]), AV_OPT_TYPE_FLOAT, {.dbl=1.0}, 0.0, INT_MAX, FLAGS},
{ "2rdiv", "set rdiv for 3rd plane", OFFSET(rdiv[2]), AV_OPT_TYPE_FLOAT, {.dbl=1.0}, 0.0, INT_MAX, FLAGS},
{ "3rdiv", "set rdiv for 4th plane", OFFSET(rdiv[3]), AV_OPT_TYPE_FLOAT, {.dbl=1.0}, 0.0, INT_MAX, FLAGS},
{ "0bias", "set bias for 1st plane", OFFSET(bias[0]), AV_OPT_TYPE_FLOAT, {.dbl=0.0}, 0.0, INT_MAX, FLAGS},
{ "1bias", "set bias for 2nd plane", OFFSET(bias[1]), AV_OPT_TYPE_FLOAT, {.dbl=0.0}, 0.0, INT_MAX, FLAGS},
{ "2bias", "set bias for 3rd plane", OFFSET(bias[2]), AV_OPT_TYPE_FLOAT, {.dbl=0.0}, 0.0, INT_MAX, FLAGS},
{ "3bias", "set bias for 4th plane", OFFSET(bias[3]), AV_OPT_TYPE_FLOAT, {.dbl=0.0}, 0.0, INT_MAX, FLAGS},
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define FLAGS
#define OFFSET(x)

Definition at line 61 of file vf_convolution.c.

const int same3x3[9]
static
Initial value:
= {0, 0, 0,
0, 1, 0,
0, 0, 0}

Definition at line 79 of file vf_convolution.c.

Referenced by init().

const int same5x5[25]
static
Initial value:
= {0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0}

Definition at line 83 of file vf_convolution.c.

Referenced by init().

const AVFilterPad convolution_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
.filter_frame = filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static int config_input(AVFilterLink *inlink)

Definition at line 870 of file vf_convolution.c.

const AVFilterPad convolution_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 880 of file vf_convolution.c.