Changeset 3589
- Timestamp:
- Jun 20, 2011 4:06:19 AM (13 years ago)
- Location:
- pjproject/branches/1.x/pjmedia
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/1.x/pjmedia/include/pjmedia-codec/amr_helper.h
r3553 r3589 568 568 */ 569 569 const pj_uint8_t pjmedia_codec_amrnb_framelen[16] = 570 {12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 5};570 {12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0}; 571 571 /** 572 572 * Constant of AMR-NB frame lengths in bits. … … 584 584 */ 585 585 const pj_uint8_t pjmedia_codec_amrwb_framelen[16] = 586 {17, 23, 32, 37, 40, 46, 50, 58, 60, 5, 0, 0, 0, 0, 0, 5};586 {17, 23, 32, 37, 40, 46, 50, 58, 60, 5, 0, 0, 0, 0, 0, 0}; 587 587 /** 588 588 * Constant of AMR-WB frame lengths in bits. … … 607 607 pj_uint8_t start_bit; /**< Frame start bit. */ 608 608 pj_uint8_t good_quality:1; /**< Flag if frame is good/degraded. */ 609 pj_uint8_t STI:1; /**< STI mode (first/update). */ 609 610 } pjmedia_codec_amr_bit_info; 610 611 #pragma pack() … … 1021 1022 1022 1023 /* SID */ 1023 pj_uint8_t STI = 0; 1024 1025 amr_bits[35] = (pj_uint8_t)(STI & 1); 1024 amr_bits[35] |= info->STI; 1026 1025 1027 1026 if (setting->amr_nb) { … … 1164 1163 info->good_quality = (pj_uint8_t)(Q == 1); 1165 1164 info->start_bit = 0; 1165 info->STI = 0; 1166 1166 frames[cnt].timestamp = ts_; 1167 1167 frames[cnt].type = PJMEDIA_FRAME_TYPE_AUDIO; … … 1186 1186 frames[cnt].buf = r; 1187 1187 info->start_bit = r_bitptr; 1188 1189 if (FT == SID_FT) { 1190 unsigned sti_bitptr; 1191 sti_bitptr = r_bitptr + 35; 1192 info->STI = (pj_uint8_t) 1193 (r[sti_bitptr >> 3] >> (7 - (sti_bitptr % 8))) & 1; 1194 } 1188 1195 1189 1196 if (setting->octet_aligned) { -
pjproject/branches/1.x/pjmedia/src/pjmedia-codec/ipp_codecs.c
r3553 r3589 42 42 43 43 #define THIS_FILE "ipp_codecs.c" 44 44 45 45 46 /* Prototypes for IPP codecs factory */ … … 238 239 { 239 240 # if PJMEDIA_HAS_INTEL_IPP_CODEC_AMR 240 /* AMR-NB SID seems to produce noise, so let's just disable its VAD. */241 241 {1, "AMR", PJMEDIA_RTP_PT_AMR, &USC_GSMAMR_Fxns, 8000, 1, 160, 242 7400, 12200, 2, 0, 1,242 7400, 12200, 2, 1, 1, 243 243 &predecode_amr, &parse_amr, &pack_amr, 244 244 {1, {{{"octet-align", 11}, {"1", 1}}} } … … 488 488 /* SID */ 489 489 if (info->good_quality) { 490 pj_bool_t STI; 491 STI = (((pj_uint8_t*)frame.buf)[35 >> 3] & 0x10) != 0; 492 usc_frame->frametype = STI? 2 : 1; 490 usc_frame->frametype = info->STI? 2 : 1; 493 491 } else { 494 492 usc_frame->frametype = setting->amr_nb ? 6 : 7; … … 534 532 info->good_quality = (pj_uint8_t)((info_ & 0x80) == 0); 535 533 info->mode = (pj_int8_t) ((info_ >> 8) & 0x0F); 534 info->STI = (pj_uint8_t)((info_ >> 5) & 1); 536 535 537 536 frames[nframes].buf = r + 2; … … 1419 1418 /* Two octets for AMR frame info, 0=LSB: 1420 1419 * bit 0-3 : frame type 1420 * bit 5 : STI flag 1421 1421 * bit 6 : last frame flag 1422 1422 * bit 7 : quality flag … … 1442 1442 if (out.frametype == 6 || out.frametype == 7) 1443 1443 *info |= 0x80; 1444 /* STI */ 1445 if (out.frametype != 1) 1446 *info |= 0x20; 1444 1447 } else { 1445 1448 /* Untransmited */ -
pjproject/branches/1.x/pjmedia/src/pjmedia-codec/passthrough.c
r3553 r3589 267 267 info->good_quality = 1; 268 268 info->mode = setting->enc_mode; 269 if (info->frame_type == SID_FT) 270 info->STI = (sf->data[4] >> 4) & 1; 269 271 270 272 frames[i].buf = sf->data;
Note: See TracChangeset
for help on using the changeset viewer.