FFmpeg
|
3D Lookup table filter More...
#include "float.h"
#include "libavutil/opt.h"
#include "libavutil/file.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intfloat.h"
#include "libavutil/avassert.h"
#include "libavutil/pixdesc.h"
#include "libavutil/avstring.h"
#include "avfilter.h"
#include "drawutils.h"
#include "formats.h"
#include "framesync.h"
#include "internal.h"
#include "video.h"
Go to the source code of this file.
Data Structures | |
struct | rgbvec |
struct | Lut3DPreLut |
struct | LUT3DContext |
struct | ThreadData |
Used for passing data between threads. More... | |
Macros | |
#define | R 0 |
#define | G 1 |
#define | B 2 |
#define | A 3 |
#define | MAX_LEVEL 256 |
#define | PRELUT_SIZE 65536 |
#define | OFFSET(x) offsetof(LUT3DContext, x) |
#define | FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
#define | COMMON_OPTIONS |
#define | EXPONENT_MASK 0x7F800000 |
#define | MANTISSA_MASK 0x007FFFFF |
#define | SIGN_MASK 0x80000000 |
#define | NEAR(x) ((int)((x) + .5)) |
#define | PREV(x) ((int)(x)) |
#define | NEXT(x) (FFMIN((int)(x) + 1, lut3d->lutsize - 1)) |
#define | DEFINE_INTERP_FUNC_PLANAR(name, nbits, depth) |
#define | DEFINE_INTERP_FUNC_PLANAR_FLOAT(name, depth) |
#define | DEFINE_INTERP_FUNC(name, nbits) |
#define | MAX_LINE_SIZE 512 |
#define | NEXT_LINE(loop_cond) |
#define | NEXT_LINE_OR_GOTO(loop_cond, label) |
#define | SET_COLOR(id) |
#define | NEXT_FLOAT_OR_GOTO(value, label) |
#define | SET_FUNC(name) |
Enumerations | |
enum | interp_mode { INTERPOLATE_NEAREST, INTERPOLATE_TRILINEAR, INTERPOLATE_TETRAHEDRAL, NB_INTERP_MODE } |
Functions | |
static float | sanitizef (float f) |
static float | lerpf (float v0, float v1, float f) |
static struct rgbvec | lerp (const struct rgbvec *v0, const struct rgbvec *v1, float f) |
static struct rgbvec | interp_nearest (const LUT3DContext *lut3d, const struct rgbvec *s) |
Get the nearest defined point. More... | |
static struct rgbvec | interp_trilinear (const LUT3DContext *lut3d, const struct rgbvec *s) |
Interpolate using the 8 vertices of a cube. More... | |
static struct rgbvec | interp_tetrahedral (const LUT3DContext *lut3d, const struct rgbvec *s) |
Tetrahedral interpolation. More... | |
static float | prelut_interp_1d_linear (const Lut3DPreLut *prelut, int idx, const float s) |
static struct rgbvec | apply_prelut (const Lut3DPreLut *prelut, const struct rgbvec *s) |
static int | skip_line (const char *p) |
static char * | fget_next_word (char *dst, int max, FILE *f) |
static int | allocate_3dlut (AVFilterContext *ctx, int lutsize, int prelut) |
static int | parse_dat (AVFilterContext *ctx, FILE *f) |
static int | parse_cube (AVFilterContext *ctx, FILE *f) |
static int | parse_3dl (AVFilterContext *ctx, FILE *f) |
static int | parse_m3d (AVFilterContext *ctx, FILE *f) |
static int | nearest_sample_index (float *data, float x, int low, int hi) |
static int | parse_cinespace (AVFilterContext *ctx, FILE *f) |
static int | set_identity_matrix (AVFilterContext *ctx, int size) |
static int | query_formats (AVFilterContext *ctx) |
static int | config_input (AVFilterLink *inlink) |
static AVFrame * | apply_lut (AVFilterLink *inlink, AVFrame *in) |
static int | filter_frame (AVFilterLink *inlink, AVFrame *in) |
3D Lookup table filter
Definition in file vf_lut3d.c.
#define R 0 |
Definition at line 43 of file vf_lut3d.c.
#define G 1 |
Definition at line 44 of file vf_lut3d.c.
#define B 2 |
Definition at line 45 of file vf_lut3d.c.
#define A 3 |
Definition at line 46 of file vf_lut3d.c.
#define MAX_LEVEL 256 |
Definition at line 61 of file vf_lut3d.c.
Referenced by allocate_3dlut(), filter_frame(), and parse_m3d().
#define PRELUT_SIZE 65536 |
Definition at line 62 of file vf_lut3d.c.
Referenced by allocate_3dlut(), and parse_cinespace().
#define OFFSET | ( | x | ) | offsetof(LUT3DContext, x) |
Definition at line 99 of file vf_lut3d.c.
Referenced by filter_frame().
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
Definition at line 100 of file vf_lut3d.c.
Referenced by filter_frame().
#define COMMON_OPTIONS |
Definition at line 101 of file vf_lut3d.c.
Referenced by filter_frame().
#define EXPONENT_MASK 0x7F800000 |
Definition at line 108 of file vf_lut3d.c.
Referenced by sanitizef().
#define MANTISSA_MASK 0x007FFFFF |
Definition at line 109 of file vf_lut3d.c.
Referenced by sanitizef().
#define SIGN_MASK 0x80000000 |
Definition at line 110 of file vf_lut3d.c.
Referenced by sanitizef().
#define NEAR | ( | x | ) | ((int)((x) + .5)) |
Definition at line 145 of file vf_lut3d.c.
Referenced by filter_frame(), and interp_nearest().
#define PREV | ( | x | ) | ((int)(x)) |
Definition at line 146 of file vf_lut3d.c.
Referenced by filter_frame(), interp_tetrahedral(), interp_trilinear(), and prelut_interp_1d_linear().
Definition at line 147 of file vf_lut3d.c.
Referenced by interp_tetrahedral(), and interp_trilinear().
#define DEFINE_INTERP_FUNC_PLANAR | ( | name, | |
nbits, | |||
depth | |||
) |
Definition at line 275 of file vf_lut3d.c.
#define DEFINE_INTERP_FUNC_PLANAR_FLOAT | ( | name, | |
depth | |||
) |
Definition at line 361 of file vf_lut3d.c.
#define DEFINE_INTERP_FUNC | ( | name, | |
nbits | |||
) |
Definition at line 426 of file vf_lut3d.c.
#define MAX_LINE_SIZE 512 |
Definition at line 483 of file vf_lut3d.c.
Referenced by filter_frame(), parse_3dl(), parse_cinespace(), parse_cube(), parse_dat(), and parse_m3d().
#define NEXT_LINE | ( | loop_cond | ) |
Definition at line 526 of file vf_lut3d.c.
Referenced by filter_frame(), parse_3dl(), parse_cube(), parse_dat(), and parse_m3d().
#define NEXT_LINE_OR_GOTO | ( | loop_cond, | |
label | |||
) |
Definition at line 533 of file vf_lut3d.c.
Referenced by parse_cinespace().
#define SET_COLOR | ( | id | ) |
Referenced by parse_m3d().
#define NEXT_FLOAT_OR_GOTO | ( | value, | |
label | |||
) |
Definition at line 800 of file vf_lut3d.c.
Referenced by parse_cinespace().
#define SET_FUNC | ( | name | ) |
Referenced by config_input().
enum interp_mode |
Enumerator | |
---|---|
INTERPOLATE_NEAREST | |
INTERPOLATE_TRILINEAR | |
INTERPOLATE_TETRAHEDRAL | |
NB_INTERP_MODE |
Definition at line 48 of file vf_lut3d.c.
|
inlinestatic |
Definition at line 112 of file vf_lut3d.c.
Referenced by parse_cinespace().
|
inlinestatic |
Definition at line 132 of file vf_lut3d.c.
Referenced by filter_frame(), lerp(), parse_cinespace(), and prelut_interp_1d_linear().
Definition at line 137 of file vf_lut3d.c.
Referenced by interp_trilinear().
|
static |
Get the nearest defined point.
Definition at line 152 of file vf_lut3d.c.
|
static |
Interpolate using the 8 vertices of a cube.
Definition at line 162 of file vf_lut3d.c.
|
static |
Tetrahedral interpolation.
Based on code found in Truelight Software Library paper.
Definition at line 192 of file vf_lut3d.c.
|
inlinestatic |
Definition at line 247 of file vf_lut3d.c.
Referenced by apply_prelut().
|
static |
Definition at line 261 of file vf_lut3d.c.
|
static |
Definition at line 485 of file vf_lut3d.c.
Referenced by filter_frame(), parse_3dl(), parse_cinespace(), parse_cube(), and parse_dat().
|
static |
Definition at line 492 of file vf_lut3d.c.
|
static |
Definition at line 541 of file vf_lut3d.c.
Referenced by filter_frame(), parse_3dl(), parse_cinespace(), parse_cube(), parse_dat(), parse_m3d(), and set_identity_matrix().
|
static |
Definition at line 576 of file vf_lut3d.c.
Referenced by filter_frame().
|
static |
Definition at line 611 of file vf_lut3d.c.
Referenced by filter_frame().
|
static |
Definition at line 668 of file vf_lut3d.c.
Referenced by filter_frame().
|
static |
Definition at line 703 of file vf_lut3d.c.
Referenced by filter_frame().
Definition at line 772 of file vf_lut3d.c.
Referenced by parse_cinespace().
|
static |
Definition at line 810 of file vf_lut3d.c.
Referenced by filter_frame().
|
static |
Definition at line 1007 of file vf_lut3d.c.
Referenced by filter_frame().
|
static |
Definition at line 1032 of file vf_lut3d.c.
Referenced by filter_frame().
|
static |
Definition at line 1057 of file vf_lut3d.c.
Referenced by filter_frame().
|
static |
Definition at line 1096 of file vf_lut3d.c.
Referenced by filter_frame().
|
static |
Definition at line 1125 of file vf_lut3d.c.