Home | History | Annotate | Download | only in support
      1 /*
      2  *  Copyright (c) 2013 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 "dl/sp/api/armSP.h"
     12 #include "dl/sp/api/omxSP.h"
     13 #include "dl/sp/src/test/test_util.h"
     14 #include "dl/sp/src/test/support/float_rfft_thresholds.h"
     15 
     16 static const char* message =
     17     "Test forward and inverse real floating-point FFT (Autodetect NEON)\n";
     18 
     19 extern int omxSP_HasArmNeon();
     20 
     21 const char* UsageMessage() {
     22   return message;
     23 }
     24 
     25 void FinishedMessage() {
     26   printf("Tests finished. (Detected %s).\n",
     27          omxSP_HasArmNeon() ? "NEON" : "Non-NEON");
     28 }
     29 
     30 void SetThresholds(struct TestInfo* info) {
     31   if (omxSP_HasArmNeon()) {
     32     info->forward_threshold_ = FLOAT_RFFT_FORWARD_THRESHOLD_NEON;
     33     info->inverse_threshold_ = FLOAT_RFFT_INVERSE_THRESHOLD_NEON;
     34   } else {
     35     info->forward_threshold_ = FLOAT_RFFT_FORWARD_THRESHOLD_ARMV7;
     36     info->inverse_threshold_ = FLOAT_RFFT_INVERSE_THRESHOLD_ARMV7;
     37   }
     38 }
     39 
     40 OMXResult ForwardRFFT(OMX_F32* x,
     41                       OMX_F32* y,
     42                       OMXFFTSpec_R_F32 *fft_fwd_spec) {
     43   return omxSP_FFTFwd_RToCCS_F32(x, y, fft_fwd_spec);
     44 }
     45 
     46 OMXResult InverseRFFT(OMX_F32* y,
     47                       OMX_F32* z,
     48                       OMXFFTSpec_R_F32 *fft_inv_spec) {
     49   return omxSP_FFTInv_CCSToR_F32(y, z, fft_inv_spec);
     50 }
     51