FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
vf_lensfun.c File Reference

Lensfun filter, applies lens correction with parameters from the lensfun database. More...

#include <float.h>
#include <math.h>
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libswscale/swscale.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include <lensfun.h>

Go to the source code of this file.

Data Structures

struct  VignettingThreadData
 
struct  DistortionCorrectionThreadData
 
struct  LensfunContext
 

Macros

#define LANCZOS_RESOLUTION   256
 
#define OFFSET(x)   offsetof(LensfunContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Enumerations

enum  Mode {
  MODE_4k75 = 0, MODE_5k15, MODE_5k9, MODE_6k7,
  MODE_7k4, MODE_7k95, MODE_10k2, MODE_12k2,
  MODE_DTX, N_MODES, NO_DATA = 15, MODE_6k60 = 0,
  MODE_8k85, MODE_12k65, MODE_14k25, MODE_15k85,
  MODE_18k25, MODE_19k85, MODE_23k05, MODE_23k85,
  MODE_SID, SP_LOST = 14, NO_DATA, VIGNETTING = 0x1,
  GEOMETRY_DISTORTION = 0x2, SUBPIXEL_DISTORTION = 0x4
}
 
enum  InterpolationType { NEAREST, LINEAR, LANCZOS }
 

Functions

 AVFILTER_DEFINE_CLASS (lensfun)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static float lanczos_kernel (float x)
 
static int config_props (AVFilterLink *inlink)
 
static int vignetting_filter_slice (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static float square (float x)
 
static int distortion_correction_filter_slice (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption lensfun_options []
 
static const AVFilterPad lensfun_inputs []
 
static const AVFilterPad lensfun_outputs []
 
AVFilter ff_vf_lensfun
 

Detailed Description

Lensfun filter, applies lens correction with parameters from the lensfun database.

See Also
https://lensfun.sourceforge.net/

Definition in file vf_lensfun.c.

Macro Definition Documentation

#define LANCZOS_RESOLUTION   256

Definition at line 42 of file vf_lensfun.c.

Referenced by config_props(), and distortion_correction_filter_slice().

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

Definition at line 94 of file vf_lensfun.c.

Definition at line 95 of file vf_lensfun.c.

Enumeration Type Documentation

enum Mode
Enumerator
MODE_4k75 

4.75 kbit/s

MODE_5k15 

5.15 kbit/s

MODE_5k9 

5.90 kbit/s

MODE_6k7 

6.70 kbit/s

MODE_7k4 

7.40 kbit/s

MODE_7k95 

7.95 kbit/s

MODE_10k2 

10.2 kbit/s

MODE_12k2 

12.2 kbit/s

MODE_DTX 

silent frame

N_MODES 

number of modes

NO_DATA 

no transmission

MODE_6k60 

6.60 kbit/s

MODE_8k85 

8.85 kbit/s

MODE_12k65 

12.65 kbit/s

MODE_14k25 

14.25 kbit/s

MODE_15k85 

15.85 kbit/s

MODE_18k25 

18.25 kbit/s

MODE_19k85 

19.85 kbit/s

MODE_23k05 

23.05 kbit/s

MODE_23k85 

23.85 kbit/s

MODE_SID 

comfort noise frame

SP_LOST 

speech lost

NO_DATA 

no transmission

VIGNETTING 
GEOMETRY_DISTORTION 
SUBPIXEL_DISTORTION 

Definition at line 44 of file vf_lensfun.c.

Enumerator
NEAREST 
LINEAR 
LANCZOS 

Definition at line 50 of file vf_lensfun.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( lensfun  )
static av_cold int init ( AVFilterContext ctx)
static

Definition at line 130 of file vf_lensfun.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 186 of file vf_lensfun.c.

static float lanczos_kernel ( float  x)
static

Definition at line 194 of file vf_lensfun.c.

Referenced by config_props().

static int config_props ( AVFilterLink inlink)
static

Definition at line 205 of file vf_lensfun.c.

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

Definition at line 289 of file vf_lensfun.c.

Referenced by filter_frame().

static float square ( float  x)
static

Definition at line 307 of file vf_lensfun.c.

Referenced by distortion_correction_filter_slice().

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

Definition at line 312 of file vf_lensfun.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 441 of file vf_lensfun.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 503 of file vf_lensfun.c.

Variable Documentation

const AVOption lensfun_options[]
static

Definition at line 96 of file vf_lensfun.c.

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

Definition at line 517 of file vf_lensfun.c.

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

Definition at line 527 of file vf_lensfun.c.

AVFilter ff_vf_lensfun
Initial value:
= {
.name = "lensfun",
.description = NULL_IF_CONFIG_SMALL("Apply correction to an image based on info derived from the lensfun database."),
.priv_size = sizeof(LensfunContext),
.init = init,
.priv_class = &lensfun_class,
}
static const AVFilterPad lensfun_outputs[]
Definition: vf_lensfun.c:527
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:125
static int query_formats(AVFilterContext *ctx)
Definition: vf_lensfun.c:186
static av_cold int init(AVFilterContext *ctx)
Definition: vf_lensfun.c:130
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_lensfun.c:503
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static const AVFilterPad lensfun_inputs[]
Definition: vf_lensfun.c:517
#define flags(name, subs,...)
Definition: cbs_av1.c:596

Definition at line 535 of file vf_lensfun.c.