webrtc_m130/webrtc/common_audio/real_fourier_openmax.cc
kjellander 56cf60e717 Revert of Add check_deps rules in DEPS files. (patchset #2 id:60001 of https://codereview.webrtc.org/1796413002/ )
Reason for revert:
The openmax_dl include change breaks downstream projects.

Original issue's description:
> Add check_deps rules in DEPS files.
>
> Add fine-grained check_deps rules for all of WebRTC.
> This will help both maintaining sane dependencies and provides a way
> to visualize dependency graphs using the buildtools/checkdeps/graphdeps.py script.
>
> Example:
> buildtools/checkdeps/graphdeps.py --root=. --format=png \
> --out=./webrtc.png --incl='^webrtc/modules/bitrate_controller->' \
> --excl='chromium|base|external|testing|webrtc/test|\.h$|\.cc$'
>
> will produce a neat webrtc.png image showcasing the dependencies
> (according to the DEPS file) for the bitrate_controller module.
> Some dependencies are filtered out for readability.
>
> BUG=webrtc:5623
> TESTED=Passing runs using:
> buildtools/checkdeps/checkdeps.py --root=. talk
> buildtools/checkdeps/checkdeps.py --root=. webrtc
>
> R=tommi@webrtc.org
>
> Committed: https://crrev.com/086f851b7b9b4bcbd4fe507c3bf83b760bd7f4d9
> Cr-Commit-Position: refs/heads/master@{#12008}

TBR=tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5623

Review URL: https://codereview.webrtc.org/1808573002

Cr-Commit-Position: refs/heads/master@{#12009}
2016-03-16 00:41:04 +00:00

70 lines
2.0 KiB
C++

/*
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "webrtc/common_audio/real_fourier_openmax.h"
#include <cstdlib>
#include "dl/sp/api/omxSP.h"
#include "webrtc/base/checks.h"
namespace webrtc {
using std::complex;
namespace {
// Creates and initializes the Openmax state. Transfers ownership to caller.
OMXFFTSpec_R_F32* CreateOpenmaxState(int order) {
RTC_CHECK_GE(order, 1);
// The omx implementation uses this macro to check order validity.
RTC_CHECK_LE(order, TWIDDLE_TABLE_ORDER);
OMX_INT buffer_size;
OMXResult r = omxSP_FFTGetBufSize_R_F32(order, &buffer_size);
RTC_CHECK_EQ(r, OMX_Sts_NoErr);
OMXFFTSpec_R_F32* omx_spec = malloc(buffer_size);
RTC_DCHECK(omx_spec);
r = omxSP_FFTInit_R_F32(omx_spec, order);
RTC_CHECK_EQ(r, OMX_Sts_NoErr);
return omx_spec;
}
} // namespace
RealFourierOpenmax::RealFourierOpenmax(int fft_order)
: order_(fft_order),
omx_spec_(CreateOpenmaxState(order_)) {
}
RealFourierOpenmax::~RealFourierOpenmax() {
free(omx_spec_);
}
void RealFourierOpenmax::Forward(const float* src, complex<float>* dest) const {
// This cast is well-defined since C++11. See "Non-static data members" at:
// http://en.cppreference.com/w/cpp/numeric/complex
OMXResult r =
omxSP_FFTFwd_RToCCS_F32(src, reinterpret_cast<OMX_F32*>(dest), omx_spec_);
RTC_CHECK_EQ(r, OMX_Sts_NoErr);
}
void RealFourierOpenmax::Inverse(const complex<float>* src, float* dest) const {
OMXResult r =
omxSP_FFTInv_CCSToR_F32(reinterpret_cast<const OMX_F32*>(src), dest,
omx_spec_);
RTC_CHECK_EQ(r, OMX_Sts_NoErr);
}
} // namespace webrtc