common_audio: Made input vector const in WebRtcSpl_LevinsonDurbin()

In addition, expanded the unit test to verify both unstable and stable filters.

BUG=3353, 1132
TESTED=locally on Mac and trybots
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/35599004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@8038 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
bjornv@webrtc.org
2015-01-12 05:53:43 +00:00
parent c14e3572c6
commit 88a4298234
3 changed files with 19 additions and 19 deletions

View File

@ -371,18 +371,20 @@ TEST_F(SplTest, VectorOperationsTest) {
}
TEST_F(SplTest, EstimatorsTest) {
const int kVectorSize = 4;
int B[] = {4, 12, 133, 1100};
int16_t b16[kVectorSize];
int32_t b32[kVectorSize];
int16_t bTmp16[kVectorSize];
const int16_t kOrder = 2;
const int32_t unstable_filter[] = { 4, 12, 133, 1100 };
const int32_t stable_filter[] = { 1100, 133, 12, 4 };
int16_t lpc[kOrder + 2] = { 0 };
int16_t refl[kOrder + 2] = { 0 };
int16_t lpc_result[] = { 4096, -497, 15, 0 };
int16_t refl_result[] = { -3962, 123, 0, 0 };
for (int kk = 0; kk < kVectorSize; ++kk) {
b16[kk] = B[kk];
b32[kk] = B[kk];
}
EXPECT_EQ(0, WebRtcSpl_LevinsonDurbin(b32, b16, bTmp16, 2));
EXPECT_EQ(0, WebRtcSpl_LevinsonDurbin(unstable_filter, lpc, refl, kOrder));
EXPECT_EQ(1, WebRtcSpl_LevinsonDurbin(stable_filter, lpc, refl, kOrder));
for (int i = 0; i < kOrder + 2; ++i) {
EXPECT_EQ(lpc_result[i], lpc[i]);
EXPECT_EQ(refl_result[i], refl[i]);
}
}
TEST_F(SplTest, FilterTest) {