|
FFmpeg
|
#include <assert.h>#include <string.h>#include "libavutil/attributes.h"#include "libavutil/avassert.h"#include "libavutil/mem.h"#include "cms.h"#include "csputils.h"#include "lut3d.h"Go to the source code of this file.
Functions | |
| SwsLut3D * | ff_sws_lut3d_alloc (void) |
| void | ff_sws_lut3d_free (SwsLut3D **plut3d) |
| bool | ff_sws_lut3d_test_fmt (enum AVPixelFormat fmt, int output) |
| Test to see if a given format is supported by the 3DLUT input/output code. More... | |
| enum AVPixelFormat | ff_sws_lut3d_pick_pixfmt (SwsFormat fmt, int output) |
| Pick the best compatible pixfmt for a given SwsFormat. More... | |
| static av_always_inline v3u16_t | barycentric (int shift, int x, int y, int z, v3u16_t v0, v3u16_t v1, v3u16_t v2, v3u16_t v3) |
| v0 and v1 are 'black' and 'white' v2 and v3 are closest RGB/CMY vertices x >= y >= z are relative weights More... | |
| static av_always_inline v3u16_t | tetrahedral (const SwsLut3D *lut3d, int Rx, int Gx, int Bx, int Rf, int Gf, int Bf) |
| static av_always_inline v3u16_t | lookup_input16 (const SwsLut3D *lut3d, v3u16_t rgb) |
| static av_always_inline v2u16_t | lerp2u16 (v2u16_t a, v2u16_t b, int x, int shift) |
| Note: These functions are scaled such that x == (1 << shift) corresponds to a value of 1.0. More... | |
| static av_always_inline v3u16_t | lerp3u16 (v3u16_t a, v3u16_t b, int x, int shift) |
| static av_always_inline v3u16_t | lookup_output (const SwsLut3D *lut3d, v3u16_t ipt) |
| static av_always_inline v3u16_t | apply_tone_map (const SwsLut3D *lut3d, v3u16_t ipt) |
| int | ff_sws_lut3d_generate (SwsLut3D *lut3d, enum AVPixelFormat fmt_in, enum AVPixelFormat fmt_out, const SwsColorMap *map) |
| Recalculate the (static) 3DLUT state with new settings. More... | |
| void | ff_sws_lut3d_update (SwsLut3D *lut3d, const SwsColor *new_src) |
| Update the tone mapping state. More... | |
| void | ff_sws_lut3d_apply (const SwsLut3D *lut3d, const uint8_t *in, int in_stride, uint8_t *out, int out_stride, int w, int h) |
| Applies a color transformation to a plane. More... | |
| SwsLut3D* ff_sws_lut3d_alloc | ( | void | ) |
Definition at line 32 of file lut3d.c.
Referenced by adapt_colors().
| void ff_sws_lut3d_free | ( | SwsLut3D ** | plut3d | ) |
Definition at line 42 of file lut3d.c.
Referenced by adapt_colors(), and free_lut3d().
| bool ff_sws_lut3d_test_fmt | ( | enum AVPixelFormat | fmt, |
| int | output | ||
| ) |
Test to see if a given format is supported by the 3DLUT input/output code.
Definition at line 47 of file lut3d.c.
Referenced by ff_sws_lut3d_generate().
| enum AVPixelFormat ff_sws_lut3d_pick_pixfmt | ( | SwsFormat | fmt, |
| int | output | ||
| ) |
Pick the best compatible pixfmt for a given SwsFormat.
Definition at line 52 of file lut3d.c.
Referenced by adapt_colors().
|
static |
v0 and v1 are 'black' and 'white' v2 and v3 are closest RGB/CMY vertices x >= y >= z are relative weights
Definition at line 63 of file lut3d.c.
Referenced by tetrahedral().
|
static |
Definition at line 81 of file lut3d.c.
Referenced by lookup_input16().
|
static |
Definition at line 122 of file lut3d.c.
Referenced by ff_sws_lut3d_apply().
|
static |
Note: These functions are scaled such that x == (1 << shift) corresponds to a value of 1.0.
This makes them suitable for use when interpolation LUT entries with a fractional part that is just masked away from the index, since a fractional coordinate of e.g. 0xFFFF corresponds to a mix weight of just slightly less than 1.0.
Definition at line 141 of file lut3d.c.
Referenced by apply_tone_map().
|
static |
Definition at line 150 of file lut3d.c.
Referenced by lookup_output().
|
static |
Definition at line 160 of file lut3d.c.
Referenced by ff_sws_lut3d_apply().
|
static |
Definition at line 193 of file lut3d.c.
Referenced by ff_sws_lut3d_apply().
| int ff_sws_lut3d_generate | ( | SwsLut3D * | lut3d, |
| enum AVPixelFormat | fmt_in, | ||
| enum AVPixelFormat | fmt_out, | ||
| const SwsColorMap * | map | ||
| ) |
Recalculate the (static) 3DLUT state with new settings.
This will recompute everything. To only update per-frame tone mapping state, instead call ff_sws_lut3d_update().
Returns 0 or a negative error code.
Definition at line 211 of file lut3d.c.
Referenced by adapt_colors().
Update the tone mapping state.
This will only use per-frame metadata. The static metadata is ignored.
Definition at line 239 of file lut3d.c.
Referenced by ff_sws_lut3d_generate(), and setup_lut3d().
| void ff_sws_lut3d_apply | ( | const SwsLut3D * | lut3d, |
| const uint8_t * | in, | ||
| int | in_stride, | ||
| uint8_t * | out, | ||
| int | out_stride, | ||
| int | w, | ||
| int | h | ||
| ) |
Applies a color transformation to a plane.
The format must match the format provided during ff_sws_lut3d_update().
Definition at line 250 of file lut3d.c.
Referenced by run_lut3d().
1.8.17