blob: 55227022148186397c8550f8cb98be8c802d92bc [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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.orgba468042012-08-17 10:38:28 +000014#include <string.h>
15
niklase@google.com470e71d2011-07-07 08:21:25 +000016#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.org554ae1a2011-12-16 10:09:04 +000026namespace webrtc {
27
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000028struct ACMTestISACConfig {
29 int32_t currentRateBitPerSec;
30 int16_t currentFrameSizeMsec;
31 uint32_t maxRateBitPerSec;
32 int16_t maxPayloadSizeByte;
33 int16_t encodingMode;
34 uint32_t initRateBitPerSec;
35 int16_t initFrameSizeInMsec;
36 bool enforceFrameSize;
niklase@google.com470e71d2011-07-07 08:21:25 +000037};
38
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000039class ISACTest : public ACMTest {
40 public:
41 ISACTest(int testMode);
42 ~ISACTest();
niklase@google.com470e71d2011-07-07 08:21:25 +000043
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000044 void Perform();
45 private:
46 int16_t Setup();
47 int16_t SetupConference();
48 int16_t RunConference();
niklase@google.com470e71d2011-07-07 08:21:25 +000049
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000050 void Run10ms();
niklase@google.com470e71d2011-07-07 08:21:25 +000051
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000052 void EncodeDecode(int testNr, ACMTestISACConfig& wbISACConfig,
53 ACMTestISACConfig& swbISACConfig);
pbos@webrtc.org0946a562013-04-09 00:28:06 +000054
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000055 void TestBWE(int testNr);
niklase@google.com470e71d2011-07-07 08:21:25 +000056
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000057 void SwitchingSamplingRate(int testNr, int maxSampRateChange);
niklase@google.com470e71d2011-07-07 08:21:25 +000058
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000059 AudioCodingModule* _acmA;
60 AudioCodingModule* _acmB;
niklase@google.com470e71d2011-07-07 08:21:25 +000061
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000062 Channel* _channel_A2B;
63 Channel* _channel_B2A;
niklase@google.com470e71d2011-07-07 08:21:25 +000064
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000065 PCMFile _inFileA;
66 PCMFile _inFileB;
niklase@google.com470e71d2011-07-07 08:21:25 +000067
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000068 PCMFile _outFileA;
69 PCMFile _outFileB;
niklase@google.com470e71d2011-07-07 08:21:25 +000070
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000071 uint8_t _idISAC16kHz;
72 uint8_t _idISAC32kHz;
73 CodecInst _paramISAC16kHz;
74 CodecInst _paramISAC32kHz;
niklase@google.com470e71d2011-07-07 08:21:25 +000075
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000076 std::string file_name_swb_;
niklase@google.com470e71d2011-07-07 08:21:25 +000077
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000078 ACMTestTimer _myTimer;
79 int _testMode;
niklase@google.com470e71d2011-07-07 08:21:25 +000080
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000081 AudioCodingModule* _defaultACM32;
82 AudioCodingModule* _defaultACM16;
niklase@google.com470e71d2011-07-07 08:21:25 +000083
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000084 AudioCodingModule* _confACM[NO_OF_CLIENTS];
85 AudioCodingModule* _clientACM[NO_OF_CLIENTS];
86 Channel* _conf2Client[NO_OF_CLIENTS];
87 Channel* _client2Conf[NO_OF_CLIENTS];
niklase@google.com470e71d2011-07-07 08:21:25 +000088
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000089 PCMFile _clientOutFile[NO_OF_CLIENTS];
niklase@google.com470e71d2011-07-07 08:21:25 +000090};
91
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000092} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000093
94#endif