Changeset 4293
- Timestamp:
- Nov 3, 2012 3:32:09 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/silk.c
r4278 r4293 40 40 #endif 41 41 42 #define FRAME_LENGTH_MS 20 42 #define FRAME_LENGTH_MS 20 43 #define SILK_ENC_CTL_PACKET_LOSS_PCT 10 44 #define SILK_MIN_BITRATE 5000 43 45 #define CALC_BITRATE_QUALITY(quality, max_br) \ 44 46 (quality * max_br / 10) … … 311 313 { 312 314 if (silk_factory.silk_param[i].clock_rate == clock_rate) { 315 int quality = PJMEDIA_CODEC_SILK_DEFAULT_QUALITY; 316 int complexity = PJMEDIA_CODEC_SILK_DEFAULT_COMPLEXITY; 317 313 318 silk_factory.silk_param[i].enabled = opt->enabled; 314 silk_factory.silk_param[i].complexity = opt->complexity; 319 if (opt->complexity >= 0) 320 complexity = opt->complexity; 321 silk_factory.silk_param[i].complexity = complexity; 322 if (opt->quality >= 0) 323 quality = opt->quality; 315 324 silk_factory.silk_param[i].bitrate = 316 CALC_BITRATE_QUALITY( opt->quality,325 CALC_BITRATE_QUALITY(quality, 317 326 silk_factory.silk_param[i].max_bitrate); 327 if (silk_factory.silk_param[i].bitrate < SILK_MIN_BITRATE) 328 silk_factory.silk_param[i].bitrate = SILK_MIN_BITRATE; 329 318 330 return PJ_SUCCESS; 319 331 } … … 589 601 590 602 /* Check fmtp params */ 591 enc_use_fec = PJ_ FALSE;603 enc_use_fec = PJ_TRUE; 592 604 enc_bitrate = sp->bitrate; 593 605 for (i = 0; i < attr->setting.enc_fmtp.cnt; ++i) { … … 615 627 silk->enc_ctl.maxInternalSampleRate = attr->info.clock_rate; 616 628 silk->enc_ctl.packetSize = silk->samples_per_frame; 617 silk->enc_ctl.packetLossPercentage = 0; 629 /* For useInBandFEC setting to be useful, we need to set 630 * packetLossPercentage greater than LBRR_LOSS_THRES (1) 631 */ 632 silk->enc_ctl.packetLossPercentage = SILK_ENC_CTL_PACKET_LOSS_PCT; 618 633 silk->enc_ctl.useInBandFEC = enc_use_fec; 619 634 silk->enc_ctl.useDTX = attr->setting.vad;
Note: See TracChangeset
for help on using the changeset viewer.