00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AVCODEC_PS_H
00023 #define AVCODEC_PS_H
00024
00025 #include <stdint.h>
00026
00027 #include "aacpsdsp.h"
00028 #include "avcodec.h"
00029 #include "get_bits.h"
00030
00031 #define PS_MAX_NUM_ENV 5
00032 #define PS_MAX_NR_IIDICC 34
00033 #define PS_MAX_NR_IPDOPD 17
00034 #define PS_MAX_SSB 91
00035 #define PS_MAX_AP_BANDS 50
00036 #define PS_QMF_TIME_SLOTS 32
00037 #define PS_MAX_DELAY 14
00038 #define PS_AP_LINKS 3
00039 #define PS_MAX_AP_DELAY 5
00040
00041 typedef struct {
00042 int start;
00043 int enable_iid;
00044 int iid_quant;
00045 int nr_iid_par;
00046 int nr_ipdopd_par;
00047 int enable_icc;
00048 int icc_mode;
00049 int nr_icc_par;
00050 int enable_ext;
00051 int frame_class;
00052 int num_env_old;
00053 int num_env;
00054 int enable_ipdopd;
00055 int border_position[PS_MAX_NUM_ENV+1];
00056 int8_t iid_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];
00057 int8_t icc_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];
00058
00059 int8_t ipd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];
00060 int8_t opd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];
00061 int is34bands;
00062 int is34bands_old;
00063
00064 DECLARE_ALIGNED(16, float, in_buf)[5][44][2];
00065 DECLARE_ALIGNED(16, float, delay)[PS_MAX_SSB][PS_QMF_TIME_SLOTS + PS_MAX_DELAY][2];
00066 DECLARE_ALIGNED(16, float, ap_delay)[PS_MAX_AP_BANDS][PS_AP_LINKS][PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2];
00067 DECLARE_ALIGNED(16, float, peak_decay_nrg)[34];
00068 DECLARE_ALIGNED(16, float, power_smooth)[34];
00069 DECLARE_ALIGNED(16, float, peak_decay_diff_smooth)[34];
00070 DECLARE_ALIGNED(16, float, H11)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
00071 DECLARE_ALIGNED(16, float, H12)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
00072 DECLARE_ALIGNED(16, float, H21)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
00073 DECLARE_ALIGNED(16, float, H22)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC];
00074 int8_t opd_hist[PS_MAX_NR_IIDICC];
00075 int8_t ipd_hist[PS_MAX_NR_IIDICC];
00076 PSDSPContext dsp;
00077 } PSContext;
00078
00079 void ff_ps_init(void);
00080 void ff_ps_ctx_init(PSContext *ps);
00081 int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb, PSContext *ps, int bits_left);
00082 int ff_ps_apply(AVCodecContext *avctx, PSContext *ps, float L[2][38][64], float R[2][38][64], int top);
00083
00084 #endif