FFmpeg
Loading...
Searching...
No Matches
lut3d.h File Reference
#include <stdint.h>
#include "libavutil/csp.h"
#include "libavutil/pixfmt.h"
#include "cms.h"
#include "csputils.h"
#include "format.h"

Go to the source code of this file.

Data Structures

struct  SwsLut3D
 Append a set of operations for applying a gamut/tone mapping 3D LUT to the pixels. More...
 

Enumerations

enum  {
  INPUT_LUT_BITS = 6 , INPUT_LUT_SIZE = (1 << INPUT_LUT_BITS) + 1 , TONE_LUT_BITS = 8 , TONE_LUT_SIZE = (1 << TONE_LUT_BITS) + 1 ,
  OUTPUT_LUT_BITS_I = 6 , OUTPUT_LUT_BITS_PT = 7 , OUTPUT_LUT_SIZE_I = (1 << OUTPUT_LUT_BITS_I) + 1 , OUTPUT_LUT_SIZE_PT = (1 << OUTPUT_LUT_BITS_PT) + 1
}
 

Functions

SwsLut3Dff_sws_lut3d_alloc (void)
 Allocates a refstruct.
 
int ff_sws_lut3d_generate (SwsLut3D *lut3d, const SwsColorMap *map)
 Recalculate the (static) 3DLUT state with new settings.
 
void ff_sws_lut3d_update (SwsLut3D *lut3d, const SwsColor *new_src)
 Update the tone mapping state.
 
void ff_sws_lut3d_apply_rgba64 (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 in RGBA64 format.
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
INPUT_LUT_BITS 
INPUT_LUT_SIZE 
TONE_LUT_BITS 
TONE_LUT_SIZE 
OUTPUT_LUT_BITS_I 
OUTPUT_LUT_BITS_PT 
OUTPUT_LUT_SIZE_I 
OUTPUT_LUT_SIZE_PT 

Definition at line 33 of file lut3d.h.

Function Documentation

◆ ff_sws_lut3d_alloc()

SwsLut3D * ff_sws_lut3d_alloc ( void )

Allocates a refstruct.

Note that the LUT contents are not initialized.

Definition at line 33 of file lut3d.c.

Referenced by check_lut_3d(), generate_3dlut(), and sws_uops_macros_gen().

◆ ff_sws_lut3d_generate()

int ff_sws_lut3d_generate ( SwsLut3D * lut3d,
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 198 of file lut3d.c.

Referenced by generate_3dlut().

◆ ff_sws_lut3d_update()

void ff_sws_lut3d_update ( SwsLut3D * lut3d,
const SwsColor * new_src )

Update the tone mapping state.

This will only use per-frame metadata. The static metadata is ignored.

Definition at line 222 of file lut3d.c.

Referenced by ff_sws_graph_update_metadata(), and ff_sws_lut3d_generate().

◆ ff_sws_lut3d_apply_rgba64()

void ff_sws_lut3d_apply_rgba64 ( 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 in RGBA64 format.

Definition at line 234 of file lut3d.c.

Referenced by run_legacy_lut3d().