Lines Matching refs:sfboffs
258 INT j,sfb,sfboffs;
277 for (grpCounter = 0, sfboffs = 0; sfboffs < sfbCnt; sfboffs += sfbPerGroup, grpCounter++) {
281 FIXP_DBL isValue = sfbEnergyLdDataLeft[sfb+sfboffs]-sfbEnergyLdDataRight[sfb+sfboffs];
284 realScale[sfb + sfboffs] = fixMin(FL2FXCONST_DBL(60.f/(1<<(REAL_SCALE_SF+LD_DATA_SHIFT))), fixMax(FL2FXCONST_DBL(-60.f/(1<<(REAL_SCALE_SF+LD_DATA_SHIFT))), isValue));
286 sL = fixMax(0,(CntLeadingZeros(sfbEnergyLeft[sfb + sfboffs])-1));
287 sR = fixMax(0,(CntLeadingZeros(sfbEnergyRight[sfb + sfboffs])-1));
289 normSfbLoudness[sfb + sfboffs] = sqrtFixp(sqrtFixp(((sfbEnergyLeft[sfb + sfboffs]<<s) >> 1) + ((sfbEnergyRight[sfb + sfboffs]<<s) >> 1))) >> (s>>2);
291 overallLoudness[grpCounter] += normSfbLoudness[sfb + sfboffs] >> OVERALL_LOUDNESS_SF;
296 if( (sfbEnergyLeft[sfb + sfboffs] >= fMult(isParams->left_right_ratio_threshold,sfbEnergyRight[sfb + sfboffs]))
297 && (fMult(isParams->left_right_ratio_threshold,sfbEnergyLeft[sfb + sfboffs]) <= sfbEnergyRight[sfb + sfboffs]) ) {
300 hrrErr[sfb + sfboffs] = FL2FXCONST_DBL(1.0/8.0);
305 for (grpCounter = 0, sfboffs = 0; sfboffs < sfbCnt; sfboffs += sfbPerGroup, grpCounter++) {
322 tmp = fMultDiv2((normSfbLoudness[sfb + sfboffs]>>OVERALL_LOUDNESS_SF)<<OVERALL_LOUDNESS_SF,invOverallLoudness);
324 normSfbLoudness[sfb + sfboffs] = scaleValue(tmp, invOverallLoudnessSF);
326 channelCorr[sfb + sfboffs] = FL2FXCONST_DBL(0.0f);
331 inv_n = GetInvInt((sfbOffset[sfb + sfboffs + 1] - sfbOffset[sfb + sfboffs])>>1);
344 sL = calcSfbMaxScale(mdctSpectrumLeft,sfbOffset[sfb+sfboffs],sfbOffset[sfb+sfboffs+1]);
345 sR = calcSfbMaxScale(mdctSpectrumRight,sfbOffset[sfb+sfboffs],sfbOffset[sfb+sfboffs+1]);
348 for (j = sfbOffset[sfb + sfboffs]; j < sfbOffset[sfb + sfboffs + 1]; j++) {
355 for (j = sfbOffset[sfb + sfboffs]; j < sfbOffset[sfb + sfboffs + 1]; j++) {
383 channelCorr[sfb + sfboffs] = -(fDivNorm(-prod_lr,tmp,&channelCorrSF));
387 channelCorr[sfb + sfboffs] = (fDivNorm( prod_lr,tmp,&channelCorrSF));
392 channelCorr[sfb + sfboffs] = channelCorr[sfb + sfboffs] >> (-channelCorrSF);
396 if ( fAbs(channelCorr[sfb + sfboffs]) > (((FIXP_DBL)MAXVAL_DBL)>>channelCorrSF) ) {
397 if (channelCorr[sfb + sfboffs] < FL2FXCONST_DBL(0.0f))
398 channelCorr[sfb + sfboffs] = -(FIXP_DBL) MAXVAL_DBL;
400 channelCorr[sfb + sfboffs] = (FIXP_DBL) MAXVAL_DBL;
403 channelCorr[sfb + sfboffs] = channelCorr[sfb + sfboffs] << channelCorrSF;
411 if (hrrErr[sfb + sfboffs] == FL2FXCONST_DBL(1.0/8.0)) {
415 hrrErr[sfb + sfboffs] = fMultDiv2((FL2FXCONST_DBL(0.25f)-(channelCorr[sfb + sfboffs]>>2)),normSfbLoudness[sfb + sfboffs]);
418 if (fAbs(channelCorr[sfb + sfboffs]) >= isParams->corr_thresh) {
419 isMask[sfb + sfboffs] = 1;
452 INT sfb,sfboffs, j;
456 for (sfboffs = 0; sfboffs < sfbCnt; sfboffs += sfbPerGroup) {
464 if (isMask[sfboffs + sfb] == 1) {
466 startIsSfb = sfboffs + sfb;
469 isScaleLast = realIsScale[sfboffs + sfb];
474 overallHrrError += hrrErr[sfboffs + sfb] >> (MAX_SFB_PER_GROUP_SF-3);
475 isRegionLoudness += normSfbLoudness[sfboffs + sfb] >> MAX_SFB_PER_GROUP_SF;
484 overallHrrError += hrrErr[sfboffs + sfb] >> (MAX_SFB_PER_GROUP_SF-3);
485 isRegionLoudness += normSfbLoudness[sfboffs + sfb] >> MAX_SFB_PER_GROUP_SF;
487 if ( (hrrErr[sfboffs + sfb] < (isParams->local_error_thresh>>3)) && (overallHrrError < (isParams->total_error_thresh>>MAX_SFB_PER_GROUP_SF)) ) {
490 isMask[sfboffs + sfb] = 1;
498 if( fAbs(isScaleLast-realIsScale[sfboffs + sfb]) < (isParams->direction_deviation_thresh>>(REAL_SCALE_SF+LD_DATA_SHIFT-IS_DIRECTION_DEVIATION_THRESH_SF)) ) {
499 isScaleLast = realIsScale[sfboffs + sfb];
502 isMask[sfboffs + sfb] = 0;
511 for(j = startIsSfb; j <= sfboffs + sfb; j++) {
588 INT sfb,sfboffs, j;
641 for (sfboffs=0; sfboffs<maxSfbPerGroup; sfboffs++) {
645 msMask[sfb+sfboffs] = 0;
646 if (isMask[sfb+sfboffs] == 0) {
650 if ( (sfbEnergyLeft[sfb+sfboffs] < sfbThresholdLeft[sfb+sfboffs])
651 &&(fMult(FL2FXCONST_DBL(1.0f/1.5f),sfbEnergyRight[sfb+sfboffs]) > sfbThresholdRight[sfb+sfboffs]) ) {
656 if(pnsData[0]->pnsFlag[sfb+sfboffs]) {
657 pnsData[0]->pnsFlag[sfb+sfboffs] = 0;
659 if(pnsData[1]->pnsFlag[sfb+sfboffs]) {
660 pnsData[1]->pnsFlag[sfb+sfboffs] = 0;
664 inv_n = GetInvInt((sfbOffset[sfb + sfboffs + 1] - sfbOffset[sfb + sfboffs])>>1); // scaled with 2 to compensate fMultDiv2() in subsequent loop
665 sL = calcSfbMaxScale(mdctSpectrumLeft,sfbOffset[sfb+sfboffs],sfbOffset[sfb+sfboffs+1]);
666 sR = calcSfbMaxScale(mdctSpectrumRight,sfbOffset[sfb+sfboffs],sfbOffset[sfb+sfboffs+1]);
669 for (j=sfbOffset[sfb+sfboffs]; j<sfbOffset[sfb+sfboffs+1]; j++)
679 for (j=sfbOffset[sfb+sfboffs]; j<sfbOffset[sfb+sfboffs+1]; j++) {
683 msMask[sfb+sfboffs] = 1;
684 tmp = fDivNorm(sfbEnergyLeft[sfb+sfboffs],ed,&s1);
695 for (j=sfbOffset[sfb+sfboffs]; j<sfbOffset[sfb+sfboffs+1]; j++) {
701 for (j=sfbOffset[sfb+sfboffs]; j<sfbOffset[sfb+sfboffs+1]; j++) {
713 for (j=sfbOffset[sfb+sfboffs]; j<sfbOffset[sfb+sfboffs+1]; j++) {
717 msMask[sfb+sfboffs] = 0;
718 tmp = fDivNorm(sfbEnergyLeft[sfb+sfboffs],es,&s1);
729 for (j=sfbOffset[sfb+sfboffs]; j<sfbOffset[sfb+sfboffs+1]; j++) {
735 for (j=sfbOffset[sfb+sfboffs]; j<sfbOffset[sfb+sfboffs+1]; j++) {
742 isBook[sfb+sfboffs] = CODE_BOOK_IS_IN_PHASE_NO;
744 if ( realIsScale[sfb+sfboffs] < FL2FXCONST_DBL(0.0f) ) {
745 isScale[sfb+sfboffs] = (INT)(((realIsScale[sfb+sfboffs]>>1)-FL2FXCONST_DBL(0.5f/(1<<(REAL_SCALE_SF+LD_DATA_SHIFT+1))))>>(DFRACT_BITS-1-REAL_SCALE_SF-LD_DATA_SHIFT-1)) + 1;
748 isScale[sfb+sfboffs] = (INT)(((realIsScale[sfb+sfboffs]>>1)+FL2FXCONST_DBL(0.5f/(1<<(REAL_SCALE_SF+LD_DATA_SHIFT+1))))>>(DFRACT_BITS-1-REAL_SCALE_SF-LD_DATA_SHIFT-1));
751 sfbEnergyRight[sfb+sfboffs] = FL2FXCONST_DBL(0.0f);
752 sfbEnergyLdDataRight[sfb+sfboffs] = FL2FXCONST_DBL(-1.0f);
753 sfbThresholdRight[sfb+sfboffs] = FL2FXCONST_DBL(0.0f);
754 sfbThresholdLdDataRight[sfb+sfboffs] = FL2FXCONST_DBL(-0.515625f);
755 sfbSpreadEnRight[sfb+sfboffs] = FL2FXCONST_DBL(0.0f);