FFmpeg
Functions | Variables
h274.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "h274.h"

Go to the source code of this file.

Functions

static void prng_shift (uint32_t *state)
 
static void init_slice_c (int8_t out[64][64], uint8_t h, uint8_t v, int16_t tmp[64][64])
 
static void init_slice (H274FilmGrainDatabase *database, uint8_t h, uint8_t v)
 
static uint16_t avg_8x8_c (const uint8_t *in, int in_stride)
 
static void synth_grain_8x8_c (int8_t *out, const int out_stride, const int16_t scale, const uint8_t shift, const int8_t *db)
 
static void deblock_8x8_c (int8_t *out, const int out_stride)
 
static av_always_inline void generate (int8_t *out, int out_stride, const uint8_t *in, int in_stride, H274FilmGrainDatabase *database, const AVFilmGrainH274Params *h274, int c, int invert, int deblock, int y_offset, int x_offset)
 
static void add_8x8_clip_c (uint8_t *out, const uint8_t *a, const int8_t *b, int n)
 
int ff_h274_apply_film_grain (AVFrame *out_frame, const AVFrame *in_frame, H274FilmGrainDatabase *database, const AVFilmGrainParams *params)
 

Variables

static const int8_t Gaussian_LUT [2048+4]
 
static const uint32_t Seed_LUT [256]
 
static const int8_t R64T [64][64]
 

Detailed Description

H.274 film grain synthesis.

Author
Niklas Haas ffmpe.nosp@m.g@ha.nosp@m.asn.x.nosp@m.yz

Definition in file h274.c.

Function Documentation

◆ prng_shift()

static void prng_shift ( uint32_t *  state)
static

Definition at line 37 of file h274.c.

Referenced by ff_h274_apply_film_grain(), and init_slice_c().

◆ init_slice_c()

static void init_slice_c ( int8_t  out[64][64],
uint8_t  h,
uint8_t  v,
int16_t  tmp[64][64] 
)
static

Definition at line 45 of file h274.c.

Referenced by init_slice().

◆ init_slice()

static void init_slice ( H274FilmGrainDatabase database,
uint8_t  h,
uint8_t  v 
)
static

Definition at line 104 of file h274.c.

Referenced by generate().

◆ avg_8x8_c()

static uint16_t avg_8x8_c ( const uint8_t *  in,
int  in_stride 
)
static

Definition at line 114 of file h274.c.

Referenced by generate().

◆ synth_grain_8x8_c()

static void synth_grain_8x8_c ( int8_t *  out,
const int  out_stride,
const int16_t  scale,
const uint8_t  shift,
const int8_t *  db 
)
static

Definition at line 129 of file h274.c.

Referenced by generate().

◆ deblock_8x8_c()

static void deblock_8x8_c ( int8_t *  out,
const int  out_stride 
)
static

Definition at line 143 of file h274.c.

Referenced by generate().

◆ generate()

static av_always_inline void generate ( int8_t *  out,
int  out_stride,
const uint8_t *  in,
int  in_stride,
H274FilmGrainDatabase database,
const AVFilmGrainH274Params h274,
int  c,
int  invert,
int  deblock,
int  y_offset,
int  x_offset 
)
static

Definition at line 156 of file h274.c.

Referenced by ff_h274_apply_film_grain().

◆ add_8x8_clip_c()

static void add_8x8_clip_c ( uint8_t *  out,
const uint8_t *  a,
const int8_t *  b,
int  n 
)
static

Definition at line 210 of file h274.c.

Referenced by ff_h274_apply_film_grain().

◆ ff_h274_apply_film_grain()

int ff_h274_apply_film_grain ( AVFrame out_frame,
const AVFrame in_frame,
H274FilmGrainDatabase database,
const AVFilmGrainParams params 
)

Definition at line 217 of file h274.c.

Referenced by ff_h264_field_end(), and hevc_frame_end().

Variable Documentation

◆ Gaussian_LUT

static const int8_t Gaussian_LUT
static

Definition at line 33 of file h274.c.

Referenced by init_slice_c().

◆ Seed_LUT

static const uint32_t Seed_LUT
static

Definition at line 34 of file h274.c.

Referenced by ff_h274_apply_film_grain(), and init_slice_c().

◆ R64T

static const int8_t R64T
static

Definition at line 35 of file h274.c.

Referenced by init_slice_c().