APE range decoder


Defines

#define CODE_BITS   32
#define TOP_VALUE   ((unsigned int)1 << (CODE_BITS-1))
#define SHIFT_BITS   (CODE_BITS - 9)
#define EXTRA_BITS   ((CODE_BITS-2) % 8 + 1)
#define BOTTOM_VALUE   (TOP_VALUE >> 8)
#define MODEL_ELEMENTS   64

Functions

static void range_start_decoding (APEContext *ctx)
 Start the decoder.
static void range_dec_normalize (APEContext *ctx)
 Perform normalization.
static int range_decode_culfreq (APEContext *ctx, int tot_f)
 Calculate culmulative frequency for next symbol.
static int range_decode_culshift (APEContext *ctx, int shift)
 Decode value with given size in bits.
static void range_decode_update (APEContext *ctx, int sy_f, int lt_f)
 Update decoding state.
static int range_decode_bits (APEContext *ctx, int n)
 Decode n bits (n <= 16) without modelling.
static int range_get_symbol (APEContext *ctx, const uint16_t counts[], const uint16_t counts_diff[])
 Decode symbol.

Variables

static const uint16_t counts_3970 [22]
 Fixed probabilities for symbols in Monkey Audio version 3.97.
static const uint16_t counts_diff_3970 [21]
 Probability ranges for symbols in Monkey Audio version 3.97.
static const uint16_t counts_3980 [22]
 Fixed probabilities for symbols in Monkey Audio version 3.98.
static const uint16_t counts_diff_3980 [21]
 Probability ranges for symbols in Monkey Audio version 3.98.

Define Documentation

#define BOTTOM_VALUE   (TOP_VALUE >> 8)

Definition at line 227 of file apedec.c.

Referenced by range_dec_normalize().

#define CODE_BITS   32

Definition at line 223 of file apedec.c.

#define EXTRA_BITS   ((CODE_BITS-2) % 8 + 1)

Definition at line 226 of file apedec.c.

Referenced by range_start_decoding().

#define MODEL_ELEMENTS   64

Definition at line 297 of file apedec.c.

Referenced by ape_decode_value().

#define SHIFT_BITS   (CODE_BITS - 9)

Definition at line 225 of file apedec.c.

#define TOP_VALUE   ((unsigned int)1 << (CODE_BITS-1))

Definition at line 224 of file apedec.c.

Referenced by ff_bgmc_decode_init().


Function Documentation

static void range_dec_normalize ( APEContext ctx  )  [inline, static]

Perform normalization.

Definition at line 238 of file apedec.c.

Referenced by entropy_decode(), range_decode_culfreq(), and range_decode_culshift().

static int range_decode_bits ( APEContext ctx,
int  n 
) [inline, static]

Decode n bits (n <= 16) without modelling.

Definition at line 289 of file apedec.c.

Referenced by ape_decode_value().

static int range_decode_culfreq ( APEContext ctx,
int  tot_f 
) [inline, static]

Calculate culmulative frequency for next symbol.

Does NO update!

Parameters:
ctx decoder context
tot_f is the total frequency or (code_value)1<<shift
Returns:
the culmulative frequency

Definition at line 256 of file apedec.c.

Referenced by ape_decode_value().

static int range_decode_culshift ( APEContext ctx,
int  shift 
) [inline, static]

Decode value with given size in bits.

Parameters:
ctx decoder context
shift number of bits to decode

Definition at line 268 of file apedec.c.

Referenced by range_decode_bits(), and range_get_symbol().

static void range_decode_update ( APEContext ctx,
int  sy_f,
int  lt_f 
) [inline, static]

Update decoding state.

Parameters:
ctx decoder context
sy_f the interval length (frequency of the symbol)
lt_f the lower end (frequency sum of < symbols)

Definition at line 282 of file apedec.c.

Referenced by ape_decode_value(), range_decode_bits(), and range_get_symbol().

static int range_get_symbol ( APEContext ctx,
const uint16_t  counts[],
const uint16_t  counts_diff[] 
) [inline, static]

Decode symbol.

Parameters:
ctx decoder context
counts probability range start position
counts_diff probability range widths

Definition at line 341 of file apedec.c.

Referenced by ape_decode_value().

static void range_start_decoding ( APEContext ctx  )  [inline, static]

Start the decoder.

Definition at line 230 of file apedec.c.

Referenced by init_entropy_decoder().


Variable Documentation

const uint16_t counts_3970[22] [static]

Initial value:

 {
        0, 14824, 28224, 39348, 47855, 53994, 58171, 60926,
    62682, 63786, 64463, 64878, 65126, 65276, 65365, 65419,
    65450, 65469, 65480, 65487, 65491, 65493,
}
Fixed probabilities for symbols in Monkey Audio version 3.97.

Definition at line 302 of file apedec.c.

Referenced by ape_decode_value().

const uint16_t counts_3980[22] [static]

Initial value:

 {
        0, 19578, 36160, 48417, 56323, 60899, 63265, 64435,
    64971, 65232, 65351, 65416, 65447, 65466, 65476, 65482,
    65485, 65488, 65490, 65491, 65492, 65493,
}
Fixed probabilities for symbols in Monkey Audio version 3.98.

Definition at line 320 of file apedec.c.

Referenced by ape_decode_value().

const uint16_t counts_diff_3970[21] [static]

Initial value:

 {
    14824, 13400, 11124, 8507, 6139, 4177, 2755, 1756,
    1104, 677, 415, 248, 150, 89, 54, 31,
    19, 11, 7, 4, 2,
}
Probability ranges for symbols in Monkey Audio version 3.97.

Definition at line 311 of file apedec.c.

Referenced by ape_decode_value().

const uint16_t counts_diff_3980[21] [static]

Initial value:

 {
    19578, 16582, 12257, 7906, 4576, 2366, 1170, 536,
    261, 119, 65, 31, 19, 10, 6, 3,
    3, 2, 1, 1, 1,
}
Probability ranges for symbols in Monkey Audio version 3.98.

Definition at line 329 of file apedec.c.

Referenced by ape_decode_value().


Generated on Fri Oct 26 02:36:56 2012 for FFmpeg by  doxygen 1.5.8