libavcodec/aacps.c File Reference

#include <stdint.h>
#include "libavutil/common.h"
#include "libavutil/mathematics.h"
#include "avcodec.h"
#include "get_bits.h"
#include "aacps.h"
#include "aacps_tablegen.h"
#include "aacpsdata.c"

Go to the source code of this file.

Defines

#define PS_BASELINE   0
#define numQMFSlots   32
#define READ_PAR_DATA(PAR, OFFSET, MASK, ERR_CONDITION)
 Read Inter-channel Intensity Difference/Inter-Channel Coherence/ Inter-channel Phase Difference/Overall Phase Difference parameters from the bitstream.
#define DECAY_SLOPE   0.05f
#define PS_INIT_VLC_STATIC(num, size)
#define PS_VLC_ROW(name)   { name ## _codes, name ## _bits, sizeof(name ## _codes), sizeof(name ## _codes[0]) }

Enumerations

enum  {
  huff_iid_df1, huff_iid_dt1, huff_iid_df0, huff_iid_dt0,
  huff_icc_df, huff_icc_dt, huff_ipd_df, huff_ipd_dt,
  huff_opd_df, huff_opd_dt
}

Functions

 READ_PAR_DATA (iid, huff_offset[table_idx], 0, FFABS(ps->iid_par[e][b]) > 7+8 *ps->iid_quant) static int ps_read_extension_data(GetBitContext *gb
static void map_idx_10_to_20 (int8_t *par_mapped, const int8_t *par, int full)
 Table 8.46.
static void map_idx_34_to_20 (int8_t *par_mapped, const int8_t *par, int full)
static void map_val_34_to_20 (float par[PS_MAX_NR_IIDICC])
static void map_idx_10_to_34 (int8_t *par_mapped, const int8_t *par, int full)
static void map_idx_20_to_34 (int8_t *par_mapped, const int8_t *par, int full)
static void map_val_20_to_34 (float par[PS_MAX_NR_IIDICC])
static void decorrelation (PSContext *ps, float(*out)[32][2], const float(*s)[32][2], int is34)
static void remap34 (int8_t(**p_par_mapped)[PS_MAX_NR_IIDICC], int8_t(*par)[PS_MAX_NR_IIDICC], int num_par, int num_env, int full)
static void remap20 (int8_t(**p_par_mapped)[PS_MAX_NR_IIDICC], int8_t(*par)[PS_MAX_NR_IIDICC], int num_par, int num_env, int full)
static void stereo_processing (PSContext *ps, float(*l)[32][2], float(*r)[32][2], int is34)
int ff_ps_apply (AVCodecContext *avctx, PSContext *ps, float L[2][38][64], float R[2][38][64], int top)
av_cold void ff_ps_init (void)
av_cold void ff_ps_ctx_init (PSContext *ps)

Variables

static const int8_t num_env_tab [2][4]
static const int8_t nr_iidicc_par_tab []
static const int8_t nr_iidopd_par_tab []
static const int huff_iid []
static VLC vlc_ps [10]
PSContextps
static const int NR_BANDS [] = { 71, 91 }
 Number of frequency bands that can be addressed by the sub subband index, k.
static const int DECAY_CUTOFF [] = { 10, 32 }
 Start frequency band for the all-pass filter decay slope.
static const int NR_ALLPASS_BANDS [] = { 30, 50 }
 Number of all-pass filer bands.
static const int SHORT_DELAY_BAND [] = { 42, 62 }
 First stereo band using the short one sample delay.


Define Documentation

#define DECAY_SLOPE   0.05f

Referenced by decorrelation().

#define numQMFSlots   32

Definition at line 35 of file aacps.c.

Referenced by decorrelation().

#define PS_BASELINE   0

Definition at line 31 of file aacps.c.

Referenced by stereo_processing().

#define PS_INIT_VLC_STATIC ( num,
size   ) 

Value:

INIT_VLC_STATIC(&vlc_ps[num], 9, ps_tmp[num].table_size / ps_tmp[num].elem_size,    \
                    ps_tmp[num].ps_bits, 1, 1,                                          \
                    ps_tmp[num].ps_codes, ps_tmp[num].elem_size, ps_tmp[num].elem_size, \
                    size);

Definition at line 994 of file aacps.c.

Referenced by ff_ps_init().

#define PS_VLC_ROW ( name   )     { name ## _codes, name ## _bits, sizeof(name ## _codes), sizeof(name ## _codes[0]) }

Definition at line 1000 of file aacps.c.

Referenced by ff_ps_init().

#define READ_PAR_DATA ( PAR,
OFFSET,
MASK,
ERR_CONDITION   ) 

Value:

static int read_ ## PAR ## _data(AVCodecContext *avctx, GetBitContext *gb, PSContext *ps, \
                        int8_t (*PAR)[PS_MAX_NR_IIDICC], int table_idx, int e, int dt) \
{ \
    int b, num = ps->nr_ ## PAR ## _par; \
    VLC_TYPE (*vlc_table)[2] = vlc_ps[table_idx].table; \
    if (dt) { \
        int e_prev = e ? e - 1 : ps->num_env_old - 1; \
        e_prev = FFMAX(e_prev, 0); \
        for (b = 0; b < num; b++) { \
            int val = PAR[e_prev][b] + get_vlc2(gb, vlc_table, 9, 3) - OFFSET; \
            if (MASK) val &= MASK; \
            PAR[e][b] = val; \
            if (ERR_CONDITION) \
                goto err; \
        } \
    } else { \
        int val = 0; \
        for (b = 0; b < num; b++) { \
            val += get_vlc2(gb, vlc_table, 9, 3) - OFFSET; \
            if (MASK) val &= MASK; \
            PAR[e][b] = val; \
            if (ERR_CONDITION) \
                goto err; \
        } \
    } \
    return 0; \
err: \
    av_log(avctx, AV_LOG_ERROR, "illegal "#PAR"\n"); \
    return -1; \
}
Read Inter-channel Intensity Difference/Inter-Channel Coherence/ Inter-channel Phase Difference/Overall Phase Difference parameters from the bitstream.

Parameters:
avctx contains the current codec context
gb pointer to the input bitstream
ps pointer to the Parametric Stereo context
par pointer to the parameter to be read
e envelope to decode
dt 1: time delta-coded, 0: frequency delta-coded

Definition at line 84 of file aacps.c.


Enumeration Type Documentation

anonymous enum

Enumerator:
huff_iid_df1 
huff_iid_dt1 
huff_iid_df0 
huff_iid_dt0 
huff_icc_df 
huff_icc_dt 
huff_ipd_df 
huff_ipd_dt 
huff_opd_df 
huff_opd_dt 

Definition at line 50 of file aacps.c.


Function Documentation

static void decorrelation ( PSContext ps,
float(*)  out[32][2],
const float(*)  s[32][2],
int  is34 
) [static]

Definition at line 645 of file aacps.c.

Referenced by ff_ps_apply().

int ff_ps_apply ( AVCodecContext avctx,
PSContext ps,
float  L[2][38][64],
float  R[2][38][64],
int  top 
)

Definition at line 973 of file aacps.c.

Referenced by ff_sbr_apply().

av_cold void ff_ps_ctx_init ( PSContext ps  ) 

Definition at line 1035 of file aacps.c.

Referenced by ff_aac_sbr_ctx_init().

av_cold void ff_ps_init ( void   ) 

Definition at line 1003 of file aacps.c.

Referenced by ff_aac_sbr_init().

static void map_idx_10_to_20 ( int8_t *  par_mapped,
const int8_t *  par,
int  full 
) [static]

Table 8.46.

Definition at line 461 of file aacps.c.

Referenced by remap20().

static void map_idx_10_to_34 ( int8_t *  par_mapped,
const int8_t *  par,
int  full 
) [static]

Definition at line 525 of file aacps.c.

Referenced by remap34().

static void map_idx_20_to_34 ( int8_t *  par_mapped,
const int8_t *  par,
int  full 
) [static]

Definition at line 567 of file aacps.c.

Referenced by remap34().

static void map_idx_34_to_20 ( int8_t *  par_mapped,
const int8_t *  par,
int  full 
) [static]

Definition at line 475 of file aacps.c.

Referenced by remap20().

static void map_val_20_to_34 ( float  par[PS_MAX_NR_IIDICC]  )  [static]

Definition at line 607 of file aacps.c.

Referenced by stereo_processing().

static void map_val_34_to_20 ( float  par[PS_MAX_NR_IIDICC]  )  [static]

Definition at line 501 of file aacps.c.

Referenced by stereo_processing().

READ_PAR_DATA ( iid  ,
huff_offset  [table_idx],
,
FFABS(ps->iid_par[e][b])  ,
7+8 *ps->  iid_quant 
)

static void remap20 ( int8_t(**)  p_par_mapped[PS_MAX_NR_IIDICC],
int8_t(*)  par[PS_MAX_NR_IIDICC],
int  num_par,
int  num_env,
int  full 
) [static]

Definition at line 775 of file aacps.c.

Referenced by stereo_processing().

static void remap34 ( int8_t(**)  p_par_mapped[PS_MAX_NR_IIDICC],
int8_t(*)  par[PS_MAX_NR_IIDICC],
int  num_par,
int  num_env,
int  full 
) [static]

Definition at line 756 of file aacps.c.

Referenced by stereo_processing().

static void stereo_processing ( PSContext ps,
float(*)  l[32][2],
float(*)  r[32][2],
int  is34 
) [static]

Definition at line 794 of file aacps.c.

Referenced by ff_ps_apply().


Variable Documentation

const int DECAY_CUTOFF[] = { 10, 32 } [static]

Start frequency band for the all-pass filter decay slope.

Definition at line 454 of file aacps.c.

Referenced by decorrelation().

const int huff_iid[] [static]

Initial value:

Definition at line 63 of file aacps.c.

const int NR_ALLPASS_BANDS[] = { 30, 50 } [static]

Number of all-pass filer bands.

Definition at line 456 of file aacps.c.

Referenced by decorrelation(), and ff_ps_apply().

const int NR_BANDS[] = { 71, 91 } [static]

Number of frequency bands that can be addressed by the sub subband index, k.

Definition at line 452 of file aacps.c.

Referenced by decorrelation(), ff_ps_apply(), and stereo_processing().

const int8_t nr_iidicc_par_tab[] [static]

Initial value:

 {
    10, 20, 34, 10, 20, 34,
}

Definition at line 42 of file aacps.c.

const int8_t nr_iidopd_par_tab[] [static]

Initial value:

 {
     5, 11, 17,  5, 11, 17,
}

Definition at line 46 of file aacps.c.

const int8_t num_env_tab[2][4] [static]

Initial value:

 {
    { 0, 1, 2, 4, },
    { 1, 2, 3, 4, },
}

Definition at line 37 of file aacps.c.

const int SHORT_DELAY_BAND[] = { 42, 62 } [static]

First stereo band using the short one sample delay.

Definition at line 458 of file aacps.c.

Referenced by decorrelation().

VLC vlc_ps[10] [static]

Definition at line 70 of file aacps.c.


Generated on Mon May 2 19:50:14 2011 for FFmpeg by  doxygen 1.5.6