blob: 69a7ac298344213673692510dde6644cfe1dae3d [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
turaj@webrtc.org6ea3d1c2013-10-02 21:44:33 +000011#ifndef WEBRTC_MODULES_AUDIO_CODING_MAIN_TEST_ISACTEST_H_
12#define WEBRTC_MODULES_AUDIO_CODING_MAIN_TEST_ISACTEST_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +000014#include <string.h>
15
turaj@webrtc.org6ea3d1c2013-10-02 21:44:33 +000016#include "webrtc/common.h"
17#include "webrtc/common_types.h"
18#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
19#include "webrtc/modules/audio_coding/main/test/ACMTest.h"
20#include "webrtc/modules/audio_coding/main/test/Channel.h"
21#include "webrtc/modules/audio_coding/main/test/PCMFile.h"
22#include "webrtc/modules/audio_coding/main/test/utility.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000023
24#define MAX_FILE_NAME_LENGTH_BYTE 500
25#define NO_OF_CLIENTS 15
26
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000027namespace webrtc {
28
turaj@webrtc.org6ea3d1c2013-10-02 21:44:33 +000029class Config;
30
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000031struct ACMTestISACConfig {
32 int32_t currentRateBitPerSec;
33 int16_t currentFrameSizeMsec;
34 uint32_t maxRateBitPerSec;
35 int16_t maxPayloadSizeByte;
36 int16_t encodingMode;
37 uint32_t initRateBitPerSec;
38 int16_t initFrameSizeInMsec;
39 bool enforceFrameSize;
niklase@google.com470e71d2011-07-07 08:21:25 +000040};
41
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000042class ISACTest : public ACMTest {
43 public:
turaj@webrtc.org6ea3d1c2013-10-02 21:44:33 +000044 ISACTest(int testMode, const Config& config);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000045 ~ISACTest();
niklase@google.com470e71d2011-07-07 08:21:25 +000046
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000047 void Perform();
48 private:
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000049 void Setup();
niklase@google.com470e71d2011-07-07 08:21:25 +000050
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000051 void Run10ms();
niklase@google.com470e71d2011-07-07 08:21:25 +000052
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000053 void EncodeDecode(int testNr, ACMTestISACConfig& wbISACConfig,
54 ACMTestISACConfig& swbISACConfig);
pbos@webrtc.org0946a562013-04-09 00:28:06 +000055
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000056 void SwitchingSamplingRate(int testNr, int maxSampRateChange);
niklase@google.com470e71d2011-07-07 08:21:25 +000057
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000058 AudioCodingModule* _acmA;
59 AudioCodingModule* _acmB;
niklase@google.com470e71d2011-07-07 08:21:25 +000060
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000061 Channel* _channel_A2B;
62 Channel* _channel_B2A;
niklase@google.com470e71d2011-07-07 08:21:25 +000063
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000064 PCMFile _inFileA;
65 PCMFile _inFileB;
niklase@google.com470e71d2011-07-07 08:21:25 +000066
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000067 PCMFile _outFileA;
68 PCMFile _outFileB;
niklase@google.com470e71d2011-07-07 08:21:25 +000069
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000070 uint8_t _idISAC16kHz;
71 uint8_t _idISAC32kHz;
72 CodecInst _paramISAC16kHz;
73 CodecInst _paramISAC32kHz;
niklase@google.com470e71d2011-07-07 08:21:25 +000074
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000075 std::string file_name_swb_;
niklase@google.com470e71d2011-07-07 08:21:25 +000076
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000077 ACMTestTimer _myTimer;
78 int _testMode;
niklase@google.com470e71d2011-07-07 08:21:25 +000079};
80
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000081} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000082
turaj@webrtc.org6ea3d1c2013-10-02 21:44:33 +000083#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_TEST_ISACTEST_H_