1c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org/* 2c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 3c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org * 4c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org * Use of this source code is governed by a BSD-style license 5c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org * that can be found in the LICENSE file in the root of the source 6c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org * tree. An additional intellectual property rights grant can be found 7c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org * in the file PATENTS. All contributing project authors may 8c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org * be found in the AUTHORS file in the root of the source tree. 9c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org */ 10c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 11c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org/* 12c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org * The core AEC algorithm, which is presented with time-aligned signals. 13c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org */ 14c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 15c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#include "webrtc/modules/audio_processing/aec/aec_core.h" 16c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 17c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#include <math.h> 18c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 19c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h" 20c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#include "webrtc/modules/audio_processing/aec/aec_core_internal.h" 21c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#include "webrtc/modules/audio_processing/aec/aec_rdft.h" 22c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 23c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.orgextern const float WebRtcAec_weightCurve[65]; 24c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.orgextern const float WebRtcAec_overDriveCurve[65]; 25c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 26c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.orgvoid WebRtcAec_ComfortNoise_mips(AecCore* aec, 27c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float efw[2][PART_LEN1], 2899b1a32146fcc63e52fd45484958d7c8c4cf0061peah float comfortNoiseHband[2][PART_LEN1], 29c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org const float* noisePow, 30c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org const float* lambda) { 31c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org int i, num; 32c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float rand[PART_LEN]; 33c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float noise, noiseAvg, tmp, tmpAvg; 34c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org int16_t randW16[PART_LEN]; 35c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org complex_t u[PART_LEN1]; 36c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 37c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org const float pi2 = 6.28318530717959f; 38c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org const float pi2t = pi2 / 32768; 39c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 40c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // Generate a uniform random array on [0 1] 41c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org WebRtcSpl_RandUArray(randW16, PART_LEN, &aec->seed); 42c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 4371d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org int16_t* randWptr = randW16; 44c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float randTemp, randTemp2, randTemp3, randTemp4; 4571d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org int32_t tmp1s, tmp2s, tmp3s, tmp4s; 46c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 47c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org for (i = 0; i < PART_LEN; i+=4) { 48c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org __asm __volatile ( 49c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set push \n\t" 50c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set noreorder \n\t" 51c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lh %[tmp1s], 0(%[randWptr]) \n\t" 52c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lh %[tmp2s], 2(%[randWptr]) \n\t" 53c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lh %[tmp3s], 4(%[randWptr]) \n\t" 54c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lh %[tmp4s], 6(%[randWptr]) \n\t" 55c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mtc1 %[tmp1s], %[randTemp] \n\t" 56c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mtc1 %[tmp2s], %[randTemp2] \n\t" 57c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mtc1 %[tmp3s], %[randTemp3] \n\t" 58c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mtc1 %[tmp4s], %[randTemp4] \n\t" 59c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "cvt.s.w %[randTemp], %[randTemp] \n\t" 60c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "cvt.s.w %[randTemp2], %[randTemp2] \n\t" 61c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "cvt.s.w %[randTemp3], %[randTemp3] \n\t" 62c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "cvt.s.w %[randTemp4], %[randTemp4] \n\t" 63c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[randWptr], %[randWptr], 8 \n\t" 64c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[randTemp], %[randTemp], %[pi2t] \n\t" 65c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[randTemp2], %[randTemp2], %[pi2t] \n\t" 66c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[randTemp3], %[randTemp3], %[pi2t] \n\t" 67c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[randTemp4], %[randTemp4], %[pi2t] \n\t" 68c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set pop \n\t" 69c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : [randWptr] "+r" (randWptr), [randTemp] "=&f" (randTemp), 70c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [randTemp2] "=&f" (randTemp2), [randTemp3] "=&f" (randTemp3), 71c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [randTemp4] "=&f" (randTemp4), [tmp1s] "=&r" (tmp1s), 72c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [tmp2s] "=&r" (tmp2s), [tmp3s] "=&r" (tmp3s), 73c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [tmp4s] "=&r" (tmp4s) 74c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : [pi2t] "f" (pi2t) 75c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : "memory" 76c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ); 77c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 7871d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org u[i+1][0] = cosf(randTemp); 7971d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org u[i+1][1] = sinf(randTemp); 8071d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org u[i+2][0] = cosf(randTemp2); 8171d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org u[i+2][1] = sinf(randTemp2); 8271d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org u[i+3][0] = cosf(randTemp3); 8371d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org u[i+3][1] = sinf(randTemp3); 8471d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org u[i+4][0] = cosf(randTemp4); 8571d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org u[i+4][1] = sinf(randTemp4); 86c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org } 87c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 88c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // Reject LF noise 8971d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org float* u_ptr = &u[1][0]; 90c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float noise2, noise3, noise4; 91c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float tmp1f, tmp2f, tmp3f, tmp4f, tmp5f, tmp6f, tmp7f, tmp8f; 92c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 93c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org u[0][0] = 0; 94c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org u[0][1] = 0; 95c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org for (i = 1; i < PART_LEN1; i+=4) { 96c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org __asm __volatile ( 97c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set push \n\t" 98c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set noreorder \n\t" 99c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[noise], 4(%[noisePow]) \n\t" 100c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[noise2], 8(%[noisePow]) \n\t" 101c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[noise3], 12(%[noisePow]) \n\t" 102c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[noise4], 16(%[noisePow]) \n\t" 103c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sqrt.s %[noise], %[noise] \n\t" 104c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sqrt.s %[noise2], %[noise2] \n\t" 105c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sqrt.s %[noise3], %[noise3] \n\t" 106c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sqrt.s %[noise4], %[noise4] \n\t" 107c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp1f], 0(%[u_ptr]) \n\t" 108c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp2f], 4(%[u_ptr]) \n\t" 109c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp3f], 8(%[u_ptr]) \n\t" 110c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp4f], 12(%[u_ptr]) \n\t" 111c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp5f], 16(%[u_ptr]) \n\t" 112c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp6f], 20(%[u_ptr]) \n\t" 113c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp7f], 24(%[u_ptr]) \n\t" 114c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp8f], 28(%[u_ptr]) \n\t" 115c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[noisePow], %[noisePow], 16 \n\t" 116c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp1f], %[tmp1f], %[noise] \n\t" 117c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp2f], %[tmp2f], %[noise] \n\t" 118c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp3f], %[tmp3f], %[noise2] \n\t" 119c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp4f], %[tmp4f], %[noise2] \n\t" 120c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp5f], %[tmp5f], %[noise3] \n\t" 121c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp6f], %[tmp6f], %[noise3] \n\t" 122c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[tmp1f], 0(%[u_ptr]) \n\t" 123c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[tmp3f], 8(%[u_ptr]) \n\t" 124c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp8f], %[tmp8f], %[noise4] \n\t" 125c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp7f], %[tmp7f], %[noise4] \n\t" 126c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "neg.s %[tmp2f] \n\t" 127c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "neg.s %[tmp4f] \n\t" 128c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "neg.s %[tmp6f] \n\t" 129c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "neg.s %[tmp8f] \n\t" 130c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[tmp5f], 16(%[u_ptr]) \n\t" 131c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[tmp7f], 24(%[u_ptr]) \n\t" 132c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[tmp2f], 4(%[u_ptr]) \n\t" 133c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[tmp4f], 12(%[u_ptr]) \n\t" 134c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[tmp6f], 20(%[u_ptr]) \n\t" 135c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[tmp8f], 28(%[u_ptr]) \n\t" 136c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[u_ptr], %[u_ptr], 32 \n\t" 137c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set pop \n\t" 138c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : [u_ptr] "+r" (u_ptr), [noisePow] "+r" (noisePow), 139c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [noise] "=&f" (noise), [noise2] "=&f" (noise2), 140c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [noise3] "=&f" (noise3), [noise4] "=&f" (noise4), 141c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [tmp1f] "=&f" (tmp1f), [tmp2f] "=&f" (tmp2f), 142c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [tmp3f] "=&f" (tmp3f), [tmp4f] "=&f" (tmp4f), 143c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [tmp5f] "=&f" (tmp5f), [tmp6f] "=&f" (tmp6f), 144c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [tmp7f] "=&f" (tmp7f), [tmp8f] "=&f" (tmp8f) 145c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : 146c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : "memory" 147c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ); 148c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org } 149c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org u[PART_LEN][1] = 0; 150c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org noisePow -= PART_LEN; 151c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 152c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org u_ptr = &u[0][0]; 15371d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org float* u_ptr_end = &u[PART_LEN][0]; 15471d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org float* efw_ptr_0 = &efw[0][0]; 15571d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org float* efw_ptr_1 = &efw[1][0]; 156c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float tmp9f, tmp10f; 157c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org const float tmp1c = 1.0; 158c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 159c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org __asm __volatile ( 160c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set push \n\t" 161c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set noreorder \n\t" 162c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "1: \n\t" 163c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp1f], 0(%[lambda]) \n\t" 164c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp6f], 4(%[lambda]) \n\t" 16571d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org "addiu %[lambda], %[lambda], 8 \n\t" 166c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "c.lt.s %[tmp1f], %[tmp1c] \n\t" 167c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "bc1f 4f \n\t" 168c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org " nop \n\t" 169c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "c.lt.s %[tmp6f], %[tmp1c] \n\t" 170c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "bc1f 3f \n\t" 171c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org " nop \n\t" 172c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "2: \n\t" 173c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp1f], %[tmp1f], %[tmp1f] \n\t" 174c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp6f], %[tmp6f], %[tmp6f] \n\t" 175c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sub.s %[tmp1f], %[tmp1c], %[tmp1f] \n\t" 176c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sub.s %[tmp6f], %[tmp1c], %[tmp6f] \n\t" 177c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sqrt.s %[tmp1f], %[tmp1f] \n\t" 178c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sqrt.s %[tmp6f], %[tmp6f] \n\t" 179c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp2f], 0(%[efw_ptr_0]) \n\t" 180c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp3f], 0(%[u_ptr]) \n\t" 181c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp7f], 4(%[efw_ptr_0]) \n\t" 182c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp8f], 8(%[u_ptr]) \n\t" 183c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp4f], 0(%[efw_ptr_1]) \n\t" 184c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp5f], 4(%[u_ptr]) \n\t" 185c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp9f], 4(%[efw_ptr_1]) \n\t" 186c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp10f], 12(%[u_ptr]) \n\t" 187c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#if !defined(MIPS32_R2_LE) 188c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp3f], %[tmp1f], %[tmp3f] \n\t" 189c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[tmp2f], %[tmp2f], %[tmp3f] \n\t" 190c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp3f], %[tmp1f], %[tmp5f] \n\t" 191c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[tmp4f], %[tmp4f], %[tmp3f] \n\t" 192c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp3f], %[tmp6f], %[tmp8f] \n\t" 193c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[tmp7f], %[tmp7f], %[tmp3f] \n\t" 194c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp3f], %[tmp6f], %[tmp10f] \n\t" 195c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[tmp9f], %[tmp9f], %[tmp3f] \n\t" 196c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#else // #if !defined(MIPS32_R2_LE) 197c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "madd.s %[tmp2f], %[tmp2f], %[tmp1f], %[tmp3f] \n\t" 198c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "madd.s %[tmp4f], %[tmp4f], %[tmp1f], %[tmp5f] \n\t" 199c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "madd.s %[tmp7f], %[tmp7f], %[tmp6f], %[tmp8f] \n\t" 200c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "madd.s %[tmp9f], %[tmp9f], %[tmp6f], %[tmp10f] \n\t" 201c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#endif // #if !defined(MIPS32_R2_LE) 202c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[tmp2f], 0(%[efw_ptr_0]) \n\t" 203c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[tmp4f], 0(%[efw_ptr_1]) \n\t" 204c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[tmp7f], 4(%[efw_ptr_0]) \n\t" 205c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "b 5f \n\t" 206c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org " swc1 %[tmp9f], 4(%[efw_ptr_1]) \n\t" 207c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "3: \n\t" 208c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp1f], %[tmp1f], %[tmp1f] \n\t" 209c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sub.s %[tmp1f], %[tmp1c], %[tmp1f] \n\t" 210c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sqrt.s %[tmp1f], %[tmp1f] \n\t" 211c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp2f], 0(%[efw_ptr_0]) \n\t" 212c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp3f], 0(%[u_ptr]) \n\t" 213c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp4f], 0(%[efw_ptr_1]) \n\t" 214c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp5f], 4(%[u_ptr]) \n\t" 215c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#if !defined(MIPS32_R2_LE) 216c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp3f], %[tmp1f], %[tmp3f] \n\t" 217c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[tmp2f], %[tmp2f], %[tmp3f] \n\t" 218c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp3f], %[tmp1f], %[tmp5f] \n\t" 219c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[tmp4f], %[tmp4f], %[tmp3f] \n\t" 220c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#else // #if !defined(MIPS32_R2_LE) 221c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "madd.s %[tmp2f], %[tmp2f], %[tmp1f], %[tmp3f] \n\t" 222c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "madd.s %[tmp4f], %[tmp4f], %[tmp1f], %[tmp5f] \n\t" 223c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#endif // #if !defined(MIPS32_R2_LE) 224c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[tmp2f], 0(%[efw_ptr_0]) \n\t" 225c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "b 5f \n\t" 226c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org " swc1 %[tmp4f], 0(%[efw_ptr_1]) \n\t" 227c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "4: \n\t" 228c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "c.lt.s %[tmp6f], %[tmp1c] \n\t" 229c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "bc1f 5f \n\t" 230c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org " nop \n\t" 231c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp6f], %[tmp6f], %[tmp6f] \n\t" 232c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sub.s %[tmp6f], %[tmp1c], %[tmp6f] \n\t" 233c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sqrt.s %[tmp6f], %[tmp6f] \n\t" 234c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp7f], 4(%[efw_ptr_0]) \n\t" 235c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp8f], 8(%[u_ptr]) \n\t" 236c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp9f], 4(%[efw_ptr_1]) \n\t" 237c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[tmp10f], 12(%[u_ptr]) \n\t" 238c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#if !defined(MIPS32_R2_LE) 239c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp3f], %[tmp6f], %[tmp8f] \n\t" 240c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[tmp7f], %[tmp7f], %[tmp3f] \n\t" 241c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[tmp3f], %[tmp6f], %[tmp10f] \n\t" 242c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[tmp9f], %[tmp9f], %[tmp3f] \n\t" 243c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#else // #if !defined(MIPS32_R2_LE) 244c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "madd.s %[tmp7f], %[tmp7f], %[tmp6f], %[tmp8f] \n\t" 245c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "madd.s %[tmp9f], %[tmp9f], %[tmp6f], %[tmp10f] \n\t" 246c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#endif // #if !defined(MIPS32_R2_LE) 247c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[tmp7f], 4(%[efw_ptr_0]) \n\t" 248c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[tmp9f], 4(%[efw_ptr_1]) \n\t" 249c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "5: \n\t" 250c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[u_ptr], %[u_ptr], 16 \n\t" 251c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[efw_ptr_0], %[efw_ptr_0], 8 \n\t" 252c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "bne %[u_ptr], %[u_ptr_end], 1b \n\t" 253c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org " addiu %[efw_ptr_1], %[efw_ptr_1], 8 \n\t" 254c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set pop \n\t" 255c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : [lambda] "+r" (lambda), [u_ptr] "+r" (u_ptr), 256c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [efw_ptr_0] "+r" (efw_ptr_0), [efw_ptr_1] "+r" (efw_ptr_1), 257c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [tmp1f] "=&f" (tmp1f), [tmp2f] "=&f" (tmp2f), [tmp3f] "=&f" (tmp3f), 258c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [tmp4f] "=&f" (tmp4f), [tmp5f] "=&f" (tmp5f), 259c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [tmp6f] "=&f" (tmp6f), [tmp7f] "=&f" (tmp7f), [tmp8f] "=&f" (tmp8f), 260c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [tmp9f] "=&f" (tmp9f), [tmp10f] "=&f" (tmp10f) 26171d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org : [tmp1c] "f" (tmp1c), [u_ptr_end] "r" (u_ptr_end) 262c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : "memory" 263c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ); 264c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 265c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org lambda -= PART_LEN; 266c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org tmp = sqrtf(WEBRTC_SPL_MAX(1 - lambda[PART_LEN] * lambda[PART_LEN], 0)); 267c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org //tmp = 1 - lambda[i]; 268c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org efw[0][PART_LEN] += tmp * u[PART_LEN][0]; 269c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org efw[1][PART_LEN] += tmp * u[PART_LEN][1]; 270c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 271c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // For H band comfort noise 272c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // TODO: don't compute noise and "tmp" twice. Use the previous results. 273c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org noiseAvg = 0.0; 274c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org tmpAvg = 0.0; 275c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org num = 0; 2760bc176b99b770f2fa3dd94d54553ab635df6930dpeah if (aec->num_bands > 1) { 277c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org for (i = 0; i < PART_LEN; i++) { 278c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org rand[i] = ((float)randW16[i]) / 32768; 279c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org } 280c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 281c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // average noise scale 282c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // average over second half of freq spectrum (i.e., 4->8khz) 283c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // TODO: we shouldn't need num. We know how many elements we're summing. 284c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org for (i = PART_LEN1 >> 1; i < PART_LEN1; i++) { 285c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org num++; 286c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org noiseAvg += sqrtf(noisePow[i]); 287c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org } 288c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org noiseAvg /= (float)num; 289c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 290c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // average nlp scale 291c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // average over second half of freq spectrum (i.e., 4->8khz) 292c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // TODO: we shouldn't need num. We know how many elements we're summing. 293c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org num = 0; 294c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org for (i = PART_LEN1 >> 1; i < PART_LEN1; i++) { 295c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org num++; 296c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org tmpAvg += sqrtf(WEBRTC_SPL_MAX(1 - lambda[i] * lambda[i], 0)); 297c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org } 298c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org tmpAvg /= (float)num; 299c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 300c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // Use average noise for H band 301c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // TODO: we should probably have a new random vector here. 302c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // Reject LF noise 303c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org u[0][0] = 0; 304c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org u[0][1] = 0; 305c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org for (i = 1; i < PART_LEN1; i++) { 306c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org tmp = pi2 * rand[i - 1]; 307c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 308c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // Use average noise for H band 309c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org u[i][0] = noiseAvg * (float)cos(tmp); 310c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org u[i][1] = -noiseAvg * (float)sin(tmp); 311c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org } 312c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org u[PART_LEN][1] = 0; 313c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 314c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org for (i = 0; i < PART_LEN1; i++) { 315c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // Use average NLP weight for H band 31699b1a32146fcc63e52fd45484958d7c8c4cf0061peah comfortNoiseHband[0][i] = tmpAvg * u[i][0]; 31799b1a32146fcc63e52fd45484958d7c8c4cf0061peah comfortNoiseHband[1][i] = tmpAvg * u[i][1]; 318c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org } 31999b1a32146fcc63e52fd45484958d7c8c4cf0061peah } else { 32099b1a32146fcc63e52fd45484958d7c8c4cf0061peah memset(comfortNoiseHband, 0, 32199b1a32146fcc63e52fd45484958d7c8c4cf0061peah 2 * PART_LEN1 * sizeof(comfortNoiseHband[0][0])); 322c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org } 323c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org} 324c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 32554eb5e2e9ae91e9ad6dcb297de7b918ebe706d5fpeahvoid WebRtcAec_FilterFar_mips( 32654eb5e2e9ae91e9ad6dcb297de7b918ebe706d5fpeah int num_partitions, 3277e43138c0890bd99f627fa061b122c8d5716a99dpeah int x_fft_buf_block_pos, 3287e43138c0890bd99f627fa061b122c8d5716a99dpeah float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1], 3297e43138c0890bd99f627fa061b122c8d5716a99dpeah float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1], 3307e43138c0890bd99f627fa061b122c8d5716a99dpeah float y_fft[2][PART_LEN1]) { 331c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org int i; 33254eb5e2e9ae91e9ad6dcb297de7b918ebe706d5fpeah for (i = 0; i < num_partitions; i++) { 3337e43138c0890bd99f627fa061b122c8d5716a99dpeah int xPos = (i + x_fft_buf_block_pos) * PART_LEN1; 334c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org int pos = i * PART_LEN1; 335c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // Check for wrap 3367e43138c0890bd99f627fa061b122c8d5716a99dpeah if (i + x_fft_buf_block_pos >= num_partitions) { 33754eb5e2e9ae91e9ad6dcb297de7b918ebe706d5fpeah xPos -= num_partitions * (PART_LEN1); 338c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org } 3397e43138c0890bd99f627fa061b122c8d5716a99dpeah float* yf0 = y_fft[0]; 3407e43138c0890bd99f627fa061b122c8d5716a99dpeah float* yf1 = y_fft[1]; 3417e43138c0890bd99f627fa061b122c8d5716a99dpeah float* aRe = x_fft_buf[0] + xPos; 3427e43138c0890bd99f627fa061b122c8d5716a99dpeah float* aIm = x_fft_buf[1] + xPos; 3437e43138c0890bd99f627fa061b122c8d5716a99dpeah float* bRe = h_fft_buf[0] + pos; 3447e43138c0890bd99f627fa061b122c8d5716a99dpeah float* bIm = h_fft_buf[1] + pos; 345c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13; 346c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org int len = PART_LEN1 >> 1; 347c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 348c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org __asm __volatile ( 349c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set push \n\t" 350c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set noreorder \n\t" 351c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "1: \n\t" 352c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f0], 0(%[aRe]) \n\t" 353c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f1], 0(%[bRe]) \n\t" 354c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f2], 0(%[bIm]) \n\t" 355c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f3], 0(%[aIm]) \n\t" 356c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f4], 4(%[aRe]) \n\t" 357c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f5], 4(%[bRe]) \n\t" 358c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f6], 4(%[bIm]) \n\t" 359c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f8], %[f0], %[f1] \n\t" 360c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f0], %[f0], %[f2] \n\t" 361c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f9], %[f4], %[f5] \n\t" 362c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f4], %[f4], %[f6] \n\t" 363c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f7], 4(%[aIm]) \n\t" 364c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#if !defined(MIPS32_R2_LE) 365c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f12], %[f2], %[f3] \n\t" 366c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f1], %[f3], %[f1] \n\t" 367c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f11], %[f6], %[f7] \n\t" 368c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[aRe], %[aRe], 8 \n\t" 369c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[aIm], %[aIm], 8 \n\t" 370c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[len], %[len], -1 \n\t" 371c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sub.s %[f8], %[f8], %[f12] \n\t" 372c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f12], %[f7], %[f5] \n\t" 373c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f2], 0(%[yf0]) \n\t" 374c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f1], %[f0], %[f1] \n\t" 375c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f3], 0(%[yf1]) \n\t" 376c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sub.s %[f9], %[f9], %[f11] \n\t" 377c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f6], 4(%[yf0]) \n\t" 378c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f4], %[f4], %[f12] \n\t" 379c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#else // #if !defined(MIPS32_R2_LE) 380c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[aRe], %[aRe], 8 \n\t" 381c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[aIm], %[aIm], 8 \n\t" 382c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[len], %[len], -1 \n\t" 383c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "nmsub.s %[f8], %[f8], %[f2], %[f3] \n\t" 384c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f2], 0(%[yf0]) \n\t" 385c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "madd.s %[f1], %[f0], %[f3], %[f1] \n\t" 386c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f3], 0(%[yf1]) \n\t" 387c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "nmsub.s %[f9], %[f9], %[f6], %[f7] \n\t" 388c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f6], 4(%[yf0]) \n\t" 389c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "madd.s %[f4], %[f4], %[f7], %[f5] \n\t" 390c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#endif // #if !defined(MIPS32_R2_LE) 391c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f5], 4(%[yf1]) \n\t" 392c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f2], %[f2], %[f8] \n\t" 393c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[bRe], %[bRe], 8 \n\t" 394c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[bIm], %[bIm], 8 \n\t" 395c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f3], %[f3], %[f1] \n\t" 396c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f6], %[f6], %[f9] \n\t" 397c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f5], %[f5], %[f4] \n\t" 398c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f2], 0(%[yf0]) \n\t" 399c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f3], 0(%[yf1]) \n\t" 400c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f6], 4(%[yf0]) \n\t" 401c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f5], 4(%[yf1]) \n\t" 402c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[yf0], %[yf0], 8 \n\t" 403c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "bgtz %[len], 1b \n\t" 404c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org " addiu %[yf1], %[yf1], 8 \n\t" 405c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f0], 0(%[aRe]) \n\t" 406c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f1], 0(%[bRe]) \n\t" 407c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f2], 0(%[bIm]) \n\t" 408c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f3], 0(%[aIm]) \n\t" 409c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f8], %[f0], %[f1] \n\t" 410c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f0], %[f0], %[f2] \n\t" 411c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#if !defined(MIPS32_R2_LE) 412c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f12], %[f2], %[f3] \n\t" 413c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f1], %[f3], %[f1] \n\t" 414c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sub.s %[f8], %[f8], %[f12] \n\t" 415c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f2], 0(%[yf0]) \n\t" 416c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f1], %[f0], %[f1] \n\t" 417c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f3], 0(%[yf1]) \n\t" 418c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#else // #if !defined(MIPS32_R2_LE) 419c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "nmsub.s %[f8], %[f8], %[f2], %[f3] \n\t" 420c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f2], 0(%[yf0]) \n\t" 421c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "madd.s %[f1], %[f0], %[f3], %[f1] \n\t" 422c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f3], 0(%[yf1]) \n\t" 423c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#endif // #if !defined(MIPS32_R2_LE) 424c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f2], %[f2], %[f8] \n\t" 425c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f3], %[f3], %[f1] \n\t" 426c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f2], 0(%[yf0]) \n\t" 427c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f3], 0(%[yf1]) \n\t" 428c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set pop \n\t" 429c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : [f0] "=&f" (f0), [f1] "=&f" (f1), [f2] "=&f" (f2), 430c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [f3] "=&f" (f3), [f4] "=&f" (f4), [f5] "=&f" (f5), 431c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [f6] "=&f" (f6), [f7] "=&f" (f7), [f8] "=&f" (f8), 432c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [f9] "=&f" (f9), [f10] "=&f" (f10), [f11] "=&f" (f11), 433c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [f12] "=&f" (f12), [f13] "=&f" (f13), [aRe] "+r" (aRe), 434c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [aIm] "+r" (aIm), [bRe] "+r" (bRe), [bIm] "+r" (bIm), 435c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [yf0] "+r" (yf0), [yf1] "+r" (yf1), [len] "+r" (len) 43671d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org : 437c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : "memory" 438c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ); 439c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org } 440c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org} 441c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 4427e43138c0890bd99f627fa061b122c8d5716a99dpeahvoid WebRtcAec_FilterAdaptation_mips( 4437e43138c0890bd99f627fa061b122c8d5716a99dpeah int num_partitions, 4447e43138c0890bd99f627fa061b122c8d5716a99dpeah int x_fft_buf_block_pos, 4457e43138c0890bd99f627fa061b122c8d5716a99dpeah float x_fft_buf[2][kExtendedNumPartitions * PART_LEN1], 4467e43138c0890bd99f627fa061b122c8d5716a99dpeah float e_fft[2][PART_LEN1], 4477e43138c0890bd99f627fa061b122c8d5716a99dpeah float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1]) { 4487e43138c0890bd99f627fa061b122c8d5716a99dpeah float fft[PART_LEN2]; 449c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org int i; 4507e43138c0890bd99f627fa061b122c8d5716a99dpeah for (i = 0; i < num_partitions; i++) { 4517e43138c0890bd99f627fa061b122c8d5716a99dpeah int xPos = (i + x_fft_buf_block_pos)*(PART_LEN1); 452c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org int pos; 453c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // Check for wrap 4547e43138c0890bd99f627fa061b122c8d5716a99dpeah if (i + x_fft_buf_block_pos >= num_partitions) { 4557e43138c0890bd99f627fa061b122c8d5716a99dpeah xPos -= num_partitions * PART_LEN1; 456c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org } 457c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 458c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org pos = i * PART_LEN1; 4597e43138c0890bd99f627fa061b122c8d5716a99dpeah float* aRe = x_fft_buf[0] + xPos; 4607e43138c0890bd99f627fa061b122c8d5716a99dpeah float* aIm = x_fft_buf[1] + xPos; 4617e43138c0890bd99f627fa061b122c8d5716a99dpeah float* bRe = e_fft[0]; 4627e43138c0890bd99f627fa061b122c8d5716a99dpeah float* bIm = e_fft[1]; 46371d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org float* fft_tmp; 464c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 465c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float f0, f1, f2, f3, f4, f5, f6 ,f7, f8, f9, f10, f11, f12; 466c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org int len = PART_LEN >> 1; 467c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 468c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org __asm __volatile ( 469c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set push \n\t" 470c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set noreorder \n\t" 47171d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org "addiu %[fft_tmp], %[fft], 0 \n\t" 472c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "1: \n\t" 473c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f0], 0(%[aRe]) \n\t" 474c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f1], 0(%[bRe]) \n\t" 475c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f2], 0(%[bIm]) \n\t" 476c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f4], 4(%[aRe]) \n\t" 477c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f5], 4(%[bRe]) \n\t" 478c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f6], 4(%[bIm]) \n\t" 479c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[aRe], %[aRe], 8 \n\t" 480c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[bRe], %[bRe], 8 \n\t" 481c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f8], %[f0], %[f1] \n\t" 482c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f0], %[f0], %[f2] \n\t" 483c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f3], 0(%[aIm]) \n\t" 484c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f9], %[f4], %[f5] \n\t" 485c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f7], 4(%[aIm]) \n\t" 486c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f4], %[f4], %[f6] \n\t" 487c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#if !defined(MIPS32_R2_LE) 488c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f10], %[f3], %[f2] \n\t" 489c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f1], %[f3], %[f1] \n\t" 490c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f11], %[f7], %[f6] \n\t" 491c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f5], %[f7], %[f5] \n\t" 492c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[aIm], %[aIm], 8 \n\t" 493c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[bIm], %[bIm], 8 \n\t" 494c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[len], %[len], -1 \n\t" 495c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f8], %[f8], %[f10] \n\t" 496c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sub.s %[f1], %[f0], %[f1] \n\t" 497c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f9], %[f9], %[f11] \n\t" 498c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sub.s %[f5], %[f4], %[f5] \n\t" 499c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#else // #if !defined(MIPS32_R2_LE) 500c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[aIm], %[aIm], 8 \n\t" 501c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[bIm], %[bIm], 8 \n\t" 502c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[len], %[len], -1 \n\t" 503c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "madd.s %[f8], %[f8], %[f3], %[f2] \n\t" 504c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "nmsub.s %[f1], %[f0], %[f3], %[f1] \n\t" 505c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "madd.s %[f9], %[f9], %[f7], %[f6] \n\t" 506c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "nmsub.s %[f5], %[f4], %[f7], %[f5] \n\t" 507c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#endif // #if !defined(MIPS32_R2_LE) 508c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f8], 0(%[fft_tmp]) \n\t" 509c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f1], 4(%[fft_tmp]) \n\t" 510c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f9], 8(%[fft_tmp]) \n\t" 511c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f5], 12(%[fft_tmp]) \n\t" 512c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "bgtz %[len], 1b \n\t" 513c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org " addiu %[fft_tmp], %[fft_tmp], 16 \n\t" 514c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f0], 0(%[aRe]) \n\t" 515c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f1], 0(%[bRe]) \n\t" 516c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f2], 0(%[bIm]) \n\t" 517c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f3], 0(%[aIm]) \n\t" 518c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f8], %[f0], %[f1] \n\t" 519c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#if !defined(MIPS32_R2_LE) 520c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f10], %[f3], %[f2] \n\t" 521c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f8], %[f8], %[f10] \n\t" 522c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#else // #if !defined(MIPS32_R2_LE) 523c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "madd.s %[f8], %[f8], %[f3], %[f2] \n\t" 524c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#endif // #if !defined(MIPS32_R2_LE) 525c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f8], 4(%[fft]) \n\t" 526c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set pop \n\t" 527c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : [f0] "=&f" (f0), [f1] "=&f" (f1), [f2] "=&f" (f2), 528c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [f3] "=&f" (f3), [f4] "=&f" (f4), [f5] "=&f" (f5), 529c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [f6] "=&f" (f6), [f7] "=&f" (f7), [f8] "=&f" (f8), 530c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [f9] "=&f" (f9), [f10] "=&f" (f10), [f11] "=&f" (f11), 531c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [f12] "=&f" (f12), [aRe] "+r" (aRe), [aIm] "+r" (aIm), 53271d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org [bRe] "+r" (bRe), [bIm] "+r" (bIm), [fft_tmp] "=&r" (fft_tmp), 53371d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org [len] "+r" (len) 53471d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org : [fft] "r" (fft) 535c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : "memory" 536c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ); 537c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 538c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org aec_rdft_inverse_128(fft); 539c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org memset(fft + PART_LEN, 0, sizeof(float) * PART_LEN); 540c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 541c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // fft scaling 542c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org { 543c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float scale = 2.0f / PART_LEN2; 544c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org __asm __volatile ( 545c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set push \n\t" 546c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set noreorder \n\t" 547c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[fft_tmp], %[fft], 0 \n\t" 548c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[len], $zero, 8 \n\t" 549c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "1: \n\t" 550c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[len], %[len], -1 \n\t" 551c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f0], 0(%[fft_tmp]) \n\t" 552c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f1], 4(%[fft_tmp]) \n\t" 553c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f2], 8(%[fft_tmp]) \n\t" 554c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f3], 12(%[fft_tmp]) \n\t" 555c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f0], %[f0], %[scale] \n\t" 556c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f1], %[f1], %[scale] \n\t" 557c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f2], %[f2], %[scale] \n\t" 558c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f3], %[f3], %[scale] \n\t" 559c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f4], 16(%[fft_tmp]) \n\t" 560c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f5], 20(%[fft_tmp]) \n\t" 561c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f6], 24(%[fft_tmp]) \n\t" 562c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f7], 28(%[fft_tmp]) \n\t" 563c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f4], %[f4], %[scale] \n\t" 564c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f5], %[f5], %[scale] \n\t" 565c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f6], %[f6], %[scale] \n\t" 566c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f7], %[f7], %[scale] \n\t" 567c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f0], 0(%[fft_tmp]) \n\t" 568c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f1], 4(%[fft_tmp]) \n\t" 569c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f2], 8(%[fft_tmp]) \n\t" 570c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f3], 12(%[fft_tmp]) \n\t" 571c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f4], 16(%[fft_tmp]) \n\t" 572c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f5], 20(%[fft_tmp]) \n\t" 573c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f6], 24(%[fft_tmp]) \n\t" 574c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f7], 28(%[fft_tmp]) \n\t" 575c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "bgtz %[len], 1b \n\t" 576c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org " addiu %[fft_tmp], %[fft_tmp], 32 \n\t" 577c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set pop \n\t" 578c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : [f0] "=&f" (f0), [f1] "=&f" (f1), [f2] "=&f" (f2), 579c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [f3] "=&f" (f3), [f4] "=&f" (f4), [f5] "=&f" (f5), 580c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [f6] "=&f" (f6), [f7] "=&f" (f7), [len] "=&r" (len), 581c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [fft_tmp] "=&r" (fft_tmp) 582c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : [scale] "f" (scale), [fft] "r" (fft) 583c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : "memory" 584c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ); 585c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org } 586c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org aec_rdft_forward_128(fft); 5877e43138c0890bd99f627fa061b122c8d5716a99dpeah aRe = h_fft_buf[0] + pos; 5887e43138c0890bd99f627fa061b122c8d5716a99dpeah aIm = h_fft_buf[1] + pos; 589c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org __asm __volatile ( 590c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set push \n\t" 591c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set noreorder \n\t" 592c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[fft_tmp], %[fft], 0 \n\t" 593c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[len], $zero, 31 \n\t" 594c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f0], 0(%[aRe]) \n\t" 595c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f1], 0(%[fft_tmp]) \n\t" 596c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f2], 256(%[aRe]) \n\t" 597c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f3], 4(%[fft_tmp]) \n\t" 598c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f4], 4(%[aRe]) \n\t" 599c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f5], 8(%[fft_tmp]) \n\t" 600c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f6], 4(%[aIm]) \n\t" 601c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f7], 12(%[fft_tmp]) \n\t" 602c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f0], %[f0], %[f1] \n\t" 603c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f2], %[f2], %[f3] \n\t" 604c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f4], %[f4], %[f5] \n\t" 605c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f6], %[f6], %[f7] \n\t" 606c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[fft_tmp], %[fft_tmp], 16 \n\t" 607c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f0], 0(%[aRe]) \n\t" 608c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f2], 256(%[aRe]) \n\t" 609c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f4], 4(%[aRe]) \n\t" 610c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[aRe], %[aRe], 8 \n\t" 611c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f6], 4(%[aIm]) \n\t" 612c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[aIm], %[aIm], 8 \n\t" 613c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "1: \n\t" 614c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f0], 0(%[aRe]) \n\t" 615c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f1], 0(%[fft_tmp]) \n\t" 616c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f2], 0(%[aIm]) \n\t" 617c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f3], 4(%[fft_tmp]) \n\t" 618c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f4], 4(%[aRe]) \n\t" 619c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f5], 8(%[fft_tmp]) \n\t" 620c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f6], 4(%[aIm]) \n\t" 621c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f7], 12(%[fft_tmp]) \n\t" 622c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f0], %[f0], %[f1] \n\t" 623c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f2], %[f2], %[f3] \n\t" 624c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f4], %[f4], %[f5] \n\t" 625c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f6], %[f6], %[f7] \n\t" 626c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[len], %[len], -1 \n\t" 627c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[fft_tmp], %[fft_tmp], 16 \n\t" 628c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f0], 0(%[aRe]) \n\t" 629c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f2], 0(%[aIm]) \n\t" 630c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f4], 4(%[aRe]) \n\t" 631c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[aRe], %[aRe], 8 \n\t" 632c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f6], 4(%[aIm]) \n\t" 633c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "bgtz %[len], 1b \n\t" 634c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org " addiu %[aIm], %[aIm], 8 \n\t" 635c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set pop \n\t" 636c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : [f0] "=&f" (f0), [f1] "=&f" (f1), [f2] "=&f" (f2), 637c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [f3] "=&f" (f3), [f4] "=&f" (f4), [f5] "=&f" (f5), 638c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [f6] "=&f" (f6), [f7] "=&f" (f7), [len] "=&r" (len), 63971d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org [fft_tmp] "=&r" (fft_tmp), [aRe] "+r" (aRe), [aIm] "+r" (aIm) 64071d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org : [fft] "r" (fft) 641c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : "memory" 642c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ); 643c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org } 644c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org} 645c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 64671d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.orgvoid WebRtcAec_OverdriveAndSuppress_mips(AecCore* aec, 647c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float hNl[PART_LEN1], 648c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org const float hNlFb, 649c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float efw[2][PART_LEN1]) { 650c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org int i; 651c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org const float one = 1.0; 65271d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org float* p_hNl; 65371d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org float* p_efw0; 65471d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org float* p_efw1; 65571d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org float* p_WebRtcAec_wC; 656c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float temp1, temp2, temp3, temp4; 657c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 658c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org p_hNl = &hNl[0]; 659c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org p_efw0 = &efw[0][0]; 660c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org p_efw1 = &efw[1][0]; 661c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org p_WebRtcAec_wC = (float*)&WebRtcAec_weightCurve[0]; 662c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 663c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org for (i = 0; i < PART_LEN1; i++) { 664c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org // Weight subbands 665c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org __asm __volatile ( 666c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set push \n\t" 667c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set noreorder \n\t" 668c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[temp1], 0(%[p_hNl]) \n\t" 669c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[temp2], 0(%[p_wC]) \n\t" 670c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "c.lt.s %[hNlFb], %[temp1] \n\t" 671c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "bc1f 1f \n\t" 672c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org " mul.s %[temp3], %[temp2], %[hNlFb] \n\t" 673c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sub.s %[temp4], %[one], %[temp2] \n\t" 674c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#if !defined(MIPS32_R2_LE) 675c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[temp1], %[temp1], %[temp4] \n\t" 676c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[temp1], %[temp3], %[temp1] \n\t" 677c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#else // #if !defined(MIPS32_R2_LE) 678c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "madd.s %[temp1], %[temp3], %[temp1], %[temp4] \n\t" 679c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#endif // #if !defined(MIPS32_R2_LE) 680c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[temp1], 0(%[p_hNl]) \n\t" 681c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "1: \n\t" 682c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[p_wC], %[p_wC], 4 \n\t" 683c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set pop \n\t" 684c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : [temp1] "=&f" (temp1), [temp2] "=&f" (temp2), [temp3] "=&f" (temp3), 685c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [temp4] "=&f" (temp4), [p_wC] "+r" (p_WebRtcAec_wC) 686c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : [hNlFb] "f" (hNlFb), [one] "f" (one), [p_hNl] "r" (p_hNl) 687c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : "memory" 688c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ); 689c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 690c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org hNl[i] = powf(hNl[i], aec->overDriveSm * WebRtcAec_overDriveCurve[i]); 691c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 692c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org __asm __volatile ( 693c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[temp1], 0(%[p_hNl]) \n\t" 694c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[temp3], 0(%[p_efw1]) \n\t" 695c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[temp2], 0(%[p_efw0]) \n\t" 696c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[p_hNl], %[p_hNl], 4 \n\t" 697c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[temp3], %[temp3], %[temp1] \n\t" 698c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[temp2], %[temp2], %[temp1] \n\t" 699c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[p_efw0], %[p_efw0], 4 \n\t" 700c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[p_efw1], %[p_efw1], 4 \n\t" 701c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "neg.s %[temp4], %[temp3] \n\t" 702c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[temp2], -4(%[p_efw0]) \n\t" 703c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[temp4], -4(%[p_efw1]) \n\t" 704c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : [temp1] "=&f" (temp1), [temp2] "=&f" (temp2), [temp3] "=&f" (temp3), 705c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [temp4] "=&f" (temp4), [p_efw0] "+r" (p_efw0), [p_efw1] "+r" (p_efw1), 706c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [p_hNl] "+r" (p_hNl) 707c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : 708c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : "memory" 709c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ); 710c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org } 711c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org} 712c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 713d860523112263f9c8f29b95658c89215fbd95a16peahvoid WebRtcAec_ScaleErrorSignal_mips(int extended_filter_enabled, 714d860523112263f9c8f29b95658c89215fbd95a16peah float normal_mu, 715d860523112263f9c8f29b95658c89215fbd95a16peah float normal_error_threshold, 7167e43138c0890bd99f627fa061b122c8d5716a99dpeah float x_pow[PART_LEN1], 717d860523112263f9c8f29b95658c89215fbd95a16peah float ef[2][PART_LEN1]) { 718d860523112263f9c8f29b95658c89215fbd95a16peah const float mu = extended_filter_enabled ? kExtendedMu : normal_mu; 719d860523112263f9c8f29b95658c89215fbd95a16peah const float error_threshold = extended_filter_enabled 720c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ? kExtendedErrorThreshold 721d860523112263f9c8f29b95658c89215fbd95a16peah : normal_error_threshold; 722c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org int len = (PART_LEN1); 72371d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org float* ef0 = ef[0]; 72471d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.org float* ef1 = ef[1]; 725c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float fac1 = 1e-10f; 726c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float err_th2 = error_threshold * error_threshold; 727c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float f0, f1, f2; 728c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#if !defined(MIPS32_R2_LE) 729c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org float f3; 730c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#endif 731c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 732c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org __asm __volatile ( 733c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set push \n\t" 734c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set noreorder \n\t" 735c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "1: \n\t" 73654eb5e2e9ae91e9ad6dcb297de7b918ebe706d5fpeah "lwc1 %[f0], 0(%[x_pow]) \n\t" 737c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f1], 0(%[ef0]) \n\t" 738c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "lwc1 %[f2], 0(%[ef1]) \n\t" 739c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f0], %[f0], %[fac1] \n\t" 740c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "div.s %[f1], %[f1], %[f0] \n\t" 741c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "div.s %[f2], %[f2], %[f0] \n\t" 742c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f0], %[f1], %[f1] \n\t" 743c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#if defined(MIPS32_R2_LE) 744c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "madd.s %[f0], %[f0], %[f2], %[f2] \n\t" 745c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#else 746c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f3], %[f2], %[f2] \n\t" 747c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f0], %[f0], %[f3] \n\t" 748c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#endif 749c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "c.le.s %[f0], %[err_th2] \n\t" 750c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "nop \n\t" 751c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "bc1t 2f \n\t" 752c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org " nop \n\t" 753c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "sqrt.s %[f0], %[f0] \n\t" 754c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "add.s %[f0], %[f0], %[fac1] \n\t" 755c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "div.s %[f0], %[err_th], %[f0] \n\t" 756c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f1], %[f1], %[f0] \n\t" 757c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f2], %[f2], %[f0] \n\t" 758c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "2: \n\t" 759c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f1], %[f1], %[mu] \n\t" 760c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "mul.s %[f2], %[f2], %[mu] \n\t" 761c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f1], 0(%[ef0]) \n\t" 762c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "swc1 %[f2], 0(%[ef1]) \n\t" 763c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[len], %[len], -1 \n\t" 76454eb5e2e9ae91e9ad6dcb297de7b918ebe706d5fpeah "addiu %[x_pow], %[x_pow], 4 \n\t" 765c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "addiu %[ef0], %[ef0], 4 \n\t" 766c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org "bgtz %[len], 1b \n\t" 767c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org " addiu %[ef1], %[ef1], 4 \n\t" 768c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ".set pop \n\t" 769c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : [f0] "=&f" (f0), [f1] "=&f" (f1), [f2] "=&f" (f2), 770c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#if !defined(MIPS32_R2_LE) 771c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [f3] "=&f" (f3), 772c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org#endif 773d860523112263f9c8f29b95658c89215fbd95a16peah [x_pow] "+r" (x_pow), [ef0] "+r" (ef0), [ef1] "+r" (ef1), 774c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [len] "+r" (len) 775c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : [fac1] "f" (fac1), [err_th2] "f" (err_th2), [mu] "f" (mu), 776c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org [err_th] "f" (error_threshold) 777c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org : "memory" 778c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org ); 779c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org} 780c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org 78171d9572e9c7a28b9045644f4e418673b9f49c04fandrew@webrtc.orgvoid WebRtcAec_InitAec_mips(void) { 782c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org WebRtcAec_FilterFar = WebRtcAec_FilterFar_mips; 783c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org WebRtcAec_FilterAdaptation = WebRtcAec_FilterAdaptation_mips; 784c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org WebRtcAec_ScaleErrorSignal = WebRtcAec_ScaleErrorSignal_mips; 785c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org WebRtcAec_ComfortNoise = WebRtcAec_ComfortNoise_mips; 786c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org WebRtcAec_OverdriveAndSuppress = WebRtcAec_OverdriveAndSuppress_mips; 787c0907eff42079cb53c4ee28cb47a8e495ab06b37andrew@webrtc.org} 788