1 /*
2 * audio encoder psychoacoustic model
3 * Copyright (C) 2008 Konstantin Shishkov
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 #include <string.h>
23
28
30
32 const uint8_t **bands,
const int* num_bands,
33 int num_groups,
const uint8_t *group_map)
34 {
35 int i, j, k = 0;
36
42 memcpy(ctx->
bands, bands,
sizeof(ctx->
bands[0]) * num_lens);
44
45 /* assign channels to groups (with virtual channels for coupling) */
46 for (i = 0; i < num_groups; i++) {
47 /* NOTE: Add 1 to handle the AAC chan_config without modification.
48 * This has the side effect of allowing an array of 0s to map
49 * to one channel per group.
50 */
54 }
55
59 break;
60 }
63 return 0;
64 }
65
67 {
68 int i = 0, ch = 0;
69
70 while (ch <= channel)
72
73 return &ctx->
group[i-1];
74 }
75
77 {
84 }
85
93
95
97 {
99 int i;
100 float cutoff_coeff = 0;
103
106
109
110 if (cutoff_coeff && cutoff_coeff < 0.98)
113 cutoff_coeff, 0.0, 0.0);
116 for (i = 0; i < avctx->
channels; i++)
118 }
119
121
122 return ctx;
123 }
124
126 {
127 int ch;
130
132 for (ch = 0; ch < channels; ch++)
134 &audio[ch][frame_size], 1, &audio[ch][frame_size], 1);
135 }
136 }
137
139 {
140 int i;
147 }