Question about adding a codec

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
 I want to implement the MELP 2.4Kbps codec in the pjmedia_codec. 

 As far as I know, MELP 2.4Kbps is running at 8KHz of sampling. Every frame has 180 samples(that is 22.5ms). Every frame is encoded to 54 bits. I will encode every frame to 56 bits(7 bytes) with padding 2 bits zero.
 I would like to use the gsm.c as a template. Now comes the question:

 Because the actual bit rate is: 56*1000/22.5=2488.89 and one frame is 22.5ms length, how can I set the attr->info.avg_bps, attr->info.max_bps and attr->info.frm_ptime in the default_attr function?

ps: In gsm.c, code is like this:

static pj_status_t gsm_default_attr (pjmedia_codec_factory *factory, 
                      const pjmedia_codec_info *id, 
                      pjmedia_codec_param *attr )
{
    PJ_UNUSED_ARG(factory);
    PJ_UNUSED_ARG(id);

    pj_bzero(attr, sizeof(pjmedia_codec_param));
    attr->info.clock_rate = 8000;
    attr->info.channel_cnt = 1;
    attr->info.avg_bps = 13200;
    attr->info.max_bps = 13200;
    attr->info.pcm_bits_per_sample = 16;
    attr->info.frm_ptime = 20;
    attr->info.pt = PJMEDIA_RTP_PT_GSM;
    ......
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080829/07755585/attachment.html 


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux