1 /*
2 * TAK common code
3 * Copyright (c) 2012 Paul B Mahol
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
25
27 0,
46 };
47
49 3, 4, 6, 8, 4096, 8192, 16384, 512, 1024, 2048,
50 };
51
53 {
54 int nb_samples, max_nb_samples;
55
59 max_nb_samples = 16384;
62 max_nb_samples = sample_rate *
65 } else {
67 }
68
69 if (nb_samples <= 0 || nb_samples > max_nb_samples)
71
72 return nb_samples;
73 }
74
76 #if CONFIG_SMALL
77 #define CRC_TABLE_SIZE 257
78 #else
79 #define CRC_TABLE_SIZE 1024
80 #endif
82
84 {
88 }
89 }
90
92 {
93 uint32_t crc, CRC;
94
95 if (buf_size < 4)
97 buf_size -= 3;
98
101 if (CRC != crc)
103
104 return 0;
105 }
106
108 {
109 uint64_t channel_mask = 0;
110 int frame_type, i;
111
114
117
125
131
134 }
135 }
136 }
137
140 }
141
144 {
148 }
149
152
156 } else {
158 }
159
162
166 }
167
170
172
173 return 0;
174 }