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

Bitstream parser for ATRAC3+ decoder. More...

#include "libavutil/avassert.h"
#include "avcodec.h"
#include "get_bits.h"
#include "atrac3plus.h"
#include "atrac3plus_data.h"

Go to the source code of this file.

Macros

#define UNPACK_SF_VQ_SHAPE(gb, dst, num_vals)
 
#define DEC_CT_IDX_COMMON(OP)
 
#define CODING_DIRECT   get_bits(gb, num_bits)
 
#define CODING_VLC   get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1)
 
#define CODING_VLC_DELTA
 
#define CODING_VLC_DIFF
 

Functions

static av_cold void build_canonical_huff (const uint8_t *cb, const uint8_t *xlat, int *tab_offset, VLC *out_vlc)
 Generate canonical VLC table from given descriptor. More...
 
av_cold void ff_atrac3p_init_vlcs (void)
 Initialize VLC tables for bitstream parsing. More...
 
static int num_coded_units (GetBitContext *gb, Atrac3pChanParams *chan, Atrac3pChanUnitCtx *ctx, AVCodecContext *avctx)
 Decode number of coded quantization units. More...
 
static int add_wordlen_weights (Atrac3pChanUnitCtx *ctx, Atrac3pChanParams *chan, int wtab_idx, AVCodecContext *avctx)
 Add weighting coefficients to the decoded word-length information. More...
 
static int subtract_sf_weights (Atrac3pChanUnitCtx *ctx, Atrac3pChanParams *chan, int wtab_idx, AVCodecContext *avctx)
 Subtract weighting coefficients from decoded scalefactors. More...
 
static void unpack_vq_shape (int start_val, const int8_t *shape_vec, int *dst, int num_values)
 Unpack vector quantization tables. More...
 
static int decode_channel_wordlen (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int ch_num, AVCodecContext *avctx)
 Decode word length for each quantization unit of a channel. More...
 
static int decode_channel_sf_idx (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int ch_num, AVCodecContext *avctx)
 Decode scale factor indexes for each quant unit of a channel. More...
 
static int decode_quant_wordlen (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int num_channels, AVCodecContext *avctx)
 Decode word length information for each channel. More...
 
static int decode_scale_factors (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int num_channels, AVCodecContext *avctx)
 Decode scale factor indexes for each channel. More...
 
static int get_num_ct_values (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, AVCodecContext *avctx)
 Decode number of code table values. More...
 
static int decode_channel_code_tab (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int ch_num, AVCodecContext *avctx)
 Decode code table indexes for each quant unit of a channel. More...
 
static int decode_code_table_indexes (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int num_channels, AVCodecContext *avctx)
 Decode code table indexes for each channel. More...
 
static void decode_qu_spectra (GetBitContext *gb, const Atrac3pSpecCodeTab *tab, VLC *vlc_tab, int16_t *out, const int num_specs)
 Decode huffman-coded spectral lines for a given quant unit. More...
 
static void decode_spectrum (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int num_channels, AVCodecContext *avctx)
 Decode huffman-coded IMDCT spectrum for all channels. More...
 
static int get_subband_flags (GetBitContext *gb, uint8_t *out, int num_flags)
 Retrieve specified amount of flag bits from the input bitstream. More...
 
static void decode_window_shape (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int num_channels)
 Decode mdct window shape flags for all channels. More...
 
static int decode_gainc_npoints (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int ch_num, int coded_subbands)
 Decode number of gain control points. More...
 
static void gainc_level_mode3s (AtracGainInfo *dst, AtracGainInfo *ref)
 Implements coding mode 3 (slave) for gain compensation levels. More...
 
static void gainc_level_mode1m (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, AtracGainInfo *dst)
 Implements coding mode 1 (master) for gain compensation levels. More...
 
static int decode_gainc_levels (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int ch_num, int coded_subbands)
 Decode level code for each gain control point. More...
 
static void gainc_loc_mode0 (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, AtracGainInfo *dst, int pos)
 Implements coding mode 0 for gain compensation locations. More...
 
static void gainc_loc_mode1 (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, AtracGainInfo *dst)
 Implements coding mode 1 for gain compensation locations. More...
 
static int decode_gainc_loc_codes (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int ch_num, int coded_subbands, AVCodecContext *avctx)
 Decode location code for each gain control point. More...
 
static int decode_gainc_data (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int num_channels, AVCodecContext *avctx)
 Decode gain control data for all channels. More...
 
static void decode_tones_envelope (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int ch_num, int band_has_tones[])
 Decode envelope for all tones of a channel. More...
 
static int decode_band_numwavs (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int ch_num, int band_has_tones[], AVCodecContext *avctx)
 Decode number of tones for each subband of a channel. More...
 
static void decode_tones_frequency (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int ch_num, int band_has_tones[])
 Decode frequency information for each subband of a channel. More...
 
static void decode_tones_amplitude (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int ch_num, int band_has_tones[])
 Decode amplitude information for each subband of a channel. More...
 
static void decode_tones_phase (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int ch_num, int band_has_tones[])
 Decode phase information for each subband of a channel. More...
 
static int decode_tones_info (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int num_channels, AVCodecContext *avctx)
 Decode tones info for all channels. More...
 
int ff_atrac3p_decode_channel_unit (GetBitContext *gb, Atrac3pChanUnitCtx *ctx, int num_channels, AVCodecContext *avctx)
 Decode bitstream data of a channel unit. More...
 

Variables

static VLC_TYPE tables_data [154276][2]
 
static VLC wl_vlc_tabs [4]
 
static VLC sf_vlc_tabs [8]
 
static VLC ct_vlc_tabs [4]
 
static VLC spec_vlc_tabs [112]
 
static VLC gain_vlc_tabs [11]
 
static VLC tone_vlc_tabs [7]
 

Detailed Description

Bitstream parser for ATRAC3+ decoder.

Definition in file atrac3plus.c.

Macro Definition Documentation

#define UNPACK_SF_VQ_SHAPE (   gb,
  dst,
  num_vals 
)
Value:
start_val = get_bits((gb), 6); \
unpack_vq_shape(start_val, &atrac3p_sf_shapes[get_bits((gb), 6)][0], \
(dst), (num_vals))
static void unpack_vq_shape(int start_val, const int8_t *shape_vec, int *dst, int num_values)
Unpack vector quantization tables.
Definition: atrac3plus.c:309
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:260
static const int8_t atrac3p_sf_shapes[64][9]
2D base shape tables for scale factor coding.

Definition at line 321 of file atrac3plus.c.

Referenced by decode_channel_sf_idx().

#define DEC_CT_IDX_COMMON (   OP)
Value:
num_vals = get_num_ct_values(gb, ctx, avctx); \
if (num_vals < 0) \
return num_vals; \
for (i = 0; i < num_vals; i++) { \
if (chan->qu_wordlen[i]) { \
chan->qu_tab_idx[i] = OP; \
} else if (ch_num && ref_chan->qu_wordlen[i]) \
/* get clone master flag */ \
chan->qu_tab_idx[i] = get_bits1(gb); \
}
static int get_num_ct_values(GetBitContext *gb, Atrac3pChanUnitCtx *ctx, AVCodecContext *avctx)
Decode number of code table values.
Definition: atrac3plus.c:673
AVFormatContext * ctx
Definition: movenc-test.c:48
return
#define OP(LOAD, STORE)
Definition: hpeldsp_alpha.c:55
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:312
if(ret< 0)
Definition: vf_mcdeint.c:282
for(j=16;j >0;--j)

Definition at line 690 of file atrac3plus.c.

Referenced by decode_channel_code_tab().

#define CODING_DIRECT   get_bits(gb, num_bits)

Definition at line 703 of file atrac3plus.c.

Referenced by decode_channel_code_tab().

#define CODING_VLC   get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1)

Definition at line 705 of file atrac3plus.c.

Referenced by decode_channel_code_tab().

#define CODING_VLC_DELTA
Value:
(!i) ? CODING_VLC \
: (pred + get_vlc2(gb, delta_vlc->table, \
delta_vlc->bits, 1)) & mask; \
pred = chan->qu_tab_idx[i]
static const uint16_t mask[17]
Definition: lzw.c:38
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
Definition: get_bits.h:574
#define CODING_VLC
Definition: atrac3plus.c:705
static const float pred[4]
Definition: siprdata.h:259

Definition at line 707 of file atrac3plus.c.

Referenced by decode_channel_code_tab().

#define CODING_VLC_DIFF
Value:
(ref_chan->qu_tab_idx[i] + \
get_vlc2(gb, vlc_tab->table, vlc_tab->bits, 1)) & mask
static const uint16_t mask[17]
Definition: lzw.c:38
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
Definition: get_bits.h:574

Definition at line 713 of file atrac3plus.c.

Referenced by decode_channel_code_tab().

Function Documentation

static av_cold void build_canonical_huff ( const uint8_t cb,
const uint8_t xlat,
int *  tab_offset,
VLC out_vlc 
)
static

Generate canonical VLC table from given descriptor.

Parameters
[in]cbptr to codebook descriptor
[in]xlatptr to translation table or NULL
[in,out]tab_offsetstarting offset to the generated vlc table
[out]out_vlcptr to vlc table to be generated

Definition at line 50 of file atrac3plus.c.

Referenced by ff_atrac3p_init_vlcs().

av_cold void ff_atrac3p_init_vlcs ( void  )

Initialize VLC tables for bitstream parsing.

Definition at line 80 of file atrac3plus.c.

Referenced by atrac3p_decode_init().

static int num_coded_units ( GetBitContext gb,
Atrac3pChanParams chan,
Atrac3pChanUnitCtx ctx,
AVCodecContext avctx 
)
static

Decode number of coded quantization units.

Parameters
[in]gbthe GetBit context
[in,out]chanptr to the channel parameters
[in,out]ctxptr to the channel unit context
[in]avctxptr to the AVCodecContext
Returns
result code: 0 = OK, otherwise - error code

Definition at line 221 of file atrac3plus.c.

Referenced by decode_channel_wordlen().

static int add_wordlen_weights ( Atrac3pChanUnitCtx ctx,
Atrac3pChanParams chan,
int  wtab_idx,
AVCodecContext avctx 
)
static

Add weighting coefficients to the decoded word-length information.

Parameters
[in,out]ctxptr to the channel unit context
[in,out]chanptr to the channel parameters
[in]wtab_idxindex of the table of weights
[in]avctxptr to the AVCodecContext
Returns
result code: 0 = OK, otherwise - error code

Definition at line 251 of file atrac3plus.c.

Referenced by decode_channel_wordlen().

static int subtract_sf_weights ( Atrac3pChanUnitCtx ctx,
Atrac3pChanParams chan,
int  wtab_idx,
AVCodecContext avctx 
)
static

Subtract weighting coefficients from decoded scalefactors.

Parameters
[in,out]ctxptr to the channel unit context
[in,out]chanptr to the channel parameters
[in]wtab_idxindex of table of weights
[in]avctxptr to the AVCodecContext
Returns
result code: 0 = OK, otherwise - error code

Definition at line 281 of file atrac3plus.c.

Referenced by decode_channel_sf_idx().

static void unpack_vq_shape ( int  start_val,
const int8_t *  shape_vec,
int *  dst,
int  num_values 
)
inlinestatic

Unpack vector quantization tables.

Parameters
[in]start_valstart value for the unpacked table
[in]shape_vecptr to table to unpack
[out]dstptr to output array
[in]num_valuesnumber of values to unpack

Definition at line 309 of file atrac3plus.c.

Referenced by decode_channel_wordlen().

static int decode_channel_wordlen ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  ch_num,
AVCodecContext avctx 
)
static

Decode word length for each quantization unit of a channel.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]ch_numchannel to process
[in]avctxptr to the AVCodecContext
Returns
result code: 0 = OK, otherwise - error code

Definition at line 335 of file atrac3plus.c.

Referenced by decode_quant_wordlen().

static int decode_channel_sf_idx ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  ch_num,
AVCodecContext avctx 
)
static

Decode scale factor indexes for each quant unit of a channel.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]ch_numchannel to process
[in]avctxptr to the AVCodecContext
Returns
result code: 0 = OK, otherwise - error code

Definition at line 478 of file atrac3plus.c.

Referenced by decode_scale_factors().

static int decode_quant_wordlen ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  num_channels,
AVCodecContext avctx 
)
static

Decode word length information for each channel.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]num_channelsnumber of channels to process
[in]avctxptr to the AVCodecContext
Returns
result code: 0 = OK, otherwise - error code

Definition at line 613 of file atrac3plus.c.

Referenced by ff_atrac3p_decode_channel_unit().

static int decode_scale_factors ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  num_channels,
AVCodecContext avctx 
)
static

Decode scale factor indexes for each channel.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]num_channelsnumber of channels to process
[in]avctxptr to the AVCodecContext
Returns
result code: 0 = OK, otherwise - error code

Definition at line 646 of file atrac3plus.c.

Referenced by ff_atrac3p_decode_channel_unit().

static int get_num_ct_values ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
AVCodecContext avctx 
)
static

Decode number of code table values.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]avctxptr to the AVCodecContext
Returns
result code: 0 = OK, otherwise - error code

Definition at line 673 of file atrac3plus.c.

static int decode_channel_code_tab ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  ch_num,
AVCodecContext avctx 
)
static

Decode code table indexes for each quant unit of a channel.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]ch_numchannel to process
[in]avctxptr to the AVCodecContext
Returns
result code: 0 = OK, otherwise - error code

Definition at line 726 of file atrac3plus.c.

Referenced by decode_code_table_indexes().

static int decode_code_table_indexes ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  num_channels,
AVCodecContext avctx 
)
static

Decode code table indexes for each channel.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]num_channelsnumber of channels to process
[in]avctxptr to the AVCodecContext
Returns
result code: 0 = OK, otherwise - error code

Definition at line 779 of file atrac3plus.c.

Referenced by ff_atrac3p_decode_channel_unit().

static void decode_qu_spectra ( GetBitContext gb,
const Atrac3pSpecCodeTab tab,
VLC vlc_tab,
int16_t *  out,
const int  num_specs 
)
static

Decode huffman-coded spectral lines for a given quant unit.

This is a generalized version for all known coding modes. Its speed can be improved by creating separate functions for each mode.

Parameters
[in]gbthe GetBit context
[in]tabcode table telling how to decode spectral lines
[in]vlc_tabptr to the huffman table associated with the code table
[out]outpointer to buffer where decoded data should be stored
[in]num_specsnumber of spectral lines to decode

Definition at line 812 of file atrac3plus.c.

Referenced by decode_spectrum().

static void decode_spectrum ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  num_channels,
AVCodecContext avctx 
)
static

Decode huffman-coded IMDCT spectrum for all channels.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]num_channelsnumber of channels to process
[in]avctxptr to the AVCodecContext

Definition at line 851 of file atrac3plus.c.

Referenced by ff_atrac3p_decode_channel_unit().

static int get_subband_flags ( GetBitContext gb,
uint8_t out,
int  num_flags 
)
static

Retrieve specified amount of flag bits from the input bitstream.

The data can be shortened in the case of the following two common conditions: if all bits are zero then only one signal bit = 0 will be stored, if all bits are ones then two signal bits = 1,0 will be stored. Otherwise, all necessary bits will be directly stored prefixed by two signal bits = 1,1.

Parameters
[in]gbptr to the GetBitContext
[out]outwhere to place decoded flags
[in]num_flagsnumber of flags to process
Returns
: 0 = all flag bits are zero, 1 = there is at least one non-zero flag bit

Definition at line 921 of file atrac3plus.c.

Referenced by decode_tones_info(), decode_window_shape(), and ff_atrac3p_decode_channel_unit().

static void decode_window_shape ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  num_channels 
)
static

Decode mdct window shape flags for all channels.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]num_channelsnumber of channels to process

Definition at line 946 of file atrac3plus.c.

Referenced by ff_atrac3p_decode_channel_unit().

static int decode_gainc_npoints ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  ch_num,
int  coded_subbands 
)
static

Decode number of gain control points.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]ch_numchannel to process
[in]coded_subbandsnumber of subbands to process
Returns
result code: 0 = OK, otherwise - error code

Definition at line 965 of file atrac3plus.c.

Referenced by decode_gainc_data().

static void gainc_level_mode3s ( AtracGainInfo dst,
AtracGainInfo ref 
)
inlinestatic

Implements coding mode 3 (slave) for gain compensation levels.

Parameters
[out]dstptr to the output array
[in]refptr to the reference channel

Definition at line 1030 of file atrac3plus.c.

Referenced by decode_gainc_levels().

static void gainc_level_mode1m ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
AtracGainInfo dst 
)
inlinestatic

Implements coding mode 1 (master) for gain compensation levels.

Parameters
[in]gbthe GetBit context
[in]ctxptr to the channel unit context
[out]dstptr to the output array

Definition at line 1045 of file atrac3plus.c.

Referenced by decode_gainc_levels().

static int decode_gainc_levels ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  ch_num,
int  coded_subbands 
)
static

Decode level code for each gain control point.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]ch_numchannel to process
[in]coded_subbandsnumber of subbands to process
Returns
result code: 0 = OK, otherwise - error code

Definition at line 1071 of file atrac3plus.c.

Referenced by decode_gainc_data().

static void gainc_loc_mode0 ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
AtracGainInfo dst,
int  pos 
)
inlinestatic

Implements coding mode 0 for gain compensation locations.

Parameters
[in]gbthe GetBit context
[in]ctxptr to the channel unit context
[out]dstptr to the output array
[in]posposition of the value to be processed

Definition at line 1153 of file atrac3plus.c.

Referenced by decode_gainc_loc_codes().

static void gainc_loc_mode1 ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
AtracGainInfo dst 
)
inlinestatic

Implements coding mode 1 for gain compensation locations.

Parameters
[in]gbthe GetBit context
[in]ctxptr to the channel unit context
[out]dstptr to the output array

Definition at line 1176 of file atrac3plus.c.

Referenced by decode_gainc_loc_codes().

static int decode_gainc_loc_codes ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  ch_num,
int  coded_subbands,
AVCodecContext avctx 
)
static

Decode location code for each gain control point.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]ch_numchannel to process
[in]coded_subbandsnumber of subbands to process
[in]avctxptr to the AVCodecContext
Returns
result code: 0 = OK, otherwise - error code

Definition at line 1208 of file atrac3plus.c.

Referenced by decode_gainc_data().

static int decode_gainc_data ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  num_channels,
AVCodecContext avctx 
)
static

Decode gain control data for all channels.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]num_channelsnumber of channels to process
[in]avctxptr to the AVCodecContext
Returns
result code: 0 = OK, otherwise - error code

Definition at line 1362 of file atrac3plus.c.

Referenced by ff_atrac3p_decode_channel_unit().

static void decode_tones_envelope ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  ch_num,
int  band_has_tones[] 
)
static

Decode envelope for all tones of a channel.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]ch_numchannel to process
[in]band_has_tonesptr to an array of per-band-flags: 1 - tone data present

Definition at line 1405 of file atrac3plus.c.

Referenced by decode_tones_info().

static int decode_band_numwavs ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  ch_num,
int  band_has_tones[],
AVCodecContext avctx 
)
static

Decode number of tones for each subband of a channel.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]ch_numchannel to process
[in]band_has_tonesptr to an array of per-band-flags: 1 - tone data present
[in]avctxptr to the AVCodecContext
Returns
result code: 0 = OK, otherwise - error code

fixed-length coding

variable-length coding

VLC modulo delta to master (slave only)

copy master (slave only)

initialize start tone index for each subband

Definition at line 1446 of file atrac3plus.c.

Referenced by decode_tones_info().

static void decode_tones_frequency ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  ch_num,
int  band_has_tones[] 
)
static

Decode frequency information for each subband of a channel.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]ch_numchannel to process
[in]band_has_tonesptr to an array of per-band-flags: 1 - tone data present

packed numbers in descending order

packed numbers in ascending order

Definition at line 1510 of file atrac3plus.c.

Referenced by decode_tones_info().

static void decode_tones_amplitude ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  ch_num,
int  band_has_tones[] 
)
static

Decode amplitude information for each subband of a channel.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]ch_numchannel to process
[in]band_has_tonesptr to an array of per-band-flags: 1 - tone data present

fixed-length coding

min + VLC delta

VLC modulo delta to master (slave only)

clone master (slave only)

Definition at line 1570 of file atrac3plus.c.

Referenced by decode_tones_info().

static void decode_tones_phase ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  ch_num,
int  band_has_tones[] 
)
static

Decode phase information for each subband of a channel.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]ch_numchannel to process
[in]band_has_tonesptr to an array of per-band-flags: 1 - tone data present

Definition at line 1670 of file atrac3plus.c.

Referenced by decode_tones_info().

static int decode_tones_info ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  num_channels,
AVCodecContext avctx 
)
static

Decode tones info for all channels.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]num_channelsnumber of channels to process
[in]avctxptr to the AVCodecContext
Returns
result code: 0 = OK, otherwise - error code

Definition at line 1695 of file atrac3plus.c.

Referenced by ff_atrac3p_decode_channel_unit().

int ff_atrac3p_decode_channel_unit ( GetBitContext gb,
Atrac3pChanUnitCtx ctx,
int  num_channels,
AVCodecContext avctx 
)

Decode bitstream data of a channel unit.

Parameters
[in]gbthe GetBit context
[in,out]ctxptr to the channel unit context
[in]num_channelsnumber of channels to process
[in]avctxptr to the AVCodecContext
Returns
result code: 0 = OK, otherwise - error code

Definition at line 1757 of file atrac3plus.c.

Referenced by atrac3p_decode_frame().

Variable Documentation

VLC_TYPE tables_data[154276][2]
static

Definition at line 34 of file atrac3plus.c.

Referenced by build_canonical_huff(), and ff_atrac3p_init_vlcs().

VLC wl_vlc_tabs[4]
static

Definition at line 35 of file atrac3plus.c.

VLC sf_vlc_tabs[8]
static

Definition at line 36 of file atrac3plus.c.

VLC ct_vlc_tabs[4]
static

Definition at line 37 of file atrac3plus.c.

Referenced by decode_channel_code_tab().

VLC spec_vlc_tabs[112]
static

Definition at line 38 of file atrac3plus.c.

VLC gain_vlc_tabs[11]
static

Definition at line 39 of file atrac3plus.c.

VLC tone_vlc_tabs[7]
static

Definition at line 40 of file atrac3plus.c.