FFmpeg
Macros | Functions | Variables
pcm_tablegen.h File Reference
#include <stdint.h>
#include "libavutil/attributes.h"

Go to the source code of this file.

Macros

#define SIGN_BIT   (0x80) /* Sign bit for a A-law byte. */
 
#define QUANT_MASK   (0xf) /* Quantization field mask. */
 
#define NSEGS   (8) /* Number of A-law segments. */
 
#define SEG_SHIFT   (4) /* Left shift for segment number. */
 
#define SEG_MASK   (0x70) /* Segment field mask. */
 
#define BIAS   (0x84) /* Bias for linear code. */
 
#define VIDC_SIGN_BIT   (1)
 
#define VIDC_QUANT_MASK   (0x1E)
 
#define VIDC_QUANT_SHIFT   (1)
 
#define VIDC_SEG_SHIFT   (5)
 
#define VIDC_SEG_MASK   (0xE0)
 

Functions

static av_cold int alaw2linear (unsigned char a_val)
 
static av_cold int ulaw2linear (unsigned char u_val)
 
static av_cold int vidc2linear (unsigned char u_val)
 
static av_cold void build_xlaw_table (uint8_t *linear_to_xlaw, int(*xlaw2linear)(unsigned char), int mask)
 
static void pcm_alaw_tableinit (void)
 
static void pcm_ulaw_tableinit (void)
 
static void pcm_vidc_tableinit (void)
 

Variables

static uint8_t linear_to_alaw [16384]
 
static uint8_t linear_to_ulaw [16384]
 
static uint8_t linear_to_vidc [16384]
 

Macro Definition Documentation

◆ SIGN_BIT

#define SIGN_BIT   (0x80) /* Sign bit for a A-law byte. */

Definition at line 31 of file pcm_tablegen.h.

◆ QUANT_MASK

#define QUANT_MASK   (0xf) /* Quantization field mask. */

Definition at line 32 of file pcm_tablegen.h.

◆ NSEGS

#define NSEGS   (8) /* Number of A-law segments. */

Definition at line 33 of file pcm_tablegen.h.

◆ SEG_SHIFT

#define SEG_SHIFT   (4) /* Left shift for segment number. */

Definition at line 34 of file pcm_tablegen.h.

◆ SEG_MASK

#define SEG_MASK   (0x70) /* Segment field mask. */

Definition at line 35 of file pcm_tablegen.h.

◆ BIAS

#define BIAS   (0x84) /* Bias for linear code. */

Definition at line 37 of file pcm_tablegen.h.

◆ VIDC_SIGN_BIT

#define VIDC_SIGN_BIT   (1)

Definition at line 39 of file pcm_tablegen.h.

◆ VIDC_QUANT_MASK

#define VIDC_QUANT_MASK   (0x1E)

Definition at line 40 of file pcm_tablegen.h.

◆ VIDC_QUANT_SHIFT

#define VIDC_QUANT_SHIFT   (1)

Definition at line 41 of file pcm_tablegen.h.

◆ VIDC_SEG_SHIFT

#define VIDC_SEG_SHIFT   (5)

Definition at line 42 of file pcm_tablegen.h.

◆ VIDC_SEG_MASK

#define VIDC_SEG_MASK   (0xE0)

Definition at line 43 of file pcm_tablegen.h.

Function Documentation

◆ alaw2linear()

static av_cold int alaw2linear ( unsigned char  a_val)
static

Definition at line 46 of file pcm_tablegen.h.

Referenced by pcm_alaw_tableinit(), and pcm_decode_init().

◆ ulaw2linear()

static av_cold int ulaw2linear ( unsigned char  u_val)
static

Definition at line 61 of file pcm_tablegen.h.

Referenced by pcm_decode_init(), and pcm_ulaw_tableinit().

◆ vidc2linear()

static av_cold int vidc2linear ( unsigned char  u_val)
static

Definition at line 78 of file pcm_tablegen.h.

Referenced by pcm_decode_init(), and pcm_vidc_tableinit().

◆ build_xlaw_table()

static av_cold void build_xlaw_table ( uint8_t linear_to_xlaw,
int(*)(unsigned char)  xlaw2linear,
int  mask 
)
static

Definition at line 103 of file pcm_tablegen.h.

Referenced by pcm_alaw_tableinit(), pcm_ulaw_tableinit(), and pcm_vidc_tableinit().

◆ pcm_alaw_tableinit()

static void pcm_alaw_tableinit ( void  )
static

Definition at line 127 of file pcm_tablegen.h.

Referenced by main(), and pcm_encode_init().

◆ pcm_ulaw_tableinit()

static void pcm_ulaw_tableinit ( void  )
static

Definition at line 132 of file pcm_tablegen.h.

Referenced by main(), and pcm_encode_init().

◆ pcm_vidc_tableinit()

static void pcm_vidc_tableinit ( void  )
static

Definition at line 137 of file pcm_tablegen.h.

Referenced by main(), and pcm_encode_init().

Variable Documentation

◆ linear_to_alaw

uint8_t linear_to_alaw[16384]
static

Definition at line 99 of file pcm_tablegen.h.

Referenced by main(), pcm_alaw_tableinit(), and pcm_encode_frame().

◆ linear_to_ulaw

uint8_t linear_to_ulaw[16384]
static

Definition at line 100 of file pcm_tablegen.h.

Referenced by main(), pcm_encode_frame(), and pcm_ulaw_tableinit().

◆ linear_to_vidc

uint8_t linear_to_vidc[16384]
static

Definition at line 101 of file pcm_tablegen.h.

Referenced by main(), pcm_encode_frame(), and pcm_vidc_tableinit().