FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
csputils.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <math.h>
#include "libavutil/attributes.h"
#include "libavutil/common.h"
#include "libavutil/csp.h"
#include "libavutil/pixfmt.h"

Go to the source code of this file.

Data Structures

struct  SwsMatrix3x3
 
struct  v3u8_t
 
struct  v2u16_t
 
struct  v3u16_t
 

Macros

#define fmixf(a, b, x)   ((b) * (x) + (a) * (1 - (x)))
 

Enumerations

enum  { PQ_LUT_SIZE = 1024 }
 

Functions

static float smoothstepf (float edge0, float edge1, float x)
 
void ff_sws_matrix3x3_mul (SwsMatrix3x3 *a, const SwsMatrix3x3 *b)
 
void ff_sws_matrix3x3_rmul (const SwsMatrix3x3 *a, SwsMatrix3x3 *b)
 
void ff_sws_matrix3x3_invert (SwsMatrix3x3 *mat)
 
void ff_sws_matrix3x3_apply (const SwsMatrix3x3 *mat, float vec[3])
 
SwsMatrix3x3 ff_sws_ipt_rgb2lms (const AVColorPrimariesDesc *prim)
 
SwsMatrix3x3 ff_sws_ipt_lms2rgb (const AVColorPrimariesDesc *prim)
 
SwsMatrix3x3 ff_sws_rgb2xyz (const AVColorPrimariesDesc *prim)
 
SwsMatrix3x3 ff_sws_xyz2rgb (const AVColorPrimariesDesc *prim)
 
SwsMatrix3x3 ff_sws_get_adaptation (const AVPrimaryCoefficients *prim, AVWhitepointCoefficients from, AVWhitepointCoefficients to)
 
static float pq_eotf (float x)
 
static float pq_oetf (float x)
 
bool ff_prim_superset (const AVPrimaryCoefficients *a, const AVPrimaryCoefficients *b)
 Returns true if 'b' is entirely contained in 'a'. More...
 

Variables

static const float PQ_M1 = 2610./4096 * 1./4
 
static const float PQ_M2 = 2523./4096 * 128
 
static const float PQ_C1 = 3424./4096
 
static const float PQ_C2 = 2413./4096 * 32
 
static const float PQ_C3 = 2392./4096 * 32
 
const float ff_pq_eotf_lut [PQ_LUT_SIZE+1]
 

Macro Definition Documentation

◆ fmixf

#define fmixf (   a,
  b,
 
)    ((b) * (x) + (a) * (1 - (x)))

Definition at line 35 of file csputils.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PQ_LUT_SIZE 

Definition at line 88 of file csputils.h.

Function Documentation

◆ smoothstepf()

static float smoothstepf ( float  edge0,
float  edge1,
float  x 
)
inlinestatic

Definition at line 37 of file csputils.h.

Referenced by perceptual(), and st2094_pick_knee().

◆ ff_sws_matrix3x3_mul()

void ff_sws_matrix3x3_mul ( SwsMatrix3x3 a,
const SwsMatrix3x3 b 
)

◆ ff_sws_matrix3x3_rmul()

void ff_sws_matrix3x3_rmul ( const SwsMatrix3x3 a,
SwsMatrix3x3 b 
)

Definition at line 39 of file csputils.c.

◆ ff_sws_matrix3x3_invert()

void ff_sws_matrix3x3_invert ( SwsMatrix3x3 mat)

Definition at line 52 of file csputils.c.

Referenced by ff_sws_ipt_lms2rgb(), ff_sws_rgb2xyz(), and ff_sws_xyz2rgb().

◆ ff_sws_matrix3x3_apply()

void ff_sws_matrix3x3_apply ( const SwsMatrix3x3 mat,
float  vec[3] 
)

Definition at line 85 of file csputils.c.

Referenced by absolute().

◆ ff_sws_ipt_rgb2lms()

SwsMatrix3x3 ff_sws_ipt_rgb2lms ( const AVColorPrimariesDesc prim)

Definition at line 232 of file csputils.c.

Referenced by ff_sws_ipt_lms2rgb(), and gamut_from_colorspace().

◆ ff_sws_ipt_lms2rgb()

SwsMatrix3x3 ff_sws_ipt_lms2rgb ( const AVColorPrimariesDesc prim)

Definition at line 252 of file csputils.c.

Referenced by gamut_from_colorspace().

◆ ff_sws_rgb2xyz()

SwsMatrix3x3 ff_sws_rgb2xyz ( const AVColorPrimariesDesc prim)

Definition at line 105 of file csputils.c.

Referenced by ff_sws_get_adaptation(), ff_sws_ipt_rgb2lms(), and ff_sws_xyz2rgb().

◆ ff_sws_xyz2rgb()

SwsMatrix3x3 ff_sws_xyz2rgb ( const AVColorPrimariesDesc prim)

Definition at line 143 of file csputils.c.

Referenced by ff_sws_get_adaptation().

◆ ff_sws_get_adaptation()

SwsMatrix3x3 ff_sws_get_adaptation ( const AVPrimaryCoefficients prim,
AVWhitepointCoefficients  from,
AVWhitepointCoefficients  to 
)

Definition at line 204 of file csputils.c.

Referenced by sws_color_map_generate_dynamic().

◆ pq_eotf()

static float pq_eotf ( float  x)
inlinestatic

Definition at line 91 of file csputils.h.

Referenced by ingamut(), and ipt2rgb().

◆ pq_oetf()

static float pq_oetf ( float  x)
inlinestatic

Definition at line 99 of file csputils.h.

Referenced by gamut_from_colorspace(), and rgb2ipt().

◆ ff_prim_superset()

bool ff_prim_superset ( const AVPrimaryCoefficients a,
const AVPrimaryCoefficients b 
)

Returns true if 'b' is entirely contained in 'a'.

Useful for figuring out if colorimetric clipping will occur or not.

Definition at line 281 of file csputils.c.

Referenced by sws_color_map_noop().

Variable Documentation

◆ PQ_M1

const float PQ_M1 = 2610./4096 * 1./4
static

Definition at line 82 of file csputils.h.

Referenced by pq_oetf().

◆ PQ_M2

const float PQ_M2 = 2523./4096 * 128
static

Definition at line 83 of file csputils.h.

Referenced by pq_oetf().

◆ PQ_C1

const float PQ_C1 = 3424./4096
static

Definition at line 84 of file csputils.h.

Referenced by pq_oetf().

◆ PQ_C2

const float PQ_C2 = 2413./4096 * 32
static

Definition at line 85 of file csputils.h.

Referenced by pq_oetf().

◆ PQ_C3

const float PQ_C3 = 2392./4096 * 32
static

Definition at line 86 of file csputils.h.

Referenced by pq_oetf().

◆ ff_pq_eotf_lut

const float ff_pq_eotf_lut[PQ_LUT_SIZE+1]

Definition at line 288 of file csputils.c.

Referenced by pq_eotf().