1333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com/* 2333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 3333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com * 4333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com * Use of this source code is governed by a BSD-style license 5333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com * that can be found in the LICENSE file in the root of the source 6333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com * tree. An additional intellectual property rights grant can be found 7333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com * in the file PATENTS. All contributing project authors may 8333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com * be found in the AUTHORS file in the root of the source tree. 9333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com * 10333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com */ 11333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com 12333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com#include "dl/api/omxtypes.h" 13333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com#include "dl/sp/api/mipsSP.h" 14333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com#include "dl/sp/api/omxSP.h" 15333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com 16333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.comOMXResult omxSP_FFTGetBufSize_R_F32(OMX_INT order, OMX_INT* pSize) { 17333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com OMX_INT fft_size; 18333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com 19333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com if (!pSize || (order < 1) || (order > TWIDDLE_TABLE_ORDER)) 20333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com return OMX_Sts_BadArgErr; 21333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com 22333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com /* For order larger than 4, compute Real FFT as Complex FFT of (order - 1). */ 23333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com if (order > 4) 24333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com fft_size = 1 << (order - 1); 25333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com else 26333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com fft_size = 1 << order; 27333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com 28333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com *pSize = sizeof(MIPSFFTSpec_R_FC32) + 29333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com /* BitRev Table. */ 30333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com sizeof(OMX_U16) * fft_size + 31333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com /* BitRevInv Table. */ 32333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com sizeof(OMX_U16) * fft_size + 33333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com /* Offsets table. */ 34333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com sizeof(OMX_U16) * 35333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com ((SUBTRANSFORM_CONST >> (16 - TWIDDLE_TABLE_ORDER)) | 1) + 36333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com /* pBuf. */ 37333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com sizeof(OMX_F32) * (fft_size << 1) + 38333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com /* 39333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com * Extra bytes to get 32 byte alignment of 40333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com * pBitRev, pBitRevInv, pOffset and pBuf. 41333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com */ 42333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com 124; 43333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com 44333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com return OMX_Sts_NoErr; 45333c00b74820c9dc0022d124c5a10a788d74d5cartoy@google.com} 46