• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

libavcodec/ra144.h

Go to the documentation of this file.
00001 /*
00002  * Real Audio 1.0 (14.4K)
00003  * Copyright (c) 2003 the ffmpeg project
00004  *
00005  * This file is part of Libav.
00006  *
00007  * Libav is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * Libav is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with Libav; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
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       ///< number of subblocks within a block
00029 #define BLOCKSIZE       40      ///< subblock size in 16-bit words
00030 #define BUFFERSIZE      146     ///< the size of the adaptive codebook
00031 #define FIXED_CB_SIZE   128     ///< size of fixed codebooks
00032 #define FRAMESIZE       20      ///< size of encoded frame
00033 #define LPC_ORDER       10      ///< order of LPC filter
00034 
00035 typedef struct {
00036     AVCodecContext *avctx;
00037     AVFrame frame;
00038     LPCContext lpc_ctx;
00039 
00040     unsigned int     old_energy;        
00041 
00042     unsigned int     lpc_tables[2][10];
00043 
00046     unsigned int    *lpc_coef[2];
00047 
00048     unsigned int     lpc_refl_rms[2];
00049 
00050     int16_t curr_block[NBLOCKS * BLOCKSIZE];
00051 
00053     int16_t curr_sblock[50];
00054 
00057     uint16_t adapt_cb[146+2];
00058 } RA144Context;
00059 
00060 void ff_copy_and_dup(int16_t *target, const int16_t *source, int offset);
00061 int ff_eval_refl(int *refl, const int16_t *coefs, AVCodecContext *avctx);
00062 void ff_eval_coefs(int *coefs, const int *refl);
00063 void ff_int_to_int16(int16_t *out, const int *inp);
00064 int ff_t_sqrt(unsigned int x);
00065 unsigned int ff_rms(const int *data);
00066 int ff_interp(RA144Context *ractx, int16_t *out, int a, int copyold,
00067               int energy);
00068 unsigned int ff_rescale_rms(unsigned int rms, unsigned int energy);
00069 int ff_irms(const int16_t *data);
00070 void ff_subblock_synthesis(RA144Context *ractx, const uint16_t *lpc_coefs,
00071                            int cba_idx, int cb1_idx, int cb2_idx,
00072                            int gval, int gain);
00073 
00074 extern const int16_t ff_gain_val_tab[256][3];
00075 extern const uint8_t ff_gain_exp_tab[256];
00076 extern const int8_t ff_cb1_vects[128][40];
00077 extern const int8_t ff_cb2_vects[128][40];
00078 extern const uint16_t ff_cb1_base[128];
00079 extern const uint16_t ff_cb2_base[128];
00080 extern const int16_t ff_energy_tab[32];
00081 extern const int16_t * const ff_lpc_refl_cb[10];
00082 
00083 #endif /* AVCODEC_RA144_H */
Generated on Sat Mar 17 2012 12:57:48 for Libav by doxygen 1.7.1