FFmpeg
lut3d.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Clément Bœsch
3  * Copyright (c) 2018 Paul B Mahol
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 #ifndef AVFILTER_LUT3D_H
22 #define AVFILTER_LUT3D_H
23 
24 #include "config_components.h"
25 
26 #include "libavutil/pixdesc.h"
27 #include "framesync.h"
28 #include "avfilter.h"
29 
37 };
38 
39 struct rgbvec {
40  float r, g, b;
41 };
42 
43 /* 3D LUT don't often go up to level 32, but it is common to have a Hald CLUT
44  * of 512x512 (64x64x64) */
45 #define MAX_LEVEL 256
46 #define PRELUT_SIZE 65536
47 
48 typedef struct Lut3DPreLut {
49  int size;
50  float min[3];
51  float max[3];
52  float scale[3];
53  float* lut[3];
54 } Lut3DPreLut;
55 
56 typedef struct LUT3DContext {
57  const AVClass *class;
58  struct rgbvec *lut;
59  int lutsize;
60  int lutsize2;
61  struct rgbvec scale;
62  int interpolation; ///<interp_mode
63  char *file;
64  uint8_t rgba_map[4];
65  int step;
68 #if CONFIG_HALDCLUT_FILTER
69  int clut;
70  int got_clut;
71  uint8_t clut_rgba_map[4];
72  int clut_step;
73  int clut_bits;
74  int clut_planar;
75  int clut_float;
76  int clut_width;
78 #endif
79 } LUT3DContext;
80 
81 typedef struct ThreadData {
82  AVFrame *in, *out;
83 } ThreadData;
84 
86 
87 #endif /* AVFILTER_LUT3D_H */
rgbvec
Definition: lut3d.h:39
avfilter_action_func
int() avfilter_action_func(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
A function pointer passed to the AVFilterGraph::execute callback to be executed multiple times,...
Definition: avfilter.h:796
LUT3DContext::lutsize2
int lutsize2
Definition: lut3d.h:60
LUT3DContext::scale
struct rgbvec scale
Definition: lut3d.h:61
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:344
pixdesc.h
FFFrameSync
Frame sync structure.
Definition: framesync.h:168
ThreadData::out
AVFrame * out
Definition: af_adeclick.c:526
ThreadData::in
AVFrame * in
Definition: af_adecorrelate.c:153
LUT3DContext
Definition: lut3d.h:56
INTERPOLATE_PYRAMID
@ INTERPOLATE_PYRAMID
Definition: lut3d.h:34
Lut3DPreLut::lut
float * lut[3]
Definition: lut3d.h:53
INTERPOLATE_NEAREST
@ INTERPOLATE_NEAREST
Definition: lut3d.h:31
LUT3DContext::file
char * file
Definition: lut3d.h:63
Lut3DPreLut::scale
float scale[3]
Definition: lut3d.h:52
s
#define s(width, name)
Definition: cbs_vp9.c:198
INTERPOLATE_PRISM
@ INTERPOLATE_PRISM
Definition: lut3d.h:35
Lut3DPreLut::size
int size
Definition: lut3d.h:49
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
rgbvec::r
float r
Definition: lut3d.h:40
fs
#define fs(width, name, subs,...)
Definition: cbs_vp9.c:200
Lut3DPreLut::min
float min[3]
Definition: lut3d.h:50
NB_INTERP_MODE
@ NB_INTERP_MODE
Definition: lut3d.h:36
LUT3DContext::interp
avfilter_action_func * interp
Definition: lut3d.h:66
ThreadData
Used for passing data between threads.
Definition: dsddec.c:69
INTERPOLATE_TETRAHEDRAL
@ INTERPOLATE_TETRAHEDRAL
Definition: lut3d.h:33
Lut3DPreLut::max
float max[3]
Definition: lut3d.h:51
Lut3DPreLut
Definition: lut3d.h:48
rgbvec::g
float g
Definition: lut3d.h:40
LUT3DContext::prelut
Lut3DPreLut prelut
Definition: lut3d.h:67
framesync.h
rgbvec::b
float b
Definition: lut3d.h:40
avfilter.h
LUT3DContext::step
int step
Definition: lut3d.h:65
interp_mode
interp_mode
Definition: lut3d.h:30
desc
const char * desc
Definition: libsvtav1.c:75
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:69
INTERPOLATE_TRILINEAR
@ INTERPOLATE_TRILINEAR
Definition: lut3d.h:32
ff_lut3d_init_x86
void ff_lut3d_init_x86(LUT3DContext *s, const AVPixFmtDescriptor *desc)
Definition: vf_lut3d_init.c:58
LUT3DContext::lutsize
int lutsize
Definition: lut3d.h:59
LUT3DContext::lut
struct rgbvec * lut
Definition: lut3d.h:58
LUT3DContext::interpolation
int interpolation
interp_mode
Definition: lut3d.h:62
LUT3DContext::rgba_map
uint8_t rgba_map[4]
Definition: lut3d.h:64