Changeset 299
- Timestamp:
- 04/27/07 12:50:17 (18 years ago)
- Location:
- libmpc/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpc/trunk/include/mpc/mpc_types.h
r204 r299 93 93 94 94 #ifdef MPC_FIXED_POINT 95 # define MPC_FIXED_POINT_SHIFT 16 96 # define MPC_FIXED_POINT_FRACTPART 14 97 # define MPC_FIXED_POINT_SCALE_SHIFT (MPC_FIXED_POINT_SHIFT + MPC_FIXED_POINT_FRACTPART) 98 # define MPC_FIXED_POINT_SCALE (1 << (MPC_FIXED_POINT_SCALE_SHIFT - 1)) 95 99 typedef mpc_int32_t MPC_SAMPLE_FORMAT; 96 100 #else -
libmpc/trunk/libmpcdec/mpcdec_math.h
r262 r299 46 46 #endif 47 47 48 #define MPC_FIXED_POINT_SHIFT 1649 50 51 48 #ifdef MPC_FIXED_POINT 52 49 … … 56 53 #endif 57 54 58 #define MPC_FIXED_POINT_SCALE_SHIFT (MPC_FIXED_POINT_SHIFT + MPC_FIXED_POINT_FRACTPART)59 #define MPC_FIXED_POINT_SCALE (1 << (MPC_FIXED_POINT_SCALE_SHIFT - 1))60 61 55 //in fixedpoint mode, results in decode output buffer are in -MPC_FIXED_POINT_SCALE ... MPC_FIXED_POINT_SCALE range 62 63 #define MPC_FIXED_POINT_FRACTPART 1464 56 65 57 typedef mpc_int64_t MPC_SAMPLE_FORMAT_MULTIPLY; -
libmpc/trunk/mpcdec/mpcdec.c
r279 r299 112 112 sum += end - begin; 113 113 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 115 126 if(waveformat_output_process_float32(&wav_output, sample_buffer, frame.samples*2) < 0) 127 #endif 116 128 break; 129 } 117 130 } 118 131
Note: See TracChangeset
for help on using the changeset viewer.