FFmpeg
Data Structures | Macros | Functions
sonic.c File Reference
#include "config_components.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "encode.h"
#include "get_bits.h"
#include "golomb.h"
#include "put_golomb.h"
#include "rangecoder.h"

Go to the source code of this file.

Data Structures

struct  SonicContext
 

Macros

#define MAX_CHANNELS   2
 
#define MID_SIDE   0
 
#define LEFT_SIDE   1
 
#define RIGHT_SIDE   2
 
#define LATTICE_SHIFT   10
 
#define SAMPLE_SHIFT   4
 
#define LATTICE_FACTOR   (1 << LATTICE_SHIFT)
 
#define SAMPLE_FACTOR   (1 << SAMPLE_SHIFT)
 
#define BASE_QUANT   0.6
 
#define RATE_VARIATION   3.0
 
#define put_rac(C, S, B)
 

Functions

static int shift (int a, int b)
 
static int shift_down (int a, int b)
 
static av_always_inline av_flatten void put_symbol (RangeCoder *c, uint8_t *state, int v, int is_signed, uint64_t rc_stat[256][2], uint64_t rc_stat2[32][2])
 
static av_flatten int get_symbol (RangeCoder *c, uint8_t *state, int is_signed)
 
static int intlist_write (RangeCoder *c, uint8_t *state, int *buf, int entries, int base_2_part)
 
static int intlist_read (RangeCoder *c, uint8_t *state, int *buf, int entries, int base_2_part)
 
static void predictor_init_state (int *k, int *state, int order)
 
static int predictor_calc_error (int *k, int *state, int order, int error)
 

Detailed Description

Simple free lossless/lossy audio codec Based on Paul Francis Harrison's Bonk (http://www.logarithmic.net/pfh/bonk) Written and designed by Alex Beregszaszi

TODO:

Definition in file sonic.c.

Macro Definition Documentation

◆ MAX_CHANNELS

#define MAX_CHANNELS   2

Definition at line 49 of file sonic.c.

◆ MID_SIDE

#define MID_SIDE   0

Definition at line 51 of file sonic.c.

◆ LEFT_SIDE

#define LEFT_SIDE   1

Definition at line 52 of file sonic.c.

◆ RIGHT_SIDE

#define RIGHT_SIDE   2

Definition at line 53 of file sonic.c.

◆ LATTICE_SHIFT

#define LATTICE_SHIFT   10

Definition at line 80 of file sonic.c.

◆ SAMPLE_SHIFT

#define SAMPLE_SHIFT   4

Definition at line 81 of file sonic.c.

◆ LATTICE_FACTOR

#define LATTICE_FACTOR   (1 << LATTICE_SHIFT)

Definition at line 82 of file sonic.c.

◆ SAMPLE_FACTOR

#define SAMPLE_FACTOR   (1 << SAMPLE_SHIFT)

Definition at line 83 of file sonic.c.

◆ BASE_QUANT

#define BASE_QUANT   0.6

Definition at line 85 of file sonic.c.

◆ RATE_VARIATION

#define RATE_VARIATION   3.0

Definition at line 86 of file sonic.c.

◆ put_rac

#define put_rac (   C,
  S,
  B 
)
Value:
do{\
if(rc_stat){\
rc_stat[*(S)][B]++;\
rc_stat2[(S)-state][B]++;\
}\
put_rac(C,S,B);\
}while(0)

Function Documentation

◆ shift()

static int shift ( int  a,
int  b 
)
inlinestatic

Definition at line 88 of file sonic.c.

◆ shift_down()

static int shift_down ( int  a,
int  b 
)
inlinestatic

Definition at line 93 of file sonic.c.

Referenced by predictor_calc_error(), and predictor_init_state().

◆ put_symbol()

static av_always_inline av_flatten void put_symbol ( RangeCoder c,
uint8_t *  state,
int  v,
int  is_signed,
uint64_t  rc_stat[256][2],
uint64_t  rc_stat2[32][2] 
)
static

Definition at line 98 of file sonic.c.

Referenced by intlist_write().

◆ get_symbol()

static av_flatten int get_symbol ( RangeCoder c,
uint8_t *  state,
int  is_signed 
)
inlinestatic

Definition at line 145 of file sonic.c.

Referenced by intlist_read().

◆ intlist_write()

static int intlist_write ( RangeCoder c,
uint8_t *  state,
int buf,
int  entries,
int  base_2_part 
)
inlinestatic

Definition at line 169 of file sonic.c.

◆ intlist_read()

static int intlist_read ( RangeCoder c,
uint8_t *  state,
int buf,
int  entries,
int  base_2_part 
)
inlinestatic

Definition at line 179 of file sonic.c.

◆ predictor_init_state()

static void predictor_init_state ( int k,
int state,
int  order 
)
static

Definition at line 457 of file sonic.c.

◆ predictor_calc_error()

static int predictor_calc_error ( int k,
int state,
int  order,
int  error 
)
static

Definition at line 474 of file sonic.c.

S
#define S(s, c, i)
Definition: flacdsp_template.c:46
C
s EdgeDetect Foobar g libavfilter vf_edgedetect c libavfilter vf_foobar c edit libavfilter and add an entry for foobar following the pattern of the other filters edit libavfilter allfilters and add an entry for foobar following the pattern of the other filters configure make j< whatever > ffmpeg ffmpeg i you should get a foobar png with Lena edge detected That s your new playground is ready Some little details about what s going which in turn will define variables for the build system and the C
Definition: writing_filters.txt:58
state
static struct @382 state
B
#define B
Definition: huffyuv.h:42