Home | History | Annotate | Download | only in signal_processing
      1 /*
      2  *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
      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 #include "signal_processing_library.h"
     12 #include "gtest/gtest.h"
     13 
     14 class SplTest : public testing::Test {
     15  protected:
     16   virtual ~SplTest() {
     17   }
     18   void SetUp() {
     19   }
     20   void TearDown() {
     21   }
     22 };
     23 
     24 TEST_F(SplTest, MacroTest) {
     25     // Macros with inputs.
     26     int A = 10;
     27     int B = 21;
     28     int a = -3;
     29     int b = WEBRTC_SPL_WORD32_MAX;
     30     int nr = 2;
     31     int d_ptr2 = 0;
     32 
     33     EXPECT_EQ(10, WEBRTC_SPL_MIN(A, B));
     34     EXPECT_EQ(21, WEBRTC_SPL_MAX(A, B));
     35 
     36     EXPECT_EQ(3, WEBRTC_SPL_ABS_W16(a));
     37     EXPECT_EQ(3, WEBRTC_SPL_ABS_W32(a));
     38     EXPECT_EQ(0, WEBRTC_SPL_GET_BYTE(&B, nr));
     39     WEBRTC_SPL_SET_BYTE(&d_ptr2, 1, nr);
     40     EXPECT_EQ(65536, d_ptr2);
     41 
     42     EXPECT_EQ(-63, WEBRTC_SPL_MUL(a, B));
     43     EXPECT_EQ(-2147483645, WEBRTC_SPL_MUL(a, b));
     44     EXPECT_EQ(-2147483645u, WEBRTC_SPL_UMUL(a, b));
     45     b = WEBRTC_SPL_WORD16_MAX >> 1;
     46     EXPECT_EQ(65535u, WEBRTC_SPL_UMUL_RSFT16(a, b));
     47     EXPECT_EQ(1073627139u, WEBRTC_SPL_UMUL_16_16(a, b));
     48     EXPECT_EQ(16382u, WEBRTC_SPL_UMUL_16_16_RSFT16(a, b));
     49     EXPECT_EQ(-49149u, WEBRTC_SPL_UMUL_32_16(a, b));
     50     EXPECT_EQ(65535u, WEBRTC_SPL_UMUL_32_16_RSFT16(a, b));
     51     EXPECT_EQ(-49149, WEBRTC_SPL_MUL_16_U16(a, b));
     52 
     53     a = b;
     54     b = -3;
     55     EXPECT_EQ(-5461, WEBRTC_SPL_DIV(a, b));
     56     EXPECT_EQ(0u, WEBRTC_SPL_UDIV(a, b));
     57 
     58     EXPECT_EQ(-1, WEBRTC_SPL_MUL_16_32_RSFT16(a, b));
     59     EXPECT_EQ(-1, WEBRTC_SPL_MUL_16_32_RSFT15(a, b));
     60     EXPECT_EQ(-3, WEBRTC_SPL_MUL_16_32_RSFT14(a, b));
     61     EXPECT_EQ(-24, WEBRTC_SPL_MUL_16_32_RSFT11(a, b));
     62 
     63     int a32 = WEBRTC_SPL_WORD32_MAX;
     64     int a32a = (WEBRTC_SPL_WORD32_MAX >> 16);
     65     int a32b = (WEBRTC_SPL_WORD32_MAX & 0x0000ffff);
     66     EXPECT_EQ(5, WEBRTC_SPL_MUL_32_32_RSFT32(a32a, a32b, A));
     67     EXPECT_EQ(5, WEBRTC_SPL_MUL_32_32_RSFT32BI(a32, A));
     68 
     69     EXPECT_EQ(-49149, WEBRTC_SPL_MUL_16_16(a, b));
     70     EXPECT_EQ(-12288, WEBRTC_SPL_MUL_16_16_RSFT(a, b, 2));
     71 
     72     EXPECT_EQ(-12287, WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(a, b, 2));
     73     EXPECT_EQ(-1, WEBRTC_SPL_MUL_16_16_RSFT_WITH_FIXROUND(a, b));
     74 
     75     EXPECT_EQ(16380, WEBRTC_SPL_ADD_SAT_W32(a, b));
     76     EXPECT_EQ(21, WEBRTC_SPL_SAT(a, A, B));
     77     EXPECT_EQ(21, WEBRTC_SPL_SAT(a, B, A));
     78     EXPECT_EQ(-49149, WEBRTC_SPL_MUL_32_16(a, b));
     79 
     80     EXPECT_EQ(16386, WEBRTC_SPL_SUB_SAT_W32(a, b));
     81     EXPECT_EQ(16380, WEBRTC_SPL_ADD_SAT_W16(a, b));
     82     EXPECT_EQ(16386, WEBRTC_SPL_SUB_SAT_W16(a, b));
     83 
     84     EXPECT_TRUE(WEBRTC_SPL_IS_NEG(b));
     85 
     86     // Shifting with negative numbers allowed
     87     int shift_amount = 1;  // Workaround compiler warning using variable here.
     88     // Positive means left shift
     89     EXPECT_EQ(32766, WEBRTC_SPL_SHIFT_W16(a, shift_amount));
     90     EXPECT_EQ(32766, WEBRTC_SPL_SHIFT_W32(a, shift_amount));
     91 
     92     // Shifting with negative numbers not allowed
     93     // We cannot do casting here due to signed/unsigned problem
     94     EXPECT_EQ(8191, WEBRTC_SPL_RSHIFT_W16(a, 1));
     95     EXPECT_EQ(32766, WEBRTC_SPL_LSHIFT_W16(a, 1));
     96     EXPECT_EQ(8191, WEBRTC_SPL_RSHIFT_W32(a, 1));
     97     EXPECT_EQ(32766, WEBRTC_SPL_LSHIFT_W32(a, 1));
     98 
     99     EXPECT_EQ(8191, WEBRTC_SPL_RSHIFT_U16(a, 1));
    100     EXPECT_EQ(32766, WEBRTC_SPL_LSHIFT_U16(a, 1));
    101     EXPECT_EQ(8191u, WEBRTC_SPL_RSHIFT_U32(a, 1));
    102     EXPECT_EQ(32766u, WEBRTC_SPL_LSHIFT_U32(a, 1));
    103 
    104     EXPECT_EQ(1470, WEBRTC_SPL_RAND(A));
    105 }
    106 
    107 TEST_F(SplTest, InlineTest) {
    108     WebRtc_Word16 a = 121;
    109     WebRtc_Word16 b = -17;
    110     WebRtc_Word32 A = 111121;
    111     WebRtc_Word32 B = -1711;
    112     char bVersion[8];
    113 
    114     EXPECT_EQ(104, WebRtcSpl_AddSatW16(a, b));
    115     EXPECT_EQ(138, WebRtcSpl_SubSatW16(a, b));
    116 
    117     EXPECT_EQ(109410, WebRtcSpl_AddSatW32(A, B));
    118     EXPECT_EQ(112832, WebRtcSpl_SubSatW32(A, B));
    119 
    120     EXPECT_EQ(17, WebRtcSpl_GetSizeInBits(A));
    121     EXPECT_EQ(14, WebRtcSpl_NormW32(A));
    122     EXPECT_EQ(4, WebRtcSpl_NormW16(B));
    123     EXPECT_EQ(15, WebRtcSpl_NormU32(A));
    124 
    125     EXPECT_EQ(0, WebRtcSpl_get_version(bVersion, 8));
    126 }
    127 
    128 TEST_F(SplTest, MathOperationsTest) {
    129     int A = 117;
    130     WebRtc_Word32 num = 117;
    131     WebRtc_Word32 den = -5;
    132     WebRtc_UWord16 denU = 5;
    133     EXPECT_EQ(10, WebRtcSpl_Sqrt(A));
    134     EXPECT_EQ(10, WebRtcSpl_SqrtFloor(A));
    135 
    136 
    137     EXPECT_EQ(-91772805, WebRtcSpl_DivResultInQ31(den, num));
    138     EXPECT_EQ(-23, WebRtcSpl_DivW32W16ResW16(num, (WebRtc_Word16)den));
    139     EXPECT_EQ(-23, WebRtcSpl_DivW32W16(num, (WebRtc_Word16)den));
    140     EXPECT_EQ(23u, WebRtcSpl_DivU32U16(num, denU));
    141     EXPECT_EQ(0, WebRtcSpl_DivW32HiLow(128, 0, 256));
    142 }
    143 
    144 TEST_F(SplTest, BasicArrayOperationsTest) {
    145     const int kVectorSize = 4;
    146     int B[] = {4, 12, 133, 1100};
    147     WebRtc_UWord8 b8[kVectorSize];
    148     WebRtc_Word16 b16[kVectorSize];
    149     WebRtc_Word32 b32[kVectorSize];
    150 
    151     WebRtc_UWord8 bTmp8[kVectorSize];
    152     WebRtc_Word16 bTmp16[kVectorSize];
    153     WebRtc_Word32 bTmp32[kVectorSize];
    154 
    155     WebRtcSpl_MemSetW16(b16, 3, kVectorSize);
    156     for (int kk = 0; kk < kVectorSize; ++kk) {
    157         EXPECT_EQ(3, b16[kk]);
    158     }
    159     EXPECT_EQ(kVectorSize, WebRtcSpl_ZerosArrayW16(b16, kVectorSize));
    160     for (int kk = 0; kk < kVectorSize; ++kk) {
    161         EXPECT_EQ(0, b16[kk]);
    162     }
    163     EXPECT_EQ(kVectorSize, WebRtcSpl_OnesArrayW16(b16, kVectorSize));
    164     for (int kk = 0; kk < kVectorSize; ++kk) {
    165         EXPECT_EQ(1, b16[kk]);
    166     }
    167     WebRtcSpl_MemSetW32(b32, 3, kVectorSize);
    168     for (int kk = 0; kk < kVectorSize; ++kk) {
    169         EXPECT_EQ(3, b32[kk]);
    170     }
    171     EXPECT_EQ(kVectorSize, WebRtcSpl_ZerosArrayW32(b32, kVectorSize));
    172     for (int kk = 0; kk < kVectorSize; ++kk) {
    173         EXPECT_EQ(0, b32[kk]);
    174     }
    175     EXPECT_EQ(kVectorSize, WebRtcSpl_OnesArrayW32(b32, kVectorSize));
    176     for (int kk = 0; kk < kVectorSize; ++kk) {
    177         EXPECT_EQ(1, b32[kk]);
    178     }
    179     for (int kk = 0; kk < kVectorSize; ++kk) {
    180         bTmp8[kk] = (WebRtc_Word8)kk;
    181         bTmp16[kk] = (WebRtc_Word16)kk;
    182         bTmp32[kk] = (WebRtc_Word32)kk;
    183     }
    184     WEBRTC_SPL_MEMCPY_W8(b8, bTmp8, kVectorSize);
    185     for (int kk = 0; kk < kVectorSize; ++kk) {
    186         EXPECT_EQ(b8[kk], bTmp8[kk]);
    187     }
    188     WEBRTC_SPL_MEMCPY_W16(b16, bTmp16, kVectorSize);
    189     for (int kk = 0; kk < kVectorSize; ++kk) {
    190         EXPECT_EQ(b16[kk], bTmp16[kk]);
    191     }
    192 //    WEBRTC_SPL_MEMCPY_W32(b32, bTmp32, kVectorSize);
    193 //    for (int kk = 0; kk < kVectorSize; ++kk) {
    194 //        EXPECT_EQ(b32[kk], bTmp32[kk]);
    195 //    }
    196     EXPECT_EQ(2, WebRtcSpl_CopyFromEndW16(b16, kVectorSize, 2, bTmp16));
    197     for (int kk = 0; kk < 2; ++kk) {
    198         EXPECT_EQ(kk+2, bTmp16[kk]);
    199     }
    200 
    201     for (int kk = 0; kk < kVectorSize; ++kk) {
    202         b32[kk] = B[kk];
    203         b16[kk] = (WebRtc_Word16)B[kk];
    204     }
    205     WebRtcSpl_VectorBitShiftW32ToW16(bTmp16, kVectorSize, b32, 1);
    206     for (int kk = 0; kk < kVectorSize; ++kk) {
    207         EXPECT_EQ((B[kk]>>1), bTmp16[kk]);
    208     }
    209     WebRtcSpl_VectorBitShiftW16(bTmp16, kVectorSize, b16, 1);
    210     for (int kk = 0; kk < kVectorSize; ++kk) {
    211         EXPECT_EQ((B[kk]>>1), bTmp16[kk]);
    212     }
    213     WebRtcSpl_VectorBitShiftW32(bTmp32, kVectorSize, b32, 1);
    214     for (int kk = 0; kk < kVectorSize; ++kk) {
    215         EXPECT_EQ((B[kk]>>1), bTmp32[kk]);
    216     }
    217 
    218     WebRtcSpl_MemCpyReversedOrder(&bTmp16[3], b16, kVectorSize);
    219     for (int kk = 0; kk < kVectorSize; ++kk) {
    220         EXPECT_EQ(b16[3-kk], bTmp16[kk]);
    221     }
    222 }
    223 
    224 TEST_F(SplTest, MinMaxOperationsTest) {
    225     const int kVectorSize = 4;
    226     int B[] = {4, 12, 133, -1100};
    227     WebRtc_Word16 b16[kVectorSize];
    228     WebRtc_Word32 b32[kVectorSize];
    229 
    230     for (int kk = 0; kk < kVectorSize; ++kk) {
    231         b16[kk] = B[kk];
    232         b32[kk] = B[kk];
    233     }
    234 
    235     EXPECT_EQ(1100, WebRtcSpl_MaxAbsValueW16(b16, kVectorSize));
    236     EXPECT_EQ(1100, WebRtcSpl_MaxAbsValueW32(b32, kVectorSize));
    237     EXPECT_EQ(133, WebRtcSpl_MaxValueW16(b16, kVectorSize));
    238     EXPECT_EQ(133, WebRtcSpl_MaxValueW32(b32, kVectorSize));
    239     EXPECT_EQ(3, WebRtcSpl_MaxAbsIndexW16(b16, kVectorSize));
    240     EXPECT_EQ(2, WebRtcSpl_MaxIndexW16(b16, kVectorSize));
    241     EXPECT_EQ(2, WebRtcSpl_MaxIndexW32(b32, kVectorSize));
    242 
    243     EXPECT_EQ(-1100, WebRtcSpl_MinValueW16(b16, kVectorSize));
    244     EXPECT_EQ(-1100, WebRtcSpl_MinValueW32(b32, kVectorSize));
    245     EXPECT_EQ(3, WebRtcSpl_MinIndexW16(b16, kVectorSize));
    246     EXPECT_EQ(3, WebRtcSpl_MinIndexW32(b32, kVectorSize));
    247 
    248     EXPECT_EQ(0, WebRtcSpl_GetScalingSquare(b16, kVectorSize, 1));
    249 }
    250 
    251 TEST_F(SplTest, VectorOperationsTest) {
    252     const int kVectorSize = 4;
    253     int B[] = {4, 12, 133, 1100};
    254     WebRtc_Word16 a16[kVectorSize];
    255     WebRtc_Word16 b16[kVectorSize];
    256     WebRtc_Word32 b32[kVectorSize];
    257     WebRtc_Word16 bTmp16[kVectorSize];
    258 
    259     for (int kk = 0; kk < kVectorSize; ++kk) {
    260         a16[kk] = B[kk];
    261         b16[kk] = B[kk];
    262     }
    263 
    264     WebRtcSpl_AffineTransformVector(bTmp16, b16, 3, 7, 2, kVectorSize);
    265     for (int kk = 0; kk < kVectorSize; ++kk) {
    266         EXPECT_EQ((B[kk]*3+7)>>2, bTmp16[kk]);
    267     }
    268     WebRtcSpl_ScaleAndAddVectorsWithRound(b16, 3, b16, 2, 2, bTmp16, kVectorSize);
    269     for (int kk = 0; kk < kVectorSize; ++kk) {
    270         EXPECT_EQ((B[kk]*3+B[kk]*2+2)>>2, bTmp16[kk]);
    271     }
    272 
    273     WebRtcSpl_AddAffineVectorToVector(bTmp16, b16, 3, 7, 2, kVectorSize);
    274     for (int kk = 0; kk < kVectorSize; ++kk) {
    275         EXPECT_EQ(((B[kk]*3+B[kk]*2+2)>>2)+((b16[kk]*3+7)>>2), bTmp16[kk]);
    276     }
    277 
    278     WebRtcSpl_CrossCorrelation(b32, b16, bTmp16, kVectorSize, 2, 2, 0);
    279     for (int kk = 0; kk < 2; ++kk) {
    280         EXPECT_EQ(614236, b32[kk]);
    281     }
    282 //    EXPECT_EQ(, WebRtcSpl_DotProduct(b16, bTmp16, 4));
    283     EXPECT_EQ(306962, WebRtcSpl_DotProductWithScale(b16, b16, kVectorSize, 2));
    284 
    285     WebRtcSpl_ScaleVector(b16, bTmp16, 13, kVectorSize, 2);
    286     for (int kk = 0; kk < kVectorSize; ++kk) {
    287         EXPECT_EQ((b16[kk]*13)>>2, bTmp16[kk]);
    288     }
    289     WebRtcSpl_ScaleVectorWithSat(b16, bTmp16, 13, kVectorSize, 2);
    290     for (int kk = 0; kk < kVectorSize; ++kk) {
    291         EXPECT_EQ((b16[kk]*13)>>2, bTmp16[kk]);
    292     }
    293     WebRtcSpl_ScaleAndAddVectors(a16, 13, 2, b16, 7, 2, bTmp16, kVectorSize);
    294     for (int kk = 0; kk < kVectorSize; ++kk) {
    295         EXPECT_EQ(((a16[kk]*13)>>2)+((b16[kk]*7)>>2), bTmp16[kk]);
    296     }
    297 
    298     WebRtcSpl_AddVectorsAndShift(bTmp16, a16, b16, kVectorSize, 2);
    299     for (int kk = 0; kk < kVectorSize; ++kk) {
    300         EXPECT_EQ(B[kk] >> 1, bTmp16[kk]);
    301     }
    302     WebRtcSpl_ReverseOrderMultArrayElements(bTmp16, a16, &b16[3], kVectorSize, 2);
    303     for (int kk = 0; kk < kVectorSize; ++kk) {
    304         EXPECT_EQ((a16[kk]*b16[3-kk])>>2, bTmp16[kk]);
    305     }
    306     WebRtcSpl_ElementwiseVectorMult(bTmp16, a16, b16, kVectorSize, 6);
    307     for (int kk = 0; kk < kVectorSize; ++kk) {
    308         EXPECT_EQ((a16[kk]*b16[kk])>>6, bTmp16[kk]);
    309     }
    310 
    311     WebRtcSpl_SqrtOfOneMinusXSquared(b16, kVectorSize, bTmp16);
    312     for (int kk = 0; kk < kVectorSize - 1; ++kk) {
    313         EXPECT_EQ(32767, bTmp16[kk]);
    314     }
    315     EXPECT_EQ(32749, bTmp16[kVectorSize - 1]);
    316 }
    317 
    318 TEST_F(SplTest, EstimatorsTest) {
    319     const int kVectorSize = 4;
    320     int B[] = {4, 12, 133, 1100};
    321     WebRtc_Word16 b16[kVectorSize];
    322     WebRtc_Word32 b32[kVectorSize];
    323     WebRtc_Word16 bTmp16[kVectorSize];
    324 
    325     for (int kk = 0; kk < kVectorSize; ++kk) {
    326         b16[kk] = B[kk];
    327         b32[kk] = B[kk];
    328     }
    329 
    330     EXPECT_EQ(0, WebRtcSpl_LevinsonDurbin(b32, b16, bTmp16, 2));
    331 }
    332 
    333 TEST_F(SplTest, FilterTest) {
    334     const int kVectorSize = 4;
    335     WebRtc_Word16 A[] = {1, 2, 33, 100};
    336     WebRtc_Word16 A5[] = {1, 2, 33, 100, -5};
    337     WebRtc_Word16 B[] = {4, 12, 133, 110};
    338     WebRtc_Word16 b16[kVectorSize];
    339     WebRtc_Word16 bTmp16[kVectorSize];
    340     WebRtc_Word16 bTmp16Low[kVectorSize];
    341     WebRtc_Word16 bState[kVectorSize];
    342     WebRtc_Word16 bStateLow[kVectorSize];
    343 
    344     WebRtcSpl_ZerosArrayW16(bState, kVectorSize);
    345     WebRtcSpl_ZerosArrayW16(bStateLow, kVectorSize);
    346 
    347     for (int kk = 0; kk < kVectorSize; ++kk) {
    348         b16[kk] = A[kk];
    349     }
    350 
    351     // MA filters
    352     WebRtcSpl_FilterMAFastQ12(b16, bTmp16, B, kVectorSize, kVectorSize);
    353     for (int kk = 0; kk < kVectorSize; ++kk) {
    354         //EXPECT_EQ(aTmp16[kk], bTmp16[kk]);
    355     }
    356     // AR filters
    357     WebRtcSpl_FilterARFastQ12(b16, bTmp16, A, kVectorSize, kVectorSize);
    358     for (int kk = 0; kk < kVectorSize; ++kk) {
    359 //        EXPECT_EQ(aTmp16[kk], bTmp16[kk]);
    360     }
    361     EXPECT_EQ(kVectorSize, WebRtcSpl_FilterAR(A5,
    362                                               5,
    363                                               b16,
    364                                               kVectorSize,
    365                                               bState,
    366                                               kVectorSize,
    367                                               bStateLow,
    368                                               kVectorSize,
    369                                               bTmp16,
    370                                               bTmp16Low,
    371                                               kVectorSize));
    372 }
    373 
    374 TEST_F(SplTest, RandTest) {
    375     const int kVectorSize = 4;
    376     WebRtc_Word16 BU[] = {3653, 12446, 8525, 30691};
    377     WebRtc_Word16 b16[kVectorSize];
    378     WebRtc_UWord32 bSeed = 100000;
    379 
    380     EXPECT_EQ(464449057u, WebRtcSpl_IncreaseSeed(&bSeed));
    381     EXPECT_EQ(31565, WebRtcSpl_RandU(&bSeed));
    382     EXPECT_EQ(-9786, WebRtcSpl_RandN(&bSeed));
    383     EXPECT_EQ(kVectorSize, WebRtcSpl_RandUArray(b16, kVectorSize, &bSeed));
    384     for (int kk = 0; kk < kVectorSize; ++kk) {
    385         EXPECT_EQ(BU[kk], b16[kk]);
    386     }
    387 }
    388 
    389 TEST_F(SplTest, SignalProcessingTest) {
    390     const int kVectorSize = 4;
    391     int A[] = {1, 2, 33, 100};
    392     WebRtc_Word16 b16[kVectorSize];
    393     WebRtc_Word32 b32[kVectorSize];
    394 
    395     WebRtc_Word16 bTmp16[kVectorSize];
    396     WebRtc_Word32 bTmp32[kVectorSize];
    397 
    398     int bScale = 0;
    399 
    400     for (int kk = 0; kk < kVectorSize; ++kk) {
    401         b16[kk] = A[kk];
    402         b32[kk] = A[kk];
    403     }
    404 
    405     EXPECT_EQ(2, WebRtcSpl_AutoCorrelation(b16, kVectorSize, 1, bTmp32, &bScale));
    406     WebRtcSpl_ReflCoefToLpc(b16, kVectorSize, bTmp16);
    407 //    for (int kk = 0; kk < kVectorSize; ++kk) {
    408 //        EXPECT_EQ(aTmp16[kk], bTmp16[kk]);
    409 //    }
    410     WebRtcSpl_LpcToReflCoef(bTmp16, kVectorSize, b16);
    411 //    for (int kk = 0; kk < kVectorSize; ++kk) {
    412 //        EXPECT_EQ(a16[kk], b16[kk]);
    413 //    }
    414     WebRtcSpl_AutoCorrToReflCoef(b32, kVectorSize, bTmp16);
    415 //    for (int kk = 0; kk < kVectorSize; ++kk) {
    416 //        EXPECT_EQ(aTmp16[kk], bTmp16[kk]);
    417 //    }
    418     WebRtcSpl_GetHanningWindow(bTmp16, kVectorSize);
    419 //    for (int kk = 0; kk < kVectorSize; ++kk) {
    420 //        EXPECT_EQ(aTmp16[kk], bTmp16[kk]);
    421 //    }
    422 
    423     for (int kk = 0; kk < kVectorSize; ++kk) {
    424         b16[kk] = A[kk];
    425     }
    426     EXPECT_EQ(11094 , WebRtcSpl_Energy(b16, kVectorSize, &bScale));
    427     EXPECT_EQ(0, bScale);
    428 }
    429 
    430 TEST_F(SplTest, FFTTest) {
    431     WebRtc_Word16 B[] = {1, 2, 33, 100,
    432             2, 3, 34, 101,
    433             3, 4, 35, 102,
    434             4, 5, 36, 103};
    435 
    436     EXPECT_EQ(0, WebRtcSpl_ComplexFFT(B, 3, 1));
    437 //    for (int kk = 0; kk < 16; ++kk) {
    438 //        EXPECT_EQ(A[kk], B[kk]);
    439 //    }
    440     EXPECT_EQ(0, WebRtcSpl_ComplexIFFT(B, 3, 1));
    441 //    for (int kk = 0; kk < 16; ++kk) {
    442 //        EXPECT_EQ(A[kk], B[kk]);
    443 //    }
    444     WebRtcSpl_ComplexBitReverse(B, 3);
    445     for (int kk = 0; kk < 16; ++kk) {
    446         //EXPECT_EQ(A[kk], B[kk]);
    447     }
    448 }
    449