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 {
77 uint32_t crc, CRC;
78
79 if (buf_size < 4)
81 buf_size -= 3;
82
85 if (CRC != crc)
87
88 return 0;
89 }
90
92 {
93 uint64_t channel_mask = 0;
94 int frame_type, i;
95
98
101
109
115
118 }
119 }
120 }
121
124 }
125
128 {
132 }
133
136
140 } else {
142 }
143
146
150 }
151
154
156
157 return 0;
158 }