Lines Matching refs:scf
214 static FIXP_DBL FDKaacEnc_countSingleScfBits(INT scf, INT scfLeft, INT scfRight)
218 scfBitsFract = (FIXP_DBL) ( FDKaacEnc_bitCountScalefactorDelta(scfLeft-scf)
219 + FDKaacEnc_bitCountScalefactorDelta(scf-scfRight) );
231 static FIXP_DBL FDKaacEnc_calcSingleSpecPe(INT scf, FIXP_DBL sfbConstPePart, FIXP_DBL nLines)
237 scfFract = (FIXP_DBL)(scf << (DFRACT_BITS-1-AS_PE_FAC_SHIFT));
363 INT scf,
370 INT scfBest = scf;
378 scf);
379 *minScfCalculated = scf;
382 INT scfEstimated = scf;
385 /* improve by bigger scf ? */
389 scf++;
393 scf);
396 scfBest = scf;
402 /* improve by smaller scf ? */
404 scf = scfEstimated;
406 while ((sfbDistLdData > (threshLdData-distFactorLdData)) && (cnt++ < 1) && (scf > minScf)) {
407 scf--;
411 scf);
414 scfBest = scf;
419 *minScfCalculated = scf;
423 else { /* nmr <= 1.25 -> try to find bigger scf to use less bits */
428 scf++;
432 scf);
436 scfBest = scf;
457 INT *scf,
496 while ((sfbNext < psyOutChan->sfbCnt) && (scf[sfbNext] == FDK_INT_MIN))
500 scfAct = scf[sfbAct];
501 scfLast = scf + sfbLast;
502 scfNext = scf + sfbNext;
507 /* first relevant scf */
508 scfAct = scf[sfbAct];
510 scfNext = scf + sfbNext;
515 /* last relevant scf */
516 scfAct = scf[sfbAct];
517 scfLast = scf + sfbLast;
533 /* bigger than neighbouring scf found, try to use smaller scf */
539 /* estimate required bits for actual scf */
556 /* estimate required bits for smaller scf */
560 /* estimate required bits for new scf */
564 /* use new scf if no increase in pe and
569 /* distortion of new scf */
576 /* success, replace scf by new one */
577 scf[sfbAct] = scfAct;
591 /* from this scf value on not all new values have been checked */
632 INT *scf,
654 if (scf[sfb]!=FDK_INT_MIN) {
655 scfMin = fixMin(scfMin, scf[sfb]);
656 scfMax = fixMax(scfMax, scf[sfb]);
665 /* try smaller scf */
668 scfTmp[i] = scf[i];
673 while (sfb<sfbCnt && (scf[sfb]==FDK_INT_MIN || scf[sfb] <= scfAct))
677 while (sfb<sfbCnt && (scf[sfb]==FDK_INT_MIN || scf[sfb] > scfAct))
686 if (scf[sfb] != FDK_INT_MIN)
703 deltaScfBits = FDKaacEnc_countScfBitsDiff(scf,scfTmp,sfbCnt,startSfb,stopSfb);
705 deltaSpecPe = FDKaacEnc_calcSpecPeDiff(psyOutChan, qcOutChannel, scf, scfTmp, sfbConstPePart,
741 if (scf[sfb] != FDK_INT_MIN) {
745 scf[sfb] = scfAct;
771 INT *scf,
797 if (scf[sfb]!=FDK_INT_MIN) {
798 scfMin = fixMin(scfMin, scf[sfb]);
799 scfMax = fixMax(scfMax, scf[sfb]);
806 /* search for region with same scf values scfAct */
810 while (sfb<sfbCnt && (scf[sfb]==FDK_INT_MIN))
813 scfAct = scf[startSfb];
815 while (sfb<sfbCnt && ((scf[sfb]==FDK_INT_MIN) || (scf[sfb]==scf[startSfb])))
820 scfNext = scf[stopSfb];
830 /* try to reduce bits by checking scf values in the range
831 scf[startSfb]...scfHi */
833 /* try to find a better solution by reducing the scf difference to
834 the nearest possible lower scf */
842 if (scfHi > scf[startSfb]) {
845 if (scf[sfb] != FDK_INT_MIN) {
855 /* loop over all possible scf values for this region */
857 for (scfNew=scf[startSfb]+1; scfNew<=scfHi; scfNew++) {
859 scfTmp[k] = scf[k];
868 deltaScfBits = FDKaacEnc_countScfBitsDiff(scf,scfTmp,sfbCnt,startSfb,stopSfb);
870 deltaSpecPe = FDKaacEnc_calcSpecPeDiff(psyOutChan, qcOutChannel, scf, scfTmp, sfbConstPePart,
906 if (scf[sfb] != FDK_INT_MIN) {
907 scf[sfb] = scfNew;
922 if (scfAct==scf[startSfb] &&
929 scfTmp[k] = scf[k];
945 deltaScfBits = FDKaacEnc_countScfBitsDiff(scf,scfTmp,sfbCnt,startSfb,stopSfb);
947 deltaSpecPe = FDKaacEnc_calcSpecPeDiff(psyOutChan, qcOutChannel, scf, scfTmp, sfbConstPePart,
980 if (scf[sfb] != FDK_INT_MIN) {
981 scf[sfb] = scfNew;
994 if (scfMax-scfMin <= MAX_SCF_DELTA-3) { /* 3 bec. scf is reduced 3 times,
998 scfTmp[k] = scf[k];
1008 deltaScfBits = FDKaacEnc_countScfBitsDiff(scf,scfTmp,sfbCnt,startSfb,stopSfb);
1019 a smaller scf */
1040 if (scf[sfb] != FDK_INT_MIN) {
1041 scf[sfb] = scfNew;
1057 INT *RESTRICT scf,
1092 scf[i] = FDK_INT_MIN;
1119 /* scf calc */
1139 /* lower scf limit to avoid quantized values bigger than MAX_QUANT */
1166 scf[sfbOffs+sfb] = scfInt;
1173 /* try to decrease scf differences */
1190 FDKaacEnc_assimilateSingleScf(psyOutChannel, qcOutChannel, quantSpec, quantSpecTmp, scf,
1195 FDKaacEnc_assimilateMultipleScf(psyOutChannel, qcOutChannel, quantSpec, quantSpecTmp, scf,
1200 FDKaacEnc_FDKaacEnc_assimilateMultipleScf2(psyOutChannel, qcOutChannel, quantSpec, quantSpecTmp, scf,
1211 if (scf[sfbOffs+sfb]!=FDK_INT_MIN)
1212 minSf = fixMin(minSf,scf[sfbOffs+sfb]);
1216 /* limit scf delta */
1219 if ((scf[sfbOffs+sfb] != FDK_INT_MIN) && (minSf+MAX_SCF_DELTA) < scf[sfbOffs+sfb]) {
1220 scf[sfbOffs+sfb] = minSf + MAX_SCF_DELTA;
1226 scf[sfbOffs+sfb]
1238 maxSf = fixMax(maxSf,scf[sfbOffs+sfb]);
1247 if( scf[sfbOffs+sfb] == FDK_INT_MIN ) {
1248 scf[sfbOffs+sfb] = 0;
1255 scf[sfbOffs+sfb] = maxSf - scf[sfbOffs+sfb];
1265 scf[sfbOffs+sfb] = 0;
1292 qcOutChannel[ch]->scf,