Ignore:
Timestamp:
04/27/07 12:50:17 (17 years ago)
Author:
r2d
Message:
  • moved some MPC_FIXED_POINT defines from mpcdec_math.h to mpc_types.h
  • added MPC_FIXED_POINT to mpcdec to test all this
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libmpc/trunk/mpcdec/mpcdec.c

    r279 r299  
    112112        sum           += end - begin;
    113113
    114         if(is_wav_output)
     114                if(is_wav_output) {
     115#ifdef MPC_FIXED_POINT
     116                        mpc_int16_t tmp_buff[MPC_DECODER_BUFFER_LENGTH];
     117                        int i;
     118                        for( i = 0; i < MPC_DECODER_BUFFER_LENGTH; i++) {
     119                                int tmp = sample_buffer[i] >> MPC_FIXED_POINT_FRACTPART;
     120                                if (tmp > ((1 << 15) - 1)) tmp = ((1 << 15) - 1);
     121                                if (tmp < -(1 << 15)) tmp = -(1 << 15);
     122                                tmp_buff[i] = tmp;
     123                        }
     124                        if(waveformat_output_process_int16(&wav_output, tmp_buff, frame.samples*2) < 0)
     125#else
    115126            if(waveformat_output_process_float32(&wav_output, sample_buffer, frame.samples*2) < 0)
     127#endif
    116128                break;
     129                }
    117130    }
    118131
Note: See TracChangeset for help on using the changeset viewer.