niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
tina.legrand@webrtc.org | ba46804 | 2012-08-17 10:38:28 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef ACM_ISAC_TEST_H |
| 12 | #define ACM_ISAC_TEST_H |
| 13 | |
tina.legrand@webrtc.org | ba46804 | 2012-08-17 10:38:28 +0000 | [diff] [blame] | 14 | #include <string.h> |
| 15 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 16 | #include "ACMTest.h" |
| 17 | #include "Channel.h" |
| 18 | #include "PCMFile.h" |
| 19 | #include "audio_coding_module.h" |
| 20 | #include "utility.h" |
| 21 | #include "common_types.h" |
| 22 | |
| 23 | #define MAX_FILE_NAME_LENGTH_BYTE 500 |
| 24 | #define NO_OF_CLIENTS 15 |
| 25 | |
tina.legrand@webrtc.org | 554ae1a | 2011-12-16 10:09:04 +0000 | [diff] [blame] | 26 | namespace webrtc { |
| 27 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 28 | struct ACMTestISACConfig |
| 29 | { |
pbos@webrtc.org | 0946a56 | 2013-04-09 00:28:06 +0000 | [diff] [blame] | 30 | int32_t currentRateBitPerSec; |
| 31 | int16_t currentFrameSizeMsec; |
| 32 | uint32_t maxRateBitPerSec; |
| 33 | int16_t maxPayloadSizeByte; |
| 34 | int16_t encodingMode; |
| 35 | uint32_t initRateBitPerSec; |
| 36 | int16_t initFrameSizeInMsec; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 37 | bool enforceFrameSize; |
| 38 | }; |
| 39 | |
| 40 | |
| 41 | |
| 42 | class ISACTest : public ACMTest |
| 43 | { |
| 44 | public: |
| 45 | ISACTest(int testMode); |
| 46 | ~ISACTest(); |
| 47 | |
| 48 | void Perform(); |
| 49 | private: |
pbos@webrtc.org | 0946a56 | 2013-04-09 00:28:06 +0000 | [diff] [blame] | 50 | int16_t Setup(); |
| 51 | int16_t SetupConference(); |
| 52 | int16_t RunConference(); |
| 53 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 54 | |
| 55 | void Run10ms(); |
| 56 | |
| 57 | void EncodeDecode( |
| 58 | int testNr, |
| 59 | ACMTestISACConfig& wbISACConfig, |
| 60 | ACMTestISACConfig& swbISACConfig); |
| 61 | |
| 62 | void TestBWE( |
| 63 | int testNr); |
| 64 | |
| 65 | void SwitchingSamplingRate( |
| 66 | int testNr, |
| 67 | int maxSampRateChange); |
| 68 | |
| 69 | AudioCodingModule* _acmA; |
| 70 | AudioCodingModule* _acmB; |
| 71 | |
| 72 | Channel* _channel_A2B; |
| 73 | Channel* _channel_B2A; |
| 74 | |
| 75 | PCMFile _inFileA; |
| 76 | PCMFile _inFileB; |
| 77 | |
| 78 | PCMFile _outFileA; |
| 79 | PCMFile _outFileB; |
| 80 | |
pbos@webrtc.org | 0946a56 | 2013-04-09 00:28:06 +0000 | [diff] [blame] | 81 | uint8_t _idISAC16kHz; |
| 82 | uint8_t _idISAC32kHz; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 83 | CodecInst _paramISAC16kHz; |
| 84 | CodecInst _paramISAC32kHz; |
| 85 | |
tina.legrand@webrtc.org | ba46804 | 2012-08-17 10:38:28 +0000 | [diff] [blame] | 86 | std::string file_name_swb_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 87 | |
| 88 | ACMTestTimer _myTimer; |
| 89 | int _testMode; |
| 90 | |
| 91 | AudioCodingModule* _defaultACM32; |
| 92 | AudioCodingModule* _defaultACM16; |
| 93 | |
| 94 | AudioCodingModule* _confACM[NO_OF_CLIENTS]; |
| 95 | AudioCodingModule* _clientACM[NO_OF_CLIENTS]; |
| 96 | Channel* _conf2Client[NO_OF_CLIENTS]; |
| 97 | Channel* _client2Conf[NO_OF_CLIENTS]; |
| 98 | |
| 99 | PCMFile _clientOutFile[NO_OF_CLIENTS]; |
| 100 | }; |
| 101 | |
tina.legrand@webrtc.org | 554ae1a | 2011-12-16 10:09:04 +0000 | [diff] [blame] | 102 | } // namespace webrtc |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 103 | |
| 104 | #endif |