Changeset 2225 for pjproject/trunk
- Timestamp:
- Aug 19, 2008 3:01:48 PM (16 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia-codec/config.h
r2219 r2225 85 85 86 86 /** 87 * IPP codecs are excluded by default. IPP codecs contain various codecs, 88 * e.g: G.729, G.723.1, G.726, G.728, G.722.1, AMR. 87 * Enable the features provided by Intel IPP libraries, for example 88 * codecs such as G.729, G.723.1, G.726, G.728, G.722.1, and AMR. 89 * 90 * By default this is disabled. Please follow the instructions in 91 * http://trac.pjsip.org/repos/wiki/Intel_IPP_Codecs on how to setup 92 * Intel IPP with PJMEDIA. 89 93 */ 90 #ifndef PJMEDIA_HAS_INTEL_IPP _CODECS91 # define PJMEDIA_HAS_INTEL_IPP _CODECS094 #ifndef PJMEDIA_HAS_INTEL_IPP 95 # define PJMEDIA_HAS_INTEL_IPP 0 92 96 #endif 93 97 98 94 99 /** 95 * Specify IPP codecs content. If PJMEDIA_HAS_INTEL_IPP_CODECS is not set, 96 * these settings will be ignored. 100 * Visual Studio only: when this option is set, the Intel IPP libraries 101 * will be automatically linked to application using pragma(comment) 102 * constructs. This is convenient, however it will only link with 103 * the stub libraries and the Intel IPP DLL's will be required when 104 * distributing the application. 105 * 106 * If application wants to link with the different types of the Intel IPP 107 * libraries (for example, the static libraries), it must set this option 108 * to zero and specify the Intel IPP libraries in the application's input 109 * library specification manually. 110 * 111 * Default 1. 112 */ 113 #ifndef PJMEDIA_AUTO_LINK_IPP_LIBS 114 # define PJMEDIA_AUTO_LINK_IPP_LIBS 1 115 #endif 116 117 118 /** 119 * Enable Intel IPP AMR codec. This also needs to be enabled when AMR WB 120 * codec is enabled. This option is only used when PJMEDIA_HAS_INTEL_IPP 121 * is enabled. 122 * 123 * Default: 1 97 124 */ 98 125 #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_AMR … … 100 127 #endif 101 128 129 130 /** 131 * Enable Intel IPP AMR wideband codec. The PJMEDIA_HAS_INTEL_IPP_CODEC_AMR 132 * option must also be enabled to use this codec. This option is only used 133 * when PJMEDIA_HAS_INTEL_IPP is enabled. 134 * 135 * Default: 1 136 */ 102 137 #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_AMRWB 103 138 # define PJMEDIA_HAS_INTEL_IPP_CODEC_AMRWB 1 104 139 #endif 105 140 141 142 /** 143 * Enable Intel IPP G.729 codec. This option is only used when 144 * PJMEDIA_HAS_INTEL_IPP is enabled. 145 * 146 * Default: 1 147 */ 106 148 #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G729 107 149 # define PJMEDIA_HAS_INTEL_IPP_CODEC_G729 1 108 150 #endif 109 151 110 #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G723 111 # define PJMEDIA_HAS_INTEL_IPP_CODEC_G723 1 152 153 /** 154 * Enable Intel IPP G.723.1 codec. This option is only used when 155 * PJMEDIA_HAS_INTEL_IPP is enabled. 156 * 157 * Default: 1 158 */ 159 #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G723_1 160 # define PJMEDIA_HAS_INTEL_IPP_CODEC_G723_1 1 112 161 #endif 113 162 163 164 /** 165 * Enable Intel IPP G.726 codec. This option is only used when 166 * PJMEDIA_HAS_INTEL_IPP is enabled. 167 * 168 * Default: 1 169 */ 114 170 #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G726 115 171 # define PJMEDIA_HAS_INTEL_IPP_CODEC_G726 1 116 172 #endif 117 173 174 175 /** 176 * Enable Intel IPP G.728 codec. This option is only used when 177 * PJMEDIA_HAS_INTEL_IPP is enabled. 178 * 179 * Default: 1 180 */ 118 181 #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G728 119 182 # define PJMEDIA_HAS_INTEL_IPP_CODEC_G728 1 120 183 #endif 121 184 185 186 /** 187 * Enable Intel IPP G.722.1 codec. This option is only used when 188 * PJMEDIA_HAS_INTEL_IPP is enabled. 189 * 190 * Default: 1 191 */ 122 192 #ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 123 193 # define PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 1 -
pjproject/trunk/pjmedia/src/pjmedia-codec/ipp_codecs.c
r2223 r2225 31 31 32 32 /* 33 * Only build this file if PJMEDIA_HAS_INTEL_IPP _CODECS!= 033 * Only build this file if PJMEDIA_HAS_INTEL_IPP != 0 34 34 */ 35 #if defined(PJMEDIA_HAS_INTEL_IPP _CODECS) && PJMEDIA_HAS_INTEL_IPP_CODECS!= 035 #if defined(PJMEDIA_HAS_INTEL_IPP) && PJMEDIA_HAS_INTEL_IPP != 0 36 36 37 37 #include <usc.h> … … 218 218 ipp_codec[] = 219 219 { 220 # if defined(PJMEDIA_HAS_INTEL_IPP_CODEC_AMR) && PJMEDIA_HAS_INTEL_IPP_CODEC_AMR != 0220 # if PJMEDIA_HAS_INTEL_IPP_CODEC_AMR 221 221 {1, "AMR", PJMEDIA_RTP_PT_AMR, &USC_GSMAMR_Fxns, 8000, 1, 160, 222 222 5900, 12200, 4, 1, 1, … … 225 225 # endif 226 226 227 # if defined(PJMEDIA_HAS_INTEL_IPP_CODEC_AMRWB) && PJMEDIA_HAS_INTEL_IPP_CODEC_AMRWB != 0228 {1, "AMR-WB", PJMEDIA_RTP_PT_AMRWB, &USC_AMRWB_Fxns, 16000, 1, 320, 229 15850, 23850, 4, 1, 1,227 # if PJMEDIA_HAS_INTEL_IPP_CODEC_AMRWB 228 {1, "AMR-WB", PJMEDIA_RTP_PT_AMRWB, &USC_AMRWB_Fxns, 16000, 1, 320, 229 15850, 23850, 1, 1, 1, 230 230 &predecode_amr, &parse_amr, &pack_amr 231 231 }, 232 232 # endif 233 233 234 # if defined(PJMEDIA_HAS_INTEL_IPP_CODEC_G729) && PJMEDIA_HAS_INTEL_IPP_CODEC_G729 != 0234 # if PJMEDIA_HAS_INTEL_IPP_CODEC_G729 235 235 /* G.729 actually has internal VAD, but for now we need to disable it, 236 236 * since its RTP packaging (multiple frames per packet) requires … … 245 245 # endif 246 246 247 # if defined(PJMEDIA_HAS_INTEL_IPP_CODEC_G723) && PJMEDIA_HAS_INTEL_IPP_CODEC_G723 != 0247 # if PJMEDIA_HAS_INTEL_IPP_CODEC_G723_1 248 248 /* This is actually G.723.1 */ 249 249 {1, "G723", PJMEDIA_RTP_PT_G723, &USC_G723_Fxns, 8000, 1, 240, 250 5300, 6300, 1, 1, 1,250 6300, 6300, 1, 1, 1, 251 251 &predecode_g723, &parse_g723, NULL 252 252 }, 253 253 # endif 254 254 255 # if defined(PJMEDIA_HAS_INTEL_IPP_CODEC_G726) && PJMEDIA_HAS_INTEL_IPP_CODEC_G726 != 0255 # if PJMEDIA_HAS_INTEL_IPP_CODEC_G726 256 256 {0, "G726-16", PJMEDIA_RTP_PT_G726_16, &USC_G726_Fxns, 8000, 1, 80, 257 257 16000, 16000, 2, 0, 0, … … 272 272 # endif 273 273 274 # if defined(PJMEDIA_HAS_INTEL_IPP_CODEC_G728) && PJMEDIA_HAS_INTEL_IPP_CODEC_G728 != 0274 # if PJMEDIA_HAS_INTEL_IPP_CODEC_G728 275 275 {1, "G728", PJMEDIA_RTP_PT_G728, &USC_G728_Fxns, 8000, 1, 80, 276 276 16000, 16000, 2, 0, 1, … … 279 279 # endif 280 280 281 # if defined(PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1) && PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 != 0281 # if PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 282 282 {0, "G7221", PJMEDIA_RTP_PT_G722_1, &USC_G722_Fxns, 16000, 1, 320, 283 24000, 32000, 1, 0, 1,283 16000, 32000, 1, 0, 1, 284 284 NULL, NULL, NULL 285 285 }, … … 520 520 521 521 /* Create pool for codec instance */ 522 pool = pjmedia_endpt_create_pool(ipp_factory.endpt, "IPP codec inst", 523 4000, 4000); 522 pool = pjmedia_endpt_create_pool(ipp_factory.endpt, "IPPcodec", 512, 512); 524 523 codec = PJ_POOL_ZALLOC_T(pool, pjmedia_codec); 525 524 PJ_ASSERT_RETURN(codec != NULL, PJ_ENOMEM); … … 605 604 { 606 605 ipp_private_t *codec_data = (ipp_private_t*) codec->codec_data; 606 struct ipp_codec *ippc = &ipp_codec[codec_data->codec_idx]; 607 607 int info_size; 608 608 pj_pool_t *pool; 609 int i, j , idx;609 int i, j; 610 610 USC_MemBank *membanks; 611 611 int nb_membanks; 612 612 613 613 pool = codec_data->pool; 614 idx = codec_data->codec_idx;615 614 616 615 /* Get the codec info size */ 617 if (USC_NoError != ipp _codec[idx].fxns->std.GetInfoSize(&info_size)) {618 PJ_LOG( 3,(THIS_FILE, "Error getting codec info size"));616 if (USC_NoError != ippc->fxns->std.GetInfoSize(&info_size)) { 617 PJ_LOG(1,(THIS_FILE, "Error getting codec info size")); 619 618 goto on_error; 620 619 } 621 620 /* Get the codec info */ 622 621 codec_data->info = pj_pool_zalloc(pool, info_size); 623 if (USC_NoError != ipp _codec[idx].fxns->std.GetInfo((USC_Handle)NULL,624 622 if (USC_NoError != ippc->fxns->std.GetInfo((USC_Handle)NULL, 623 codec_data->info)) 625 624 { 626 PJ_LOG( 3,(THIS_FILE, "Error getting codec info"));625 PJ_LOG(1,(THIS_FILE, "Error getting codec info")); 627 626 goto on_error; 628 627 } … … 633 632 codec_data->info->params.direction = USC_ENCODE; 634 633 codec_data->info->params.modes.vad = attr->setting.vad && 635 ipp_codec[codec_data->codec_idx].has_native_vad;634 ippc->has_native_vad; 636 635 codec_data->info->params.modes.bitrate = attr->info.avg_bps; 637 636 codec_data->info->params.law = 0; /* Linear PCM input */ 638 637 639 638 /* Get number of memory blocks needed by the encoder */ 640 if (USC_NoError != 641 ipp_codec[idx].fxns->std.NumAlloc(&codec_data->info->params, 642 &nb_membanks)) 639 if (USC_NoError != ippc->fxns->std.NumAlloc(&codec_data->info->params, 640 &nb_membanks)) 643 641 { 644 PJ_LOG( 3,(THIS_FILE, "Error getting no of memory blocks of encoder"));642 PJ_LOG(1,(THIS_FILE, "Error getting no of memory blocks of encoder")); 645 643 goto on_error; 646 644 } … … 650 648 sizeof(USC_MemBank) * nb_membanks); 651 649 /* Get size of each memory block */ 652 if (USC_NoError != 653 ipp_codec[idx].fxns->std.MemAlloc(&codec_data->info->params,membanks))650 if (USC_NoError != ippc->fxns->std.MemAlloc(&codec_data->info->params, 651 membanks)) 654 652 { 655 PJ_LOG( 3,(THIS_FILE, "Error getting memory blocks size of encoder"));653 PJ_LOG(1,(THIS_FILE, "Error getting memory blocks size of encoder")); 656 654 goto on_error; 657 655 } … … 663 661 664 662 /* Create encoder instance */ 665 if (USC_NoError != ipp _codec[idx].fxns->std.Init(&codec_data->info->params,666 667 663 if (USC_NoError != ippc->fxns->std.Init(&codec_data->info->params, 664 membanks, 665 &codec_data->enc)) 668 666 { 669 PJ_LOG( 3,(THIS_FILE, "Error initializing encoder"));667 PJ_LOG(1,(THIS_FILE, "Error initializing encoder")); 670 668 goto on_error; 671 669 } … … 677 675 678 676 /* Get number of memory blocks needed by the decoder */ 679 if (USC_NoError != 680 ipp_codec[idx].fxns->std.NumAlloc(&codec_data->info->params, 681 &nb_membanks)) 677 if (USC_NoError != ippc->fxns->std.NumAlloc(&codec_data->info->params, 678 &nb_membanks)) 682 679 { 683 PJ_LOG( 3,(THIS_FILE, "Error getting no of memory blocks of decoder"));680 PJ_LOG(1,(THIS_FILE, "Error getting no of memory blocks of decoder")); 684 681 goto on_error; 685 682 } … … 689 686 sizeof(USC_MemBank) * nb_membanks); 690 687 /* Get size of each memory block */ 691 if (USC_NoError != 692 ipp_codec[idx].fxns->std.MemAlloc(&codec_data->info->params,membanks))688 if (USC_NoError != ippc->fxns->std.MemAlloc(&codec_data->info->params, 689 membanks)) 693 690 { 694 PJ_LOG( 3,(THIS_FILE, "Error getting memory blocks size of decoder"));691 PJ_LOG(1,(THIS_FILE, "Error getting memory blocks size of decoder")); 695 692 goto on_error; 696 693 } … … 702 699 703 700 /* Create decoder instance */ 704 if (USC_NoError != ipp_codec[idx].fxns->std.Init(&codec_data->info->params, 705 membanks, 706 &codec_data->dec)) 701 if (USC_NoError != ippc->fxns->std.Init(&codec_data->info->params, 702 membanks, &codec_data->dec)) 707 703 { 708 PJ_LOG( 3,(THIS_FILE, "Error initializing decoder"));704 PJ_LOG(1,(THIS_FILE, "Error initializing decoder")); 709 705 goto on_error; 710 706 } 711 707 712 708 /* Update codec info */ 713 ipp _codec[idx].fxns->std.GetInfo((USC_Handle)codec_data->enc, codec_data->info);709 ippc->fxns->std.GetInfo((USC_Handle)codec_data->enc, codec_data->info); 714 710 715 711 /* Get bitstream size */ 716 i = codec_data->info->params.modes.bitrate * ipp _codec[idx].samples_per_frame;717 j = ipp _codec[idx].clock_rate << 3;712 i = codec_data->info->params.modes.bitrate * ippc->samples_per_frame; 713 j = ippc->clock_rate << 3; 718 714 codec_data->frame_size = (pj_uint16_t)(i / j); 719 715 if (i % j) ++codec_data->frame_size; … … 746 742 { 747 743 ipp_private_t *codec_data = (ipp_private_t*) codec->codec_data; 744 struct ipp_codec *ippc = &ipp_codec[codec_data->codec_idx]; 748 745 749 746 codec_data->vad_enabled = (attr->setting.vad != 0); 750 747 codec_data->plc_enabled = (attr->setting.plc != 0); 751 748 752 if (ipp _codec[codec_data->codec_idx].has_native_vad) {749 if (ippc->has_native_vad) { 753 750 USC_Modes modes; 754 751 755 752 modes = codec_data->info->params.modes; 756 753 modes.vad = codec_data->vad_enabled; 757 ipp _codec[codec_data->codec_idx].fxns->std.Control(&modes, codec_data->enc);754 ippc->fxns->std.Control(&modes, codec_data->enc); 758 755 } 759 756 … … 772 769 { 773 770 ipp_private_t *codec_data = (ipp_private_t*) codec->codec_data; 771 struct ipp_codec *ippc = &ipp_codec[codec_data->codec_idx]; 774 772 unsigned count = 0; 775 773 776 774 PJ_ASSERT_RETURN(frame_cnt, PJ_EINVAL); 777 775 778 if (ipp_codec[codec_data->codec_idx].parse != NULL) { 779 return ipp_codec[codec_data->codec_idx].parse(codec_data, pkt, 780 pkt_size, ts, frame_cnt, frames); 776 if (ippc->parse != NULL) { 777 return ippc->parse(codec_data, pkt, pkt_size, ts, frame_cnt, frames); 781 778 } 782 779 … … 785 782 frames[count].buf = pkt; 786 783 frames[count].size = codec_data->frame_size; 787 frames[count].timestamp.u64 = ts->u64 + count * 788 ipp_codec[codec_data->codec_idx].samples_per_frame; 784 frames[count].timestamp.u64 = ts->u64 + count*ippc->samples_per_frame; 789 785 790 786 pkt = ((char*)pkt) + codec_data->frame_size; … … 798 794 frames[count].buf = pkt; 799 795 frames[count].size = pkt_size; 800 frames[count].timestamp.u64 = ts->u64 + count * 801 ipp_codec[codec_data->codec_idx].samples_per_frame; 796 frames[count].timestamp.u64 = ts->u64 + count*ippc->samples_per_frame; 802 797 ++count; 803 798 } … … 816 811 { 817 812 ipp_private_t *codec_data = (ipp_private_t*) codec->codec_data; 813 struct ipp_codec *ippc = &ipp_codec[codec_data->codec_idx]; 818 814 unsigned samples_per_frame; 819 815 unsigned nsamples; … … 837 833 if (is_silence && 838 834 PJMEDIA_CODEC_MAX_SILENCE_PERIOD != -1 && 839 silence_duration < (PJMEDIA_CODEC_MAX_SILENCE_PERIOD *840 (int)ipp_codec[codec_data->codec_idx].clock_rate/1000))835 silence_duration < (PJMEDIA_CODEC_MAX_SILENCE_PERIOD * 836 (int)ippc->clock_rate / 1000)) 841 837 { 842 838 output->type = PJMEDIA_FRAME_TYPE_NONE; … … 851 847 852 848 nsamples = input->size >> 1; 853 samples_per_frame =ipp_codec[codec_data->codec_idx].samples_per_frame;854 pt = ipp _codec[codec_data->codec_idx].pt;849 samples_per_frame = ippc->samples_per_frame; 850 pt = ippc->pt; 855 851 856 852 PJ_ASSERT_RETURN(nsamples % samples_per_frame == 0, … … 871 867 out.pBuffer = bits_out; 872 868 873 #if defined(PJMEDIA_HAS_INTEL_IPP_CODEC_AMR) && PJMEDIA_HAS_INTEL_IPP_CODEC_AMR != 0869 #if PJMEDIA_HAS_INTEL_IPP_CODEC_AMR 874 870 /* For AMR: reserve the first byte for frame info */ 875 871 if (pt == PJMEDIA_RTP_PT_AMR || pt == PJMEDIA_RTP_PT_AMRWB) { … … 878 874 #endif 879 875 880 if (USC_NoError != ipp _codec[codec_data->codec_idx].fxns->Encode(codec_data->enc, &in, &out)) {876 if (USC_NoError != ippc->fxns->Encode(codec_data->enc, &in, &out)) { 881 877 break; 882 878 } 883 879 884 #if defined(PJMEDIA_HAS_INTEL_IPP_CODEC_AMR) && PJMEDIA_HAS_INTEL_IPP_CODEC_AMR != 0 885 /* For AMR: put info (frametype, degraded, last frame) in the first byte */ 880 #if PJMEDIA_HAS_INTEL_IPP_CODEC_AMR 881 /* For AMR: put info (frametype, degraded, last frame) in the 882 * first byte 883 */ 886 884 if (pt == PJMEDIA_RTP_PT_AMR || pt == PJMEDIA_RTP_PT_AMRWB) { 887 885 pj_uint8_t *info = (pj_uint8_t*)bits_out; … … 908 906 { 909 907 /* SID */ 910 *info = pt == PJMEDIA_RTP_PT_AMRWB? 9 : 8;908 *info = (pj_uint8_t)(pt == PJMEDIA_RTP_PT_AMRWB? 9 : 8); 911 909 /* Degraded */ 912 910 if (out.frametype == 6 || out.frametype == 7) … … 930 928 } 931 929 932 if (ipp_codec[codec_data->codec_idx].pack != NULL) { 933 ipp_codec[codec_data->codec_idx].pack(codec_data, output->buf, 934 &tx, output_buf_len); 930 if (ippc->pack != NULL) { 931 ippc->pack(codec_data, output->buf, &tx, output_buf_len); 935 932 } 936 933 … … 960 957 { 961 958 ipp_private_t *codec_data = (ipp_private_t*) codec->codec_data; 959 struct ipp_codec *ippc = &ipp_codec[codec_data->codec_idx]; 962 960 unsigned samples_per_frame; 963 961 USC_PCMStream out; … … 965 963 pj_uint8_t pt; 966 964 967 pt = ipp _codec[codec_data->codec_idx].pt;968 samples_per_frame = ipp _codec[codec_data->codec_idx].samples_per_frame;965 pt = ippc->pt; 966 samples_per_frame = ippc->samples_per_frame; 969 967 970 968 PJ_ASSERT_RETURN(output_buf_len >= samples_per_frame << 1, … … 972 970 973 971 if (input->type == PJMEDIA_FRAME_TYPE_AUDIO) { 974 if (ipp _codec[codec_data->codec_idx].predecode) {975 ipp _codec[codec_data->codec_idx].predecode(codec_data, input, &in);972 if (ippc->predecode) { 973 ippc->predecode(codec_data, input, &in); 976 974 } else { 977 975 /* Most IPP codecs have frametype==0 for speech frame */ … … 986 984 987 985 if (input->type != PJMEDIA_FRAME_TYPE_AUDIO || 988 USC_NoError != ipp_codec[codec_data->codec_idx].fxns->Decode( 989 codec_data->dec, &in, &out)) 986 USC_NoError != ippc->fxns->Decode(codec_data->dec, &in, &out)) 990 987 { 991 988 pjmedia_zero_samples((pj_int16_t*)output->buf, samples_per_frame); … … 996 993 } 997 994 998 #if defined(PJMEDIA_HAS_INTEL_IPP_CODEC_G726) && PJMEDIA_HAS_INTEL_IPP_CODEC_G726 != 0995 #if PJMEDIA_HAS_INTEL_IPP_CODEC_G726 999 996 /* For G.726: amplify decoding result (USC G.726 encoder deamplified it) */ 1000 997 if (pt == PJMEDIA_RTP_PT_G726_16 || pt == PJMEDIA_RTP_PT_G726_24 || … … 1028 1025 { 1029 1026 ipp_private_t *codec_data = (ipp_private_t*) codec->codec_data; 1027 struct ipp_codec *ippc = &ipp_codec[codec_data->codec_idx]; 1030 1028 unsigned samples_per_frame; 1031 1029 1032 1030 PJ_UNUSED_ARG(output_buf_len); 1033 1031 1034 samples_per_frame = ipp _codec[codec_data->codec_idx].samples_per_frame;1032 samples_per_frame = ippc->samples_per_frame; 1035 1033 1036 1034 output->type = PJMEDIA_FRAME_TYPE_AUDIO; … … 1043 1041 USC_PCMStream out; 1044 1042 out.pBuffer = output->buf; 1045 ipp_codec[codec_data->codec_idx].fxns->Decode(codec_data->dec, 1046 NULL, &out); 1043 ippc->fxns->Decode(codec_data->dec, NULL, &out); 1047 1044 } 1048 1045 } else { … … 1053 1050 } 1054 1051 1055 #if defined(PJMEDIA_HAS_INTEL_IPP_CODEC_G729) && PJMEDIA_HAS_INTEL_IPP_CODEC_G729 != 01052 #if PJMEDIA_HAS_INTEL_IPP_CODEC_G729 1056 1053 1057 1054 static void predecode_g729( ipp_private_t *codec_data, … … 1093 1090 1094 1091 1095 #if defined(PJMEDIA_HAS_INTEL_IPP_CODEC_G723) && PJMEDIA_HAS_INTEL_IPP_CODEC_G723 != 01092 #if PJMEDIA_HAS_INTEL_IPP_CODEC_G723_1 1096 1093 1097 1094 static void predecode_g723( ipp_private_t *codec_data, … … 1141 1138 framesize = 1; 1142 1139 else { 1143 pj_assert(!"Unknown G723.1 frametype, bitstreammay be corrupted!");1140 pj_assert(!"Unknown G723.1 frametype, packet may be corrupted!"); 1144 1141 return PJMEDIA_CODEC_EINMODE; 1145 1142 } … … 1161 1158 } 1162 1159 1163 #endif /* PJMEDIA_HAS_INTEL_IPP_CODEC_G723 */1164 1165 1166 #if defined(PJMEDIA_HAS_INTEL_IPP_CODEC_AMR) && PJMEDIA_HAS_INTEL_IPP_CODEC_AMR != 01160 #endif /* PJMEDIA_HAS_INTEL_IPP_CODEC_G723_1 */ 1161 1162 1163 #if PJMEDIA_HAS_INTEL_IPP_CODEC_AMR 1167 1164 1168 1165 /* AMR bitstream sensitivity order map */ 1169 1166 static pj_int16_t AMRNB_ordermap122[244] = 1170 1167 { 1171 0, 1, 2, 3, 4, 5, 6, 7, 8,9,1172 10, 11, 12, 13, 14, 23, 15, 16, 17,18,1173 19, 20, 21, 22, 24, 25, 26, 27, 28,38,1174 141, 39, 142, 40, 143, 41, 144, 42, 145,43,1175 146, 44, 147, 45, 148, 46, 149, 47, 97,150,1176 200, 48, 98, 151, 201, 49, 99, 152, 202,86,1177 136, 189, 239, 87, 137, 190, 240, 88, 138,191,1178 241, 91, 194, 92, 195, 93, 196, 94, 197,95,1179 198, 29, 30, 31, 32, 33, 34, 35, 50,100,1180 153, 203, 89, 139, 192, 242, 51, 101, 154,204,1181 55, 105, 158, 208, 90, 140, 193, 243, 59,109,1182 162, 212, 63, 113, 166, 216, 67, 117, 170,220,1183 36, 37, 54, 53, 52, 58, 57, 56, 62,61,1184 60, 66, 65, 64, 70, 69, 68, 104, 103,102,1185 108, 107, 106, 112, 111, 110, 116, 115, 114,120,1186 119, 118, 157, 156, 155, 161, 160, 159, 165,164,1187 163, 169, 168, 167, 173, 172, 171, 207, 206,205,1188 211, 210, 209, 215, 214, 213, 219, 218, 217,223,1189 222, 221, 73, 72, 71, 76, 75, 74, 79,78,1190 77, 82, 81, 80, 85, 84, 83, 123, 122,121,1191 126, 125, 124, 129, 128, 127, 132, 131, 130,135,1192 134, 133, 176, 175, 174, 179, 178, 177, 182,181,1193 180, 185, 184, 183, 188, 187, 186, 226, 225,224,1194 229, 228, 227, 232, 231, 230, 235, 234, 233,238,1195 237, 236, 96,1991168 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1169 10, 11, 12, 13, 14, 23, 15, 16, 17, 18, 1170 19, 20, 21, 22, 24, 25, 26, 27, 28, 38, 1171 141, 39, 142, 40, 143, 41, 144, 42, 145, 43, 1172 146, 44, 147, 45, 148, 46, 149, 47, 97, 150, 1173 200, 48, 98, 151, 201, 49, 99, 152, 202, 86, 1174 136, 189, 239, 87, 137, 190, 240, 88, 138, 191, 1175 241, 91, 194, 92, 195, 93, 196, 94, 197, 95, 1176 198, 29, 30, 31, 32, 33, 34, 35, 50, 100, 1177 153, 203, 89, 139, 192, 242, 51, 101, 154, 204, 1178 55, 105, 158, 208, 90, 140, 193, 243, 59, 109, 1179 162, 212, 63, 113, 166, 216, 67, 117, 170, 220, 1180 36, 37, 54, 53, 52, 58, 57, 56, 62, 61, 1181 60, 66, 65, 64, 70, 69, 68, 104, 103, 102, 1182 108, 107, 106, 112, 111, 110, 116, 115, 114, 120, 1183 119, 118, 157, 156, 155, 161, 160, 159, 165, 164, 1184 163, 169, 168, 167, 173, 172, 171, 207, 206, 205, 1185 211, 210, 209, 215, 214, 213, 219, 218, 217, 223, 1186 222, 221, 73, 72, 71, 76, 75, 74, 79, 78, 1187 77, 82, 81, 80, 85, 84, 83, 123, 122, 121, 1188 126, 125, 124, 129, 128, 127, 132, 131, 130, 135, 1189 134, 133, 176, 175, 174, 179, 178, 177, 182, 181, 1190 180, 185, 184, 183, 188, 187, 186, 226, 225, 224, 1191 229, 228, 227, 232, 231, 230, 235, 234, 233, 238, 1192 237, 236, 96, 199 1196 1193 }; 1197 1194 1198 1195 static pj_int16_t AMRNB_ordermap102[204] = 1199 1196 { 1200 7, 6, 5, 4, 3,2, 1, 0, 16, 15,1201 14, 13, 12, 11, 10, 9, 8, 26, 27, 28,1202 29, 30, 31, 115, 116, 117, 118, 119, 120, 72,1203 73, 161, 162, 65, 68, 69, 108, 111, 112, 154,1197 7, 6, 5, 4, 3, 2, 1, 0, 16, 15, 1198 14, 13, 12, 11, 10, 9, 8, 26, 27, 28, 1199 29, 30, 31, 115, 116, 117, 118, 119, 120, 72, 1200 73, 161, 162, 65, 68, 69, 108, 111, 112, 154, 1204 1201 157, 158, 197, 200, 201, 32, 33, 121, 122, 74, 1205 75, 163, 164, 66, 109, 155, 198, 19, 23, 21,1206 22, 18, 17, 20, 24, 25, 37, 36, 35, 34,1207 80, 79, 78, 77, 126, 125, 124, 123, 169, 168,1202 75, 163, 164, 66, 109, 155, 198, 19, 23, 21, 1203 22, 18, 17, 20, 24, 25, 37, 36, 35, 34, 1204 80, 79, 78, 77, 126, 125, 124, 123, 169, 168, 1208 1205 167, 166, 70, 67, 71, 113, 110, 114, 159, 156, 1209 1206 160, 202, 199, 203, 76, 165, 81, 82, 92, 91, 1210 93, 83, 95, 85, 84, 94, 101, 102, 96, 104,1211 86, 103, 87, 97, 127, 128, 138, 137, 139, 129,1207 93, 83, 95, 85, 84, 94, 101, 102, 96, 104, 1208 86, 103, 87, 97, 127, 128, 138, 137, 139, 129, 1212 1209 141, 131, 130, 140, 147, 148, 142, 150, 132, 149, 1213 1210 133, 143, 170, 171, 181, 180, 182, 172, 184, 174, 1214 1211 173, 183, 190, 191, 185, 193, 175, 192, 176, 186, 1215 38, 39, 49, 48, 50, 40, 52, 42, 41, 51,1216 58, 59, 53, 61, 43, 60, 44, 54, 194, 179,1212 38, 39, 49, 48, 50, 40, 52, 42, 41, 51, 1213 58, 59, 53, 61, 43, 60, 44, 54, 194, 179, 1217 1214 189, 196, 177, 195, 178, 187, 188, 151, 136, 146, 1218 1215 153, 134, 152, 135, 144, 145, 105, 90, 100, 107, 1219 88, 106, 89, 98, 99, 62, 47, 57, 64, 45,1220 63, 46, 55, 561216 88, 106, 89, 98, 99, 62, 47, 57, 64, 45, 1217 63, 46, 55, 56 1221 1218 }; 1222 1219 1223 1220 static pj_int16_t AMRNB_ordermap795[159] = 1224 1221 { 1225 8, 7, 6, 5, 4, 3, 2, 14, 16,9,1226 10, 12, 13, 15, 11, 17, 20, 22, 24,23,1227 19, 18, 21, 56, 88, 122, 154, 57, 89,123,1228 155, 58, 90, 124, 156, 52, 84, 118, 150,53,1229 85, 119, 151, 27, 93, 28, 94, 29, 95,30,1230 96, 31, 97, 61, 127, 62, 128, 63, 129,59,1231 91, 125, 157, 32, 98, 64, 130, 1, 0,25,1232 26, 33, 99, 34, 100, 65, 131, 66, 132,54,1233 86, 120, 152, 60, 92, 126, 158, 55, 87,121,1234 153, 117, 116, 115, 46, 78, 112, 144, 43,75,1235 109, 141, 40, 72, 106, 138, 36, 68, 102,134,1236 114, 149, 148, 147, 146, 83, 82, 81, 80,51,1237 50, 49, 48, 47, 45, 44, 42, 39, 35,79,1238 77, 76, 74, 71, 67, 113, 111, 110, 108,105,1239 101, 145, 143, 142, 140, 137, 133, 41, 73,107,1240 139, 37, 69, 103, 135, 38, 70, 104,1361222 8, 7, 6, 5, 4, 3, 2, 14, 16, 9, 1223 10, 12, 13, 15, 11, 17, 20, 22, 24, 23, 1224 19, 18, 21, 56, 88, 122, 154, 57, 89, 123, 1225 155, 58, 90, 124, 156, 52, 84, 118, 150, 53, 1226 85, 119, 151, 27, 93, 28, 94, 29, 95, 30, 1227 96, 31, 97, 61, 127, 62, 128, 63, 129, 59, 1228 91, 125, 157, 32, 98, 64, 130, 1, 0, 25, 1229 26, 33, 99, 34, 100, 65, 131, 66, 132, 54, 1230 86, 120, 152, 60, 92, 126, 158, 55, 87, 121, 1231 153, 117, 116, 115, 46, 78, 112, 144, 43, 75, 1232 109, 141, 40, 72, 106, 138, 36, 68, 102, 134, 1233 114, 149, 148, 147, 146, 83, 82, 81, 80, 51, 1234 50, 49, 48, 47, 45, 44, 42, 39, 35, 79, 1235 77, 76, 74, 71, 67, 113, 111, 110, 108, 105, 1236 101, 145, 143, 142, 140, 137, 133, 41, 73, 107, 1237 139, 37, 69, 103, 135, 38, 70, 104, 136 1241 1238 1242 1239 }; … … 1244 1241 static pj_int16_t AMRNB_ordermap74[148] = 1245 1242 { 1246 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,1247 10, 11, 12, 13, 14, 15, 16, 26, 87, 27,1248 88, 28, 89, 29, 90, 30, 91, 51, 80, 112,1243 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1244 10, 11, 12, 13, 14, 15, 16, 26, 87, 27, 1245 88, 28, 89, 29, 90, 30, 91, 51, 80, 112, 1249 1246 141, 52, 81, 113, 142, 54, 83, 115, 144, 55, 1250 84, 116, 145, 58, 119, 59, 120, 21, 22, 23,1251 17, 18, 19, 31, 60, 92, 121, 56, 85, 117,1247 84, 116, 145, 58, 119, 59, 120, 21, 22, 23, 1248 17, 18, 19, 31, 60, 92, 121, 56, 85, 117, 1252 1249 146, 20, 24, 25, 50, 79, 111, 140, 57, 86, 1253 1250 118, 147, 49, 78, 110, 139, 48, 77, 53, 82, 1254 1251 114, 143, 109, 138, 47, 76, 108, 137, 32, 33, 1255 61, 62, 93, 94, 122, 123, 41, 42, 43, 44,1256 45, 46, 70, 71, 72, 73, 74, 75, 102, 103,1252 61, 62, 93, 94, 122, 123, 41, 42, 43, 44, 1253 45, 46, 70, 71, 72, 73, 74, 75, 102, 103, 1257 1254 104, 105, 106, 107, 131, 132, 133, 134, 135, 136, 1258 34, 63, 95, 124, 35, 64, 96, 125, 36, 65,1259 97, 126, 37, 66, 98, 127, 38, 67, 99, 128,1260 39, 68, 100, 129, 40, 69, 101, 1301255 34, 63, 95, 124, 35, 64, 96, 125, 36, 65, 1256 97, 126, 37, 66, 98, 127, 38, 67, 99, 128, 1257 39, 68, 100, 129, 40, 69, 101, 130 1261 1258 }; 1262 1259 1263 1260 static pj_int16_t AMRNB_ordermap67[134] = 1264 1261 { 1265 0, 1, 4, 3, 5, 6, 13, 7, 2,8,1266 9, 11, 15, 12, 14, 10, 28, 82, 29,83,1267 27, 81, 26, 80, 30, 84, 16, 55, 109,56,1268 110, 31, 85, 57, 111, 48, 73, 102, 127,32,1269 86, 51, 76, 105, 130, 52, 77, 106, 131,58,1270 112, 33, 87, 19, 23, 53, 78, 107, 132,21,1271 22, 18, 17, 20, 24, 25, 50, 75, 104,129,1272 47, 72, 101, 126, 54, 79, 108, 133, 46,71,1273 100, 125, 128, 103, 74, 49, 45, 70, 99,124,1274 42, 67, 96, 121, 39, 64, 93, 118, 38,63,1275 92, 117, 35, 60, 89, 114, 34, 59, 88,113,1276 44, 69, 98, 123, 43, 68, 97, 122, 41,66,1277 95, 120, 40, 65, 94, 119, 37, 62, 91,116,1278 36, 61, 90,1151262 0, 1, 4, 3, 5, 6, 13, 7, 2, 8, 1263 9, 11, 15, 12, 14, 10, 28, 82, 29, 83, 1264 27, 81, 26, 80, 30, 84, 16, 55, 109, 56, 1265 110, 31, 85, 57, 111, 48, 73, 102, 127, 32, 1266 86, 51, 76, 105, 130, 52, 77, 106, 131, 58, 1267 112, 33, 87, 19, 23, 53, 78, 107, 132, 21, 1268 22, 18, 17, 20, 24, 25, 50, 75, 104, 129, 1269 47, 72, 101, 126, 54, 79, 108, 133, 46, 71, 1270 100, 125, 128, 103, 74, 49, 45, 70, 99, 124, 1271 42, 67, 96, 121, 39, 64, 93, 118, 38, 63, 1272 92, 117, 35, 60, 89, 114, 34, 59, 88, 113, 1273 44, 69, 98, 123, 43, 68, 97, 122, 41, 66, 1274 95, 120, 40, 65, 94, 119, 37, 62, 91, 116, 1275 36, 61, 90, 115 1279 1276 }; 1280 1277 1281 1278 static pj_int16_t AMRNB_ordermap59[118] = 1282 1279 { 1283 0, 1, 4, 5, 3, 6, 7, 2, 13,15,1284 8, 9, 11, 12, 14, 10, 16, 28, 74,29,1285 75, 27, 73, 26, 72, 30, 76, 51, 97,50,1286 71, 96, 117, 31, 77, 52, 98, 49, 70,95,1287 116, 53, 99, 32, 78, 33, 79, 48, 69,94,1288 115, 47, 68, 93, 114, 46, 67, 92, 113,19,1289 21, 23, 22, 18, 17, 20, 24, 111, 43,89,1290 110, 64, 65, 44, 90, 25, 45, 66, 91,112,1291 54, 100, 40, 61, 86, 107, 39, 60, 85,106,1292 36, 57, 82, 103, 35, 56, 81, 102, 34,55,1293 80, 101, 42, 63, 88, 109, 41, 62, 87,108,1294 38, 59, 84, 105, 37, 58, 83,1041280 0, 1, 4, 5, 3, 6, 7, 2, 13, 15, 1281 8, 9, 11, 12, 14, 10, 16, 28, 74, 29, 1282 75, 27, 73, 26, 72, 30, 76, 51, 97, 50, 1283 71, 96, 117, 31, 77, 52, 98, 49, 70, 95, 1284 116, 53, 99, 32, 78, 33, 79, 48, 69, 94, 1285 115, 47, 68, 93, 114, 46, 67, 92, 113, 19, 1286 21, 23, 22, 18, 17, 20, 24, 111, 43, 89, 1287 110, 64, 65, 44, 90, 25, 45, 66, 91, 112, 1288 54, 100, 40, 61, 86, 107, 39, 60, 85, 106, 1289 36, 57, 82, 103, 35, 56, 81, 102, 34, 55, 1290 80, 101, 42, 63, 88, 109, 41, 62, 87, 108, 1291 38, 59, 84, 105, 37, 58, 83, 104 1295 1292 }; 1296 1293 1297 1294 static pj_int16_t AMRNB_ordermap515[103] = 1298 1295 { 1299 7, 6, 5, 4, 3, 2, 1, 0, 15,14,1300 13, 12, 11, 10, 9, 8, 23, 24, 25,26,1301 27, 46, 65, 84, 45, 44, 43, 64, 63,62,1302 83, 82, 81, 102, 101, 100, 42, 61, 80,99,1303 28, 47, 66, 85, 18, 41, 60, 79, 98,29,1304 48, 67, 17, 20, 22, 40, 59, 78, 97,21,1305 30, 49, 68, 86, 19, 16, 87, 39, 38,58,1306 57, 77, 35, 54, 73, 92, 76, 96, 95,36,1307 55, 74, 93, 32, 51, 33, 52, 70, 71,89,1308 90, 31, 50, 69, 88, 37, 56, 75, 94,34,1309 53, 72,911296 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 1297 13, 12, 11, 10, 9, 8, 23, 24, 25, 26, 1298 27, 46, 65, 84, 45, 44, 43, 64, 63, 62, 1299 83, 82, 81, 102, 101, 100, 42, 61, 80, 99, 1300 28, 47, 66, 85, 18, 41, 60, 79, 98, 29, 1301 48, 67, 17, 20, 22, 40, 59, 78, 97, 21, 1302 30, 49, 68, 86, 19, 16, 87, 39, 38, 58, 1303 57, 77, 35, 54, 73, 92, 76, 96, 95, 36, 1304 55, 74, 93, 32, 51, 33, 52, 70, 71, 89, 1305 90, 31, 50, 69, 88, 37, 56, 75, 94, 34, 1306 53, 72, 91 1310 1307 }; 1311 1308 1312 1309 static pj_int16_t AMRNB_ordermap475[95] = 1313 1310 { 1314 0, 1, 2, 3, 4, 5, 6, 7, 8,9,1315 10, 11, 12, 13, 14, 15, 23, 24, 25,26,1316 27, 28, 48, 49, 61, 62, 82, 83, 47,46,1317 45, 44, 81, 80, 79, 78, 17, 18, 20,22,1318 77, 76, 75, 74, 29, 30, 43, 42, 41,40,1319 38, 39, 16, 19, 21, 50, 51, 59, 60,63,1320 64, 72, 73, 84, 85, 93, 94, 32, 33,35,1321 36, 53, 54, 56, 57, 66, 67, 69, 70,87,1322 88, 90, 91, 34, 55, 68, 89, 37, 58,71,1323 92, 31, 52, 65,861311 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1312 10, 11, 12, 13, 14, 15, 23, 24, 25, 26, 1313 27, 28, 48, 49, 61, 62, 82, 83, 47, 46, 1314 45, 44, 81, 80, 79, 78, 17, 18, 20, 22, 1315 77, 76, 75, 74, 29, 30, 43, 42, 41, 40, 1316 38, 39, 16, 19, 21, 50, 51, 59, 60, 63, 1317 64, 72, 73, 84, 85, 93, 94, 32, 33, 35, 1318 36, 53, 54, 56, 57, 66, 67, 69, 70, 87, 1319 88, 90, 91, 34, 55, 68, 89, 37, 58, 71, 1320 92, 31, 52, 65, 86 1324 1321 }; 1325 1322 … … 1338 1335 static pj_int16_t AMRWB_ordermap_660[] = 1339 1336 { 1340 0, 5, 6, 7, 61, 84, 107, 130, 62,85,1341 8, 4, 37, 38, 39, 40, 58,81, 104, 127,1342 60, 83, 106, 129, 108, 131, 128, 41, 42,80,1343 126, 1, 3, 57, 103, 82, 105, 59, 2,63,1344 109, 110, 86, 19, 22, 23, 64, 87, 18,20,1345 21, 17, 13, 88, 43, 89, 65, 111, 14,24,1346 25, 26, 27, 28, 15, 16, 44, 90,66, 112,1347 9, 11, 10, 12, 67, 113, 29, 30, 31,32,1348 34, 33, 35, 36, 45, 51, 68, 74, 91,97,1349 114, 120, 46, 69, 92, 115, 52, 75,98, 121,1350 47, 70, 93, 116, 53, 76, 99, 122, 48,71,1351 94, 117, 54, 77, 100, 123, 49, 72,95, 118,1352 55, 78, 101, 124, 50, 73, 96, 119, 56,79,1337 0, 5, 6, 7, 61, 84, 107, 130, 62, 85, 1338 8, 4, 37, 38, 39, 40, 58, 81, 104, 127, 1339 60, 83, 106, 129, 108, 131, 128, 41, 42, 80, 1340 126, 1, 3, 57, 103, 82, 105, 59, 2, 63, 1341 109, 110, 86, 19, 22, 23, 64, 87, 18, 20, 1342 21, 17, 13, 88, 43, 89, 65, 111, 14, 24, 1343 25, 26, 27, 28, 15, 16, 44, 90, 66, 112, 1344 9, 11, 10, 12, 67, 113, 29, 30, 31, 32, 1345 34, 33, 35, 36, 45, 51, 68, 74, 91, 97, 1346 114, 120, 46, 69, 92, 115, 52, 75, 98, 121, 1347 47, 70, 93, 116, 53, 76, 99, 122, 48, 71, 1348 94, 117, 54, 77, 100, 123, 49, 72, 95, 118, 1349 55, 78, 101, 124, 50, 73, 96, 119, 56, 79, 1353 1350 102, 125 1354 1351 }; … … 1356 1353 static pj_int16_t AMRWB_ordermap_885[] = 1357 1354 { 1358 0, 4, 6, 7, 5, 3, 47, 48, 49, 112,1355 0, 4, 6, 7, 5, 3, 47, 48, 49, 112, 1359 1356 113, 114, 75, 106, 140, 171, 80, 111, 145, 176, 1360 77, 108, 142, 173, 78, 109, 143, 174, 79, 110,1357 77, 108, 142, 173, 78, 109, 143, 174, 79, 110, 1361 1358 144, 175, 76, 107, 141, 172, 50, 115, 51, 2, 1362 1, 81, 116, 146, 19, 21, 12, 17, 18, 20,1363 16, 25, 13, 10, 14, 24, 23, 22, 26, 8,1364 15, 52, 117, 31, 82, 147, 9, 33, 11, 83,1359 1, 81, 116, 146, 19, 21, 12, 17, 18, 20, 1360 16, 25, 13, 10, 14, 24, 23, 22, 26, 8, 1361 15, 52, 117, 31, 82, 147, 9, 33, 11, 83, 1365 1362 148, 53, 118, 28, 27, 84, 149, 34, 35, 29, 1366 46, 32, 30, 54, 119, 37, 36, 39, 38, 40,1367 85, 150, 41, 42, 43, 44, 45, 55, 60, 65,1368 70, 86, 91, 96, 101, 120, 125, 130, 135, 151,1363 46, 32, 30, 54, 119, 37, 36, 39, 38, 40, 1364 85, 150, 41, 42, 43, 44, 45, 55, 60, 65, 1365 70, 86, 91, 96, 101, 120, 125, 130, 135, 151, 1369 1366 156, 161, 166, 56, 87, 121, 152, 61, 92, 126, 1370 1367 157, 66, 97, 131, 162, 71, 102, 136, 167, 57, 1371 88, 122, 153, 62, 93, 127, 158, 67, 98, 132,1368 88, 122, 153, 62, 93, 127, 158, 67, 98, 132, 1372 1369 163, 72, 103, 137, 168, 58, 89, 123, 154, 63, 1373 94, 128, 159, 68, 99, 133, 164, 73, 104, 138,1370 94, 128, 159, 68, 99, 133, 164, 73, 104, 138, 1374 1371 169, 59, 90, 124, 155, 64, 95, 129, 160, 69, 1375 1372 100, 134, 165, 74, 105, 139, 170 … … 1378 1375 static pj_int16_t AMRWB_ordermap_1265[] = 1379 1376 { 1380 0, 4, 6, 93, 143, 196, 246, 7, 5, 3,1381 47, 48, 49, 50, 51, 150, 151, 152, 153, 154,1382 94, 144, 197, 247, 99, 149, 202, 252, 96, 146,1377 0, 4, 6, 93, 143, 196, 246, 7, 5, 3, 1378 47, 48, 49, 50, 51, 150, 151, 152, 153, 154, 1379 94, 144, 197, 247, 99, 149, 202, 252, 96, 146, 1383 1380 199, 249, 97, 147, 200, 250, 100, 203, 98, 148, 1384 1381 201, 251, 95, 145, 198, 248, 52, 2, 1, 101, 1385 1382 204, 155, 19, 21, 12, 17, 18, 20, 16, 25, 1386 13, 10, 14, 24, 23, 22, 26, 8, 15, 53,1383 13, 10, 14, 24, 23, 22, 26, 8, 15, 53, 1387 1384 156, 31, 102, 205, 9, 33, 11, 103, 206, 54, 1388 1385 157, 28, 27, 104, 207, 34, 35, 29, 46, 32, 1389 30, 55, 158, 37, 36, 39, 38, 40, 105, 208,1390 41, 42, 43, 44, 45, 56, 106, 159, 209, 57,1391 66, 75, 84, 107, 116, 125, 134, 160, 169, 178,1386 30, 55, 158, 37, 36, 39, 38, 40, 105, 208, 1387 41, 42, 43, 44, 45, 56, 106, 159, 209, 57, 1388 66, 75, 84, 107, 116, 125, 134, 160, 169, 178, 1392 1389 187, 210, 219, 228, 237, 58, 108, 161, 211, 62, 1393 1390 112, 165, 215, 67, 117, 170, 220, 71, 121, 174, … … 1408 1405 static pj_int16_t AMRWB_ordermap_1425[] = 1409 1406 { 1410 0, 4, 6, 101, 159, 220, 278, 7, 5, 3,1411 47, 48, 49, 50, 51, 166, 167, 168, 169, 170,1407 0, 4, 6, 101, 159, 220, 278, 7, 5, 3, 1408 47, 48, 49, 50, 51, 166, 167, 168, 169, 170, 1412 1409 102, 160, 221, 279, 107, 165, 226, 284, 104, 162, 1413 1410 223, 281, 105, 163, 224, 282, 108, 227, 106, 164, 1414 1411 225, 283, 103, 161, 222, 280, 52, 2, 1, 109, 1415 1412 228, 171, 19, 21, 12, 17, 18, 20, 16, 25, 1416 13, 10, 14, 24, 23, 22, 26, 8, 15, 53,1413 13, 10, 14, 24, 23, 22, 26, 8, 15, 53, 1417 1414 172, 31, 110, 229, 9, 33, 11, 111, 230, 54, 1418 1415 173, 28, 27, 112, 231, 34, 35, 29, 46, 32, 1419 30, 55, 174, 37, 36, 39, 38, 40, 113, 232,1420 41, 42, 43, 44, 45, 56, 114, 175, 233, 62,1416 30, 55, 174, 37, 36, 39, 38, 40, 113, 232, 1417 41, 42, 43, 44, 45, 56, 114, 175, 233, 62, 1421 1418 120, 181, 239, 75, 133, 194, 252, 57, 115, 176, 1422 1419 234, 63, 121, 182, 240, 70, 128, 189, 247, 76, … … 1441 1438 static pj_int16_t AMRWB_ordermap_1585[] = 1442 1439 { 1443 0, 4, 6, 109, 175, 244, 310, 7, 5, 3,1444 47, 48, 49, 50, 51, 182, 183, 184, 185, 186,1440 0, 4, 6, 109, 175, 244, 310, 7, 5, 3, 1441 47, 48, 49, 50, 51, 182, 183, 184, 185, 186, 1445 1442 110, 176, 245, 311, 115, 181, 250, 316, 112, 178, 1446 1443 247, 313, 113, 179, 248, 314, 116, 251, 114, 180, 1447 1444 249, 315, 111, 177, 246, 312, 52, 2, 1, 117, 1448 1445 252, 187, 19, 21, 12, 17, 18, 20, 16, 25, 1449 13, 10, 14, 24, 23, 22, 26, 8, 15, 53,1446 13, 10, 14, 24, 23, 22, 26, 8, 15, 53, 1450 1447 188, 31, 118, 253, 9, 33, 11, 119, 254, 54, 1451 1448 189, 28, 27, 120, 255, 34, 35, 29, 46, 32, 1452 30, 55, 190, 37, 36, 39, 38, 40, 121, 256,1453 41, 42, 43, 44, 45, 56, 122, 191, 257, 63,1449 30, 55, 190, 37, 36, 39, 38, 40, 121, 256, 1450 41, 42, 43, 44, 45, 56, 122, 191, 257, 63, 1454 1451 129, 198, 264, 76, 142, 211, 277, 89, 155, 224, 1455 1452 290, 102, 168, 237, 303, 57, 123, 192, 258, 70, … … 1477 1474 static pj_int16_t AMRWB_ordermap_1825[] = 1478 1475 { 1479 0, 4, 6, 121, 199, 280, 358, 7, 5, 3,1480 47, 48, 49, 50, 51, 206, 207, 208, 209, 210,1476 0, 4, 6, 121, 199, 280, 358, 7, 5, 3, 1477 47, 48, 49, 50, 51, 206, 207, 208, 209, 210, 1481 1478 122, 200, 281, 359, 127, 205, 286, 364, 124, 202, 1482 1479 283, 361, 125, 203, 284, 362, 128, 287, 126, 204, 1483 1480 285, 363, 123, 201, 282, 360, 52, 2, 1, 129, 1484 1481 288, 211, 19, 21, 12, 17, 18, 20, 16, 25, 1485 13, 10, 14, 24, 23, 22, 26, 8, 15, 53,1482 13, 10, 14, 24, 23, 22, 26, 8, 15, 53, 1486 1483 212, 31, 130, 289, 9, 33, 11, 131, 290, 54, 1487 1484 213, 28, 27, 132, 291, 34, 35, 29, 46, 32, 1488 30, 55, 214, 37, 36, 39, 38, 40, 133, 292,1489 41, 42, 43, 44, 45, 56, 134, 215, 293, 198,1485 30, 55, 214, 37, 36, 39, 38, 40, 133, 292, 1486 41, 42, 43, 44, 45, 56, 134, 215, 293, 198, 1490 1487 299, 136, 120, 138, 60, 279, 58, 62, 357, 139, 1491 1488 140, 295, 156, 57, 219, 297, 63, 217, 137, 170, … … 1494 1491 220, 216, 265, 251, 218, 237, 352, 223, 157, 86, 1495 1492 171, 87, 164, 351, 111, 302, 65, 178, 115, 323, 1496 72, 192, 101, 179, 93, 73, 193, 151, 337, 309,1493 72, 192, 101, 179, 93, 73, 193, 151, 337, 309, 1497 1494 143, 274, 69, 324, 165, 150, 97, 338, 110, 310, 1498 1495 330, 273, 68, 107, 175, 245, 114, 79, 113, 189, … … 1518 1515 static pj_int16_t AMRWB_ordermap_1985[] = 1519 1516 { 1520 0, 4, 6, 129, 215, 304, 390, 7, 5, 3,1521 47, 48, 49, 50, 51, 222, 223, 224, 225, 226,1517 0, 4, 6, 129, 215, 304, 390, 7, 5, 3, 1518 47, 48, 49, 50, 51, 222, 223, 224, 225, 226, 1522 1519 130, 216, 305, 391, 135, 221, 310, 396, 132, 218, 1523 1520 307, 393, 133, 219, 308, 394, 136, 311, 134, 220, 1524 1521 309, 395, 131, 217, 306, 392, 52, 2, 1, 137, 1525 1522 312, 227, 19, 21, 12, 17, 18, 20, 16, 25, 1526 13, 10, 14, 24, 23, 22, 26, 8, 15, 53,1523 13, 10, 14, 24, 23, 22, 26, 8, 15, 53, 1527 1524 228, 31, 138, 313, 9, 33, 11, 139, 314, 54, 1528 1525 229, 28, 27, 140, 315, 34, 35, 29, 46, 32, 1529 30, 55, 230, 37, 36, 39, 38, 40, 141, 316,1530 41, 42, 43, 44, 45, 56, 142, 231, 317, 63,1531 73, 92, 340, 82, 324, 149, 353, 159, 334, 165,1526 30, 55, 230, 37, 36, 39, 38, 40, 141, 316, 1527 41, 42, 43, 44, 45, 56, 142, 231, 317, 63, 1528 73, 92, 340, 82, 324, 149, 353, 159, 334, 165, 1532 1529 338, 178, 163, 254, 77, 168, 257, 153, 343, 57, 1533 1530 248, 238, 79, 252, 166, 67, 80, 201, 101, 267, 1534 1531 143, 164, 341, 255, 339, 187, 376, 318, 78, 328, 1535 1532 362, 115, 232, 242, 253, 290, 276, 62, 58, 158, 1536 68, 93, 179, 319, 148, 169, 154, 72, 385, 329,1533 68, 93, 179, 319, 148, 169, 154, 72, 385, 329, 1537 1534 333, 344, 102, 83, 144, 233, 323, 124, 243, 192, 1538 1535 354, 237, 64, 247, 202, 209, 150, 116, 335, 268, 1539 1536 239, 299, 188, 196, 298, 94, 195, 258, 123, 363, 1540 1537 384, 109, 325, 371, 170, 370, 84, 110, 295, 180, 1541 74, 210, 191, 106, 291, 205, 367, 381, 377, 206,1538 74, 210, 191, 106, 291, 205, 367, 381, 377, 206, 1542 1539 355, 122, 119, 120, 383, 160, 105, 108, 277, 380, 1543 1540 294, 284, 285, 345, 208, 269, 249, 366, 386, 300, 1544 1541 297, 259, 125, 369, 197, 97, 194, 286, 211, 281, 1545 1542 280, 183, 372, 87, 155, 283, 59, 348, 327, 184, 1546 76, 111, 330, 203, 349, 69, 98, 152, 145, 189,1547 66, 320, 337, 173, 358, 251, 198, 174, 263, 262,1543 76, 111, 330, 203, 349, 69, 98, 152, 145, 189, 1544 66, 320, 337, 173, 358, 251, 198, 174, 263, 262, 1548 1545 126, 241, 193, 88, 388, 117, 95, 387, 112, 359, 1549 1546 287, 244, 103, 272, 301, 171, 162, 234, 273, 127, 1550 1547 373, 181, 292, 85, 378, 302, 121, 107, 364, 346, 1551 1548 356, 212, 278, 213, 65, 382, 288, 207, 113, 175, 1552 99, 296, 374, 368, 199, 260, 185, 336, 331, 161,1549 99, 296, 374, 368, 199, 260, 185, 336, 331, 161, 1553 1550 270, 264, 250, 240, 75, 350, 151, 60, 89, 321, 1554 1551 156, 274, 360, 326, 70, 282, 167, 146, 352, 81, 1555 91, 389, 266, 245, 177, 235, 190, 256, 204, 342,1552 91, 389, 266, 245, 177, 235, 190, 256, 204, 342, 1556 1553 128, 118, 303, 104, 379, 182, 114, 375, 200, 96, 1557 1554 293, 172, 214, 365, 279, 86, 289, 351, 347, 357, 1558 1555 261, 186, 176, 271, 90, 100, 147, 322, 275, 361, 1559 71, 332, 61, 265, 157, 246, 2361556 71, 332, 61, 265, 157, 246, 236 1560 1557 }; 1561 1558 1562 1559 static pj_int16_t AMRWB_ordermap_2305[] = 1563 1560 { 1564 0, 4, 6, 145, 247, 352, 454, 7, 5, 3,1565 47, 48, 49, 50, 51, 254, 255, 256, 257, 258,1561 0, 4, 6, 145, 247, 352, 454, 7, 5, 3, 1562 47, 48, 49, 50, 51, 254, 255, 256, 257, 258, 1566 1563 146, 248, 353, 455, 151, 253, 358, 460, 148, 250, 1567 1564 355, 457, 149, 251, 356, 458, 152, 359, 150, 252, 1568 1565 357, 459, 147, 249, 354, 456, 52, 2, 1, 153, 1569 1566 360, 259, 19, 21, 12, 17, 18, 20, 16, 25, 1570 13, 10, 14, 24, 23, 22, 26, 8, 15, 53,1567 13, 10, 14, 24, 23, 22, 26, 8, 15, 53, 1571 1568 260, 31, 154, 361, 9, 33, 11, 155, 362, 54, 1572 1569 261, 28, 27, 156, 363, 34, 35, 29, 46, 32, 1573 30, 55, 262, 37, 36, 39, 38, 40, 157, 364,1574 41, 42, 43, 44, 45, 56, 158, 263, 365, 181,1570 30, 55, 262, 37, 36, 39, 38, 40, 157, 364, 1571 41, 42, 43, 44, 45, 56, 158, 263, 365, 181, 1575 1572 192, 170, 79, 57, 399, 90, 159, 297, 377, 366, 1576 1573 275, 68, 183, 388, 286, 194, 299, 92, 70, 182, … … 1578 1575 264, 171, 80, 389, 390, 378, 379, 193, 298, 69, 1579 1576 266, 265, 367, 277, 288, 276, 287, 184, 60, 195, 1580 82, 93, 71, 369, 402, 173, 162, 444, 300, 391,1581 98, 76, 278, 61, 267, 374, 135, 411, 167, 102,1577 82, 93, 71, 369, 402, 173, 162, 444, 300, 391, 1578 98, 76, 278, 61, 267, 374, 135, 411, 167, 102, 1582 1579 380, 200, 87, 178, 65, 94, 204, 124, 72, 342, 1583 1580 189, 305, 381, 396, 433, 301, 226, 407, 289, 237, … … 1596 1593 269, 393, 376, 383, 293, 307, 409, 179, 285, 314, 1597 1594 302, 372, 398, 190, 180, 89, 99, 103, 232, 78, 1598 88, 77, 136, 387, 165, 198, 394, 125, 176, 428,1599 74, 375, 238, 227, 66, 273, 282, 141, 306, 412,1595 88, 77, 136, 387, 165, 198, 394, 125, 176, 428, 1596 74, 375, 238, 227, 66, 273, 282, 141, 306, 412, 1600 1597 114, 85, 130, 348, 119, 291, 296, 386, 233, 397, 1601 1598 303, 405, 284, 445, 423, 221, 210, 205, 450, 108, … … 1613 1610 static pj_int16_t AMRWB_ordermap_2385[] = 1614 1611 { 1615 0, 4, 6, 145, 251, 360, 466, 7, 5, 3,1616 47, 48, 49, 50, 51, 262, 263, 264, 265, 266,1612 0, 4, 6, 145, 251, 360, 466, 7, 5, 3, 1613 47, 48, 49, 50, 51, 262, 263, 264, 265, 266, 1617 1614 146, 252, 361, 467, 151, 257, 366, 472, 148, 254, 1618 1615 363, 469, 149, 255, 364, 470, 156, 371, 150, 256, 1619 1616 365, 471, 147, 253, 362, 468, 52, 2, 1, 157, 1620 1617 372, 267, 19, 21, 12, 17, 18, 20, 16, 25, 1621 13, 10, 14, 24, 23, 22, 26, 8, 15, 53,1618 13, 10, 14, 24, 23, 22, 26, 8, 15, 53, 1622 1619 268, 31, 152, 153, 154, 155, 258, 259, 260, 261, 1623 1620 367, 368, 369, 370, 473, 474, 475, 476, 158, 373, 1624 9, 33, 11, 159, 374, 54, 269, 28, 27, 160,1621 9, 33, 11, 159, 374, 54, 269, 28, 27, 160, 1625 1622 375, 34, 35, 29, 46, 32, 30, 55, 270, 37, 1626 36, 39, 38, 40, 161, 376, 41, 42, 43, 44,1627 45, 56, 162, 271, 377, 185, 196, 174, 79, 57,1623 36, 39, 38, 40, 161, 376, 41, 42, 43, 44, 1624 45, 56, 162, 271, 377, 185, 196, 174, 79, 57, 1628 1625 411, 90, 163, 305, 389, 378, 283, 68, 187, 400, 1629 1626 294, 198, 307, 92, 70, 186, 413, 176, 59, 91, 1630 58, 412, 380, 165, 81, 164, 272, 175, 80, 401,1627 58, 412, 380, 165, 81, 164, 272, 175, 80, 401, 1631 1628 402, 390, 391, 197, 306, 69, 274, 273, 379, 285, 1632 1629 296, 284, 295, 188, 60, 199, 82, 93, 71, 381, 1633 1630 414, 177, 166, 456, 308, 403, 98, 76, 286, 61, 1634 1631 275, 386, 135, 423, 171, 102, 392, 204, 87, 182, 1635 65, 94, 208, 124, 72, 350, 193, 313, 393, 408,1632 65, 94, 208, 124, 72, 350, 193, 313, 393, 408, 1636 1633 445, 309, 230, 419, 297, 241, 113, 219, 189, 128, 1637 1634 317, 415, 116, 328, 200, 339, 382, 434, 178, 64, … … 1645 1642 450, 62, 383, 349, 75, 461, 172, 331, 168, 246, 1646 1643 428, 332, 312, 201, 343, 416, 279, 63, 195, 333, 1647 96, 173, 235, 288, 320, 191, 418, 84, 205, 100,1648 67, 394, 179, 344, 206, 338, 277, 405, 388, 395,1644 96, 173, 235, 288, 320, 191, 418, 84, 205, 100, 1645 67, 394, 179, 344, 206, 338, 277, 405, 388, 395, 1649 1646 301, 315, 421, 183, 293, 322, 310, 384, 410, 194, 1650 1647 184, 89, 99, 103, 236, 78, 88, 77, 136, 399, 1651 1648 169, 202, 406, 125, 180, 440, 74, 387, 242, 231, 1652 66, 281, 290, 141, 314, 424, 114, 85, 130, 356,1649 66, 281, 290, 141, 314, 424, 114, 85, 130, 356, 1653 1650 119, 299, 304, 398, 237, 409, 311, 417, 292, 457, 1654 1651 435, 225, 214, 209, 462, 108, 282, 446, 220, 351, … … 1762 1759 pj_int16_t **order_map = AMRNB_ordermaps; 1763 1760 1764 AMRWB = ipp_codec[codec_data->codec_idx].pt == PJMEDIA_RTP_PT_AMRWB;1761 AMRWB = (ipp_codec[codec_data->codec_idx].pt == PJMEDIA_RTP_PT_AMRWB); 1765 1762 if (AMRWB) { 1766 1763 SID_FT = 9; … … 1780 1777 if (start_bit) { 1781 1778 for (; i < (unsigned)(8-start_bit); ++i) 1782 *p_amr_bits++ = (pj_uint8_t)( *r >> (7-start_bit-i)) & 1;1779 *p_amr_bits++ = (pj_uint8_t)((*r >> (7-start_bit-i)) & 1); 1783 1780 ++r; 1784 1781 } 1785 1782 for(; i < framelenbit_tbl[FT]; i += 8) { 1786 *p_amr_bits++ = ( *r >> 7) & 1;1787 *p_amr_bits++ = ( *r >> 6) & 1;1788 *p_amr_bits++ = ( *r >> 5) & 1;1789 *p_amr_bits++ = ( *r >> 4) & 1;1790 *p_amr_bits++ = ( *r >> 3) & 1;1791 *p_amr_bits++ = ( *r >> 2) & 1;1792 *p_amr_bits++ = ( *r >> 1) & 1;1793 *p_amr_bits++ = ( *r ) & 1;1783 *p_amr_bits++ = (pj_uint8_t)((*r >> 7) & 1); 1784 *p_amr_bits++ = (pj_uint8_t)((*r >> 6) & 1); 1785 *p_amr_bits++ = (pj_uint8_t)((*r >> 5) & 1); 1786 *p_amr_bits++ = (pj_uint8_t)((*r >> 4) & 1); 1787 *p_amr_bits++ = (pj_uint8_t)((*r >> 3) & 1); 1788 *p_amr_bits++ = (pj_uint8_t)((*r >> 2) & 1); 1789 *p_amr_bits++ = (pj_uint8_t)((*r >> 1) & 1); 1790 *p_amr_bits++ = (pj_uint8_t)((*r ) & 1); 1794 1791 ++r; 1795 1792 } … … 1823 1820 STI = amr_bits[35]; 1824 1821 if (AMRWB) 1825 FT_ = (amr_bits[36] << 3) | (amr_bits[37] << 2) | (amr_bits[38] << 1) | amr_bits[39]; 1822 FT_ = (pj_uint8_t)((amr_bits[36] << 3) | (amr_bits[37] << 2) | 1823 (amr_bits[38] << 1) | amr_bits[39]); 1826 1824 else 1827 FT_ = (amr_bits[36] << 2) | (amr_bits[37] << 1) | amr_bits[38]; 1825 FT_ = (pj_uint8_t)((amr_bits[36] << 2) | (amr_bits[37] << 1) | 1826 amr_bits[38]); 1828 1827 1829 1828 pj_bzero(rtp_frame->buf, rtp_frame->size); … … 1891 1890 1892 1891 /* Code Mode Request, 4 bits */ 1893 *w = ( CMR << 4);1892 *w = (pj_uint8_t)(CMR << 4); 1894 1893 w_bitptr = 4; 1895 1894 if (octet_aligned) { … … 1903 1902 pj_uint8_t F, FT, Q; 1904 1903 1905 F = ( *r & 0x40) == 0;1906 FT = ( *r & 0x0F);1907 Q = ( *r & 0x80) == 0;1904 F = (pj_uint8_t)((*r & 0x40) == 0); 1905 FT = (pj_uint8_t)(*r & 0x0F); 1906 Q = (pj_uint8_t)((*r & 0x80) == 0); 1908 1907 1909 1908 pj_assert(FT <= SID_FT || FT == 14 || FT == 15); … … 1911 1910 1912 1911 if (w_bitptr == 0) { 1913 *w = TOC<<2;1912 *w = (pj_uint8_t)(TOC<<2); 1914 1913 w_bitptr = 6; 1915 1914 } else if (w_bitptr == 2) { … … 1918 1917 } else if (w_bitptr == 4) { 1919 1918 *w++ |= TOC>>2; 1920 *w = TOC<<6;1919 *w = (pj_uint8_t)(TOC<<6); 1921 1920 w_bitptr = 2; 1922 1921 } else if (w_bitptr == 6) { 1923 1922 *w++ |= TOC>>4; 1924 *w = TOC<<4;1923 *w = (pj_uint8_t)(TOC<<4); 1925 1924 w_bitptr = 4; 1926 1925 } … … 1951 1950 unsigned i; 1952 1951 1953 F = ( *r & 0x40) == 0;1954 FT = ( *r & 0x0F);1952 F = (pj_uint8_t)((*r & 0x40) == 0); 1953 FT = (pj_uint8_t)(*r & 0x0F); 1955 1954 pj_assert(FT <= SID_FT || FT == 14 || FT == 15); 1956 1955 … … 1964 1963 /* Unpack bits */ 1965 1964 for(i = 0; i < framelen_tbl[FT]; ++i) { 1966 *p_amr_bits++ = ( *r >> 7) & 1;1967 *p_amr_bits++ = ( *r >> 6) & 1;1968 *p_amr_bits++ = ( *r >> 5) & 1;1969 *p_amr_bits++ = ( *r >> 4) & 1;1970 *p_amr_bits++ = ( *r >> 3) & 1;1971 *p_amr_bits++ = ( *r >> 2) & 1;1972 *p_amr_bits++ = ( *r >> 1) & 1;1973 *p_amr_bits++ = ( *r ) & 1;1965 *p_amr_bits++ = (pj_uint8_t)((*r >> 7) & 1); 1966 *p_amr_bits++ = (pj_uint8_t)((*r >> 6) & 1); 1967 *p_amr_bits++ = (pj_uint8_t)((*r >> 5) & 1); 1968 *p_amr_bits++ = (pj_uint8_t)((*r >> 4) & 1); 1969 *p_amr_bits++ = (pj_uint8_t)((*r >> 3) & 1); 1970 *p_amr_bits++ = (pj_uint8_t)((*r >> 2) & 1); 1971 *p_amr_bits++ = (pj_uint8_t)((*r >> 1) & 1); 1972 *p_amr_bits++ = (pj_uint8_t)((*r ) & 1); 1974 1973 ++r; 1975 1974 } … … 2004 2003 pj_uint8_t STI = 0; 2005 2004 2006 amr_bits[35] = ( STI & 1);2005 amr_bits[35] = (pj_uint8_t)(STI & 1); 2007 2006 2008 2007 if (AMRWB) { 2009 amr_bits[36] = ( FT >> 3) & 1;2010 amr_bits[37] = ( FT >> 2) & 1;2011 amr_bits[38] = ( FT >> 1) & 1;2012 amr_bits[39] = ( FT) & 1;2008 amr_bits[36] = (pj_uint8_t)((FT >> 3) & 1); 2009 amr_bits[37] = (pj_uint8_t)((FT >> 2) & 1); 2010 amr_bits[38] = (pj_uint8_t)((FT >> 1) & 1); 2011 amr_bits[39] = (pj_uint8_t)((FT) & 1); 2013 2012 } else { 2014 amr_bits[36] = ( FT >> 2) & 1;2015 amr_bits[37] = ( FT >> 1) & 1;2016 amr_bits[38] = ( FT) & 1;2013 amr_bits[36] = (pj_uint8_t)((FT >> 2) & 1); 2014 amr_bits[37] = (pj_uint8_t)((FT >> 1) & 1); 2015 amr_bits[38] = (pj_uint8_t)((FT) & 1); 2017 2016 } 2018 2017 … … 2085 2084 2086 2085 /* Code Mode Request, 4 bits */ 2087 CMR = ( *r >> 4) & 0x0F;2086 CMR = (pj_uint8_t)((*r >> 4) & 0x0F); 2088 2087 r_bitptr = 4; 2089 2088 if (octet_aligned) { … … 2098 2097 2099 2098 if (r_bitptr == 0) { 2100 TOC = *r >> 2;2099 TOC = (pj_uint8_t)(*r >> 2); 2101 2100 r_bitptr = 6; 2102 2101 } else if (r_bitptr == 2) { 2103 TOC = *r++ & 0x3F;2102 TOC = (pj_uint8_t)(*r++ & 0x3F); 2104 2103 r_bitptr = 0; 2105 2104 } else if (r_bitptr == 4) { 2106 TOC = ( *r++ & 0x0f) << 2;2105 TOC = (pj_uint8_t)((*r++ & 0x0f) << 2); 2107 2106 TOC |= *r >> 6; 2108 2107 r_bitptr = 2; 2109 2108 } else if (r_bitptr == 6) { 2110 TOC = ( *r++ & 0x03) << 4;2109 TOC = (pj_uint8_t)((*r++ & 0x03) << 4); 2111 2110 TOC |= *r >> 4; 2112 2111 r_bitptr = 4; 2113 2112 } 2114 2113 2115 F = TOC >> 5;2116 FT = ( TOC >> 1) & 0x0F;2117 Q = TOC & 1;2114 F = (pj_uint8_t)(TOC >> 5); 2115 FT = (pj_uint8_t)((TOC >> 1) & 0x0F); 2116 Q = (pj_uint8_t)(TOC & 1); 2118 2117 2119 2118 if (FT > SID_FT && FT < 14) { … … 2179 2178 2180 2179 2181 #if def _MSC_VER2182 # pragma comment( lib, "ippcore.lib")2183 # pragma comment( lib, "ipps.lib")2184 # pragma comment( lib, "ippsc.lib")2185 # pragma comment( lib, "ippsr.lib")2186 # pragma comment( lib, "usc.lib")2180 #if defined(_MSC_VER) && PJMEDIA_AUTO_LINK_IPP_LIBS 2181 # pragma comment( lib, "ippcore.lib") 2182 # pragma comment( lib, "ipps.lib") 2183 # pragma comment( lib, "ippsc.lib") 2184 # pragma comment( lib, "ippsr.lib") 2185 # pragma comment( lib, "usc.lib") 2187 2186 #endif 2188 2187 2189 2188 2190 #endif /* PJMEDIA_HAS_INTEL_IPP _CODECS*/2191 2189 #endif /* PJMEDIA_HAS_INTEL_IPP */ 2190 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r2223 r2225 161 161 #endif /* PJMEDIA_HAS_G722_CODEC */ 162 162 163 #if PJMEDIA_HAS_INTEL_IPP _CODECS163 #if PJMEDIA_HAS_INTEL_IPP 164 164 /* Register IPP codecs */ 165 165 status = pjmedia_codec_ipp_init(pjsua_var.med_endpt); … … 170 170 } 171 171 172 #endif /* PJMEDIA_HAS_INTEL_IPP _CODECS*/172 #endif /* PJMEDIA_HAS_INTEL_IPP */ 173 173 174 174 #if PJMEDIA_HAS_L16_CODEC
Note: See TracChangeset
for help on using the changeset viewer.