OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 * - rtp_seq_number : the RTP number of the packet. | 612 * - rtp_seq_number : the RTP number of the packet. |
613 * - arr_ts : the arrival time of the packet (from NetEq) | 613 * - arr_ts : the arrival time of the packet (from NetEq) |
614 * in samples. | 614 * in samples. |
615 * | 615 * |
616 * Return value : 0 - Ok | 616 * Return value : 0 - Ok |
617 * -1 - Error | 617 * -1 - Error |
618 */ | 618 */ |
619 | 619 |
620 int16_t WebRtcIsacfix_UpdateBwEstimate1(ISACFIX_MainStruct *ISAC_main_inst, | 620 int16_t WebRtcIsacfix_UpdateBwEstimate1(ISACFIX_MainStruct *ISAC_main_inst, |
621 const uint8_t* encoded, | 621 const uint8_t* encoded, |
622 int32_t packet_size, | 622 int32_t packet_size, |
623 uint16_t rtp_seq_number, | 623 uint16_t rtp_seq_number, |
624 uint32_t arr_ts) | 624 uint32_t arr_ts) |
625 { | 625 { |
626 ISACFIX_SubStruct *ISAC_inst; | 626 ISACFIX_SubStruct *ISAC_inst; |
627 Bitstr_dec streamdata; | 627 Bitstr_dec streamdata; |
628 int16_t err; | 628 int16_t err; |
629 const int kRequiredEncodedLenBytes = 10; | 629 const int kRequiredEncodedLenBytes = 10; |
630 | 630 |
631 /* typecast pointer to real structure */ | 631 /* typecast pointer to real structure */ |
632 ISAC_inst = (ISACFIX_SubStruct *)ISAC_main_inst; | 632 ISAC_inst = (ISACFIX_SubStruct *)ISAC_main_inst; |
633 | 633 |
634 /* Sanity check of packet length */ | 634 /* Sanity check of packet length */ |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 * - send_ts : Send Time Stamp from RTP header | 684 * - send_ts : Send Time Stamp from RTP header |
685 * - arr_ts : the arrival time of the packet (from NetEq) | 685 * - arr_ts : the arrival time of the packet (from NetEq) |
686 * in samples. | 686 * in samples. |
687 * | 687 * |
688 * Return value : 0 - Ok | 688 * Return value : 0 - Ok |
689 * -1 - Error | 689 * -1 - Error |
690 */ | 690 */ |
691 | 691 |
692 int16_t WebRtcIsacfix_UpdateBwEstimate(ISACFIX_MainStruct *ISAC_main_inst, | 692 int16_t WebRtcIsacfix_UpdateBwEstimate(ISACFIX_MainStruct *ISAC_main_inst, |
693 const uint8_t* encoded, | 693 const uint8_t* encoded, |
694 int32_t packet_size, | 694 int32_t packet_size, |
695 uint16_t rtp_seq_number, | 695 uint16_t rtp_seq_number, |
696 uint32_t send_ts, | 696 uint32_t send_ts, |
697 uint32_t arr_ts) | 697 uint32_t arr_ts) |
698 { | 698 { |
699 ISACFIX_SubStruct *ISAC_inst; | 699 ISACFIX_SubStruct *ISAC_inst; |
700 Bitstr_dec streamdata; | 700 Bitstr_dec streamdata; |
701 int16_t err; | 701 int16_t err; |
702 const int kRequiredEncodedLenBytes = 10; | 702 const int kRequiredEncodedLenBytes = 10; |
703 | 703 |
704 /* typecast pointer to real structure */ | 704 /* typecast pointer to real structure */ |
705 ISAC_inst = (ISACFIX_SubStruct *)ISAC_main_inst; | 705 ISAC_inst = (ISACFIX_SubStruct *)ISAC_main_inst; |
706 | 706 |
707 /* Sanity check of packet length */ | 707 /* Sanity check of packet length */ |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 * - len : bytes in encoded vector | 759 * - len : bytes in encoded vector |
760 * | 760 * |
761 * Output: | 761 * Output: |
762 * - decoded : The decoded vector | 762 * - decoded : The decoded vector |
763 * | 763 * |
764 * Return value : >0 - number of samples in decoded vector | 764 * Return value : >0 - number of samples in decoded vector |
765 * -1 - Error | 765 * -1 - Error |
766 */ | 766 */ |
767 | 767 |
768 | 768 |
769 int WebRtcIsacfix_Decode(ISACFIX_MainStruct *ISAC_main_inst, | 769 int WebRtcIsacfix_Decode(ISACFIX_MainStruct* ISAC_main_inst, |
770 const uint8_t* encoded, | 770 const uint8_t* encoded, |
771 int16_t len, | 771 int16_t len, |
772 int16_t *decoded, | 772 int16_t* decoded, |
773 int16_t *speechType) | 773 int16_t* speechType) |
774 { | 774 { |
775 ISACFIX_SubStruct *ISAC_inst; | 775 ISACFIX_SubStruct *ISAC_inst; |
776 /* number of samples (480 or 960), output from decoder */ | 776 /* number of samples (480 or 960), output from decoder */ |
777 /* that were actually used in the encoder/decoder (determined on the fly) */ | 777 /* that were actually used in the encoder/decoder (determined on the fly) */ |
778 int16_t number_of_samples; | 778 int16_t number_of_samples; |
779 int declen = 0; | 779 int declen = 0; |
780 | 780 |
781 /* typecast pointer to real structure */ | 781 /* typecast pointer to real structure */ |
782 ISAC_inst = (ISACFIX_SubStruct *)ISAC_main_inst; | 782 ISAC_inst = (ISACFIX_SubStruct *)ISAC_main_inst; |
783 | 783 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 | 973 |
974 /* Limit number of frames to two = 60 msec. Otherwise we exceed data vectors *
/ | 974 /* Limit number of frames to two = 60 msec. Otherwise we exceed data vectors *
/ |
975 if (noOfLostFrames > 2){ | 975 if (noOfLostFrames > 2){ |
976 noOfLostFrames = 2; | 976 noOfLostFrames = 2; |
977 } | 977 } |
978 | 978 |
979 k = 0; | 979 k = 0; |
980 declen = 0; | 980 declen = 0; |
981 while( noOfLostFrames > 0 ) | 981 while( noOfLostFrames > 0 ) |
982 { | 982 { |
983 ok = WebRtcIsacfix_DecodePlcImpl( outframeWB, &ISAC_inst->ISACdec_obj, &no_o
f_samples ); | 983 WebRtcIsacfix_DecodePlcImpl(outframeWB, &ISAC_inst->ISACdec_obj, |
984 if(ok) | 984 &no_of_samples); |
985 return -1; | |
986 | 985 |
987 WebRtcIsacfix_SplitAndFilter2(outframeWB, &(outframeNB[k*240]), dummy, &ISAC
_inst->ISACdec_obj.decimatorstr_obj); | 986 WebRtcIsacfix_SplitAndFilter2(outframeWB, &(outframeNB[k*240]), dummy, &ISAC
_inst->ISACdec_obj.decimatorstr_obj); |
988 | 987 |
989 declen += no_of_samples; | 988 declen += no_of_samples; |
990 noOfLostFrames--; | 989 noOfLostFrames--; |
991 k++; | 990 k++; |
992 } | 991 } |
993 | 992 |
994 declen>>=1; | 993 declen>>=1; |
995 | 994 |
(...skipping 25 matching lines...) Expand all Loading... |
1021 * | 1020 * |
1022 * Return value : >0 - number of samples in decoded PLC vector | 1021 * Return value : >0 - number of samples in decoded PLC vector |
1023 * -1 - Error | 1022 * -1 - Error |
1024 */ | 1023 */ |
1025 | 1024 |
1026 int16_t WebRtcIsacfix_DecodePlc(ISACFIX_MainStruct *ISAC_main_inst, | 1025 int16_t WebRtcIsacfix_DecodePlc(ISACFIX_MainStruct *ISAC_main_inst, |
1027 int16_t *decoded, | 1026 int16_t *decoded, |
1028 int16_t noOfLostFrames) | 1027 int16_t noOfLostFrames) |
1029 { | 1028 { |
1030 | 1029 |
1031 int16_t no_of_samples, declen, k, ok; | 1030 int16_t no_of_samples, declen, k; |
1032 int16_t outframe16[MAX_FRAMESAMPLES]; | 1031 int16_t outframe16[MAX_FRAMESAMPLES]; |
1033 | 1032 |
1034 ISACFIX_SubStruct *ISAC_inst; | 1033 ISACFIX_SubStruct *ISAC_inst; |
1035 /* typecast pointer to real structure */ | 1034 /* typecast pointer to real structure */ |
1036 ISAC_inst = (ISACFIX_SubStruct *)ISAC_main_inst; | 1035 ISAC_inst = (ISACFIX_SubStruct *)ISAC_main_inst; |
1037 | 1036 |
1038 /* Limit number of frames to two = 60 msec. Otherwise we exceed data vectors *
/ | 1037 /* Limit number of frames to two = 60 msec. Otherwise we exceed data vectors *
/ |
1039 if (noOfLostFrames > 2) { | 1038 if (noOfLostFrames > 2) { |
1040 noOfLostFrames = 2; | 1039 noOfLostFrames = 2; |
1041 } | 1040 } |
1042 k = 0; | 1041 k = 0; |
1043 declen = 0; | 1042 declen = 0; |
1044 while( noOfLostFrames > 0 ) | 1043 while( noOfLostFrames > 0 ) |
1045 { | 1044 { |
1046 ok = WebRtcIsacfix_DecodePlcImpl( &(outframe16[k*480]), &ISAC_inst->ISACdec_
obj, &no_of_samples ); | 1045 WebRtcIsacfix_DecodePlcImpl(&(outframe16[k*480]), &ISAC_inst->ISACdec_obj, |
1047 if(ok) | 1046 &no_of_samples); |
1048 return -1; | |
1049 declen += no_of_samples; | 1047 declen += no_of_samples; |
1050 noOfLostFrames--; | 1048 noOfLostFrames--; |
1051 k++; | 1049 k++; |
1052 } | 1050 } |
1053 | 1051 |
1054 for (k=0;k<declen;k++) { | 1052 for (k=0;k<declen;k++) { |
1055 decoded[k] = outframe16[k]; | 1053 decoded[k] = outframe16[k]; |
1056 } | 1054 } |
1057 | 1055 |
1058 return declen; | 1056 return declen; |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1520 * | 1518 * |
1521 * Output: | 1519 * Output: |
1522 * - version : Pointer to character string | 1520 * - version : Pointer to character string |
1523 * | 1521 * |
1524 */ | 1522 */ |
1525 | 1523 |
1526 void WebRtcIsacfix_version(char *version) | 1524 void WebRtcIsacfix_version(char *version) |
1527 { | 1525 { |
1528 strcpy(version, "3.6.0"); | 1526 strcpy(version, "3.6.0"); |
1529 } | 1527 } |
OLD | NEW |