1 /*
2 * Real Audio 1.0 (14.4K)
3 * Copyright (c) 2003 The FFmpeg Project
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #ifndef AVCODEC_RA144_H
23 #define AVCODEC_RA144_H
24
25 #include <stdint.h>
29
30 #define NBLOCKS 4 ///< number of subblocks within a block
31 #define BLOCKSIZE 40
///< subblock size in 16-bit words
32 #define BUFFERSIZE 146
///< the size of the adaptive codebook
33 #define FIXED_CB_SIZE 128
///< size of fixed codebooks
34 #define FRAME_SIZE 20
///< size of encoded frame
35 #define LPC_ORDER 10
///< order of LPC filter
36
43
45
47
48 /** LPC coefficients: lpc_coef[0] is the coefficients of the current frame
49 * and lpc_coef[1] of the previous one. */
51
53
55
56 /** The current subblock padded by the last 10 values of the previous one. */
58
59 /** Adaptive codebook, its size is two units bigger to avoid a
60 * buffer overflow. */
62
65
73 int energy);
74 unsigned int ff_rescale_rms(
unsigned int rms,
unsigned int energy);
77 int cba_idx, int cb1_idx, int cb2_idx,
78 int gval, int gain);
79
88
89 #endif /* AVCODEC_RA144_H */
unsigned int lpc_tables[2][10]
unsigned int ff_rms(const int *data)
ptrdiff_t const GLvoid * data
const uint16_t ff_cb1_base[128]
int16_t adapt_cb[146+2]
Adaptive codebook, its size is two units bigger to avoid a buffer overflow.
#define DECLARE_ALIGNED(n, t, v)
void ff_subblock_synthesis(RA144Context *ractx, const int16_t *lpc_coefs, int cba_idx, int cb1_idx, int cb2_idx, int gval, int gain)
int ff_irms(AudioDSPContext *adsp, const int16_t *data)
inverse root mean square
#define NBLOCKS
number of subblocks within a block
const int16_t ff_energy_tab[32]
unsigned int lpc_refl_rms[2]
int ff_eval_refl(int *refl, const int16_t *coefs, AVCodecContext *avctx)
Evaluate the reflection coefficients from the filter coefficients.
void ff_int_to_int16(int16_t *out, const int *inp)
int ff_interp(RA144Context *ractx, int16_t *out, int a, int copyold, int energy)
unsigned int * lpc_coef[2]
LPC coefficients: lpc_coef[0] is the coefficients of the current frame and lpc_coef[1] of the previou...
const int8_t ff_cb2_vects[128][40]
static const uint8_t offset[127][2]
unsigned int ff_rescale_rms(unsigned int rms, unsigned int energy)
#define BLOCKSIZE
subblock size in 16-bit words
const int8_t ff_cb1_vects[128][40]
const int16_t ff_gain_val_tab[256][3]
main external API structure.
void ff_eval_coefs(int *coefs, const int *refl)
Evaluate the LPC filter coefficients from the reflection coefficients.
void ff_copy_and_dup(int16_t *target, const int16_t *source, int offset)
Copy the last offset values of *source to *target.
const uint16_t ff_cb2_base[128]
int16_t buffer_a[FFALIGN(BLOCKSIZE, 16)]
unsigned int old_energy
previous frame energy
int16_t curr_sblock[50]
The current subblock padded by the last 10 values of the previous one.
int ff_t_sqrt(unsigned int x)
Evaluate sqrt(x << 24).
int16_t curr_block[NBLOCKS *BLOCKSIZE]
const uint8_t ff_gain_exp_tab[256]
const int16_t *const ff_lpc_refl_cb[10]