FFmpeg
Loading...
Searching...
No Matches
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
38
39struct 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
48typedef struct Lut3DPreLut {
49 int size;
50 float min[3];
51 float max[3];
52 float scale[3];
53 float* lut[3];
55
56typedef struct LUT3DContext {
57 const AVClass *class;
58 struct rgbvec *lut;
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
80
81typedef struct ThreadData {
82 AVFrame *in, *out;
84
86
87#endif /* AVFILTER_LUT3D_H */
static FILE * out
Main libavfilter public API header.
#define s(width, name)
Definition cbs_vp9.c:198
#define fs(width, name, subs,...)
Definition cbs_vp9.c:200
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:544
interp_mode
Definition lut3d.h:30
@ INTERPOLATE_TRILINEAR
Definition lut3d.h:32
@ INTERPOLATE_PYRAMID
Definition lut3d.h:34
@ NB_INTERP_MODE
Definition lut3d.h:36
@ INTERPOLATE_TETRAHEDRAL
Definition lut3d.h:33
@ INTERPOLATE_PRISM
Definition lut3d.h:35
@ INTERPOLATE_NEAREST
Definition lut3d.h:31
void ff_lut3d_init_x86(LUT3DContext *s, const AVPixFmtDescriptor *desc)
const char * desc
Definition libsvtav1.c:83
Describe the class of an AVClass context structure.
Definition log.h:76
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition pixdesc.h:69
Frame sync structure.
Definition framesync.h:168
char * file
Definition lut3d.h:63
struct rgbvec * lut
Definition lut3d.h:58
int interpolation
interp_mode
Definition lut3d.h:62
int step
Definition lut3d.h:65
int lutsize
Definition lut3d.h:59
uint8_t rgba_map[4]
Definition lut3d.h:64
int lutsize2
Definition lut3d.h:60
avfilter_action_func * interp
Definition lut3d.h:66
Lut3DPreLut prelut
Definition lut3d.h:67
struct rgbvec scale
Definition lut3d.h:61
int size
Definition lut3d.h:49
float min[3]
Definition lut3d.h:50
float scale[3]
Definition lut3d.h:52
float * lut[3]
Definition lut3d.h:53
float max[3]
Definition lut3d.h:51
Used for passing data between threads.
Definition dsddec.c:71
Definition lut3d.h:39
float r
Definition lut3d.h:40
float b
Definition lut3d.h:40
float g
Definition lut3d.h:40