259static void APCM_quantization
P5((xM,xMc,mant_out,exp_out,xmaxc_out),
278 for (i = 0; i <= 12; i++) {
281 if (temp > xmax) xmax = temp;
288 temp =
SASR( xmax, 9 );
291 for (i = 0; i <= 5; i++) {
293 itest |= (temp <= 0);
294 temp =
SASR( temp, 1 );
297 if (itest == 0) exp++;
300 assert(exp <= 6 && exp >= 0);
303 assert(temp <= 11 && temp >= 0);
304 xmaxc = gsm_add(
SASR(xmax, temp), exp << 3 );
310 APCM_quantization_xmaxc_to_exp_mant(
xmaxc, &exp, &mant );
326 assert( exp <= 4096 && exp >= -4096);
327 assert( mant >= 0 && mant <= 7 );
332 for (i = 0; i <= 12; i++) {
334 assert(temp1 >= 0 && temp1 < 16);
336 temp = xM[i] << temp1;
338 temp =
SASR(temp, 12);
352static void APCM_inverse_quantization
P4((xMc,mant,exp,xMp),
364 word temp, temp1, temp2, temp3;
366 assert( mant >= 0 && mant <= 7 );
369 temp2 = gsm_sub( 6, exp );
370 temp3 = gsm_asl( 1, gsm_sub( temp2, 1 ));
374 assert( *xMc <= 7 && *xMc >= 0 );
377 temp = (*xMc++ << 1) - 7;
378 assert( temp <= 7 && temp >= -7 );
383 *xMp++ = gsm_asr( temp, temp2 );
461 word xM[13], xMp[13];
464 Weighting_filter(e, x);
465 RPE_grid_selection(x, xM,
Mc);
467 APCM_quantization( xM, xMc, &mant, &exp,
xmaxc);
468 APCM_inverse_quantization( xMc, mant, exp, xMp);
470 RPE_grid_positioning( *
Mc, xMp, e );
474void Gsm_RPE_Decoding
P5((
S, xmaxcr, Mcr, xMcr, erp),
486 APCM_quantization_xmaxc_to_exp_mant( xmaxcr, &exp, &mant );
487 APCM_inverse_quantization( xMcr, mant, exp, xMp );
488 RPE_grid_positioning( Mcr, xMp, erp );