Changeset 2236 for pjproject/trunk/pjmedia/src/pjmedia-codec/ipp_codecs.c
- Timestamp:
- Aug 25, 2008 1:58:25 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/ipp_codecs.c
r2231 r2236 30 30 #include <pj/os.h> 31 31 32 32 33 /* 33 34 * Only build this file if PJMEDIA_HAS_INTEL_IPP != 0 … … 211 212 212 213 predecode_cb predecode; /* Callback to translate RTP frame 213 into USC frame */ 214 parse_cb parse; /* Callback to parse bitstream */ 215 pack_cb pack; /* Callback to pack bitstream */ 216 } 214 into USC frame. */ 215 parse_cb parse; /* Callback to parse bitstream. */ 216 pack_cb pack; /* Callback to pack bitstream. */ 217 218 pjmedia_codec_fmtp dec_fmtp; /* Decoder's fmtp params. */ 219 } 217 220 218 221 ipp_codec[] = … … 233 236 234 237 # if PJMEDIA_HAS_INTEL_IPP_CODEC_G729 235 /* G.729 actually has internal VAD, but for now we need to disable it,236 * since its RTP packaging (multiple frames per packet) requires237 * SID frame to only be occured in the last frame, while controling238 * encoder on each loop (to enable/disable VAD) is considered inefficient.239 * This should still be interoperable with other implementations.240 */241 238 {1, "G729", PJMEDIA_RTP_PT_G729, &USC_G729AFP_Fxns, 8000, 1, 80, 242 8000, 11800, 2, 0, 1,239 8000, 11800, 2, 1, 1, 243 240 &predecode_g729, NULL, NULL 244 241 }, … … 280 277 281 278 # if PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 282 {0, "G7221", PJMEDIA_RTP_PT_G722_1, &USC_G722_Fxns, 16000, 1, 320, 283 16000, 32000, 1, 0, 1, 284 NULL, NULL, NULL 279 {0, "G7221", PJMEDIA_RTP_PT_G722_1_16, &USC_G722_Fxns, 16000, 1, 320, 280 16000, 16000, 1, 0, 1, 281 NULL, NULL, NULL, 282 {1, {{{"bitrate", 7}, {"16000", 5}}} } 283 }, 284 {1, "G7221", PJMEDIA_RTP_PT_G722_1_24, &USC_G722_Fxns, 16000, 1, 320, 285 24000, 24000, 1, 0, 1, 286 NULL, NULL, NULL, 287 {1, {{{"bitrate", 7}, {"24000", 5}}} } 288 }, 289 {1, "G7221", PJMEDIA_RTP_PT_G722_1_32, &USC_G722_Fxns, 16000, 1, 320, 290 32000, 32000, 1, 0, 1, 291 NULL, NULL, NULL, 292 {1, {{{"bitrate", 7}, {"32000", 5}}} } 285 293 }, 286 294 # endif … … 423 431 if ((pj_stricmp(&id->encoding_name, &name) == 0) && 424 432 (id->clock_rate == (unsigned)ipp_codec[i].clock_rate) && 425 (id->channel_cnt == (unsigned)ipp_codec[i].channel_count)) 433 (id->channel_cnt == (unsigned)ipp_codec[i].channel_count) && 434 (id->pt == (unsigned)ipp_codec[i].pt)) 426 435 { 427 436 attr->info.pt = (pj_uint8_t)id->pt; … … 438 447 439 448 /* Default flags. */ 440 attr->setting.cng = 0;441 449 attr->setting.plc = 1; 442 450 attr->setting.penh= 0; 443 attr->setting.vad = 1; /* Always disable for now */ 451 attr->setting.vad = 1; 452 attr->setting.cng = attr->setting.vad; 453 attr->setting.dec_fmtp = ipp_codec[i].dec_fmtp; 454 455 if (attr->setting.vad == 0) { 456 #if PJMEDIA_HAS_INTEL_IPP_CODEC_G729 457 if (id->pt == PJMEDIA_RTP_PT_G729) { 458 /* Signal G729 Annex B is being disabled */ 459 attr->setting.dec_fmtp.cnt = 1; 460 pj_strset2(&attr->setting.dec_fmtp.param[0].name, "annexb"); 461 pj_strset2(&attr->setting.dec_fmtp.param[0].val, "no"); 462 } 463 #endif 464 } 444 465 445 466 return PJ_SUCCESS; … … 632 653 codec_data->info->params.direction = USC_ENCODE; 633 654 codec_data->info->params.modes.vad = attr->setting.vad && 634 655 ippc->has_native_vad; 635 656 codec_data->info->params.modes.bitrate = attr->info.avg_bps; 636 657 codec_data->info->params.law = 0; /* Linear PCM input */ 658 659 #if PJMEDIA_HAS_INTEL_IPP_CODEC_G729 660 if (ippc->pt == PJMEDIA_RTP_PT_G729) { 661 /* Check if G729 Annex B is signaled to be disabled */ 662 for (i = 0; i < attr->setting.enc_fmtp.cnt; ++i) { 663 if (pj_stricmp2(&attr->setting.enc_fmtp.param[i].name, "annexb")==0) 664 { 665 if (pj_stricmp2(&attr->setting.enc_fmtp.param[i].val, "no")==0) 666 codec_data->info->params.modes.vad = 0; 667 break; 668 } 669 } 670 } 671 #endif 637 672 638 673 /* Get number of memory blocks needed by the encoder */ … … 673 708 /* Setting the decoder params */ 674 709 codec_data->info->params.direction = USC_DECODE; 710 711 /* Not sure if VAD affects decoder, just try to be safe */ 712 codec_data->info->params.modes.vad = ippc->has_native_vad; 675 713 676 714 /* Get number of memory blocks needed by the decoder */ … … 926 964 tx += out.nbytes; 927 965 bits_out += out.nbytes; 966 967 #if PJMEDIA_HAS_INTEL_IPP_CODEC_G729 968 if (out.frametype == 1) { 969 /* SID */ 970 break; 971 } else if (out.frametype == 0) { 972 /* Untransmitted */ 973 tx -= out.nbytes; 974 break; 975 } 976 #endif 977 928 978 } 929 979
Note: See TracChangeset
for help on using the changeset viewer.