FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_lensfun.c File Reference
#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

◆ LANCZOS_RESOLUTION

#define LANCZOS_RESOLUTION   256

Definition at line 42 of file vf_lensfun.c.

◆ OFFSET

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

Definition at line 95 of file vf_lensfun.c.

◆ FLAGS

Definition at line 96 of file vf_lensfun.c.

Enumeration Type Documentation

◆ Mode

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.

◆ InterpolationType

Enumerator
NEAREST 
LINEAR 
LANCZOS 

Definition at line 50 of file vf_lensfun.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( lensfun  )

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 132 of file vf_lensfun.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 188 of file vf_lensfun.c.

◆ lanczos_kernel()

static float lanczos_kernel ( float  x)
static

Definition at line 196 of file vf_lensfun.c.

Referenced by config_props().

◆ config_props()

static int config_props ( AVFilterLink inlink)
static

Definition at line 207 of file vf_lensfun.c.

◆ vignetting_filter_slice()

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

Definition at line 291 of file vf_lensfun.c.

Referenced by filter_frame().

◆ square()

static float square ( float  x)
static

Definition at line 309 of file vf_lensfun.c.

Referenced by distortion_correction_filter_slice().

◆ distortion_correction_filter_slice()

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

Definition at line 314 of file vf_lensfun.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 443 of file vf_lensfun.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 505 of file vf_lensfun.c.

Variable Documentation

◆ lensfun_options

const AVOption lensfun_options[]
static

Definition at line 97 of file vf_lensfun.c.

◆ lensfun_inputs

const AVFilterPad lensfun_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_props,
.filter_frame = filter_frame,
},
{ NULL }
}

Definition at line 519 of file vf_lensfun.c.

◆ lensfun_outputs

const AVFilterPad lensfun_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}

Definition at line 529 of file vf_lensfun.c.

◆ ff_vf_lensfun

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,
}

Definition at line 537 of file vf_lensfun.c.

LensfunContext
Definition: vf_lensfun.c:75
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_lensfun.c:505
lensfun_inputs
static const AVFilterPad lensfun_inputs[]
Definition: vf_lensfun.c:519
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
lensfun_outputs
static const AVFilterPad lensfun_outputs[]
Definition: vf_lensfun.c:529
NULL
#define NULL
Definition: coverity.c:32
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_lensfun.c:443
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
config_props
static int config_props(AVFilterLink *inlink)
Definition: vf_lensfun.c:207
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#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
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_lensfun.c:188
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_lensfun.c:132