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