Changeset 6065
- Timestamp:
- Sep 6, 2019 5:20:32 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/g7221.c
r5060 r6065 168 168 pj_uint16_t frame_size_bits; /**< Coded frame size in bits. */ 169 169 pj_uint16_t number_of_regions; /**< Number of regions. */ 170 int pcm_shift; /**< Adjustment for PCM in/out */170 pj_int16_t pcm_shift_val; /**< Adjustment for PCM in/out */ 171 171 172 172 /* Encoder specific state */ … … 700 700 (attr->info.clock_rate <= WB_SAMPLE_RATE? 701 701 NUMBER_OF_REGIONS:MAX_NUMBER_OF_REGIONS); 702 codec_data->pcm_shift =codec_factory.pcm_shift;702 codec_data->pcm_shift_val = 1 << (pj_int16_t)codec_factory.pcm_shift; 703 703 704 704 /* Initialize encoder state */ … … 845 845 846 846 /* Encoder adjust the input signal level */ 847 if (codec_data->pcm_shift ) {847 if (codec_data->pcm_shift_val > 1) { 848 848 unsigned i; 849 849 for (i=0; i<codec_data->samples_per_frame; ++i) { 850 850 codec_data->enc_frame[i] = 851 (Word16)(pcm_input[i] >> codec_data->pcm_shift);851 (Word16)(pcm_input[i] / codec_data->pcm_shift_val); 852 852 } 853 853 pcm_input = codec_data->enc_frame; … … 944 944 945 945 /* Decoder adjust PCM signal */ 946 if (codec_data->pcm_shift ) {946 if (codec_data->pcm_shift_val > 1) { 947 947 unsigned i; 948 948 pj_int16_t *buf = (Word16*)output->buf; 949 949 950 950 for (i=0; i<codec_data->samples_per_frame; ++i) { 951 buf[i] <<= codec_data->pcm_shift;951 buf[i] = buf[i] * codec_data->pcm_shift_val; 952 952 } 953 953 }
Note: See TracChangeset
for help on using the changeset viewer.