1 /*
2 * Real Audio 1.0 (14.4K)
3 *
4 * Copyright (c) 2008 Vitor Sessak
5 * Copyright (c) 2003 Nick Kurshev
6 * Based on public domain decoder at http://www.honeypot.net/audio
7 *
8 * This file is part of FFmpeg.
9 *
10 * FFmpeg is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
14 *
15 * FFmpeg is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with FFmpeg; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
24
30
31
33 {
35
38
41
45
46 return 0;
47 }
48
51 {
52 int cba_idx =
get_bits(gb, 7);
// index of the adaptive CB, 0 if none
56
58 gain);
59 }
60
61 /** Uncompress one block (20 bytes -> 160*2 bytes). */
64 {
67 int buf_size = avpkt->
size;
69 unsigned int refl_rms[
NBLOCKS];
// RMS of the reflection coefficients
70 int16_t block_coefs[
NBLOCKS][
LPC_ORDER];
// LPC coefficients of each sub-block
71 unsigned int lpc_refl[
LPC_ORDER];
// LPC reflection coefficients of the frame
72 int i, j;
74 int16_t *samples;
75 unsigned int energy;
76
79
82 "Frame too small (%d bytes). Truncated file?\n", buf_size);
83 *got_frame_ptr = 0;
85 }
86
87 /* get output buffer */
91 samples = (int16_t *)frame->
data[0];
92
94
97
100
102
104 refl_rms[1] =
ff_interp(ractx, block_coefs[1], 2,
105 energy <= ractx->old_energy,
107 refl_rms[2] =
ff_interp(ractx, block_coefs[2], 3, 0, energy);
109
111
114
116 *samples++ = av_clip_int16(ractx->
curr_sblock[j + 10] << 2);
117 }
118
121
123
124 *got_frame_ptr = 1;
125
127 }
128
138 };