Changeset 4272 for pjproject


Ignore:
Timestamp:
Oct 1, 2012 11:11:37 AM (12 years ago)
Author:
ming
Message:

Re #1586: Implement SILK config setting and fixed decoding fmtp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-codec/silk.c

    r4264 r4272  
    3636 
    3737#define FRAME_LENGTH_MS         20 
     38#define CALC_BITRATE_QUALITY(quality, max_br) \ 
     39                (quality * max_br / 10) 
    3840#define CALC_BITRATE(max_br) \ 
    39                 (PJMEDIA_CODEC_SILK_DEFAULT_QUALITY * max_br / 10) 
     41                CALC_BITRATE_QUALITY(PJMEDIA_CODEC_SILK_DEFAULT_QUALITY, \ 
     42                                     max_br); 
    4043 
    4144 
     
    288291                                    const pjmedia_codec_silk_setting *opt) 
    289292{ 
    290     PJ_UNUSED_ARG(clock_rate); 
    291     PJ_UNUSED_ARG(opt); 
    292     return PJ_ENOTSUP; 
     293    unsigned i; 
     294 
     295    /* Look up in factory modes table */ 
     296    for (i = 0; i < sizeof(silk_factory.silk_param)/ 
     297                    sizeof(silk_factory.silk_param[0]); ++i) 
     298    { 
     299        if (silk_factory.silk_param[i].clock_rate == clock_rate) { 
     300            silk_factory.silk_param[i].enabled = opt->enabled; 
     301            silk_factory.silk_param[i].complexity = opt->complexity; 
     302            silk_factory.silk_param[i].bitrate = 
     303                CALC_BITRATE_QUALITY(opt->quality, 
     304                                     silk_factory.silk_param[i].max_bitrate); 
     305            return PJ_SUCCESS; 
     306        } 
     307    } 
     308 
     309    return PJ_ENOTFOUND; 
    293310} 
    294311 
     
    404421 
    405422    i = 0; 
    406     attr->setting.dec_fmtp.param[i++].name = pj_str("useinbandfec"); 
     423    attr->setting.dec_fmtp.param[i].name = pj_str("useinbandfec"); 
    407424    attr->setting.dec_fmtp.param[i++].val = pj_str("0"); 
    408425    /* 
    409     attr->setting.dec_fmtp.param[i++].name = pj_str("maxaveragebitrate"); 
     426    attr->setting.dec_fmtp.param[i].name = pj_str("maxaveragebitrate"); 
    410427    attr->setting.dec_fmtp.param[i++].val = pj_str(mode->bitrate_str); 
    411428    */ 
Note: See TracChangeset for help on using the changeset viewer.