Lines Matching refs:ch

8  * Copyright (C) 2004-2005  Henryk Ploetz <henryk@ploetzli.ch>
85 int ch, sb;
87 for (ch = 0; ch < frame->channels; ch++) {
91 bitneed[ch][sb] = frame->scale_factor[ch][sb];
92 if (bitneed[ch][sb] > max_bitneed)
93 max_bitneed = bitneed[ch][sb];
97 if (frame->scale_factor[ch][sb] == 0)
98 bitneed[ch][sb] = -5;
101 loudness = frame->scale_factor[ch][sb] - sbc_offset4[sf][sb];
103 loudness = frame->scale_factor[ch][sb] - sbc_offset8[sf][sb];
105 bitneed[ch][sb] = loudness / 2;
107 bitneed[ch][sb] = loudness;
109 if (bitneed[ch][sb] > max_bitneed)
110 max_bitneed = bitneed[ch][sb];
122 if ((bitneed[ch][sb] > bitslice + 1) && (bitneed[ch][sb] < bitslice + 16))
124 else if (bitneed[ch][sb] == bitslice + 1)
135 if (bitneed[ch][sb] < bitslice + 2)
136 bits[ch][sb] = 0;
138 bits[ch][sb] = bitneed[ch][sb] - bitslice;
139 if (bits[ch][sb] > 16)
140 bits[ch][sb] = 16;
146 if ((bits[ch][sb] >= 2) && (bits[ch][sb] < 16)) {
147 bits[ch][sb]++;
149 } else if ((bitneed[ch][sb] == bitslice + 1) && (frame->bitpool > bitcount + 1)) {
150 bits[ch][sb] = 2;
157 if (bits[ch][sb] < 16) {
158 bits[ch][sb]++;
167 int ch, sb;
171 for (ch = 0; ch < 2; ch++) {
173 bitneed[ch][sb] = frame->scale_factor[ch][sb];
174 if (bitneed[ch][sb] > max_bitneed)
175 max_bitneed = bitneed[ch][sb];
179 for (ch = 0; ch < 2; ch++) {
181 if (frame->scale_factor[ch][sb] == 0)
182 bitneed[ch][sb] = -5;
185 loudness = frame->scale_factor[ch][sb] - sbc_offset4[sf][sb];
187 loudness = frame->scale_factor[ch][sb] - sbc_offset8[sf][sb];
189 bitneed[ch][sb] = loudness / 2;
191 bitneed[ch][sb] = loudness;
193 if (bitneed[ch][sb] > max_bitneed)
194 max_bitneed = bitneed[ch][sb];
206 for (ch = 0; ch < 2; ch++) {
208 if ((bitneed[ch][sb] > bitslice + 1) && (bitneed[ch][sb] < bitslice + 16))
210 else if (bitneed[ch][sb] == bitslice + 1)
221 for (ch = 0; ch < 2; ch++) {
223 if (bitneed[ch][sb] < bitslice + 2) {
224 bits[ch][sb] = 0;
226 bits[ch][sb] = bitneed[ch][sb] - bitslice;
227 if (bits[ch][sb] > 16)
228 bits[ch][sb] = 16;
233 ch = 0;
236 if ((bits[ch][sb] >= 2) && (bits[ch][sb] < 16)) {
237 bits[ch][sb]++;
239 } else if ((bitneed[ch][sb] == bitslice + 1) && (frame->bitpool > bitcount + 1)) {
240 bits[ch][sb] = 2;
243 if (ch == 1) {
244 ch = 0;
249 ch = 1;
252 ch = 0;
255 if (bits[ch][sb] < 16) {
256 bits[ch][sb]++;
259 if (ch == 1) {
260 ch = 0;
265 ch = 1;