1 /*
2 * AAC coefficients encoder
3 * Copyright (C) 2008-2009 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 /**
23 * @file
24 * AAC coefficients encoder
25 */
26
27 /***********************************
28 * TODOs:
29 * speedup quantizer selection
30 * add sane pulse detection
31 ***********************************/
32
33 #include "libavutil/libm.h" // brought forward to work around cygwin header breakage
34
36
47
52
54
55 /* Parameter of f(x) = a*(lambda/100), defines the maximum fourier spread
56 * beyond which no PNS is used (since the SFBs contain tone rather than noise) */
57 #define NOISE_SPREAD_THRESHOLD 0.9f
58
59 /* Parameter of f(x) = a*(100/lambda), defines how much PNS is allowed to
60 * replace low energy non zero bands */
61 #define NOISE_LAMBDA_REPLACE 1.948f
62
64
66 const float *in,
float *
quant,
const float *scaled,
67 int size,
int scale_idx,
int cb,
68 const float lambda,
const float uplim,
69 int *
bits,
float *energy);
70
71 /**
72 * Calculate rate distortion cost for quantizing with given codebook
73 *
74 * @return quantization distortion
75 */
79 const float *scaled,
int size,
int scale_idx,
80 int cb,
const float lambda,
const float uplim,
81 int *
bits,
float *energy,
int BT_ZERO,
int BT_UNSIGNED,
82 int BT_PAIR, int BT_ESC, int BT_NOISE, int BT_STEREO,
83 const float ROUNDING)
84 {
89 const float CLIPPED_ESCAPE = 165140.0f*IQ;
90 float cost = 0;
91 float qenergy = 0;
92 const int dim = BT_PAIR ? 2 : 4;
93 int resbits = 0;
94 int off;
95
96 if (BT_ZERO || BT_NOISE || BT_STEREO) {
101 if (energy)
102 *energy = qenergy;
105 for (
int j = 0; j <
dim; j++)
107 }
109 }
110 if (!scaled) {
111 s->aacdsp.abs_pow34(
s->scoefs, in,
size);
113 }
115 if (BT_UNSIGNED) {
116 off = 0;
117 } else {
119 }
121 const float *vec;
122 int *quants =
s->qcoefs +
i;
123 int curidx = 0;
124 int curbits;
125 float quantized, rd = 0.0f;
126 for (
int j = 0; j <
dim; j++) {
128 curidx += quants[j] + off;
129 }
132 if (BT_UNSIGNED) {
133 for (
int j = 0; j <
dim; j++) {
135 float di;
136 if (BT_ESC && vec[j] == 64.0
f) {
//FIXME: slow
137 if (t >= CLIPPED_ESCAPE) {
138 quantized = CLIPPED_ESCAPE;
139 curbits += 21;
140 } else {
144 }
145 } else {
146 quantized = vec[j]*IQ;
147 }
148 di = t - quantized;
150 out[
i+j] = in[
i+j] >= 0 ? quantized : -quantized;
152 curbits++;
153 qenergy += quantized*quantized;
154 rd += di*di;
155 }
156 } else {
157 for (
int j = 0; j <
dim; j++) {
158 quantized = vec[j]*IQ;
159 qenergy += quantized*quantized;
161 out[
i+j] = quantized;
162 rd += (in[
i+j] - quantized)*(in[
i+j] - quantized);
163 }
164 }
165 cost += rd *
lambda + curbits;
166 resbits += curbits;
167 if (cost >= uplim)
168 return uplim;
171 if (BT_UNSIGNED)
172 for (
int j = 0; j <
dim; j++)
175 if (BT_ESC) {
176 for (int j = 0; j < 2; j++) {
180
183 }
184 }
185 }
186 }
187 }
188
191 if (energy)
192 *energy = qenergy;
193 return cost;
194 }
195
197 const float *in,
float *
quant,
const float *scaled,
198 int size,
int scale_idx,
int cb,
199 const float lambda,
const float uplim,
200 int *
bits,
float *energy) {
202 return 0.0f;
203 }
204
205 #define QUANTIZE_AND_ENCODE_BAND_COST_FUNC(NAME, BT_ZERO, BT_UNSIGNED, BT_PAIR, BT_ESC, BT_NOISE, BT_STEREO, ROUNDING) \
206 static float quantize_and_encode_band_cost_ ## NAME( \
207 struct AACEncContext *s, \
208 PutBitContext *pb, const float *in, float *quant, \
209 const float *scaled, int size, int scale_idx, \
210 int cb, const float lambda, const float uplim, \
211 int *bits, float *energy) { \
212 return quantize_and_encode_band_cost_template( \
213 s, pb, in, quant, scaled, size, scale_idx, \
214 BT_ESC ? ESC_BT : cb, lambda, uplim, bits, energy, \
215 BT_ZERO, BT_UNSIGNED, BT_PAIR, BT_ESC, BT_NOISE, BT_STEREO, \
216 ROUNDING); \
217 }
218
228
230 {
231 quantize_and_encode_band_cost_ZERO,
232 quantize_and_encode_band_cost_SQUAD,
233 quantize_and_encode_band_cost_SQUAD,
234 quantize_and_encode_band_cost_UQUAD,
235 quantize_and_encode_band_cost_UQUAD,
236 quantize_and_encode_band_cost_SPAIR,
237 quantize_and_encode_band_cost_SPAIR,
238 quantize_and_encode_band_cost_UPAIR,
239 quantize_and_encode_band_cost_UPAIR,
240 quantize_and_encode_band_cost_UPAIR,
241 quantize_and_encode_band_cost_UPAIR,
242 quantize_and_encode_band_cost_ESC,
244 quantize_and_encode_band_cost_NOISE,
245 quantize_and_encode_band_cost_STEREO,
246 quantize_and_encode_band_cost_STEREO,
247 };
248
250 {
251 quantize_and_encode_band_cost_ZERO,
252 quantize_and_encode_band_cost_SQUAD,
253 quantize_and_encode_band_cost_SQUAD,
254 quantize_and_encode_band_cost_UQUAD,
255 quantize_and_encode_band_cost_UQUAD,
256 quantize_and_encode_band_cost_SPAIR,
257 quantize_and_encode_band_cost_SPAIR,
258 quantize_and_encode_band_cost_UPAIR,
259 quantize_and_encode_band_cost_UPAIR,
260 quantize_and_encode_band_cost_UPAIR,
261 quantize_and_encode_band_cost_UPAIR,
262 quantize_and_encode_band_cost_ESC_RTZ,
264 quantize_and_encode_band_cost_NOISE,
265 quantize_and_encode_band_cost_STEREO,
266 quantize_and_encode_band_cost_STEREO,
267 };
268
270 const float *in,
float *
quant,
const float *scaled,
271 int size,
int scale_idx,
int cb,
272 const float lambda,
const float uplim,
273 int *
bits,
float *energy)
274 {
278 }
279
281 const float *in,
float *
out,
int size,
int scale_idx,
282 int cb,
const float lambda,
int rtz)
283 {
286 }
287
288 /**
289 * structure used in optimal codebook search
290 */
292 int prev_idx;
///< pointer to the previous path point
296
297 /**
298 * Encode band info for single window group bands.
299 */
301 int win,
int group_len,
const float lambda)
302 {
308 const int run_esc = (1 <<
run_bits) - 1;
309 int idx, ppos, count;
310 int stackrun[120], stackcb[120], stack_len;
312 int next_mincb = 0;
313
314 s->aacdsp.abs_pow34(
s->scoefs, sce->
coeffs, 1024);
320 }
321 for (swb = 0; swb < max_sfb; swb++) {
328 }
329 } else {
330 float minrd = next_minrd;
331 int mincb = next_mincb;
333 next_mincb = 0;
335 float cost_stay_here, cost_get_here;
336 float rd = 0.0f;
342 continue;
343 }
344 for (
w = 0;
w < group_len;
w++) {
345 FFPsyBand *band = &
s->psy.ch[
s->cur_channel].psy_bands[(
win+
w)*16+swb];
347 &
s->scoefs[start +
w*128],
size,
350 }
351 cost_stay_here = path[swb][
cb].
cost + rd;
352 cost_get_here = minrd + rd +
run_bits + 4;
356 if (cost_get_here < cost_stay_here) {
358 path[swb+1][
cb].
cost = cost_get_here;
359 path[swb+1][
cb].
run = 1;
360 } else {
362 path[swb+1][
cb].
cost = cost_stay_here;
364 }
365 if (path[swb+1][
cb].cost < next_minrd) {
366 next_minrd = path[swb+1][
cb].
cost;
368 }
369 }
370 }
372 }
373
374 //convert resulting path from backward-linked list
375 stack_len = 0;
376 idx = 0;
378 if (path[max_sfb][
cb].cost < path[max_sfb][idx].cost)
380 ppos = max_sfb;
381 while (ppos > 0) {
384 stackrun[stack_len] = path[ppos][
cb].
run;
385 stackcb [stack_len] =
cb;
387 ppos -= path[ppos][
cb].
run;
388 stack_len++;
389 }
390 //perform actual band info encoding
391 start = 0;
392 for (
i = stack_len - 1;
i >= 0;
i--) {
397 //XXX: memset when band_type is also uint8_t
398 for (j = 0; j < count; j++) {
400 start++;
401 }
402 while (count >= run_esc) {
404 count -= run_esc;
405 }
407 }
408 }
409
410
415
416 #define TRELLIS_STAGES 121
417 #define TRELLIS_STATES (SCALE_MAX_DIFF+1)
418
420 {
422 int prevscaler_n = -255, prevscaler_i = 0;
424
428 continue;
434 if (prevscaler_n == -255)
437 }
438 }
439 }
440
442 return;
443
444 /* Clip the scalefactor indices */
448 continue;
453 }
454 }
455 }
456 }
457
460 const float lambda)
461 {
462 int q,
w, w2,
g, start = 0;
464 int idx;
467 int minq;
468 float mincost;
469 float q0f = FLT_MAX, q1f = 0.0f, qnrgf = 0.0f;
470 int q0,
q1, qcnt = 0;
471
472 for (
i = 0;
i < 1024;
i++) {
477 qnrgf += t*t;
478 qcnt++;
479 }
480 }
481
482 if (!qcnt) {
485 return;
486 }
487
488 //minimum scalefactor index is when minimum nonzero coefficient after quantizing is not clipped
490 //maximum scalefactor index is when maximum coefficient after quantizing is still not zero
495 //minimum scalefactor index is when maximum nonzero coefficient after quantizing is not clipped
502 }
else if (
q1 > q1high) {
505 }
506 }
507 // q0 == q1 isn't really a legal situation
509 // the following is indirect but guarantees q1 != q0 && q1 near q0
512 }
513
515 paths[0][
i].
cost = 0.0f;
516 paths[0][
i].
prev = -1;
517 }
521 paths[j][
i].
prev = -2;
522 }
523 }
524 idx = 1;
525 s->aacdsp.abs_pow34(
s->scoefs, sce->
coeffs, 1024);
529 const float *coefs = &sce->
coeffs[start];
530 float qmin, qmax;
531 int nz = 0;
532
533 bandaddr[idx] =
w * 16 +
g;
534 qmin = INT_MAX;
535 qmax = 0.0f;
537 FFPsyBand *band = &
s->psy.ch[
s->cur_channel].psy_bands[(
w+w2)*16+
g];
540 continue;
541 }
543 nz = 1;
545 float t =
fabsf(coefs[w2*128+
i]);
547 qmin =
FFMIN(qmin, t);
548 qmax =
FFMAX(qmax, t);
549 }
550 }
551 if (nz) {
552 int minscale, maxscale;
554 float maxval;
555 //minimum scalefactor index is when minimum nonzero coefficient after quantizing is not clipped
557 //maximum scalefactor index is when maximum coefficient after quantizing is still not zero
561 if (minscale == maxscale) {
564 }
566 for (q = minscale; q < maxscale; q++) {
567 float dist = 0;
570 FFPsyBand *band = &
s->psy.ch[
s->cur_channel].psy_bands[(
w+w2)*16+
g];
573 }
574 minrd =
FFMIN(minrd, dist);
575
576 for (
i = 0;
i <
q1 -
q0;
i++) {
577 float cost;
578 cost = paths[idx - 1][
i].
cost + dist
580 if (cost < paths[idx][q].cost) {
581 paths[idx][q].
cost = cost;
582 paths[idx][q].
prev =
i;
583 }
584 }
585 }
586 } else {
587 for (q = 0; q <
q1 -
q0; q++) {
588 paths[idx][q].
cost = paths[idx - 1][q].
cost + 1;
589 paths[idx][q].
prev = q;
590 }
591 }
594 idx++;
595 }
596 }
597 idx--;
598 mincost = paths[idx][0].
cost;
599 minq = 0;
601 if (paths[idx][
i].cost < mincost) {
602 mincost = paths[idx][
i].
cost;
604 }
605 }
606 while (idx) {
607 sce->
sf_idx[bandaddr[idx]] = minq +
q0;
608 minq =
FFMAX(paths[idx][minq].prev, 0);
609 idx--;
610 }
611 //set the same quantizers inside window groups
616 }
617
620 const float lambda)
621 {
622 int start = 0,
i,
w, w2,
g;
624 float dists[128] = { 0 }, uplims[128] = { 0 };
625 float maxvals[128];
626 int fflag, minscaler;
627 int its = 0;
628 int allz = 0;
630
631 // for values above this the decoder might end up in an endless loop
632 // due to always having more bits than what can be encoded.
633 destbits =
FFMIN(destbits, 5800);
634 //some heuristic to determine initial quantizers will reduce search time
635 //determine zero bands and upper limits
637 start = 0;
639 int nz = 0;
640 float uplim = 0.0f;
642 FFPsyBand *band = &
s->psy.ch[
s->cur_channel].psy_bands[(
w+w2)*16+
g];
646 continue;
647 }
648 nz = 1;
649 }
650 uplims[
w*16+
g] = uplim *512;
653 if (nz)
654 minthr =
FFMIN(minthr, uplim);
655 allz |= nz;
657 }
658 }
663 continue;
664 }
666 }
667 }
668
669 if (!allz)
670 return;
671 s->aacdsp.abs_pow34(
s->scoefs, sce->
coeffs, 1024);
673
677 const float *scaled =
s->scoefs + start;
680 }
681 }
682
683 //perform two-loop search
684 //outer loop - improve quality
685 do {
686 int tbits, qstep;
687 minscaler = sce->
sf_idx[0];
688 //inner loop - quantize spectrum to fit into given number of bits
689 qstep = its ? 1 : 32;
690 do {
691 int prev = -1;
692 tbits = 0;
696 const float *coefs = sce->
coeffs + start;
697 const float *scaled =
s->scoefs + start;
700 float dist = 0.0f;
701
704 continue;
705 }
711 coefs + w2*128,
712 scaled + w2*128,
718 }
719 dists[
w*16+
g] = dist -
bits;
720 if (prev != -1) {
722 }
726 }
727 }
728 if (tbits > destbits) {
729 for (
i = 0;
i < 128;
i++)
730 if (sce->
sf_idx[
i] < 218 - qstep)
732 } else {
733 for (
i = 0;
i < 128;
i++)
734 if (sce->
sf_idx[
i] > 60 - qstep)
736 }
737 qstep >>= 1;
738 if (!qstep && tbits > destbits*1.02 && sce->
sf_idx[0] < 217)
739 qstep = 1;
740 } while (qstep);
741
742 fflag = 0;
744
748 if (dists[
w*16+
g] > uplims[
w*16+
g] && sce->
sf_idx[
w*16+
g] > 60) {
751 else //Try to make sure there is some energy in every band
753 }
757 fflag = 1;
759 }
760 }
761 its++;
762 } while (fflag && its < 10);
763 }
764
766 {
770 int bandwidth, cutoff;
771 float *PNS = &
s->scoefs[0*128], *PNS34 = &
s->scoefs[1*128];
772 float *NOR34 = &
s->scoefs[3*128];
773 uint8_t nextband[128];
774 const float lambda =
s->lambda;
775 const float freq_mult = avctx->
sample_rate*0.5f/wlen;
778 const float dist_bias =
av_clipf(4.
f * 120 / lambda, 0.25
f, 4.0
f);
779 const float pns_transient_energy_r =
FFMIN(0.7
f, lambda / 140.
f);
780
783 * (lambda / 120.f);
784
785 /** Keep this in sync with twoloop's cutoff selection */
786 float rate_bandwidth_multiplier = 1.5f;
787 int prev = -1000, prev_sf = -1;
789 ? (refbits * rate_bandwidth_multiplier * avctx->
sample_rate / 1024)
791
792 frame_bit_rate *= 1.15f;
793
795 bandwidth = avctx->
cutoff;
796 } else {
798 }
799
800 cutoff = bandwidth * 2 * wlen / avctx->
sample_rate;
801
807 int noise_sfi;
808 float dist1 = 0.0f, dist2 = 0.0f, noise_amp;
809 float pns_energy = 0.0f, pns_tgt_energy, energy_ratio, dist_thresh;
810 float sfb_energy = 0.0f, threshold = 0.0f, spread = 2.0f;
811 float min_energy = -1.0f, max_energy = 0.0f;
813 const float freq = (start-wstart)*freq_mult;
818 continue;
819 }
821 band = &
s->psy.ch[
s->cur_channel].psy_bands[(
w+w2)*16+
g];
822 sfb_energy += band->
energy;
825 if (!w2) {
826 min_energy = max_energy = band->
energy;
827 } else {
830 }
831 }
832
833 /* Ramps down at ~8000Hz and loosens the dist threshold */
835
836 /* PNS is acceptable when all of these are true:
837 * 1. high spread energy (noise-like band)
838 * 2. near-threshold energy (high PE means the random nature of PNS content will be noticed)
839 * 3. on short window groups, all windows have similar energy (variations in energy would be destroyed by PNS)
840 *
841 * At this stage, point 2 is relaxed for zeroed bands near the noise threshold (hole avoidance is more important)
842 */
844 ((sce->
zeroes[
w*16+
g] || !sce->
band_alt[
w*16+
g]) && sfb_energy < threshold*
sqrtf(1.0
f/freq_boost)) || spread < spread_threshold ||
845 (!sce->
zeroes[
w*16+
g] && sce->
band_alt[
w*16+
g] && sfb_energy > threshold*thr_mult*freq_boost) ||
846 min_energy < pns_transient_energy_r * max_energy ) {
850 continue;
851 }
852
853 pns_tgt_energy = sfb_energy*
FFMIN(1.0
f, spread*spread);
856 if (prev != -1000) {
861 continue;
862 }
863 }
865 float band_energy,
scale, pns_senergy;
867 band = &
s->psy.ch[
s->cur_channel].psy_bands[(
w+w2)*16+
g];
870 PNS[
i] =
s->random_state;
871 }
872 band_energy =
s->fdsp->scalarproduct_float(PNS, PNS, sce->
ics.
swb_sizes[
g]);
875 pns_senergy =
s->fdsp->scalarproduct_float(PNS, PNS, sce->
ics.
swb_sizes[
g]);
876 pns_energy += pns_senergy;
880 NOR34,
885 /* Estimate rd on average as 5 bits for SF, 4 for the CB, plus spread energy * lambda/thr */
887 }
889 dist2 += 5;
890 } else {
891 dist2 += 9;
892 }
893 energy_ratio = pns_tgt_energy/pns_energy; /* Compensates for quantization error */
894 sce->
pns_ener[
w*16+
g] = energy_ratio*pns_tgt_energy;
895 if (sce->
zeroes[
w*16+
g] || !sce->
band_alt[
w*16+
g] || (energy_ratio > 0.85f && energy_ratio < 1.25f && dist2 < dist1)) {
898 prev = noise_sfi;
899 } else {
902 }
903 }
904 }
905 }
906
908 {
912 int bandwidth, cutoff;
913 const float lambda =
s->lambda;
914 const float freq_mult = avctx->
sample_rate*0.5f/wlen;
916 const float pns_transient_energy_r =
FFMIN(0.7
f, lambda / 140.
f);
917
920 * (lambda / 120.f);
921
922 /** Keep this in sync with twoloop's cutoff selection */
923 float rate_bandwidth_multiplier = 1.5f;
925 ? (refbits * rate_bandwidth_multiplier * avctx->
sample_rate / 1024)
927
928 frame_bit_rate *= 1.15f;
929
931 bandwidth = avctx->
cutoff;
932 } else {
934 }
935
936 cutoff = bandwidth * 2 * wlen / avctx->
sample_rate;
937
941 float sfb_energy = 0.0f, threshold = 0.0f, spread = 2.0f;
942 float min_energy = -1.0f, max_energy = 0.0f;
944 const float freq = start*freq_mult;
946 if (freq < NOISE_LOW_LIMIT || start >= cutoff) {
948 continue;
949 }
951 band = &
s->psy.ch[
s->cur_channel].psy_bands[(
w+w2)*16+
g];
952 sfb_energy += band->
energy;
955 if (!w2) {
956 min_energy = max_energy = band->
energy;
957 } else {
960 }
961 }
962
963 /* PNS is acceptable when all of these are true:
964 * 1. high spread energy (noise-like band)
965 * 2. near-threshold energy (high PE means the random nature of PNS content will be noticed)
966 * 3. on short window groups, all windows have similar energy (variations in energy would be destroyed by PNS)
967 */
969 if (sfb_energy < threshold*
sqrtf(1.5
f/freq_boost) || spread < spread_threshold || min_energy < pns_transient_energy_r * max_energy) {
971 } else {
973 }
974 }
975 }
976 }
977
979 {
980 int start = 0,
i,
w, w2,
g, sid_sf_boost, prev_mid, prev_side;
981 uint8_t nextband0[128], nextband1[128];
982 float *
M =
s->scoefs + 128*0, *
S =
s->scoefs + 128*1;
983 float *L34 =
s->scoefs + 128*2, *R34 =
s->scoefs + 128*3;
984 float *M34 =
s->scoefs + 128*4, *S34 =
s->scoefs + 128*5;
985 const float lambda =
s->lambda;
986 const float mslambda =
FFMIN(1.0
f, lambda / 120.
f);
990 return;
991
992 /** Scout out next nonzero bands */
995
996 prev_mid = sce0->
sf_idx[0];
997 prev_side = sce1->
sf_idx[0];
999 start = 0;
1005 float Mmax = 0.0f, Smax = 0.0f;
1006
1007 /* Must compute mid/side SF and book for the whole window group */
1011 + sce1->
coeffs[start+(
w+w2)*128+
i]) * 0.5;
1013 - sce1->
coeffs[start+(
w+w2)*128+
i];
1014 }
1018 Mmax =
FFMAX(Mmax, M34[
i]);
1019 Smax =
FFMAX(Smax, S34[
i]);
1020 }
1021 }
1022
1023 for (sid_sf_boost = 0; sid_sf_boost < 4; sid_sf_boost++) {
1024 float dist1 = 0.0f, dist2 = 0.0f;
1026 int minidx;
1027 int mididx, sididx;
1028 int midcb, sidcb;
1029
1036 /* scalefactor range violation, bad stuff, will decrease quality unacceptably */
1037 continue;
1038 }
1039
1042
1043 /* No CB can be zero */
1044 midcb =
FFMAX(1,midcb);
1045 sidcb =
FFMAX(1,sidcb);
1046
1048 FFPsyBand *band0 = &
s->psy.ch[
s->cur_channel+0].psy_bands[(
w+w2)*16+
g];
1049 FFPsyBand *band1 = &
s->psy.ch[
s->cur_channel+1].psy_bands[(
w+w2)*16+
g];
1054 + sce1->
coeffs[start+(
w+w2)*128+
i]) * 0.5;
1056 - sce1->
coeffs[start+(
w+w2)*128+
i];
1057 }
1058
1064 L34,
1070 R34,
1076 M34,
1078 mididx,
1079 midcb,
1082 S34,
1084 sididx,
1085 sidcb,
1086 mslambda / (minthr * bmax + FLT_MIN),
INFINITY, &b4,
NULL);
1091 }
1100 /* ms_mask unneeded, and it confuses some decoders */
1102 }
1103 break;
1104 }
else if (
B1 >
B0) {
1105 /* More boost won't fix this */
1106 break;
1107 }
1108 }
1109 }
1115 }
1116 }
1117 }
1118
1141 },
1163 },
1185 },
1186 };