OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 |
11 /* | 11 /* |
12 * decode_bwe.c | 12 * decode_bwe.c |
13 * | 13 * |
14 * This C file contains the internal decode bandwidth estimate function. | 14 * This C file contains the internal decode bandwidth estimate function. |
15 * | 15 * |
16 */ | 16 */ |
17 | 17 |
18 | 18 |
19 #include "bandwidth_estimator.h" | 19 #include "bandwidth_estimator.h" |
20 #include "codec.h" | 20 #include "codec.h" |
21 #include "entropy_coding.h" | 21 #include "entropy_coding.h" |
22 #include "structs.h" | 22 #include "structs.h" |
23 | 23 |
24 | 24 |
25 | 25 |
26 | 26 |
27 int WebRtcIsacfix_EstimateBandwidth(BwEstimatorstr *bwest_str, | 27 int WebRtcIsacfix_EstimateBandwidth(BwEstimatorstr *bwest_str, |
28 Bitstr_dec *streamdata, | 28 Bitstr_dec *streamdata, |
29 int32_t packet_size, | 29 size_t packet_size, |
30 uint16_t rtp_seq_number, | 30 uint16_t rtp_seq_number, |
31 uint32_t send_ts, | 31 uint32_t send_ts, |
32 uint32_t arr_ts) | 32 uint32_t arr_ts) |
33 { | 33 { |
34 int16_t index; | 34 int16_t index; |
35 int16_t frame_samples; | 35 size_t frame_samples; |
36 int err; | 36 int err; |
37 | 37 |
38 /* decode framelength */ | 38 /* decode framelength */ |
39 err = WebRtcIsacfix_DecodeFrameLen(streamdata, &frame_samples); | 39 err = WebRtcIsacfix_DecodeFrameLen(streamdata, &frame_samples); |
40 /* error check */ | 40 /* error check */ |
41 if (err<0) { | 41 if (err<0) { |
42 return err; | 42 return err; |
43 } | 43 } |
44 | 44 |
45 /* decode BW estimation */ | 45 /* decode BW estimation */ |
46 err = WebRtcIsacfix_DecodeSendBandwidth(streamdata, &index); | 46 err = WebRtcIsacfix_DecodeSendBandwidth(streamdata, &index); |
47 /* error check */ | 47 /* error check */ |
48 if (err<0) { | 48 if (err<0) { |
49 return err; | 49 return err; |
50 } | 50 } |
51 | 51 |
52 /* Update BWE with received data */ | 52 /* Update BWE with received data */ |
53 err = WebRtcIsacfix_UpdateUplinkBwImpl( | 53 err = WebRtcIsacfix_UpdateUplinkBwImpl( |
54 bwest_str, | 54 bwest_str, |
55 rtp_seq_number, | 55 rtp_seq_number, |
56 frame_samples * 1000 / FS, | 56 (int16_t)(frame_samples * 1000 / FS), |
57 send_ts, | 57 send_ts, |
58 arr_ts, | 58 arr_ts, |
59 (int16_t) packet_size, /* in bytes */ | 59 packet_size, /* in bytes */ |
60 index); | 60 index); |
61 | 61 |
62 /* error check */ | 62 /* error check */ |
63 if (err<0) { | 63 if (err<0) { |
64 return err; | 64 return err; |
65 } | 65 } |
66 | 66 |
67 /* Succesful */ | 67 /* Succesful */ |
68 return 0; | 68 return 0; |
69 } | 69 } |
OLD | NEW |