@@ -325,7 +325,7 @@ void initSlotBasedRotation(
325
325
int env, int usb) {
326
326
INT group = 0 ;
327
327
INT bin = 0 ;
328
- INT noIidSteps;
328
+ INT noIidSteps, noFactors ;
329
329
330
330
FIXP_SGL invL;
331
331
FIXP_DBL ScaleL, ScaleR;
@@ -337,9 +337,11 @@ void initSlotBasedRotation(
337
337
if (h_ps_d->bsData [h_ps_d->processSlot ].mpeg .bFineIidQ ) {
338
338
PScaleFactors = ScaleFactorsFine; /* values are shiftet right by one */
339
339
noIidSteps = NO_IID_STEPS_FINE;
340
+ noFactors = NO_IID_LEVELS_FINE;
340
341
} else {
341
342
PScaleFactors = ScaleFactors; /* values are shiftet right by one */
342
343
noIidSteps = NO_IID_STEPS;
344
+ noFactors = NO_IID_LEVELS;
343
345
}
344
346
345
347
/* dequantize and decode */
@@ -358,10 +360,13 @@ void initSlotBasedRotation(
358
360
359
361
/* ScaleR and ScaleL are scaled by 1 shift right */
360
362
361
- ScaleR = PScaleFactors[noIidSteps + h_ps_d->specificTo .mpeg .pCoef
362
- ->aaIidIndexMapped [env][bin]];
363
- ScaleL = PScaleFactors[noIidSteps - h_ps_d->specificTo .mpeg .pCoef
364
- ->aaIidIndexMapped [env][bin]];
363
+ ScaleL = ScaleR = 0 ;
364
+ if (noIidSteps + h_ps_d->specificTo .mpeg .pCoef ->aaIidIndexMapped [env][bin] >= 0 && noIidSteps + h_ps_d->specificTo .mpeg .pCoef ->aaIidIndexMapped [env][bin] < noFactors)
365
+ ScaleR = PScaleFactors[noIidSteps + h_ps_d->specificTo .mpeg .pCoef
366
+ ->aaIidIndexMapped [env][bin]];
367
+ if (noIidSteps - h_ps_d->specificTo .mpeg .pCoef ->aaIidIndexMapped [env][bin] >= 0 && noIidSteps - h_ps_d->specificTo .mpeg .pCoef ->aaIidIndexMapped [env][bin] < noFactors)
368
+ ScaleL = PScaleFactors[noIidSteps - h_ps_d->specificTo .mpeg .pCoef
369
+ ->aaIidIndexMapped [env][bin]];
365
370
366
371
AlphasValue = 0 ;
367
372
if (h_ps_d->specificTo .mpeg .pCoef ->aaIccIndexMapped [env][bin] >= 0 )
0 commit comments