Changeset 2616 for pjproject/trunk/third_party/g7221/decode/dct4_s.c
 Timestamp:
 Apr 18, 2009 2:29:28 PM (10 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

pjproject/trunk/third_party/g7221/decode/dct4_s.c
r2601 r2616 141 141 142 142 /* set_span = 1 << (DCT_LENGTH_LOG  set_count_log); */ 143 set_span = shr (dct_length,set_count_log);143 set_span = shr_nocheck(dct_length,set_count_log); 144 144 145 set_count = shl (1,set_count_log);145 set_count = shl_nocheck(1,set_count_log); 146 146 in_ptr = in_buffer; 147 147 move16(); … … 186 186 187 187 dummy = add(in_val_low,dither_ptr[i++]); 188 acca = L_add(dummy,in_val_high); 189 out_val_low = extract_l(L_shr(acca,1)); 188 // blp: addition of two 16bits vars, there's no way 189 // they'll overflow a 32bit var 190 //acca = L_add(dummy,in_val_high); 191 acca = dummy + in_val_high; 192 out_val_low = extract_l(L_shr_nocheck(acca,1)); 190 193 191 194 dummy = add(in_val_low,dither_ptr[i++]); 192 acca = L_add(dummy,in_val_high); 193 out_val_high = extract_l(L_shr(acca,1)); 195 // blp: addition of two 16bits vars, there's no way 196 // they'll overflow a 32bit var 197 //acca = L_add(dummy,in_val_high); 198 acca = dummy  in_val_high; 199 out_val_high = extract_l(L_shr_nocheck(acca,1)); 194 200 195 201 *out_ptr_low++ = out_val_low; … … 285 291 for ( k=0; k<CORE_SIZE; k++ ) 286 292 { 293 #if PJ_HAS_INT64 294 /* blp: danger danger! not really compatible but faster */ 295 pj_int64_t sum64=0; 296 move32(); 297 298 for ( i=0; i<CORE_SIZE; i++ ) 299 { 300 sum64 += L_mult(pair_ptr[i], dct_core_s[i][k]); 301 } 302 sum = L_saturate(sum64); 303 #else 287 304 sum=0L; 288 305 move32(); … … 292 309 sum = L_mac(sum, pair_ptr[i],dct_core_s[i][k]); 293 310 } 311 #endif 294 312 buffer_swap[k] = itu_round(sum); 295 313 } … … 324 342 325 343 /* set_span = 1 << (DCT_LENGTH_LOG  set_count_log); */ 326 set_span = shr (dct_length,set_count_log);327 328 set_count = shl (1,set_count_log);344 set_span = shr_nocheck(dct_length,set_count_log); 345 346 set_count = shl_nocheck(1,set_count_log); 329 347 next_in_base = in_buffer; 330 348 move16(); … … 355 373 move16(); 356 374 357 temp = shr (set_span,1);375 temp = shr_nocheck(set_span,1); 358 376 in_ptr_high = in_ptr_low + temp; 359 377 move16(); … … 402 420 sum = L_mac(sum,cos_even,in_low_even); 403 421 sum = L_mac(sum,negate(msin_even),in_high_even); 404 out_low_even = itu_round(L_shl (sum,1));422 out_low_even = itu_round(L_shl_nocheck(sum,1)); 405 423 406 424 sum = 0L; … … 408 426 sum = L_mac(sum,msin_even,in_low_even); 409 427 sum = L_mac(sum,cos_even,in_high_even); 410 out_high_even = itu_round(L_shl (sum,1));428 out_high_even = itu_round(L_shl_nocheck(sum,1)); 411 429 412 430 sum = 0L; … … 414 432 sum = L_mac(sum,cos_odd,in_low_odd); 415 433 sum = L_mac(sum,msin_odd,in_high_odd); 416 out_low_odd = itu_round(L_shl (sum,1));434 out_low_odd = itu_round(L_shl_nocheck(sum,1)); 417 435 418 436 sum = 0L; … … 420 438 sum = L_mac(sum,msin_odd,in_low_odd); 421 439 sum = L_mac(sum,negate(cos_odd),in_high_odd); 422 out_high_odd = itu_round(L_shl (sum,1));440 out_high_odd = itu_round(L_shl_nocheck(sum,1)); 423 441 424 442 *out_ptr_low++ = out_low_even; … … 459 477 for(i=0;i<320;i++) 460 478 { 461 sum = L_add(output[i],syn_bias_7khz[i]); 479 // blp: addition of two 16bits vars, there's no way 480 // they'll overflow a 32bit var 481 //sum = L_add(output[i],syn_bias_7khz[i]); 482 sum = output[i] + syn_bias_7khz[i]; 462 483 acca = L_sub(sum,32767); 463 484 test(); … … 467 488 move32(); 468 489 } 469 acca = L_add(sum,32768L); 490 // blp: addition of two 16bits vars, there's no way 491 // they'll overflow 32bit var 492 //acca = L_add(sum,32768L); 493 acca = sum + 32768; 470 494 test(); 471 495 if (acca < 0)
Note: See TracChangeset
for help on using the changeset viewer.