Ignore:
Timestamp:
Mar 12, 2009 6:11:37 PM (13 years ago)
Author:
bennylp
Message:

(Major) Task #737 and #738: integration of APS-Direct and Audiodev from aps-direct branch to trunk.

Location:
pjproject/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk

  • pjproject/trunk/pjmedia/include/pjmedia-codec/amr_helper.h

    r2394 r2506  
    633633 * @return          AMR mode. 
    634634 */ 
    635  
    636635PJ_INLINE(pj_int8_t) pjmedia_codec_amr_get_mode(unsigned bitrate) 
    637636{ 
     
    679678 
    680679/** 
     680 * Get AMR mode based on frame length. 
     681 * 
     682 * @param amrnb     Set to PJ_TRUE for AMR-NB domain or PJ_FALSE for AMR-WB. 
     683 * @param frame_len The frame length. 
     684 * 
     685 * @return          AMR mode. 
     686 */ 
     687 
     688PJ_INLINE(pj_int8_t) pjmedia_codec_amr_get_mode2(pj_bool_t amrnb, 
     689                                                 unsigned frame_len) 
     690{ 
     691    int i; 
     692 
     693    if (amrnb) { 
     694        for (i = 0; i < 9; ++i) 
     695            if (frame_len == pjmedia_codec_amrnb_framelen[i]) 
     696                return (pj_int8_t)i; 
     697    } else { 
     698        for (i = 0; i < 10; ++i) { 
     699            if (frame_len == pjmedia_codec_amrwb_framelen[i]) 
     700                return (pj_int8_t)i; 
     701        } 
     702    } 
     703     
     704    pj_assert(!"Invalid AMR frame length"); 
     705    return -1; 
     706} 
     707 
     708/** 
    681709 * Prepare a frame before pass it to decoder. This function will do: 
    682710 * - reorder AMR bitstream from descending sensitivity order into  
     
    795823        out_info->mode = FT_; 
    796824        out->size = 5; 
    797         PJ_ASSERT_RETURN(out->size <= in->size, PJMEDIA_CODEC_EFRMINLEN); 
    798825 
    799826        pj_bzero(out->buf, out->size); 
Note: See TracChangeset for help on using the changeset viewer.