Changeset 2572 for pjproject/trunk
- Timestamp:
- Apr 6, 2009 11:45:25 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/g7221.c
r2565 r2572 764 764 codec_data->samples_per_frame); 765 765 766 /* Encode the mlt coefs */ 766 /* Encode the mlt coefs. Note that encoder output stream is 16 bit array, 767 * so we need to take care about endianness. 768 */ 767 769 encoder(codec_data->frame_size_bits, 768 770 codec_data->number_of_regions, … … 771 773 output->buf); 772 774 775 #if defined(PJ_IS_LITTLE_ENDIAN) && PJ_IS_LITTLE_ENDIAN!=0 776 { 777 pj_uint16_t *p, *p_end; 778 779 p = (pj_uint16_t*)output->buf; 780 p_end = p + codec_data->frame_size/2; 781 while (p < p_end) { 782 *p = pj_htons(*p); 783 ++p; 784 } 785 } 786 #endif 787 773 788 output->type = PJMEDIA_FRAME_TYPE_AUDIO; 774 789 output->size = codec_data->frame_size; … … 801 816 PJ_ASSERT_RETURN((pj_uint16_t)input->size == codec_data->frame_size, 802 817 PJMEDIA_CODEC_EFRMINLEN); 818 819 /* Decoder requires input of 16-bits array, so we need to take care 820 * about endianness. 821 */ 822 #if defined(PJ_IS_LITTLE_ENDIAN) && PJ_IS_LITTLE_ENDIAN!=0 823 { 824 pj_uint16_t *p, *p_end; 825 826 p = (pj_uint16_t*)input->buf; 827 p_end = p + codec_data->frame_size/2; 828 while (p < p_end) { 829 *p = pj_ntohs(*p); 830 ++p; 831 } 832 } 833 #endif 834 803 835 bitobj.code_word_ptr = (Word16*)input->buf; 804 836 bitobj.current_word = *bitobj.code_word_ptr;
Note: See TracChangeset
for help on using the changeset viewer.