FFmpeg
libavfilter
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 "
libavutil/pixdesc.h
"
25
#include "
framesync.h
"
26
#include "
avfilter.h
"
27
28
enum
interp_mode
{
29
INTERPOLATE_NEAREST
,
30
INTERPOLATE_TRILINEAR
,
31
INTERPOLATE_TETRAHEDRAL
,
32
INTERPOLATE_PYRAMID
,
33
INTERPOLATE_PRISM
,
34
NB_INTERP_MODE
35
};
36
37
struct
rgbvec
{
38
float
r
,
g
,
b
;
39
};
40
41
/* 3D LUT don't often go up to level 32, but it is common to have a Hald CLUT
42
* of 512x512 (64x64x64) */
43
#define MAX_LEVEL 256
44
#define PRELUT_SIZE 65536
45
46
typedef
struct
Lut3DPreLut
{
47
int
size
;
48
float
min
[3];
49
float
max
[3];
50
float
scale
[3];
51
float
*
lut
[3];
52
}
Lut3DPreLut
;
53
54
typedef
struct
LUT3DContext
{
55
const
AVClass
*
class
;
56
struct
rgbvec
*
lut
;
57
int
lutsize
;
58
int
lutsize2
;
59
struct
rgbvec
scale
;
60
int
interpolation
;
///<interp_mode
61
char
*
file
;
62
uint8_t
rgba_map
[4];
63
int
step
;
64
avfilter_action_func
*
interp
;
65
Lut3DPreLut
prelut
;
66
#if CONFIG_HALDCLUT_FILTER
67
uint8_t clut_rgba_map[4];
68
int
clut_step;
69
int
clut_bits;
70
int
clut_planar;
71
int
clut_float;
72
int
clut_width;
73
FFFrameSync
fs
;
74
#endif
75
}
LUT3DContext
;
76
77
typedef
struct
ThreadData
{
78
AVFrame
*
in
, *
out
;
79
}
ThreadData
;
80
81
void
ff_lut3d_init_x86
(
LUT3DContext
*
s
,
const
AVPixFmtDescriptor
*
desc
);
82
83
#endif
/* AVFILTER_LUT3D_H */
rgbvec
Definition:
lut3d.h:37
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:844
LUT3DContext::lutsize2
int lutsize2
Definition:
lut3d.h:58
LUT3DContext::scale
struct rgbvec scale
Definition:
lut3d.h:59
AVFrame
This structure describes decoded (raw) audio or video data.
Definition:
frame.h:317
pixdesc.h
FFFrameSync
Frame sync structure.
Definition:
framesync.h:146
ThreadData::out
AVFrame * out
Definition:
af_adeclick.c:473
LUT3DContext
Definition:
lut3d.h:54
INTERPOLATE_PYRAMID
@ INTERPOLATE_PYRAMID
Definition:
lut3d.h:32
Lut3DPreLut::lut
float * lut[3]
Definition:
lut3d.h:51
INTERPOLATE_NEAREST
@ INTERPOLATE_NEAREST
Definition:
lut3d.h:29
LUT3DContext::file
char * file
Definition:
lut3d.h:61
Lut3DPreLut::scale
float scale[3]
Definition:
lut3d.h:50
s
#define s(width, name)
Definition:
cbs_vp9.c:257
INTERPOLATE_PRISM
@ INTERPOLATE_PRISM
Definition:
lut3d.h:33
Lut3DPreLut::size
int size
Definition:
lut3d.h:47
AVClass
Describe the class of an AVClass context structure.
Definition:
log.h:66
rgbvec::r
float r
Definition:
lut3d.h:38
fs
#define fs(width, name, subs,...)
Definition:
cbs_vp9.c:259
Lut3DPreLut::min
float min[3]
Definition:
lut3d.h:48
NB_INTERP_MODE
@ NB_INTERP_MODE
Definition:
lut3d.h:34
LUT3DContext::interp
avfilter_action_func * interp
Definition:
lut3d.h:64
ThreadData
Used for passing data between threads.
Definition:
dsddec.c:67
INTERPOLATE_TETRAHEDRAL
@ INTERPOLATE_TETRAHEDRAL
Definition:
lut3d.h:31
Lut3DPreLut::max
float max[3]
Definition:
lut3d.h:49
Lut3DPreLut
Definition:
lut3d.h:46
rgbvec::g
float g
Definition:
lut3d.h:38
LUT3DContext::prelut
Lut3DPreLut prelut
Definition:
lut3d.h:65
framesync.h
rgbvec::b
float b
Definition:
lut3d.h:38
avfilter.h
LUT3DContext::step
int step
Definition:
lut3d.h:63
interp_mode
interp_mode
Definition:
lut3d.h:28
desc
const char * desc
Definition:
libsvtav1.c:79
ThreadData::in
AVFrame * in
Definition:
af_adecorrelate.c:154
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:30
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:57
LUT3DContext::lut
struct rgbvec * lut
Definition:
lut3d.h:56
LUT3DContext::interpolation
int interpolation
interp_mode
Definition:
lut3d.h:60
LUT3DContext::rgba_map
uint8_t rgba_map[4]
Definition:
lut3d.h:62
Generated on Wed Aug 24 2022 21:38:09 for FFmpeg by
1.8.17