Lines Matching defs:sfb

118  * if IS_LEFT_RIGHT_RATIO_THRESH < sfbEnergyLeft[sfb]/sfbEnergyRight[sfb] < 1 / IS_LEFT_RIGHT_RATIO_THRESH
258 INT j,sfb,sfboffs;
279 for (sfb = 0; sfb < maxSfbPerGroup; sfb++) {
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);
319 for (sfb = 0; sfb < maxSfbPerGroup; sfb++) {
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;
465 for (sfb = 0; sfb < maxSfbPerGroup; sfb++) {
466 if (isMask[sfboffs + sfb] == 1) {
468 startIsSfb = sfboffs + sfb;
469 isScaleLast = realIsScale[sfboffs + sfb];
473 overallHrrError += hrrErr[sfboffs + sfb] >> (MAX_SFB_PER_GROUP_SF-3);
474 isRegionLoudness += normSfbLoudness[sfboffs + sfb] >> MAX_SFB_PER_GROUP_SF;
483 overallHrrError += hrrErr[sfboffs + sfb] >> (MAX_SFB_PER_GROUP_SF-3);
484 isRegionLoudness += normSfbLoudness[sfboffs + sfb] >> MAX_SFB_PER_GROUP_SF;
486 if ( (hrrErr[sfboffs + sfb] < (isParams->local_error_thresh>>3)) && (overallHrrError < (isParams->total_error_thresh>>MAX_SFB_PER_GROUP_SF)) ) {
489 isMask[sfboffs + sfb] = 1;
497 if( fAbs(isScaleLast-realIsScale[sfboffs + sfb]) < (isParams->direction_deviation_thresh>>(REAL_SCALE_SF+LD_DATA_SHIFT-IS_DIRECTION_DEVIATION_THRESH_SF)) ) {
498 isScaleLast = realIsScale[sfboffs + sfb];
501 isMask[sfboffs + sfb] = 0;
507 if (currentIsSfbCount > 0 && (!inIsBlock || sfb == maxSfbPerGroup - 1)) {
510 for(j = startIsSfb; j <= sfboffs + sfb; j++) {
579 INT sfb,sfboffs, j;
631 for (sfb=0; sfb<sfbCnt; sfb+=sfbPerGroup) {
636 msMask[sfb+sfboffs] = 0;
637 if (isMask[sfb+sfboffs] == 0) {
641 if ( (sfbEnergyLeft[sfb+sfboffs] < sfbThresholdLeft[sfb+sfboffs])
642 &&(fMult(FL2FXCONST_DBL(1.0f/1.5f),sfbEnergyRight[sfb+sfboffs]) > sfbThresholdRight[sfb+sfboffs]) ) {
647 if(pnsData[0]->pnsFlag[sfb+sfboffs]) {
648 pnsData[0]->pnsFlag[sfb+sfboffs] = 0;
650 if(pnsData[1]->pnsFlag[sfb+sfboffs]) {
651 pnsData[1]->pnsFlag[sfb+sfboffs] = 0;
655 inv_n = GetInvInt((sfbOffset[sfb + sfboffs + 1] - sfbOffset[sfb + sfboffs])>>1); // scaled with 2 to compensate fMultDiv2() in subsequent loop
656 sL = calcSfbMaxScale(mdctSpectrumLeft,sfbOffset[sfb+sfboffs],sfbOffset[sfb+sfboffs+1]);
657 sR = calcSfbMaxScale(mdctSpectrumRight,sfbOffset[sfb+sfboffs],sfbOffset[sfb+sfboffs+1]);
660 for (j=sfbOffset[sfb+sfboffs]; j<sfbOffset[sfb+sfboffs+1]; j++)
670 for (j=sfbOffset[sfb+sfboffs]; j<sfbOffset[sfb+sfboffs+1]; j++) {
674 msMask[sfb+sfboffs] = 1;
675 tmp = fDivNorm(sfbEnergyLeft[sfb+sfboffs],ed,&s1);
686 for (j=sfbOffset[sfb+sfboffs]; j<sfbOffset[sfb+sfboffs+1]; j++) {
692 for (j=sfbOffset[sfb+sfboffs]; j<sfbOffset[sfb+sfboffs+1]; j++) {
704 for (j=sfbOffset[sfb+sfboffs]; j<sfbOffset[sfb+sfboffs+1]; j++) {
708 msMask[sfb+sfboffs] = 0;
709 tmp = fDivNorm(sfbEnergyLeft[sfb+sfboffs],es,&s1);
720 for (j=sfbOffset[sfb+sfboffs]; j<sfbOffset[sfb+sfboffs+1]; j++) {
726 for (j=sfbOffset[sfb+sfboffs]; j<sfbOffset[sfb+sfboffs+1]; j++) {
733 isBook[sfb+sfboffs] = CODE_BOOK_IS_IN_PHASE_NO;
735 if ( realIsScale[sfb+sfboffs] < FL2FXCONST_DBL(0.0f) ) {
736 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;
739 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));
742 sfbEnergyRight[sfb+sfboffs] = FL2FXCONST_DBL(0.0f);
743 sfbEnergyLdDataRight[sfb+sfboffs] = FL2FXCONST_DBL(-1.0f);
744 sfbThresholdRight[sfb+sfboffs] = FL2FXCONST_DBL(0.0f);
745 sfbThresholdLdDataRight[sfb+sfboffs] = FL2FXCONST_DBL(-0.515625f);
746 sfbSpreadEnRight[sfb+sfboffs] = FL2FXCONST_DBL(0.0f);