blob: 96d3fb6157e07ab391a6d27ebd1655c8dfee0982 [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
niklase@google.com470e71d2011-07-07 08:21:25 +000028struct ACMTestISACConfig
29{
30 WebRtc_Word32 currentRateBitPerSec;
31 WebRtc_Word16 currentFrameSizeMsec;
32 WebRtc_UWord32 maxRateBitPerSec;
33 WebRtc_Word16 maxPayloadSizeByte;
34 WebRtc_Word16 encodingMode;
35 WebRtc_UWord32 initRateBitPerSec;
36 WebRtc_Word16 initFrameSizeInMsec;
37 bool enforceFrameSize;
38};
39
40
41
42class ISACTest : public ACMTest
43{
44public:
45 ISACTest(int testMode);
46 ~ISACTest();
47
48 void Perform();
49private:
50 WebRtc_Word16 Setup();
51 WebRtc_Word16 SetupConference();
52 WebRtc_Word16 RunConference();
53
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
81 WebRtc_UWord8 _idISAC16kHz;
82 WebRtc_UWord8 _idISAC32kHz;
83 CodecInst _paramISAC16kHz;
84 CodecInst _paramISAC32kHz;
85
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +000086 std::string file_name_swb_;
niklase@google.com470e71d2011-07-07 08:21:25 +000087
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.org554ae1a2011-12-16 10:09:04 +0000102} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000103
104#endif