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 |
11 #include "webrtc/modules/audio_coding/codecs/opus/opus_interface.h" | 11 #include "webrtc/modules/audio_coding/codecs/opus/opus_interface.h" |
12 | 12 |
13 #include "webrtc/base/checks.h" | 13 #include "webrtc/base/checks.h" |
14 #include "webrtc/modules/audio_coding/codecs/opus/opus_inst.h" | 14 #include "webrtc/modules/audio_coding/codecs/opus/opus_inst.h" |
15 | 15 |
16 #include <stdlib.h> | 16 #include <stdlib.h> |
17 #include <string.h> | 17 #include <string.h> |
18 | 18 |
19 enum { | 19 enum { |
| 20 #if WEBRTC_OPUS_SUPPORT_120MS_PTIME |
| 21 /* Maximum supported frame size in WebRTC is 120 ms. */ |
| 22 kWebRtcOpusMaxEncodeFrameSizeMs = 120, |
| 23 #else |
20 /* Maximum supported frame size in WebRTC is 60 ms. */ | 24 /* Maximum supported frame size in WebRTC is 60 ms. */ |
21 kWebRtcOpusMaxEncodeFrameSizeMs = 60, | 25 kWebRtcOpusMaxEncodeFrameSizeMs = 60, |
| 26 #endif |
22 | 27 |
23 /* The format allows up to 120 ms frames. Since we don't control the other | 28 /* The format allows up to 120 ms frames. Since we don't control the other |
24 * side, we must allow for packets of that size. NetEq is currently limited | 29 * side, we must allow for packets of that size. NetEq is currently limited |
25 * to 60 ms on the receive side. */ | 30 * to 60 ms on the receive side. */ |
26 kWebRtcOpusMaxDecodeFrameSizeMs = 120, | 31 kWebRtcOpusMaxDecodeFrameSizeMs = 120, |
27 | 32 |
28 /* Maximum sample count per channel is 48 kHz * maximum frame size in | 33 /* Maximum sample count per channel is 48 kHz * maximum frame size in |
29 * milliseconds. */ | 34 * milliseconds. */ |
30 kWebRtcOpusMaxFrameSizePerChannel = 48 * kWebRtcOpusMaxDecodeFrameSizeMs, | 35 kWebRtcOpusMaxFrameSizePerChannel = 48 * kWebRtcOpusMaxDecodeFrameSizeMs, |
31 | 36 |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 return 0; | 474 return 0; |
470 } | 475 } |
471 | 476 |
472 for (n = 0; n < channels; n++) { | 477 for (n = 0; n < channels; n++) { |
473 if (frame_data[0][0] & (0x80 >> ((n + 1) * (frames + 1) - 1))) | 478 if (frame_data[0][0] & (0x80 >> ((n + 1) * (frames + 1) - 1))) |
474 return 1; | 479 return 1; |
475 } | 480 } |
476 | 481 |
477 return 0; | 482 return 0; |
478 } | 483 } |
OLD | NEW |