Ignore:
Timestamp:
Apr 18, 2009 2:29:28 PM (15 years ago)
Author:
bennylp
Message:

More ticket #774: optimization for siren7/siren14 codecs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/third_party/g7221/encode/encoder.c

    r2563 r2616  
    141141       to be exactly 3.010299957 or 20.0 times log base 10 
    142142       of square root of 2. */ 
    143     temp = shl(mag_shift,1); 
     143    temp = shl_nocheck(mag_shift,1); 
    144144    mag_shift_offset = add(temp,REGION_POWER_TABLE_NUM_NEGATIVES); 
    145145     
     
    259259        if (j >= 0) 
    260260        { 
    261             temp = extract_l(L_shr(current_word,j)); 
     261            temp = extract_l(L_shr_nocheck(current_word,j)); 
    262262            out_word = add(out_word,temp); 
    263263 
     
    291291    { 
    292292        accb = L_deposit_l(out_word_index); 
    293         accb = L_shl(accb,4); 
     293        accb = L_shl_nocheck(accb,4); 
    294294        accb = L_sub(accb,number_of_bits_per_frame); 
    295295        test(); 
    296296        if(accb < 0)         
    297297        { 
    298             temp = shl(region,2); 
     298            temp = shl_nocheck(region,2); 
    299299            in_word_ptr = &region_mlt_bits[temp]; 
    300300            region_bit_count = region_mlt_bit_counts[region]; 
     
    311311     
    312312            acca = L_deposit_l(out_word_index); 
    313             acca = L_shl(acca,4); 
     313            acca = L_shl_nocheck(acca,4); 
    314314            acca = L_sub(acca,number_of_bits_per_frame); 
    315315             
     
    382382                } 
    383383                acca = L_deposit_l(out_word_index); 
    384                 acca = L_shl(acca,4); 
     384                acca = L_shl_nocheck(acca,4); 
    385385                acca = L_sub(acca,number_of_bits_per_frame); 
    386386            } 
    387387            accb = L_deposit_l(out_word_index); 
    388             accb = L_shl(accb,4); 
     388            accb = L_shl_nocheck(accb,4); 
    389389            accb = L_sub(accb,number_of_bits_per_frame); 
    390390        } 
     
    415415         
    416416        acca = L_deposit_l(out_word_index); 
    417         acca = L_shl(acca,4); 
     417        acca = L_shl_nocheck(acca,4); 
    418418        acca = L_sub(acca,number_of_bits_per_frame); 
    419419    } 
     
    462462    { 
    463463        n = sub(absolute_region_power_index[region],39); 
    464         n = shr(n,1); 
     464        n = shr_nocheck(n,1); 
    465465         
    466466        test(); 
     
    473473            for (i=0; i<REGION_SIZE; i++) 
    474474            { 
    475                 acca = L_shl(*raw_mlt_ptr,16); 
     475                acca = L_shl_nocheck(*raw_mlt_ptr,16); 
    476476                acca = L_add(acca,32768L); 
    477                 acca = L_shr(acca,n); 
    478                 acca = L_shr(acca,16); 
     477                acca = L_shr_nocheck(acca,n); 
     478                acca = L_shr_nocheck(acca,16); 
    479479                *raw_mlt_ptr++ = extract_l(acca); 
    480480            } 
    481481 
    482             temp = shl(n,1); 
     482            temp = shl_nocheck(n,1); 
    483483            temp = sub(absolute_region_power_index[region],temp); 
    484484            absolute_region_power_index[region] = temp; 
     
    568568        { 
    569569            test(); 
    570             long_accumulator = L_shr(long_accumulator,1); 
     570            long_accumulator = L_shr_nocheck(long_accumulator,1); 
    571571             
    572572            acca = (long_accumulator & 0x7fff0000L); 
     
    588588            logic16(); 
    589589             
    590             long_accumulator = L_shl(long_accumulator,1); 
     590            long_accumulator = L_shl_nocheck(long_accumulator,1); 
    591591            acca = L_sub(long_accumulator,32767); 
    592592            power_shift--; 
    593593            temp = add(power_shift,15); 
    594594        } 
    595         long_accumulator = L_shr(long_accumulator,1); 
     595        long_accumulator = L_shr_nocheck(long_accumulator,1); 
    596596        /* 28963 corresponds to square root of 2 times REGION_SIZE(20). */ 
    597597        acca = L_sub(long_accumulator,28963); 
     
    602602         
    603603        acca = L_deposit_l(mag_shift); 
    604         acca = L_shl(acca,1); 
     604        acca = L_shl_nocheck(acca,1); 
    605605        acca = L_sub(power_shift,acca); 
    606606        acca = L_add(35,acca); 
     
    786786 
    787787    /* Start in the middle of the categorization control range. */ 
    788     temp = shr(num_categorization_control_possibilities,1); 
     788    temp = shr_nocheck(num_categorization_control_possibilities,1); 
    789789    temp = sub(temp,1); 
    790790    for (*p_categorization_control = 0; *p_categorization_control < temp; (*p_categorization_control)++) 
     
    809809            region_mlt_bit_counts[region] = 
    810810            vector_huffman(category, absolute_region_power_index[region],raw_mlt_ptr, 
    811                            &region_mlt_bits[shl(region,2)]); 
     811                           &region_mlt_bits[shl_nocheck(region,2)]); 
    812812        } 
    813813        else 
     
    850850            region_mlt_bit_counts[region] = 
    851851                vector_huffman(category, absolute_region_power_index[region],raw_mlt_ptr, 
    852                            &region_mlt_bits[shl(region,2)]); 
     852                           &region_mlt_bits[shl_nocheck(region,2)]); 
    853853        } 
    854854        else 
     
    896896            region_mlt_bit_counts[region] = 
    897897                vector_huffman(category, absolute_region_power_index[region],raw_mlt_ptr, 
    898                            &region_mlt_bits[shl(region,2)]); 
     898                           &region_mlt_bits[shl_nocheck(region,2)]); 
    899899        } 
    900900        else 
     
    10031003    /* compute inverse of step size * standard deviation */ 
    10041004    acca = L_mult(step_size_inverse_table[category],standard_deviation_inverse_table[power_index]); 
    1005     acca = L_shr(acca,1); 
     1005    acca = L_shr_nocheck(acca,1); 
    10061006    acca = L_add(acca,4096); 
    1007     acca = L_shr(acca,13); 
     1007    acca = L_shr_nocheck(acca,13); 
    10081008 
    10091009        /* 
     
    10121012      
    10131013        mytemp = acca & 0x3; 
    1014     acca = L_shr(acca,2); 
     1014    acca = L_shr_nocheck(acca,2); 
    10151015 
    10161016    inv_of_step_size_times_std_dev = extract_l(acca); 
     
    10331033             
    10341034            acca = L_mult(k,inv_of_step_size_times_std_dev); 
    1035             acca = L_shr(acca,1); 
     1035            acca = L_shr_nocheck(acca,1); 
    10361036                     
    10371037                        /* 
     
    10401040 
    10411041                        myacca = (Word16)L_mult(k,mytemp); 
    1042                         myacca = (Word16)L_shr(myacca,1); 
     1042                        myacca = (Word16)L_shr_nocheck(myacca,1); 
    10431043                        myacca = (Word16)L_add(myacca,int_dead_zone_low_bits[category]); 
    1044                         myacca = (Word16)L_shr(myacca,2); 
     1044                        myacca = (Word16)L_shr_nocheck(myacca,2); 
    10451045 
    10461046            acca = L_add(acca,int_dead_zone[category]); 
     
    10511051 
    10521052                        acca = L_add(acca,myacca); 
    1053                         acca = L_shr(acca,13); 
     1053                        acca = L_shr_nocheck(acca,13); 
    10541054 
    10551055            k = extract_l(acca); 
     
    10591059            { 
    10601060                number_of_non_zero = add(number_of_non_zero,1); 
    1061                 signs_index = shl(signs_index,1); 
     1061                signs_index = shl_nocheck(signs_index,1); 
    10621062                 
    10631063                test(); 
     
    10751075                } 
    10761076            } 
    1077             acca = L_shr(L_mult(index,(kmax_plus_one)),1); 
     1077            acca = L_shr_nocheck(L_mult(index,(kmax_plus_one)),1); 
    10781078            index = extract_l(acca); 
    10791079            index = add(index,k); 
     
    11051105        { 
    11061106            j = negate(j); 
    1107             acca = L_shr(code_bits,j); 
     1107            acca = L_shr_nocheck(code_bits,j); 
    11081108            current_word = L_add(current_word,acca); 
    11091109             
Note: See TracChangeset for help on using the changeset viewer.