- Timestamp:
- Nov 11, 2008 11:25:13 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia-codec/amr_helper.h
r2359 r2363 613 613 * This structure describes AMR settings. 614 614 */ 615 typedef struct pjmedia_codec_amr_ settings{616 pj_ bool_t amr_nb; /**< TRUE for AMR-NB, FALSEfor AMR-WB. */617 pj_ bool_t reorder;/**< Reorder bitstream into descending615 typedef struct pjmedia_codec_amr_pack_setting { 616 pj_uint8_t amr_nb:1; /**< Set 1 for AMR-NB, 0 for AMR-WB. */ 617 pj_uint8_t reorder:1; /**< Reorder bitstream into descending 618 618 sensitivity order or vice versa. */ 619 pj_uint8_t octet_aligned ; /**< TRUE if payload is in octet-aligned mode,619 pj_uint8_t octet_aligned:1; /**< TRUE if payload is in octet-aligned mode, 620 620 FALSE if payload is in bandwidth 621 621 efficient mode. */ 622 pj_uint8_t CMR; /**< Change Mode Request for remote622 pj_uint8_t cmr:4; /**< Change Mode Request for remote 623 623 encoder. */ 624 } pjmedia_codec_amr_ settings;624 } pjmedia_codec_amr_pack_setting; 625 625 626 626 … … 686 686 * @param amr_nb Set PJ_TRUE for AMR-NB and PJ_FALSE for AMR-WB. 687 687 * @param in Input frame. 688 * @param setting Settings, see @pjmedia_codec_amr_ settings.688 * @param setting Settings, see @pjmedia_codec_amr_pack_setting. 689 689 * @param out Output frame. 690 690 * … … 692 692 */ 693 693 PJ_INLINE(pj_status_t) pjmedia_codec_amr_predecode( 694 695 const pjmedia_codec_amr_settings*setting,696 694 const pjmedia_frame *in, 695 const pjmedia_codec_amr_pack_setting *setting, 696 pjmedia_frame *out) 697 697 { 698 698 pj_int8_t amr_bits[477 + 7] = {0}; … … 758 758 out_info->mode = in_info->frame_type; 759 759 out->size = framelen_tbl[out_info->mode]; 760 PJ_ASSERT_RETURN(out->size <= in->size, PJMEDIA_CODEC_EFRMINLEN);761 760 762 761 pj_bzero(out->buf, out->size); … … 826 825 * @param frames AMR frames to be packed. 827 826 * @param nframes Number of frames to be packed. 828 * @param setting Settings, see @pjmedia_codec_amr_ settings.827 * @param setting Settings, see @pjmedia_codec_amr_pack_setting. 829 828 * @param pkt Payload. 830 829 * @param pkt_size Payload size, as input this specifies payload maximum size, … … 834 833 */ 835 834 PJ_INLINE (pj_status_t) pjmedia_codec_amr_pack( 836 837 838 const pjmedia_codec_amr_settings*setting,839 840 835 const pjmedia_frame frames[], 836 unsigned nframes, 837 const pjmedia_codec_amr_pack_setting *setting, 838 void *pkt, 839 pj_size_t *pkt_size) 841 840 { 842 841 /* Write cursor */ … … 876 875 877 876 /* Code Mode Request, 4 bits */ 878 *w = (pj_uint8_t)(setting-> CMR<< 4);877 *w = (pj_uint8_t)(setting->cmr << 4); 879 878 w_bitptr = 4; 880 879 if (setting->octet_aligned) { … … 1043 1042 * @param pkt_size Payload size. 1044 1043 * @param ts Base timestamp. 1045 * @param setting Settings, see @pjmedia_codec_amr_ settings.1044 * @param setting Settings, see @pjmedia_codec_amr_pack_setting. 1046 1045 * @param frames Frames parsed. 1047 1046 * @param nframes Number of frames parsed. 1048 * @param CMRChange Mode Request message for local encoder.1047 * @param cmr Change Mode Request message for local encoder. 1049 1048 * 1050 1049 * @return PJ_SUCCESS on success. 1051 1050 */ 1052 1051 PJ_INLINE(pj_status_t) pjmedia_codec_amr_parse( 1053 1054 1055 1056 const pjmedia_codec_amr_settings* setting,1057 1058 1059 pj_uint8_t *CMR)1052 void *pkt, 1053 pj_size_t pkt_size, 1054 const pj_timestamp *ts, 1055 const pjmedia_codec_amr_pack_setting* setting, 1056 pjmedia_frame frames[], 1057 unsigned *nframes, 1058 pj_uint8_t *cmr) 1060 1059 { 1061 1060 unsigned cnt = 0; … … 1090 1089 1091 1090 /* Code Mode Request, 4 bits */ 1092 * CMR= (pj_uint8_t)((*r >> 4) & 0x0F);1091 *cmr = (pj_uint8_t)((*r >> 4) & 0x0F); 1093 1092 r_bitptr = 4; 1094 1093 if (setting->octet_aligned) {
Note: See TracChangeset
for help on using the changeset viewer.