00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AVCODEC_RA144_H
00023 #define AVCODEC_RA144_H
00024
00025 #include <stdint.h>
00026 #include "lpc.h"
00027
00028 #define NBLOCKS 4
00029 #define BLOCKSIZE 40
00030 #define BUFFERSIZE 146
00031 #define FIXED_CB_SIZE 128
00032 #define FRAMESIZE 20
00033 #define LPC_ORDER 10
00034
00035 typedef struct {
00036 AVCodecContext *avctx;
00037 LPCContext lpc_ctx;
00038
00039 unsigned int old_energy;
00040
00041 unsigned int lpc_tables[2][10];
00042
00045 unsigned int *lpc_coef[2];
00046
00047 unsigned int lpc_refl_rms[2];
00048
00049 int16_t curr_block[NBLOCKS * BLOCKSIZE];
00050
00052 int16_t curr_sblock[50];
00053
00056 uint16_t adapt_cb[146+2];
00057 } RA144Context;
00058
00059 void ff_copy_and_dup(int16_t *target, const int16_t *source, int offset);
00060 int ff_eval_refl(int *refl, const int16_t *coefs, AVCodecContext *avctx);
00061 void ff_eval_coefs(int *coefs, const int *refl);
00062 void ff_int_to_int16(int16_t *out, const int *inp);
00063 int ff_t_sqrt(unsigned int x);
00064 unsigned int ff_rms(const int *data);
00065 int ff_interp(RA144Context *ractx, int16_t *out, int a, int copyold,
00066 int energy);
00067 unsigned int ff_rescale_rms(unsigned int rms, unsigned int energy);
00068 int ff_irms(const int16_t *data);
00069 void ff_subblock_synthesis(RA144Context *ractx, const uint16_t *lpc_coefs,
00070 int cba_idx, int cb1_idx, int cb2_idx,
00071 int gval, int gain);
00072
00073 extern const int16_t ff_gain_val_tab[256][3];
00074 extern const uint8_t ff_gain_exp_tab[256];
00075 extern const int8_t ff_cb1_vects[128][40];
00076 extern const int8_t ff_cb2_vects[128][40];
00077 extern const uint16_t ff_cb1_base[128];
00078 extern const uint16_t ff_cb2_base[128];
00079 extern const int16_t ff_energy_tab[32];
00080 extern const int16_t * const ff_lpc_refl_cb[10];
00081
00082 #endif