예제 #1
0
void BiquadBase::setCoefficients (double a0, double a1, double a2,
                                  double b0, double b1, double b2)
{
    assert (!Dsp::is_nan (a0) && !Dsp::is_nan (a1) && !Dsp::is_nan (a2) &&
            !Dsp::is_nan (b0) && !Dsp::is_nan (b1) && !Dsp::is_nan (b2));

    m_a0 = a0;
    m_a1 = a1/a0;
    m_a2 = a2/a0;
    m_b0 = b0/a0;
    m_b1 = b1/a0;
    m_b2 = b2/a0;
#ifdef __SSE__
    m_va0 = _mm_set1_ps(m_a0);
    m_vb0 = _mm_set1_ps(m_b0);
    m_vab12 = _mm_set_ps(m_b2, m_b1, m_a2, m_a1);
#elif defined(__ARM_NEON__)
    m_va0 = vdup_n_f32(m_a0);
    m_vb0 = vdup_n_f32(m_b0);
    vsetq_lane_f32(m_a1, m_vab12, 0);
    vsetq_lane_f32(m_b1, m_vab12, 1);
    vsetq_lane_f32(m_a2, m_vab12, 2);
    vsetq_lane_f32(m_b2, m_vab12, 3);
#endif
}
float32x2_t f_sub_abs_to_vabd_32()
{
  float32x2_t val1 = vdup_n_f32 (10);
  float32x2_t val2 = vdup_n_f32 (30);
  float32x2_t sres = vsub_f32(val1, val2);
  float32x2_t res = vabs_f32 (sres);

  return res;
}
예제 #3
0
파일: base.hpp 프로젝트: AdLantis/opencv
inline int32x2_t cv_vrnd_s32_f32(float32x2_t v)
{
    static int32x2_t v_sign = vdup_n_s32(1 << 31),
        v_05 = vreinterpret_s32_f32(vdup_n_f32(0.5f));

    int32x2_t v_addition = vorr_s32(v_05, vand_s32(v_sign, vreinterpret_s32_f32(v)));
    return vcvt_s32_f32(vadd_f32(v, vreinterpret_f32_s32(v_addition)));
}
void processVirtualizerNeon(int16_t* buffer, uint32_t sizeInFrames) {
	effectsFramesBeforeRecoveringGain -= sizeInFrames;

	float32x2_t gainClip = vld1_f32(effectsGainClip);
	float32x2_t maxAbsSample = vdup_n_f32(0.0f);

	while ((sizeInFrames--)) {
		float *samples = equalizerSamples;

		effectsTemp[0] = (int32_t)buffer[0];
		effectsTemp[1] = (int32_t)buffer[1];
		//inLR = { L, R }
		float32x2_t inLR = vcvt_f32_s32(*((int32x2_t*)effectsTemp));

		virtualizerNeon();

		floatToShortNeon();
	}

	footerNeon();
}
예제 #5
0
float32x2_t test_vdup_n_f32(float32_t v1) {
  // CHECK: test_vdup_n_f32
  return vdup_n_f32(v1);
  // CHECK: dup {{v[0-9]+}}.2s, {{v[0-9]+}}.s[0]
}
예제 #6
0
파일: base.hpp 프로젝트: AdLantis/opencv
inline uint32x2_t cv_vrnd_u32_f32(float32x2_t v)
{
    static float32x2_t v_05 = vdup_n_f32(0.5f);
    return vcvt_u32_f32(vadd_f32(v, v_05));
}
예제 #7
0
inline float32x2_t vdup_n(const f32 & val) { return vdup_n_f32(val); }