Mercurial > libavcodec.hg
comparison aaccoder.c @ 9944:c5ca5e520fe1 libavcodec
Change fminf/fmaxf to FFMIN/FFMAX to fix the build on broken operating systems.
author | alexc |
---|---|
date | Thu, 09 Jul 2009 17:22:59 +0000 |
parents | 6c5a58b34997 |
children | 6fb2be900484 |
comparison
equal
deleted
inserted
replaced
9943:2cd0d1447bd3 | 9944:c5ca5e520fe1 |
---|---|
509 sce->zeroes[(w+w2)*16+g] = 0; | 509 sce->zeroes[(w+w2)*16+g] = 0; |
510 nz = 1; | 510 nz = 1; |
511 for (i = 0; i < sce->ics.swb_sizes[g]; i++) { | 511 for (i = 0; i < sce->ics.swb_sizes[g]; i++) { |
512 float t = fabsf(coefs[w2*128+i]); | 512 float t = fabsf(coefs[w2*128+i]); |
513 if (t > 0.0f) | 513 if (t > 0.0f) |
514 qmin = fminf(qmin, t); | 514 qmin = FFMIN(qmin, t); |
515 qmax = fmaxf(qmax, t); | 515 qmax = FFMAX(qmax, t); |
516 } | 516 } |
517 } | 517 } |
518 if (nz) { | 518 if (nz) { |
519 int minscale, maxscale; | 519 int minscale, maxscale; |
520 float minrd = INFINITY; | 520 float minrd = INFINITY; |
532 dists[cb] += quantize_band_cost(s, coefs + w2*128, s->scoefs + start + w2*128, sce->ics.swb_sizes[g], | 532 dists[cb] += quantize_band_cost(s, coefs + w2*128, s->scoefs + start + w2*128, sce->ics.swb_sizes[g], |
533 q, cb, lambda / band->threshold, INFINITY, NULL); | 533 q, cb, lambda / band->threshold, INFINITY, NULL); |
534 } | 534 } |
535 dist = dists[0]; | 535 dist = dists[0]; |
536 for (i = 1; i <= ESC_BT; i++) | 536 for (i = 1; i <= ESC_BT; i++) |
537 dist = fminf(dist, dists[i]); | 537 dist = FFMIN(dist, dists[i]); |
538 minrd = fminf(minrd, dist); | 538 minrd = FFMIN(minrd, dist); |
539 | 539 |
540 for (i = FFMAX(q - SCALE_MAX_DIFF, 0); i < FFMIN(q + SCALE_MAX_DIFF, 256); i++) { | 540 for (i = FFMAX(q - SCALE_MAX_DIFF, 0); i < FFMIN(q + SCALE_MAX_DIFF, 256); i++) { |
541 float cost; | 541 float cost; |
542 int minv, maxv; | 542 int minv, maxv; |
543 if (isinf(paths[idx - 256 + i].cost)) | 543 if (isinf(paths[idx - 256 + i].cost)) |
638 nz = 1; | 638 nz = 1; |
639 } | 639 } |
640 uplims[w*16+g] = uplim *512; | 640 uplims[w*16+g] = uplim *512; |
641 sce->zeroes[w*16+g] = !nz; | 641 sce->zeroes[w*16+g] = !nz; |
642 if (nz) | 642 if (nz) |
643 minthr = fminf(minthr, uplim); | 643 minthr = FFMIN(minthr, uplim); |
644 allz = FFMAX(allz, nz); | 644 allz = FFMAX(allz, nz); |
645 } | 645 } |
646 } | 646 } |
647 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { | 647 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { |
648 for (g = 0; g < sce->ics.num_swb; g++) { | 648 for (g = 0; g < sce->ics.num_swb; g++) { |
649 if (sce->zeroes[w*16+g]) { | 649 if (sce->zeroes[w*16+g]) { |
650 sce->sf_idx[w*16+g] = SCALE_ONE_POS; | 650 sce->sf_idx[w*16+g] = SCALE_ONE_POS; |
651 continue; | 651 continue; |
652 } | 652 } |
653 sce->sf_idx[w*16+g] = SCALE_ONE_POS + fminf(log2(uplims[w*16+g]/minthr)*4,59); | 653 sce->sf_idx[w*16+g] = SCALE_ONE_POS + FFMIN(log2(uplims[w*16+g]/minthr)*4,59); |
654 } | 654 } |
655 } | 655 } |
656 | 656 |
657 if (!allz) | 657 if (!allz) |
658 return; | 658 return; |
808 continue; | 808 continue; |
809 } | 809 } |
810 for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { | 810 for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { |
811 for (i = 0; i < size; i++) { | 811 for (i = 0; i < size; i++) { |
812 float t = coefs[w2*128+i]*coefs[w2*128+i]; | 812 float t = coefs[w2*128+i]*coefs[w2*128+i]; |
813 maxq[w*16+g] = fmaxf(maxq[w*16+g], fabsf(coefs[w2*128 + i])); | 813 maxq[w*16+g] = FFMAX(maxq[w*16+g], fabsf(coefs[w2*128 + i])); |
814 thr += t; | 814 thr += t; |
815 if (sce->ics.num_windows == 1 && maxval < t) { | 815 if (sce->ics.num_windows == 1 && maxval < t) { |
816 maxval = t; | 816 maxval = t; |
817 peakpos = start+i; | 817 peakpos = start+i; |
818 } | 818 } |
961 if (!cpe->ch[0].zeroes[w*16+g] && !cpe->ch[1].zeroes[w*16+g]) { | 961 if (!cpe->ch[0].zeroes[w*16+g] && !cpe->ch[1].zeroes[w*16+g]) { |
962 float dist1 = 0.0f, dist2 = 0.0f; | 962 float dist1 = 0.0f, dist2 = 0.0f; |
963 for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) { | 963 for (w2 = 0; w2 < sce0->ics.group_len[w]; w2++) { |
964 FFPsyBand *band0 = &s->psy.psy_bands[(s->cur_channel+0)*PSY_MAX_BANDS+(w+w2)*16+g]; | 964 FFPsyBand *band0 = &s->psy.psy_bands[(s->cur_channel+0)*PSY_MAX_BANDS+(w+w2)*16+g]; |
965 FFPsyBand *band1 = &s->psy.psy_bands[(s->cur_channel+1)*PSY_MAX_BANDS+(w+w2)*16+g]; | 965 FFPsyBand *band1 = &s->psy.psy_bands[(s->cur_channel+1)*PSY_MAX_BANDS+(w+w2)*16+g]; |
966 float minthr = fminf(band0->threshold, band1->threshold); | 966 float minthr = FFMIN(band0->threshold, band1->threshold); |
967 float maxthr = fmaxf(band0->threshold, band1->threshold); | 967 float maxthr = FFMAX(band0->threshold, band1->threshold); |
968 for (i = 0; i < sce0->ics.swb_sizes[g]; i++) { | 968 for (i = 0; i < sce0->ics.swb_sizes[g]; i++) { |
969 M[i] = (sce0->coeffs[start+w2*128+i] | 969 M[i] = (sce0->coeffs[start+w2*128+i] |
970 + sce1->coeffs[start+w2*128+i]) * 0.5; | 970 + sce1->coeffs[start+w2*128+i]) * 0.5; |
971 S[i] = sce0->coeffs[start+w2*128+i] | 971 S[i] = sce0->coeffs[start+w2*128+i] |
972 - sce1->coeffs[start+w2*128+i]; | 972 - sce1->coeffs[start+w2*128+i]; |