70 #if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
77 static const uint8_t uquad_sign_bits[81] = {
78 0, 1, 1, 1, 2, 2, 1, 2, 2,
79 1, 2, 2, 2, 3, 3, 2, 3, 3,
80 1, 2, 2, 2, 3, 3, 2, 3, 3,
81 1, 2, 2, 2, 3, 3, 2, 3, 3,
82 2, 3, 3, 3, 4, 4, 3, 4, 4,
83 2, 3, 3, 3, 4, 4, 3, 4, 4,
84 1, 2, 2, 2, 3, 3, 2, 3, 3,
85 2, 3, 3, 3, 4, 4, 3, 4, 4,
86 2, 3, 3, 3, 4, 4, 3, 4, 4
89 static const uint8_t upair7_sign_bits[64] = {
90 0, 1, 1, 1, 1, 1, 1, 1,
91 1, 2, 2, 2, 2, 2, 2, 2,
92 1, 2, 2, 2, 2, 2, 2, 2,
93 1, 2, 2, 2, 2, 2, 2, 2,
94 1, 2, 2, 2, 2, 2, 2, 2,
95 1, 2, 2, 2, 2, 2, 2, 2,
96 1, 2, 2, 2, 2, 2, 2, 2,
97 1, 2, 2, 2, 2, 2, 2, 2,
100 static const uint8_t upair12_sign_bits[169] = {
101 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
102 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
103 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
104 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
105 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
106 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
107 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
108 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
109 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
110 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
111 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
112 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
113 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
116 static const uint8_t esc_sign_bits[289] = {
117 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
118 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
119 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
120 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
121 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
122 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
123 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
124 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
125 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
126 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
127 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
128 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
129 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
130 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
131 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
132 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
133 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
139 static void quantize_and_encode_band_cost_SQUAD_mips(
struct AACEncContext *
s,
141 const float *scaled,
int size,
int scale_idx,
142 int cb,
const float lambda,
const float uplim,
143 int *
bits,
float *energy,
const float ROUNDING)
148 int qc1, qc2, qc3, qc4;
149 float qenergy = 0.0f;
157 for (
i = 0;
i <
size;
i += 4) {
159 int *in_int = (
int *)&in[
i];
170 ".set noreorder \n\t"
172 "slt %[qc1], $zero, %[qc1] \n\t"
173 "slt %[qc2], $zero, %[qc2] \n\t"
174 "slt %[qc3], $zero, %[qc3] \n\t"
175 "slt %[qc4], $zero, %[qc4] \n\t"
176 "lw %[t0], 0(%[in_int]) \n\t"
177 "lw %[t1], 4(%[in_int]) \n\t"
178 "lw %[t2], 8(%[in_int]) \n\t"
179 "lw %[t3], 12(%[in_int]) \n\t"
180 "srl %[t0], %[t0], 31 \n\t"
181 "srl %[t1], %[t1], 31 \n\t"
182 "srl %[t2], %[t2], 31 \n\t"
183 "srl %[t3], %[t3], 31 \n\t"
184 "subu %[t4], $zero, %[qc1] \n\t"
185 "subu %[t5], $zero, %[qc2] \n\t"
186 "subu %[t6], $zero, %[qc3] \n\t"
187 "subu %[t7], $zero, %[qc4] \n\t"
188 "movn %[qc1], %[t4], %[t0] \n\t"
189 "movn %[qc2], %[t5], %[t1] \n\t"
190 "movn %[qc3], %[t6], %[t2] \n\t"
191 "movn %[qc4], %[t7], %[t3] \n\t"
195 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
196 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
199 : [in_int]
"r"(in_int)
212 put_bits(pb, p_bits[curidx], p_codes[curidx]);
216 vec = &p_vec[curidx*4];
228 qenergy += (e1*e1 + e2*e2) + (e3*e3 + e4*e4);
235 static void quantize_and_encode_band_cost_UQUAD_mips(
struct AACEncContext *
s,
237 const float *scaled,
int size,
int scale_idx,
238 int cb,
const float lambda,
const float uplim,
239 int *
bits,
float *energy,
const float ROUNDING)
244 int qc1, qc2, qc3, qc4;
245 float qenergy = 0.0f;
253 for (
i = 0;
i <
size;
i += 4) {
254 int curidx, sign, count;
255 int *in_int = (
int *)&in[
i];
257 unsigned int v_codes;
268 ".set noreorder \n\t"
270 "ori %[t4], $zero, 2 \n\t"
271 "ori %[sign], $zero, 0 \n\t"
272 "slt %[t0], %[t4], %[qc1] \n\t"
273 "slt %[t1], %[t4], %[qc2] \n\t"
274 "slt %[t2], %[t4], %[qc3] \n\t"
275 "slt %[t3], %[t4], %[qc4] \n\t"
276 "movn %[qc1], %[t4], %[t0] \n\t"
277 "movn %[qc2], %[t4], %[t1] \n\t"
278 "movn %[qc3], %[t4], %[t2] \n\t"
279 "movn %[qc4], %[t4], %[t3] \n\t"
280 "lw %[t0], 0(%[in_int]) \n\t"
281 "lw %[t1], 4(%[in_int]) \n\t"
282 "lw %[t2], 8(%[in_int]) \n\t"
283 "lw %[t3], 12(%[in_int]) \n\t"
284 "slt %[t0], %[t0], $zero \n\t"
285 "movn %[sign], %[t0], %[qc1] \n\t"
286 "slt %[t1], %[t1], $zero \n\t"
287 "slt %[t2], %[t2], $zero \n\t"
288 "slt %[t3], %[t3], $zero \n\t"
289 "sll %[t0], %[sign], 1 \n\t"
290 "or %[t0], %[t0], %[t1] \n\t"
291 "movn %[sign], %[t0], %[qc2] \n\t"
292 "slt %[t4], $zero, %[qc1] \n\t"
293 "slt %[t1], $zero, %[qc2] \n\t"
294 "slt %[count], $zero, %[qc3] \n\t"
295 "sll %[t0], %[sign], 1 \n\t"
296 "or %[t0], %[t0], %[t2] \n\t"
297 "movn %[sign], %[t0], %[qc3] \n\t"
298 "slt %[t2], $zero, %[qc4] \n\t"
299 "addu %[count], %[count], %[t4] \n\t"
300 "addu %[count], %[count], %[t1] \n\t"
301 "sll %[t0], %[sign], 1 \n\t"
302 "or %[t0], %[t0], %[t3] \n\t"
303 "movn %[sign], %[t0], %[qc4] \n\t"
304 "addu %[count], %[count], %[t2] \n\t"
308 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
309 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
310 [sign]
"=&r"(sign), [count]
"=&r"(count),
313 : [in_int]
"r"(in_int)
325 v_codes = (p_codes[curidx] << count) | (sign & ((1 << count) - 1));
326 v_bits = p_bits[curidx] + count;
331 vec = &p_vec[curidx*4];
332 e1 = copysignf(vec[0] * IQ, in[
i+0]);
333 e2 = copysignf(vec[1] * IQ, in[
i+1]);
334 e3 = copysignf(vec[2] * IQ, in[
i+2]);
335 e4 = copysignf(vec[3] * IQ, in[
i+3]);
343 qenergy += (e1*e1 + e2*e2) + (e3*e3 + e4*e4);
350 static void quantize_and_encode_band_cost_SPAIR_mips(
struct AACEncContext *
s,
352 const float *scaled,
int size,
int scale_idx,
353 int cb,
const float lambda,
const float uplim,
354 int *
bits,
float *energy,
const float ROUNDING)
359 int qc1, qc2, qc3, qc4;
360 float qenergy = 0.0f;
368 for (
i = 0;
i <
size;
i += 4) {
370 int *in_int = (
int *)&in[
i];
372 unsigned int v_codes;
374 const float *vec1, *vec2;
383 ".set noreorder \n\t"
385 "ori %[t4], $zero, 4 \n\t"
386 "slt %[t0], %[t4], %[qc1] \n\t"
387 "slt %[t1], %[t4], %[qc2] \n\t"
388 "slt %[t2], %[t4], %[qc3] \n\t"
389 "slt %[t3], %[t4], %[qc4] \n\t"
390 "movn %[qc1], %[t4], %[t0] \n\t"
391 "movn %[qc2], %[t4], %[t1] \n\t"
392 "movn %[qc3], %[t4], %[t2] \n\t"
393 "movn %[qc4], %[t4], %[t3] \n\t"
394 "lw %[t0], 0(%[in_int]) \n\t"
395 "lw %[t1], 4(%[in_int]) \n\t"
396 "lw %[t2], 8(%[in_int]) \n\t"
397 "lw %[t3], 12(%[in_int]) \n\t"
398 "srl %[t0], %[t0], 31 \n\t"
399 "srl %[t1], %[t1], 31 \n\t"
400 "srl %[t2], %[t2], 31 \n\t"
401 "srl %[t3], %[t3], 31 \n\t"
402 "subu %[t4], $zero, %[qc1] \n\t"
403 "subu %[t5], $zero, %[qc2] \n\t"
404 "subu %[t6], $zero, %[qc3] \n\t"
405 "subu %[t7], $zero, %[qc4] \n\t"
406 "movn %[qc1], %[t4], %[t0] \n\t"
407 "movn %[qc2], %[t5], %[t1] \n\t"
408 "movn %[qc3], %[t6], %[t2] \n\t"
409 "movn %[qc4], %[t7], %[t3] \n\t"
413 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
414 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
417 : [in_int]
"r"(in_int)
427 v_codes = (p_codes[curidx] << p_bits[curidx2]) | (p_codes[curidx2]);
428 v_bits = p_bits[curidx] + p_bits[curidx2];
433 vec1 = &p_vec[curidx*2 ];
434 vec2 = &p_vec[curidx2*2];
446 qenergy += (e1*e1 + e2*e2) + (e3*e3 + e4*e4);
453 static void quantize_and_encode_band_cost_UPAIR7_mips(
struct AACEncContext *
s,
455 const float *scaled,
int size,
int scale_idx,
456 int cb,
const float lambda,
const float uplim,
457 int *
bits,
float *energy,
const float ROUNDING)
462 int qc1, qc2, qc3, qc4;
463 float qenergy = 0.0f;
471 for (
i = 0;
i <
size;
i += 4) {
472 int curidx1, curidx2, sign1, count1, sign2, count2;
473 int *in_int = (
int *)&in[
i];
475 unsigned int v_codes;
477 const float *vec1, *vec2;
486 ".set noreorder \n\t"
488 "ori %[t4], $zero, 7 \n\t"
489 "ori %[sign1], $zero, 0 \n\t"
490 "ori %[sign2], $zero, 0 \n\t"
491 "slt %[t0], %[t4], %[qc1] \n\t"
492 "slt %[t1], %[t4], %[qc2] \n\t"
493 "slt %[t2], %[t4], %[qc3] \n\t"
494 "slt %[t3], %[t4], %[qc4] \n\t"
495 "movn %[qc1], %[t4], %[t0] \n\t"
496 "movn %[qc2], %[t4], %[t1] \n\t"
497 "movn %[qc3], %[t4], %[t2] \n\t"
498 "movn %[qc4], %[t4], %[t3] \n\t"
499 "lw %[t0], 0(%[in_int]) \n\t"
500 "lw %[t1], 4(%[in_int]) \n\t"
501 "lw %[t2], 8(%[in_int]) \n\t"
502 "lw %[t3], 12(%[in_int]) \n\t"
503 "slt %[t0], %[t0], $zero \n\t"
504 "movn %[sign1], %[t0], %[qc1] \n\t"
505 "slt %[t2], %[t2], $zero \n\t"
506 "movn %[sign2], %[t2], %[qc3] \n\t"
507 "slt %[t1], %[t1], $zero \n\t"
508 "sll %[t0], %[sign1], 1 \n\t"
509 "or %[t0], %[t0], %[t1] \n\t"
510 "movn %[sign1], %[t0], %[qc2] \n\t"
511 "slt %[t3], %[t3], $zero \n\t"
512 "sll %[t0], %[sign2], 1 \n\t"
513 "or %[t0], %[t0], %[t3] \n\t"
514 "movn %[sign2], %[t0], %[qc4] \n\t"
515 "slt %[count1], $zero, %[qc1] \n\t"
516 "slt %[t1], $zero, %[qc2] \n\t"
517 "slt %[count2], $zero, %[qc3] \n\t"
518 "slt %[t2], $zero, %[qc4] \n\t"
519 "addu %[count1], %[count1], %[t1] \n\t"
520 "addu %[count2], %[count2], %[t2] \n\t"
524 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
525 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
526 [sign1]
"=&r"(sign1), [count1]
"=&r"(count1),
527 [sign2]
"=&r"(sign2), [count2]
"=&r"(count2),
530 : [in_int]
"r"(in_int)
531 :
"t0",
"t1",
"t2",
"t3",
"t4",
538 v_codes = (p_codes[curidx1] << count1) | sign1;
539 v_bits = p_bits[curidx1] + count1;
545 v_codes = (p_codes[curidx2] << count2) | sign2;
546 v_bits = p_bits[curidx2] + count2;
551 vec1 = &p_vec[curidx1*2];
552 vec2 = &p_vec[curidx2*2];
553 e1 = copysignf(vec1[0] * IQ, in[
i+0]);
554 e2 = copysignf(vec1[1] * IQ, in[
i+1]);
555 e3 = copysignf(vec2[0] * IQ, in[
i+2]);
556 e4 = copysignf(vec2[1] * IQ, in[
i+3]);
564 qenergy += (e1*e1 + e2*e2) + (e3*e3 + e4*e4);
571 static void quantize_and_encode_band_cost_UPAIR12_mips(
struct AACEncContext *
s,
573 const float *scaled,
int size,
int scale_idx,
574 int cb,
const float lambda,
const float uplim,
575 int *
bits,
float *energy,
const float ROUNDING)
580 int qc1, qc2, qc3, qc4;
581 float qenergy = 0.0f;
589 for (
i = 0;
i <
size;
i += 4) {
590 int curidx1, curidx2, sign1, count1, sign2, count2;
591 int *in_int = (
int *)&in[
i];
593 unsigned int v_codes;
595 const float *vec1, *vec2;
604 ".set noreorder \n\t"
606 "ori %[t4], $zero, 12 \n\t"
607 "ori %[sign1], $zero, 0 \n\t"
608 "ori %[sign2], $zero, 0 \n\t"
609 "slt %[t0], %[t4], %[qc1] \n\t"
610 "slt %[t1], %[t4], %[qc2] \n\t"
611 "slt %[t2], %[t4], %[qc3] \n\t"
612 "slt %[t3], %[t4], %[qc4] \n\t"
613 "movn %[qc1], %[t4], %[t0] \n\t"
614 "movn %[qc2], %[t4], %[t1] \n\t"
615 "movn %[qc3], %[t4], %[t2] \n\t"
616 "movn %[qc4], %[t4], %[t3] \n\t"
617 "lw %[t0], 0(%[in_int]) \n\t"
618 "lw %[t1], 4(%[in_int]) \n\t"
619 "lw %[t2], 8(%[in_int]) \n\t"
620 "lw %[t3], 12(%[in_int]) \n\t"
621 "slt %[t0], %[t0], $zero \n\t"
622 "movn %[sign1], %[t0], %[qc1] \n\t"
623 "slt %[t2], %[t2], $zero \n\t"
624 "movn %[sign2], %[t2], %[qc3] \n\t"
625 "slt %[t1], %[t1], $zero \n\t"
626 "sll %[t0], %[sign1], 1 \n\t"
627 "or %[t0], %[t0], %[t1] \n\t"
628 "movn %[sign1], %[t0], %[qc2] \n\t"
629 "slt %[t3], %[t3], $zero \n\t"
630 "sll %[t0], %[sign2], 1 \n\t"
631 "or %[t0], %[t0], %[t3] \n\t"
632 "movn %[sign2], %[t0], %[qc4] \n\t"
633 "slt %[count1], $zero, %[qc1] \n\t"
634 "slt %[t1], $zero, %[qc2] \n\t"
635 "slt %[count2], $zero, %[qc3] \n\t"
636 "slt %[t2], $zero, %[qc4] \n\t"
637 "addu %[count1], %[count1], %[t1] \n\t"
638 "addu %[count2], %[count2], %[t2] \n\t"
642 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
643 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
644 [sign1]
"=&r"(sign1), [count1]
"=&r"(count1),
645 [sign2]
"=&r"(sign2), [count2]
"=&r"(count2),
648 : [in_int]
"r"(in_int)
655 v_codes = (p_codes[curidx1] << count1) | sign1;
656 v_bits = p_bits[curidx1] + count1;
662 v_codes = (p_codes[curidx2] << count2) | sign2;
663 v_bits = p_bits[curidx2] + count2;
668 vec1 = &p_vec[curidx1*2];
669 vec2 = &p_vec[curidx2*2];
670 e1 = copysignf(vec1[0] * IQ, in[
i+0]);
671 e2 = copysignf(vec1[1] * IQ, in[
i+1]);
672 e3 = copysignf(vec2[0] * IQ, in[
i+2]);
673 e4 = copysignf(vec2[1] * IQ, in[
i+3]);
681 qenergy += (e1*e1 + e2*e2) + (e3*e3 + e4*e4);
688 static void quantize_and_encode_band_cost_ESC_mips(
struct AACEncContext *
s,
690 const float *scaled,
int size,
int scale_idx,
691 int cb,
const float lambda,
const float uplim,
692 int *
bits,
float *energy,
const float ROUNDING)
697 int qc1, qc2, qc3, qc4;
698 float qenergy = 0.0f;
708 for (
i = 0;
i <
size;
i += 4) {
709 int curidx, curidx2, sign1, count1, sign2, count2;
710 int *in_int = (
int *)&in[
i];
712 unsigned int v_codes;
714 const float *vec1, *vec2;
716 qc1 = scaled[
i ] * Q34 + ROUNDING;
717 qc2 = scaled[
i+1] * Q34 + ROUNDING;
718 qc3 = scaled[
i+2] * Q34 + ROUNDING;
719 qc4 = scaled[
i+3] * Q34 + ROUNDING;
723 ".set noreorder \n\t"
725 "ori %[t4], $zero, 16 \n\t"
726 "ori %[sign1], $zero, 0 \n\t"
727 "ori %[sign2], $zero, 0 \n\t"
728 "slt %[t0], %[t4], %[qc1] \n\t"
729 "slt %[t1], %[t4], %[qc2] \n\t"
730 "slt %[t2], %[t4], %[qc3] \n\t"
731 "slt %[t3], %[t4], %[qc4] \n\t"
732 "movn %[qc1], %[t4], %[t0] \n\t"
733 "movn %[qc2], %[t4], %[t1] \n\t"
734 "movn %[qc3], %[t4], %[t2] \n\t"
735 "movn %[qc4], %[t4], %[t3] \n\t"
736 "lw %[t0], 0(%[in_int]) \n\t"
737 "lw %[t1], 4(%[in_int]) \n\t"
738 "lw %[t2], 8(%[in_int]) \n\t"
739 "lw %[t3], 12(%[in_int]) \n\t"
740 "slt %[t0], %[t0], $zero \n\t"
741 "movn %[sign1], %[t0], %[qc1] \n\t"
742 "slt %[t2], %[t2], $zero \n\t"
743 "movn %[sign2], %[t2], %[qc3] \n\t"
744 "slt %[t1], %[t1], $zero \n\t"
745 "sll %[t0], %[sign1], 1 \n\t"
746 "or %[t0], %[t0], %[t1] \n\t"
747 "movn %[sign1], %[t0], %[qc2] \n\t"
748 "slt %[t3], %[t3], $zero \n\t"
749 "sll %[t0], %[sign2], 1 \n\t"
750 "or %[t0], %[t0], %[t3] \n\t"
751 "movn %[sign2], %[t0], %[qc4] \n\t"
752 "slt %[count1], $zero, %[qc1] \n\t"
753 "slt %[t1], $zero, %[qc2] \n\t"
754 "slt %[count2], $zero, %[qc3] \n\t"
755 "slt %[t2], $zero, %[qc4] \n\t"
756 "addu %[count1], %[count1], %[t1] \n\t"
757 "addu %[count2], %[count2], %[t2] \n\t"
761 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
762 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
763 [sign1]
"=&r"(sign1), [count1]
"=&r"(count1),
764 [sign2]
"=&r"(sign2), [count2]
"=&r"(count2),
767 : [in_int]
"r"(in_int)
776 v_codes = (p_codes[curidx] << count1) | sign1;
777 v_bits = p_bits[curidx] + count1;
780 v_codes = (p_codes[curidx2] << count2) | sign2;
781 v_bits = p_bits[curidx2] + count2;
786 vec1 = &p_vectors[curidx*2 ];
787 vec2 = &p_vectors[curidx2*2];
788 e1 = copysignf(vec1[0] * IQ, in[
i+0]);
789 e2 = copysignf(vec1[1] * IQ, in[
i+1]);
790 e3 = copysignf(vec2[0] * IQ, in[
i+2]);
791 e4 = copysignf(vec2[1] * IQ, in[
i+3]);
799 qenergy += (e1*e1 + e2*e2) + (e3*e3 + e4*e4);
803 for (
i = 0;
i <
size;
i += 4) {
804 int curidx, curidx2, sign1, count1, sign2, count2;
805 int *in_int = (
int *)&in[
i];
807 unsigned int v_codes;
811 qc1 = scaled[
i ] * Q34 + ROUNDING;
812 qc2 = scaled[
i+1] * Q34 + ROUNDING;
813 qc3 = scaled[
i+2] * Q34 + ROUNDING;
814 qc4 = scaled[
i+3] * Q34 + ROUNDING;
818 ".set noreorder \n\t"
820 "ori %[t4], $zero, 16 \n\t"
821 "ori %[sign1], $zero, 0 \n\t"
822 "ori %[sign2], $zero, 0 \n\t"
823 "shll_s.w %[c1], %[qc1], 18 \n\t"
824 "shll_s.w %[c2], %[qc2], 18 \n\t"
825 "shll_s.w %[c3], %[qc3], 18 \n\t"
826 "shll_s.w %[c4], %[qc4], 18 \n\t"
827 "srl %[c1], %[c1], 18 \n\t"
828 "srl %[c2], %[c2], 18 \n\t"
829 "srl %[c3], %[c3], 18 \n\t"
830 "srl %[c4], %[c4], 18 \n\t"
831 "slt %[t0], %[t4], %[qc1] \n\t"
832 "slt %[t1], %[t4], %[qc2] \n\t"
833 "slt %[t2], %[t4], %[qc3] \n\t"
834 "slt %[t3], %[t4], %[qc4] \n\t"
835 "movn %[qc1], %[t4], %[t0] \n\t"
836 "movn %[qc2], %[t4], %[t1] \n\t"
837 "movn %[qc3], %[t4], %[t2] \n\t"
838 "movn %[qc4], %[t4], %[t3] \n\t"
839 "lw %[t0], 0(%[in_int]) \n\t"
840 "lw %[t1], 4(%[in_int]) \n\t"
841 "lw %[t2], 8(%[in_int]) \n\t"
842 "lw %[t3], 12(%[in_int]) \n\t"
843 "slt %[t0], %[t0], $zero \n\t"
844 "movn %[sign1], %[t0], %[qc1] \n\t"
845 "slt %[t2], %[t2], $zero \n\t"
846 "movn %[sign2], %[t2], %[qc3] \n\t"
847 "slt %[t1], %[t1], $zero \n\t"
848 "sll %[t0], %[sign1], 1 \n\t"
849 "or %[t0], %[t0], %[t1] \n\t"
850 "movn %[sign1], %[t0], %[qc2] \n\t"
851 "slt %[t3], %[t3], $zero \n\t"
852 "sll %[t0], %[sign2], 1 \n\t"
853 "or %[t0], %[t0], %[t3] \n\t"
854 "movn %[sign2], %[t0], %[qc4] \n\t"
855 "slt %[count1], $zero, %[qc1] \n\t"
856 "slt %[t1], $zero, %[qc2] \n\t"
857 "slt %[count2], $zero, %[qc3] \n\t"
858 "slt %[t2], $zero, %[qc4] \n\t"
859 "addu %[count1], %[count1], %[t1] \n\t"
860 "addu %[count2], %[count2], %[t2] \n\t"
864 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
865 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
866 [sign1]
"=&r"(sign1), [count1]
"=&r"(count1),
867 [sign2]
"=&r"(sign2), [count2]
"=&r"(count2),
869 [c3]
"=&r"(c3), [c4]
"=&r"(c4),
872 : [in_int]
"r"(in_int)
882 v_codes = (p_codes[curidx] << count1) | sign1;
883 v_bits = p_bits[curidx] + count1;
886 if (p_vectors[curidx*2 ] == 64.0
f) {
888 v_codes = (((1 << (
len - 3)) - 2) <<
len) | (
c1 & ((1 <<
len) - 1));
891 if (p_vectors[curidx*2+1] == 64.0
f) {
893 v_codes = (((1 << (
len - 3)) - 2) <<
len) | (
c2 & ((1 <<
len) - 1));
897 v_codes = (p_codes[curidx2] << count2) | sign2;
898 v_bits = p_bits[curidx2] + count2;
901 if (p_vectors[curidx2*2 ] == 64.0
f) {
903 v_codes = (((1 << (
len - 3)) - 2) <<
len) | (c3 & ((1 <<
len) - 1));
906 if (p_vectors[curidx2*2+1] == 64.0
f) {
908 v_codes = (((1 << (
len - 3)) - 2) <<
len) | (c4 & ((1 <<
len) - 1));
913 float e1, e2, e3, e4;
916 e3 = copysignf(c3 *
cbrtf(c3) * IQ, in[
i+2]);
917 e4 = copysignf(c4 *
cbrtf(c4) * IQ, in[
i+3]);
925 qenergy += (e1*e1 + e2*e2) + (e3*e3 + e4*e4);
933 static void quantize_and_encode_band_cost_NONE_mips(
struct AACEncContext *
s,
935 const float *scaled,
int size,
int scale_idx,
936 int cb,
const float lambda,
const float uplim,
937 int *
bits,
float *energy,
const float ROUNDING) {
941 static void quantize_and_encode_band_cost_ZERO_mips(
struct AACEncContext *
s,
943 const float *scaled,
int size,
int scale_idx,
944 int cb,
const float lambda,
const float uplim,
945 int *
bits,
float *energy,
const float ROUNDING) {
950 for (
i = 0;
i <
size;
i += 4) {
963 const float *scaled,
int size,
int scale_idx,
964 int cb,
const float lambda,
const float uplim,
965 int *
bits,
float *energy,
const float ROUNDING) = {
966 quantize_and_encode_band_cost_ZERO_mips,
967 quantize_and_encode_band_cost_SQUAD_mips,
968 quantize_and_encode_band_cost_SQUAD_mips,
969 quantize_and_encode_band_cost_UQUAD_mips,
970 quantize_and_encode_band_cost_UQUAD_mips,
971 quantize_and_encode_band_cost_SPAIR_mips,
972 quantize_and_encode_band_cost_SPAIR_mips,
973 quantize_and_encode_band_cost_UPAIR7_mips,
974 quantize_and_encode_band_cost_UPAIR7_mips,
975 quantize_and_encode_band_cost_UPAIR12_mips,
976 quantize_and_encode_band_cost_UPAIR12_mips,
977 quantize_and_encode_band_cost_ESC_mips,
978 quantize_and_encode_band_cost_NONE_mips,
979 quantize_and_encode_band_cost_ZERO_mips,
980 quantize_and_encode_band_cost_ZERO_mips,
981 quantize_and_encode_band_cost_ZERO_mips,
984 #define quantize_and_encode_band_cost( \
985 s, pb, in, out, scaled, size, scale_idx, cb, \
986 lambda, uplim, bits, energy, ROUNDING) \
987 quantize_and_encode_band_cost_arr[cb]( \
988 s, pb, in, out, scaled, size, scale_idx, cb, \
989 lambda, uplim, bits, energy, ROUNDING)
992 const float *in,
float *
out,
int size,
int scale_idx,
993 int cb,
const float lambda,
int rtz)
1004 const float *scaled,
int size,
int scale_idx,
1005 int cb,
const float lambda,
const float uplim,
1013 const float *scaled,
int size,
int scale_idx,
1014 int cb,
const float lambda,
const float uplim,
1021 static float get_band_numbits_SQUAD_mips(
struct AACEncContext *
s,
1023 const float *scaled,
int size,
int scale_idx,
1024 int cb,
const float lambda,
const float uplim,
1029 int qc1, qc2, qc3, qc4;
1034 for (
i = 0;
i <
size;
i += 4) {
1036 int *in_int = (
int *)&in[
i];
1046 ".set noreorder \n\t"
1048 "slt %[qc1], $zero, %[qc1] \n\t"
1049 "slt %[qc2], $zero, %[qc2] \n\t"
1050 "slt %[qc3], $zero, %[qc3] \n\t"
1051 "slt %[qc4], $zero, %[qc4] \n\t"
1052 "lw %[t0], 0(%[in_int]) \n\t"
1053 "lw %[t1], 4(%[in_int]) \n\t"
1054 "lw %[t2], 8(%[in_int]) \n\t"
1055 "lw %[t3], 12(%[in_int]) \n\t"
1056 "srl %[t0], %[t0], 31 \n\t"
1057 "srl %[t1], %[t1], 31 \n\t"
1058 "srl %[t2], %[t2], 31 \n\t"
1059 "srl %[t3], %[t3], 31 \n\t"
1060 "subu %[t4], $zero, %[qc1] \n\t"
1061 "subu %[t5], $zero, %[qc2] \n\t"
1062 "subu %[t6], $zero, %[qc3] \n\t"
1063 "subu %[t7], $zero, %[qc4] \n\t"
1064 "movn %[qc1], %[t4], %[t0] \n\t"
1065 "movn %[qc2], %[t5], %[t1] \n\t"
1066 "movn %[qc3], %[t6], %[t2] \n\t"
1067 "movn %[qc4], %[t7], %[t3] \n\t"
1071 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
1072 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
1075 : [in_int]
"r"(in_int)
1088 curbits += p_bits[curidx];
1093 static float get_band_numbits_UQUAD_mips(
struct AACEncContext *
s,
1095 const float *scaled,
int size,
int scale_idx,
1096 int cb,
const float lambda,
const float uplim,
1102 int qc1, qc2, qc3, qc4;
1106 for (
i = 0;
i <
size;
i += 4) {
1117 ".set noreorder \n\t"
1119 "ori %[t4], $zero, 2 \n\t"
1120 "slt %[t0], %[t4], %[qc1] \n\t"
1121 "slt %[t1], %[t4], %[qc2] \n\t"
1122 "slt %[t2], %[t4], %[qc3] \n\t"
1123 "slt %[t3], %[t4], %[qc4] \n\t"
1124 "movn %[qc1], %[t4], %[t0] \n\t"
1125 "movn %[qc2], %[t4], %[t1] \n\t"
1126 "movn %[qc3], %[t4], %[t2] \n\t"
1127 "movn %[qc4], %[t4], %[t3] \n\t"
1131 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
1132 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
1145 curbits += p_bits[curidx];
1146 curbits += uquad_sign_bits[curidx];
1151 static float get_band_numbits_SPAIR_mips(
struct AACEncContext *
s,
1153 const float *scaled,
int size,
int scale_idx,
1154 int cb,
const float lambda,
const float uplim,
1159 int qc1, qc2, qc3, qc4;
1164 for (
i = 0;
i <
size;
i += 4) {
1165 int curidx, curidx2;
1166 int *in_int = (
int *)&in[
i];
1176 ".set noreorder \n\t"
1178 "ori %[t4], $zero, 4 \n\t"
1179 "slt %[t0], %[t4], %[qc1] \n\t"
1180 "slt %[t1], %[t4], %[qc2] \n\t"
1181 "slt %[t2], %[t4], %[qc3] \n\t"
1182 "slt %[t3], %[t4], %[qc4] \n\t"
1183 "movn %[qc1], %[t4], %[t0] \n\t"
1184 "movn %[qc2], %[t4], %[t1] \n\t"
1185 "movn %[qc3], %[t4], %[t2] \n\t"
1186 "movn %[qc4], %[t4], %[t3] \n\t"
1187 "lw %[t0], 0(%[in_int]) \n\t"
1188 "lw %[t1], 4(%[in_int]) \n\t"
1189 "lw %[t2], 8(%[in_int]) \n\t"
1190 "lw %[t3], 12(%[in_int]) \n\t"
1191 "srl %[t0], %[t0], 31 \n\t"
1192 "srl %[t1], %[t1], 31 \n\t"
1193 "srl %[t2], %[t2], 31 \n\t"
1194 "srl %[t3], %[t3], 31 \n\t"
1195 "subu %[t4], $zero, %[qc1] \n\t"
1196 "subu %[t5], $zero, %[qc2] \n\t"
1197 "subu %[t6], $zero, %[qc3] \n\t"
1198 "subu %[t7], $zero, %[qc4] \n\t"
1199 "movn %[qc1], %[t4], %[t0] \n\t"
1200 "movn %[qc2], %[t5], %[t1] \n\t"
1201 "movn %[qc3], %[t6], %[t2] \n\t"
1202 "movn %[qc4], %[t7], %[t3] \n\t"
1206 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
1207 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
1210 : [in_int]
"r"(in_int)
1218 curidx2 += qc4 + 40;
1220 curbits += p_bits[curidx] + p_bits[curidx2];
1225 static float get_band_numbits_UPAIR7_mips(
struct AACEncContext *
s,
1227 const float *scaled,
int size,
int scale_idx,
1228 int cb,
const float lambda,
const float uplim,
1233 int qc1, qc2, qc3, qc4;
1238 for (
i = 0;
i <
size;
i += 4) {
1239 int curidx, curidx2;
1249 ".set noreorder \n\t"
1251 "ori %[t4], $zero, 7 \n\t"
1252 "slt %[t0], %[t4], %[qc1] \n\t"
1253 "slt %[t1], %[t4], %[qc2] \n\t"
1254 "slt %[t2], %[t4], %[qc3] \n\t"
1255 "slt %[t3], %[t4], %[qc4] \n\t"
1256 "movn %[qc1], %[t4], %[t0] \n\t"
1257 "movn %[qc2], %[t4], %[t1] \n\t"
1258 "movn %[qc3], %[t4], %[t2] \n\t"
1259 "movn %[qc4], %[t4], %[t3] \n\t"
1263 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
1264 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
1275 curbits += p_bits[curidx] +
1276 upair7_sign_bits[curidx] +
1278 upair7_sign_bits[curidx2];
1283 static float get_band_numbits_UPAIR12_mips(
struct AACEncContext *
s,
1285 const float *scaled,
int size,
int scale_idx,
1286 int cb,
const float lambda,
const float uplim,
1291 int qc1, qc2, qc3, qc4;
1296 for (
i = 0;
i <
size;
i += 4) {
1297 int curidx, curidx2;
1307 ".set noreorder \n\t"
1309 "ori %[t4], $zero, 12 \n\t"
1310 "slt %[t0], %[t4], %[qc1] \n\t"
1311 "slt %[t1], %[t4], %[qc2] \n\t"
1312 "slt %[t2], %[t4], %[qc3] \n\t"
1313 "slt %[t3], %[t4], %[qc4] \n\t"
1314 "movn %[qc1], %[t4], %[t0] \n\t"
1315 "movn %[qc2], %[t4], %[t1] \n\t"
1316 "movn %[qc3], %[t4], %[t2] \n\t"
1317 "movn %[qc4], %[t4], %[t3] \n\t"
1321 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
1322 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
1333 curbits += p_bits[curidx] +
1335 upair12_sign_bits[curidx] +
1336 upair12_sign_bits[curidx2];
1343 const float *scaled,
int size,
int scale_idx,
1344 int cb,
const float lambda,
const float uplim,
1349 int qc1, qc2, qc3, qc4;
1354 for (
i = 0;
i <
size;
i += 4) {
1355 int curidx, curidx2;
1356 int cond0, cond1, cond2, cond3;
1367 ".set noreorder \n\t"
1369 "ori %[t4], $zero, 15 \n\t"
1370 "ori %[t5], $zero, 16 \n\t"
1371 "shll_s.w %[c1], %[qc1], 18 \n\t"
1372 "shll_s.w %[c2], %[qc2], 18 \n\t"
1373 "shll_s.w %[c3], %[qc3], 18 \n\t"
1374 "shll_s.w %[c4], %[qc4], 18 \n\t"
1375 "srl %[c1], %[c1], 18 \n\t"
1376 "srl %[c2], %[c2], 18 \n\t"
1377 "srl %[c3], %[c3], 18 \n\t"
1378 "srl %[c4], %[c4], 18 \n\t"
1379 "slt %[cond0], %[t4], %[qc1] \n\t"
1380 "slt %[cond1], %[t4], %[qc2] \n\t"
1381 "slt %[cond2], %[t4], %[qc3] \n\t"
1382 "slt %[cond3], %[t4], %[qc4] \n\t"
1383 "movn %[qc1], %[t5], %[cond0] \n\t"
1384 "movn %[qc2], %[t5], %[cond1] \n\t"
1385 "movn %[qc3], %[t5], %[cond2] \n\t"
1386 "movn %[qc4], %[t5], %[cond3] \n\t"
1387 "ori %[t5], $zero, 31 \n\t"
1388 "clz %[c1], %[c1] \n\t"
1389 "clz %[c2], %[c2] \n\t"
1390 "clz %[c3], %[c3] \n\t"
1391 "clz %[c4], %[c4] \n\t"
1392 "subu %[c1], %[t5], %[c1] \n\t"
1393 "subu %[c2], %[t5], %[c2] \n\t"
1394 "subu %[c3], %[t5], %[c3] \n\t"
1395 "subu %[c4], %[t5], %[c4] \n\t"
1396 "sll %[c1], %[c1], 1 \n\t"
1397 "sll %[c2], %[c2], 1 \n\t"
1398 "sll %[c3], %[c3], 1 \n\t"
1399 "sll %[c4], %[c4], 1 \n\t"
1400 "addiu %[c1], %[c1], -3 \n\t"
1401 "addiu %[c2], %[c2], -3 \n\t"
1402 "addiu %[c3], %[c3], -3 \n\t"
1403 "addiu %[c4], %[c4], -3 \n\t"
1404 "subu %[cond0], $zero, %[cond0] \n\t"
1405 "subu %[cond1], $zero, %[cond1] \n\t"
1406 "subu %[cond2], $zero, %[cond2] \n\t"
1407 "subu %[cond3], $zero, %[cond3] \n\t"
1408 "and %[c1], %[c1], %[cond0] \n\t"
1409 "and %[c2], %[c2], %[cond1] \n\t"
1410 "and %[c3], %[c3], %[cond2] \n\t"
1411 "and %[c4], %[c4], %[cond3] \n\t"
1415 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
1416 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
1417 [cond0]
"=&r"(cond0), [cond1]
"=&r"(cond1),
1418 [cond2]
"=&r"(cond2), [cond3]
"=&r"(cond3),
1420 [c3]
"=&r"(c3), [c4]
"=&r"(c4),
1430 curbits += p_bits[curidx];
1431 curbits += esc_sign_bits[curidx];
1432 curbits += p_bits[curidx2];
1433 curbits += esc_sign_bits[curidx2];
1445 const float *scaled,
int size,
int scale_idx,
1446 int cb,
const float lambda,
const float uplim,
1448 get_band_numbits_ZERO_mips,
1449 get_band_numbits_SQUAD_mips,
1450 get_band_numbits_SQUAD_mips,
1451 get_band_numbits_UQUAD_mips,
1452 get_band_numbits_UQUAD_mips,
1453 get_band_numbits_SPAIR_mips,
1454 get_band_numbits_SPAIR_mips,
1455 get_band_numbits_UPAIR7_mips,
1456 get_band_numbits_UPAIR7_mips,
1457 get_band_numbits_UPAIR12_mips,
1458 get_band_numbits_UPAIR12_mips,
1459 get_band_numbits_ESC_mips,
1460 get_band_numbits_NONE_mips,
1461 get_band_numbits_ZERO_mips,
1462 get_band_numbits_ZERO_mips,
1463 get_band_numbits_ZERO_mips,
1466 #define get_band_numbits( \
1467 s, pb, in, scaled, size, scale_idx, cb, \
1468 lambda, uplim, bits) \
1469 get_band_numbits_arr[cb]( \
1470 s, pb, in, scaled, size, scale_idx, cb, \
1471 lambda, uplim, bits)
1474 const float *scaled,
int size,
int scale_idx,
1475 int cb,
const float lambda,
const float uplim,
1476 int *
bits,
float *energy)
1487 const float *scaled,
int size,
int scale_idx,
1488 int cb,
const float lambda,
const float uplim,
1489 int *
bits,
float *energy)
1494 for (
i = 0;
i <
size;
i += 4) {
1495 cost += in[
i ] * in[
i ];
1496 cost += in[
i+1] * in[
i+1];
1497 cost += in[
i+2] * in[
i+2];
1498 cost += in[
i+3] * in[
i+3];
1509 const float *scaled,
int size,
int scale_idx,
1510 int cb,
const float lambda,
const float uplim,
1511 int *
bits,
float *energy)
1519 const float *scaled,
int size,
int scale_idx,
1520 int cb,
const float lambda,
const float uplim,
1521 int *
bits,
float *energy)
1527 float qenergy = 0.0f;
1528 int qc1, qc2, qc3, qc4;
1534 for (
i = 0;
i <
size;
i += 4) {
1537 int *in_int = (
int *)&in[
i];
1538 float *in_pos = (
float *)&in[
i];
1539 float di0, di1, di2, di3;
1549 ".set noreorder \n\t"
1551 "slt %[qc1], $zero, %[qc1] \n\t"
1552 "slt %[qc2], $zero, %[qc2] \n\t"
1553 "slt %[qc3], $zero, %[qc3] \n\t"
1554 "slt %[qc4], $zero, %[qc4] \n\t"
1555 "lw %[t0], 0(%[in_int]) \n\t"
1556 "lw %[t1], 4(%[in_int]) \n\t"
1557 "lw %[t2], 8(%[in_int]) \n\t"
1558 "lw %[t3], 12(%[in_int]) \n\t"
1559 "srl %[t0], %[t0], 31 \n\t"
1560 "srl %[t1], %[t1], 31 \n\t"
1561 "srl %[t2], %[t2], 31 \n\t"
1562 "srl %[t3], %[t3], 31 \n\t"
1563 "subu %[t4], $zero, %[qc1] \n\t"
1564 "subu %[t5], $zero, %[qc2] \n\t"
1565 "subu %[t6], $zero, %[qc3] \n\t"
1566 "subu %[t7], $zero, %[qc4] \n\t"
1567 "movn %[qc1], %[t4], %[t0] \n\t"
1568 "movn %[qc2], %[t5], %[t1] \n\t"
1569 "movn %[qc3], %[t6], %[t2] \n\t"
1570 "movn %[qc4], %[t7], %[t3] \n\t"
1574 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
1575 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
1578 : [in_int]
"r"(in_int)
1591 curbits += p_bits[curidx];
1592 vec = &p_codes[curidx*4];
1594 qenergy += vec[0]*vec[0] + vec[1]*vec[1]
1595 + vec[2]*vec[2] + vec[3]*vec[3];
1599 ".set noreorder \n\t"
1601 "lwc1 $f0, 0(%[in_pos]) \n\t"
1602 "lwc1 $f1, 0(%[vec]) \n\t"
1603 "lwc1 $f2, 4(%[in_pos]) \n\t"
1604 "lwc1 $f3, 4(%[vec]) \n\t"
1605 "lwc1 $f4, 8(%[in_pos]) \n\t"
1606 "lwc1 $f5, 8(%[vec]) \n\t"
1607 "lwc1 $f6, 12(%[in_pos]) \n\t"
1608 "lwc1 $f7, 12(%[vec]) \n\t"
1609 "nmsub.s %[di0], $f0, $f1, %[IQ] \n\t"
1610 "nmsub.s %[di1], $f2, $f3, %[IQ] \n\t"
1611 "nmsub.s %[di2], $f4, $f5, %[IQ] \n\t"
1612 "nmsub.s %[di3], $f6, $f7, %[IQ] \n\t"
1616 : [di0]
"=&f"(di0), [di1]
"=&f"(di1),
1617 [di2]
"=&f"(di2), [di3]
"=&f"(di3)
1618 : [in_pos]
"r"(in_pos), [vec]
"r"(vec),
1620 :
"$f0",
"$f1",
"$f2",
"$f3",
1621 "$f4",
"$f5",
"$f6",
"$f7",
1625 cost += di0 * di0 + di1 * di1
1626 + di2 * di2 + di3 * di3;
1632 *energy = qenergy * (IQ*IQ);
1633 return cost *
lambda + curbits;
1638 const float *scaled,
int size,
int scale_idx,
1639 int cb,
const float lambda,
const float uplim,
1640 int *
bits,
float *energy)
1646 float qenergy = 0.0f;
1648 int qc1, qc2, qc3, qc4;
1653 for (
i = 0;
i <
size;
i += 4) {
1656 float *in_pos = (
float *)&in[
i];
1657 float di0, di1, di2, di3;
1667 ".set noreorder \n\t"
1669 "ori %[t4], $zero, 2 \n\t"
1670 "slt %[t0], %[t4], %[qc1] \n\t"
1671 "slt %[t1], %[t4], %[qc2] \n\t"
1672 "slt %[t2], %[t4], %[qc3] \n\t"
1673 "slt %[t3], %[t4], %[qc4] \n\t"
1674 "movn %[qc1], %[t4], %[t0] \n\t"
1675 "movn %[qc2], %[t4], %[t1] \n\t"
1676 "movn %[qc3], %[t4], %[t2] \n\t"
1677 "movn %[qc4], %[t4], %[t3] \n\t"
1681 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
1682 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
1695 curbits += p_bits[curidx];
1696 curbits += uquad_sign_bits[curidx];
1697 vec = &p_codes[curidx*4];
1699 qenergy += vec[0]*vec[0] + vec[1]*vec[1]
1700 + vec[2]*vec[2] + vec[3]*vec[3];
1704 ".set noreorder \n\t"
1706 "lwc1 %[di0], 0(%[in_pos]) \n\t"
1707 "lwc1 %[di1], 4(%[in_pos]) \n\t"
1708 "lwc1 %[di2], 8(%[in_pos]) \n\t"
1709 "lwc1 %[di3], 12(%[in_pos]) \n\t"
1710 "abs.s %[di0], %[di0] \n\t"
1711 "abs.s %[di1], %[di1] \n\t"
1712 "abs.s %[di2], %[di2] \n\t"
1713 "abs.s %[di3], %[di3] \n\t"
1714 "lwc1 $f0, 0(%[vec]) \n\t"
1715 "lwc1 $f1, 4(%[vec]) \n\t"
1716 "lwc1 $f2, 8(%[vec]) \n\t"
1717 "lwc1 $f3, 12(%[vec]) \n\t"
1718 "nmsub.s %[di0], %[di0], $f0, %[IQ] \n\t"
1719 "nmsub.s %[di1], %[di1], $f1, %[IQ] \n\t"
1720 "nmsub.s %[di2], %[di2], $f2, %[IQ] \n\t"
1721 "nmsub.s %[di3], %[di3], $f3, %[IQ] \n\t"
1725 : [di0]
"=&f"(di0), [di1]
"=&f"(di1),
1726 [di2]
"=&f"(di2), [di3]
"=&f"(di3)
1727 : [in_pos]
"r"(in_pos), [vec]
"r"(vec),
1729 :
"$f0",
"$f1",
"$f2",
"$f3",
1733 cost += di0 * di0 + di1 * di1
1734 + di2 * di2 + di3 * di3;
1740 *energy = qenergy * (IQ*IQ);
1741 return cost *
lambda + curbits;
1746 const float *scaled,
int size,
int scale_idx,
1747 int cb,
const float lambda,
const float uplim,
1748 int *
bits,
float *energy)
1754 float qenergy = 0.0f;
1755 int qc1, qc2, qc3, qc4;
1761 for (
i = 0;
i <
size;
i += 4) {
1762 const float *vec, *vec2;
1763 int curidx, curidx2;
1764 int *in_int = (
int *)&in[
i];
1765 float *in_pos = (
float *)&in[
i];
1766 float di0, di1, di2, di3;
1776 ".set noreorder \n\t"
1778 "ori %[t4], $zero, 4 \n\t"
1779 "slt %[t0], %[t4], %[qc1] \n\t"
1780 "slt %[t1], %[t4], %[qc2] \n\t"
1781 "slt %[t2], %[t4], %[qc3] \n\t"
1782 "slt %[t3], %[t4], %[qc4] \n\t"
1783 "movn %[qc1], %[t4], %[t0] \n\t"
1784 "movn %[qc2], %[t4], %[t1] \n\t"
1785 "movn %[qc3], %[t4], %[t2] \n\t"
1786 "movn %[qc4], %[t4], %[t3] \n\t"
1787 "lw %[t0], 0(%[in_int]) \n\t"
1788 "lw %[t1], 4(%[in_int]) \n\t"
1789 "lw %[t2], 8(%[in_int]) \n\t"
1790 "lw %[t3], 12(%[in_int]) \n\t"
1791 "srl %[t0], %[t0], 31 \n\t"
1792 "srl %[t1], %[t1], 31 \n\t"
1793 "srl %[t2], %[t2], 31 \n\t"
1794 "srl %[t3], %[t3], 31 \n\t"
1795 "subu %[t4], $zero, %[qc1] \n\t"
1796 "subu %[t5], $zero, %[qc2] \n\t"
1797 "subu %[t6], $zero, %[qc3] \n\t"
1798 "subu %[t7], $zero, %[qc4] \n\t"
1799 "movn %[qc1], %[t4], %[t0] \n\t"
1800 "movn %[qc2], %[t5], %[t1] \n\t"
1801 "movn %[qc3], %[t6], %[t2] \n\t"
1802 "movn %[qc4], %[t7], %[t3] \n\t"
1806 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
1807 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
1810 : [in_int]
"r"(in_int)
1818 curidx2 += qc4 + 40;
1820 curbits += p_bits[curidx];
1821 curbits += p_bits[curidx2];
1823 vec = &p_codes[curidx*2];
1824 vec2 = &p_codes[curidx2*2];
1826 qenergy += vec[0]*vec[0] + vec[1]*vec[1]
1827 + vec2[0]*vec2[0] + vec2[1]*vec2[1];
1831 ".set noreorder \n\t"
1833 "lwc1 $f0, 0(%[in_pos]) \n\t"
1834 "lwc1 $f1, 0(%[vec]) \n\t"
1835 "lwc1 $f2, 4(%[in_pos]) \n\t"
1836 "lwc1 $f3, 4(%[vec]) \n\t"
1837 "lwc1 $f4, 8(%[in_pos]) \n\t"
1838 "lwc1 $f5, 0(%[vec2]) \n\t"
1839 "lwc1 $f6, 12(%[in_pos]) \n\t"
1840 "lwc1 $f7, 4(%[vec2]) \n\t"
1841 "nmsub.s %[di0], $f0, $f1, %[IQ] \n\t"
1842 "nmsub.s %[di1], $f2, $f3, %[IQ] \n\t"
1843 "nmsub.s %[di2], $f4, $f5, %[IQ] \n\t"
1844 "nmsub.s %[di3], $f6, $f7, %[IQ] \n\t"
1848 : [di0]
"=&f"(di0), [di1]
"=&f"(di1),
1849 [di2]
"=&f"(di2), [di3]
"=&f"(di3)
1850 : [in_pos]
"r"(in_pos), [vec]
"r"(vec),
1851 [vec2]
"r"(vec2), [IQ]
"f"(IQ)
1852 :
"$f0",
"$f1",
"$f2",
"$f3",
1853 "$f4",
"$f5",
"$f6",
"$f7",
1857 cost += di0 * di0 + di1 * di1
1858 + di2 * di2 + di3 * di3;
1864 *energy = qenergy * (IQ*IQ);
1865 return cost *
lambda + curbits;
1870 const float *scaled,
int size,
int scale_idx,
1871 int cb,
const float lambda,
const float uplim,
1872 int *
bits,
float *energy)
1878 float qenergy = 0.0f;
1879 int qc1, qc2, qc3, qc4;
1885 for (
i = 0;
i <
size;
i += 4) {
1886 const float *vec, *vec2;
1887 int curidx, curidx2, sign1, count1, sign2, count2;
1888 int *in_int = (
int *)&in[
i];
1889 float *in_pos = (
float *)&in[
i];
1890 float di0, di1, di2, di3;
1900 ".set noreorder \n\t"
1902 "ori %[t4], $zero, 7 \n\t"
1903 "ori %[sign1], $zero, 0 \n\t"
1904 "ori %[sign2], $zero, 0 \n\t"
1905 "slt %[t0], %[t4], %[qc1] \n\t"
1906 "slt %[t1], %[t4], %[qc2] \n\t"
1907 "slt %[t2], %[t4], %[qc3] \n\t"
1908 "slt %[t3], %[t4], %[qc4] \n\t"
1909 "movn %[qc1], %[t4], %[t0] \n\t"
1910 "movn %[qc2], %[t4], %[t1] \n\t"
1911 "movn %[qc3], %[t4], %[t2] \n\t"
1912 "movn %[qc4], %[t4], %[t3] \n\t"
1913 "lw %[t0], 0(%[in_int]) \n\t"
1914 "lw %[t1], 4(%[in_int]) \n\t"
1915 "lw %[t2], 8(%[in_int]) \n\t"
1916 "lw %[t3], 12(%[in_int]) \n\t"
1917 "slt %[t0], %[t0], $zero \n\t"
1918 "movn %[sign1], %[t0], %[qc1] \n\t"
1919 "slt %[t2], %[t2], $zero \n\t"
1920 "movn %[sign2], %[t2], %[qc3] \n\t"
1921 "slt %[t1], %[t1], $zero \n\t"
1922 "sll %[t0], %[sign1], 1 \n\t"
1923 "or %[t0], %[t0], %[t1] \n\t"
1924 "movn %[sign1], %[t0], %[qc2] \n\t"
1925 "slt %[t3], %[t3], $zero \n\t"
1926 "sll %[t0], %[sign2], 1 \n\t"
1927 "or %[t0], %[t0], %[t3] \n\t"
1928 "movn %[sign2], %[t0], %[qc4] \n\t"
1929 "slt %[count1], $zero, %[qc1] \n\t"
1930 "slt %[t1], $zero, %[qc2] \n\t"
1931 "slt %[count2], $zero, %[qc3] \n\t"
1932 "slt %[t2], $zero, %[qc4] \n\t"
1933 "addu %[count1], %[count1], %[t1] \n\t"
1934 "addu %[count2], %[count2], %[t2] \n\t"
1938 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
1939 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
1940 [sign1]
"=&r"(sign1), [count1]
"=&r"(count1),
1941 [sign2]
"=&r"(sign2), [count2]
"=&r"(count2),
1944 : [in_int]
"r"(in_int)
1954 curbits += p_bits[curidx];
1955 curbits += upair7_sign_bits[curidx];
1956 vec = &p_codes[curidx*2];
1958 curbits += p_bits[curidx2];
1959 curbits += upair7_sign_bits[curidx2];
1960 vec2 = &p_codes[curidx2*2];
1962 qenergy += vec[0]*vec[0] + vec[1]*vec[1]
1963 + vec2[0]*vec2[0] + vec2[1]*vec2[1];
1967 ".set noreorder \n\t"
1969 "lwc1 %[di0], 0(%[in_pos]) \n\t"
1970 "lwc1 %[di1], 4(%[in_pos]) \n\t"
1971 "lwc1 %[di2], 8(%[in_pos]) \n\t"
1972 "lwc1 %[di3], 12(%[in_pos]) \n\t"
1973 "abs.s %[di0], %[di0] \n\t"
1974 "abs.s %[di1], %[di1] \n\t"
1975 "abs.s %[di2], %[di2] \n\t"
1976 "abs.s %[di3], %[di3] \n\t"
1977 "lwc1 $f0, 0(%[vec]) \n\t"
1978 "lwc1 $f1, 4(%[vec]) \n\t"
1979 "lwc1 $f2, 0(%[vec2]) \n\t"
1980 "lwc1 $f3, 4(%[vec2]) \n\t"
1981 "nmsub.s %[di0], %[di0], $f0, %[IQ] \n\t"
1982 "nmsub.s %[di1], %[di1], $f1, %[IQ] \n\t"
1983 "nmsub.s %[di2], %[di2], $f2, %[IQ] \n\t"
1984 "nmsub.s %[di3], %[di3], $f3, %[IQ] \n\t"
1988 : [di0]
"=&f"(di0), [di1]
"=&f"(di1),
1989 [di2]
"=&f"(di2), [di3]
"=&f"(di3)
1990 : [in_pos]
"r"(in_pos), [vec]
"r"(vec),
1991 [vec2]
"r"(vec2), [IQ]
"f"(IQ)
1992 :
"$f0",
"$f1",
"$f2",
"$f3",
1996 cost += di0 * di0 + di1 * di1
1997 + di2 * di2 + di3 * di3;
2003 *energy = qenergy * (IQ*IQ);
2004 return cost *
lambda + curbits;
2009 const float *scaled,
int size,
int scale_idx,
2010 int cb,
const float lambda,
const float uplim,
2011 int *
bits,
float *energy)
2017 float qenergy = 0.0f;
2018 int qc1, qc2, qc3, qc4;
2024 for (
i = 0;
i <
size;
i += 4) {
2025 const float *vec, *vec2;
2026 int curidx, curidx2;
2027 int sign1, count1, sign2, count2;
2028 int *in_int = (
int *)&in[
i];
2029 float *in_pos = (
float *)&in[
i];
2030 float di0, di1, di2, di3;
2040 ".set noreorder \n\t"
2042 "ori %[t4], $zero, 12 \n\t"
2043 "ori %[sign1], $zero, 0 \n\t"
2044 "ori %[sign2], $zero, 0 \n\t"
2045 "slt %[t0], %[t4], %[qc1] \n\t"
2046 "slt %[t1], %[t4], %[qc2] \n\t"
2047 "slt %[t2], %[t4], %[qc3] \n\t"
2048 "slt %[t3], %[t4], %[qc4] \n\t"
2049 "movn %[qc1], %[t4], %[t0] \n\t"
2050 "movn %[qc2], %[t4], %[t1] \n\t"
2051 "movn %[qc3], %[t4], %[t2] \n\t"
2052 "movn %[qc4], %[t4], %[t3] \n\t"
2053 "lw %[t0], 0(%[in_int]) \n\t"
2054 "lw %[t1], 4(%[in_int]) \n\t"
2055 "lw %[t2], 8(%[in_int]) \n\t"
2056 "lw %[t3], 12(%[in_int]) \n\t"
2057 "slt %[t0], %[t0], $zero \n\t"
2058 "movn %[sign1], %[t0], %[qc1] \n\t"
2059 "slt %[t2], %[t2], $zero \n\t"
2060 "movn %[sign2], %[t2], %[qc3] \n\t"
2061 "slt %[t1], %[t1], $zero \n\t"
2062 "sll %[t0], %[sign1], 1 \n\t"
2063 "or %[t0], %[t0], %[t1] \n\t"
2064 "movn %[sign1], %[t0], %[qc2] \n\t"
2065 "slt %[t3], %[t3], $zero \n\t"
2066 "sll %[t0], %[sign2], 1 \n\t"
2067 "or %[t0], %[t0], %[t3] \n\t"
2068 "movn %[sign2], %[t0], %[qc4] \n\t"
2069 "slt %[count1], $zero, %[qc1] \n\t"
2070 "slt %[t1], $zero, %[qc2] \n\t"
2071 "slt %[count2], $zero, %[qc3] \n\t"
2072 "slt %[t2], $zero, %[qc4] \n\t"
2073 "addu %[count1], %[count1], %[t1] \n\t"
2074 "addu %[count2], %[count2], %[t2] \n\t"
2078 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
2079 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
2080 [sign1]
"=&r"(sign1), [count1]
"=&r"(count1),
2081 [sign2]
"=&r"(sign2), [count2]
"=&r"(count2),
2084 : [in_int]
"r"(in_int)
2094 curbits += p_bits[curidx];
2095 curbits += p_bits[curidx2];
2096 curbits += upair12_sign_bits[curidx];
2097 curbits += upair12_sign_bits[curidx2];
2098 vec = &p_codes[curidx*2];
2099 vec2 = &p_codes[curidx2*2];
2101 qenergy += vec[0]*vec[0] + vec[1]*vec[1]
2102 + vec2[0]*vec2[0] + vec2[1]*vec2[1];
2106 ".set noreorder \n\t"
2108 "lwc1 %[di0], 0(%[in_pos]) \n\t"
2109 "lwc1 %[di1], 4(%[in_pos]) \n\t"
2110 "lwc1 %[di2], 8(%[in_pos]) \n\t"
2111 "lwc1 %[di3], 12(%[in_pos]) \n\t"
2112 "abs.s %[di0], %[di0] \n\t"
2113 "abs.s %[di1], %[di1] \n\t"
2114 "abs.s %[di2], %[di2] \n\t"
2115 "abs.s %[di3], %[di3] \n\t"
2116 "lwc1 $f0, 0(%[vec]) \n\t"
2117 "lwc1 $f1, 4(%[vec]) \n\t"
2118 "lwc1 $f2, 0(%[vec2]) \n\t"
2119 "lwc1 $f3, 4(%[vec2]) \n\t"
2120 "nmsub.s %[di0], %[di0], $f0, %[IQ] \n\t"
2121 "nmsub.s %[di1], %[di1], $f1, %[IQ] \n\t"
2122 "nmsub.s %[di2], %[di2], $f2, %[IQ] \n\t"
2123 "nmsub.s %[di3], %[di3], $f3, %[IQ] \n\t"
2127 : [di0]
"=&f"(di0), [di1]
"=&f"(di1),
2128 [di2]
"=&f"(di2), [di3]
"=&f"(di3)
2129 : [in_pos]
"r"(in_pos), [vec]
"r"(vec),
2130 [vec2]
"r"(vec2), [IQ]
"f"(IQ)
2131 :
"$f0",
"$f1",
"$f2",
"$f3",
2135 cost += di0 * di0 + di1 * di1
2136 + di2 * di2 + di3 * di3;
2142 *energy = qenergy * (IQ*IQ);
2143 return cost *
lambda + curbits;
2148 const float *scaled,
int size,
int scale_idx,
2149 int cb,
const float lambda,
const float uplim,
2150 int *
bits,
float *energy)
2154 const float CLIPPED_ESCAPE = 165140.0f * IQ;
2157 float qenergy = 0.0f;
2158 int qc1, qc2, qc3, qc4;
2164 for (
i = 0;
i <
size;
i += 4) {
2165 const float *vec, *vec2;
2166 int curidx, curidx2;
2168 float di1, di2, di3, di4;
2169 int cond0, cond1, cond2, cond3;
2180 ".set noreorder \n\t"
2182 "ori %[t6], $zero, 15 \n\t"
2183 "ori %[t7], $zero, 16 \n\t"
2184 "shll_s.w %[c1], %[qc1], 18 \n\t"
2185 "shll_s.w %[c2], %[qc2], 18 \n\t"
2186 "shll_s.w %[c3], %[qc3], 18 \n\t"
2187 "shll_s.w %[c4], %[qc4], 18 \n\t"
2188 "srl %[c1], %[c1], 18 \n\t"
2189 "srl %[c2], %[c2], 18 \n\t"
2190 "srl %[c3], %[c3], 18 \n\t"
2191 "srl %[c4], %[c4], 18 \n\t"
2192 "slt %[cond0], %[t6], %[qc1] \n\t"
2193 "slt %[cond1], %[t6], %[qc2] \n\t"
2194 "slt %[cond2], %[t6], %[qc3] \n\t"
2195 "slt %[cond3], %[t6], %[qc4] \n\t"
2196 "movn %[qc1], %[t7], %[cond0] \n\t"
2197 "movn %[qc2], %[t7], %[cond1] \n\t"
2198 "movn %[qc3], %[t7], %[cond2] \n\t"
2199 "movn %[qc4], %[t7], %[cond3] \n\t"
2203 : [qc1]
"+r"(qc1), [qc2]
"+r"(qc2),
2204 [qc3]
"+r"(qc3), [qc4]
"+r"(qc4),
2205 [cond0]
"=&r"(cond0), [cond1]
"=&r"(cond1),
2206 [cond2]
"=&r"(cond2), [cond3]
"=&r"(cond3),
2208 [c3]
"=&r"(c3), [c4]
"=&r"(c4),
2218 curbits += p_bits[curidx];
2219 curbits += esc_sign_bits[curidx];
2220 vec = &p_codes[curidx*2];
2222 curbits += p_bits[curidx2];
2223 curbits += esc_sign_bits[curidx2];
2224 vec2 = &p_codes[curidx2*2];
2226 curbits += (
av_log2(
c1) * 2 - 3) & (-cond0);
2227 curbits += (
av_log2(
c2) * 2 - 3) & (-cond1);
2228 curbits += (
av_log2(c3) * 2 - 3) & (-cond2);
2229 curbits += (
av_log2(c4) * 2 - 3) & (-cond3);
2237 if (
t1 >= CLIPPED_ESCAPE) {
2238 di1 =
t1 - CLIPPED_ESCAPE;
2239 qenergy += CLIPPED_ESCAPE*CLIPPED_ESCAPE;
2245 di1 =
t1 - (
V = vec[0] * IQ);
2250 if (
t2 >= CLIPPED_ESCAPE) {
2251 di2 =
t2 - CLIPPED_ESCAPE;
2252 qenergy += CLIPPED_ESCAPE*CLIPPED_ESCAPE;
2258 di2 =
t2 - (
V = vec[1] * IQ);
2263 if (
t3 >= CLIPPED_ESCAPE) {
2264 di3 =
t3 - CLIPPED_ESCAPE;
2265 qenergy += CLIPPED_ESCAPE*CLIPPED_ESCAPE;
2267 di3 =
t3 - (
V = c3 *
cbrtf(c3) * IQ);
2271 di3 =
t3 - (
V = vec2[0] * IQ);
2276 if (
t4 >= CLIPPED_ESCAPE) {
2277 di4 =
t4 - CLIPPED_ESCAPE;
2278 qenergy += CLIPPED_ESCAPE*CLIPPED_ESCAPE;
2280 di4 =
t4 - (
V = c4 *
cbrtf(c4) * IQ);
2284 di4 =
t4 - (
V = vec2[1]*IQ);
2288 cost += di1 * di1 + di2 * di2
2289 + di3 * di3 + di4 * di4;
2294 return cost *
lambda + curbits;
2299 const float *scaled,
int size,
int scale_idx,
2300 int cb,
const float lambda,
const float uplim,
2301 int *
bits,
float *energy) = {
2302 get_band_cost_ZERO_mips,
2303 get_band_cost_SQUAD_mips,
2304 get_band_cost_SQUAD_mips,
2305 get_band_cost_UQUAD_mips,
2306 get_band_cost_UQUAD_mips,
2307 get_band_cost_SPAIR_mips,
2308 get_band_cost_SPAIR_mips,
2309 get_band_cost_UPAIR7_mips,
2310 get_band_cost_UPAIR7_mips,
2311 get_band_cost_UPAIR12_mips,
2312 get_band_cost_UPAIR12_mips,
2313 get_band_cost_ESC_mips,
2314 get_band_cost_NONE_mips,
2315 get_band_cost_ZERO_mips,
2316 get_band_cost_ZERO_mips,
2317 get_band_cost_ZERO_mips,
2320 #define get_band_cost( \
2321 s, pb, in, scaled, size, scale_idx, cb, \
2322 lambda, uplim, bits, energy) \
2323 get_band_cost_arr[cb]( \
2324 s, pb, in, scaled, size, scale_idx, cb, \
2325 lambda, uplim, bits, energy)
2328 const float *scaled,
int size,
int scale_idx,
2329 int cb,
const float lambda,
const float uplim,
2330 int *
bits,
float *energy)
2332 return get_band_cost(
s,
NULL, in, scaled,
size, scale_idx,
cb,
lambda, uplim,
bits, energy);
2341 int start = 0,
i,
w, w2,
g, sid_sf_boost, prev_mid, prev_side;
2342 uint8_t nextband0[128], nextband1[128];
2343 float M[128],
S[128];
2344 float *L34 =
s->scoefs, *R34 =
s->scoefs + 128, *M34 =
s->scoefs + 128*2, *S34 =
s->scoefs + 128*3;
2345 const float lambda =
s->lambda;
2356 prev_mid = sce0->
sf_idx[0];
2357 prev_side = sce1->
sf_idx[0];
2365 float Mmax = 0.0f, Smax = 0.0f;
2371 + sce1->
coeffs[start+(
w+w2)*128+
i]) * 0.5;
2373 - sce1->
coeffs[start+(
w+w2)*128+
i];
2378 Mmax =
FFMAX(Mmax, M34[
i]);
2379 Smax =
FFMAX(Smax, S34[
i]);
2383 for (sid_sf_boost = 0; sid_sf_boost < 4; sid_sf_boost++) {
2384 float dist1 = 0.0f, dist2 = 0.0f;
2404 midcb =
FFMAX(1,midcb);
2405 sidcb =
FFMAX(1,sidcb);
2408 FFPsyBand *band0 = &
s->psy.ch[
s->cur_channel+0].psy_bands[(
w+w2)*16+
g];
2409 FFPsyBand *band1 = &
s->psy.ch[
s->cur_channel+1].psy_bands[(
w+w2)*16+
g];
2414 + sce1->
coeffs[start+(
w+w2)*128+
i]) * 0.5;
2416 - sce1->
coeffs[start+(
w+w2)*128+
i];
2464 }
else if (
B1 >
B0) {
2487 #if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
2489 int option =
c->options.coder;