FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
sonic.c File Reference

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. More...

#include "avcodec.h"
#include "get_bits.h"
#include "golomb.h"
#include "internal.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

#define MAX_CHANNELS   2

Definition at line 43 of file sonic.c.

#define MID_SIDE   0

Definition at line 45 of file sonic.c.

#define LEFT_SIDE   1

Definition at line 46 of file sonic.c.

#define RIGHT_SIDE   2

Definition at line 47 of file sonic.c.

#define LATTICE_SHIFT   10

Definition at line 74 of file sonic.c.

Referenced by predictor_calc_error(), and predictor_init_state().

#define SAMPLE_SHIFT   4

Definition at line 75 of file sonic.c.

#define LATTICE_FACTOR   (1 << LATTICE_SHIFT)

Definition at line 76 of file sonic.c.

#define SAMPLE_FACTOR   (1 << SAMPLE_SHIFT)

Definition at line 77 of file sonic.c.

Referenced by predictor_calc_error().

#define BASE_QUANT   0.6

Definition at line 79 of file sonic.c.

#define RATE_VARIATION   3.0

Definition at line 80 of file sonic.c.

#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

static int shift ( int  a,
int  b 
)
inlinestatic

Definition at line 82 of file sonic.c.

Referenced by ac3_lshift_int16_c(), ac3_rshift_int32_c(), adpcm_decode_frame(), adpcm_ima_expand_nibble(), adpcm_ima_wav_expand_nibble(), adpcm_sbpro_expand_nibble(), av_image_copy_to_buffer(), av_read_image_line(), av_write_image_line(), bfi_decode_frame(), bidir_refine(), blend_pixel(), calc_predictor_params(), copy_samples(), decode_bmv_frame(), decode_frame(), decode_init_static(), direct_search(), dpcm_decode_frame(), dv_audio_12to16(), encode_frame(), encode_q_branch(), encode_residual_ch(), epzs_motion_search2(), epzs_motion_search4(), epzs_motion_search_internal(), estimate_motion_b(), estimate_sid_gain(), exponents_from_scale_factors(), ff_celp_lp_synthesis_filter(), ff_convert_matrix(), ff_draw_round_to_sub(), ff_estimate_p_frame_motion(), ff_gmc_c(), ff_h263_decode_motion(), ff_hevc_hls_residual_coding(), ff_ivi_inverse_haar_4x4(), ff_ivi_inverse_haar_8x8(), ff_jpegls_decode_picture(), ff_nelly_get_sample_bits(), ff_png_pass_row_size(), ff_pre_estimate_p_frame_motion(), ff_print_debug_info2(), ff_tta_filter_init(), filter_3800(), flac_decorrelate_indep_c(), flac_decorrelate_ls_c(), flac_decorrelate_ms_c(), flac_decorrelate_rs_c(), flac_lpc_encode_c(), generate_noise(), get_amv(), get_bucket(), get_value_cached(), h261_probe(), h263_mv4_search(), hls_sao_param(), init_dequant4_coeff_table(), init_dequant8_coeff_table(), init_sample_buffers(), initFilter(), l1_unscale(), l2_unscale_group(), lag_get_rac(), line_noise_c(), line_noise_mmx(), line_noise_mmxext(), linear_scale_factor(), long_filter_high_3800(), long_term_filter(), lpc_encode_unrolled(), main(), mpeg_decode_motion(), msmpeg4v2_decode_motion(), noise(), opengl_fill_color_map(), packed16togbra16(), permutate_in_line(), picmemset(), planar_rgb16_to_uv(), planar_rgb16_to_y(), planarCopyWrapper(), predictor_decode_mono_3800(), predictor_decode_stereo_3800(), prefetch_motion(), print_stats(), put_unweighted_pred(), put_weighted_pred_avg(), quantize(), ra144_encode_frame(), radix_sort_pass(), range_decode_culshift(), renorm(), renorm_cabac_decoder_once(), sab_diamond_search(), sao_band_filter(), set_sample_rate_params(), shift_stereo(), sign_extend(), signed_shift(), snow_horizontal_compose_lift_lead_out(), softfloat_reciprocal(), sws_getShiftedVec(), transform_16x16_add(), transform_32x32_add(), transform_4x4_add(), transform_4x4_luma_add(), transform_8x8_add(), transform_skip(), ttafilter_process_dec_c(), update_initial_timestamps(), vp56_rac_renorm(), wavpack_encode_block(), weighted_pred(), weighted_pred_avg(), write_element(), write_fat_sector(), wv_get_value_float(), xa_decode(), yuv2plane1_10_c_template(), yuv2plane1_16_c_template(), yuv2planeX_10_c_template(), and yuv2planeX_16_c_template().

static int shift_down ( int  a,
int  b 
)
inlinestatic

Definition at line 87 of file sonic.c.

Referenced by predictor_calc_error(), and predictor_init_state().

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 92 of file sonic.c.

Referenced by intlist_write().

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

Definition at line 139 of file sonic.c.

Referenced by intlist_read().

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

Definition at line 160 of file sonic.c.

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

Definition at line 170 of file sonic.c.

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

Definition at line 448 of file sonic.c.

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

Definition at line 465 of file sonic.c.