1 /* 2 * Copyright (C) 2004-2010 NXP Software 3 * Copyright (C) 2010 The Android Open Source Project 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 #ifndef _VECTOR_ARITHMETIC_H_ 19 #define _VECTOR_ARITHMETIC_H_ 20 21 #include "LVM_Types.h" 22 23 /********************************************************************************** 24 VARIOUS FUNCTIONS 25 ***********************************************************************************/ 26 27 void Copy_Float(const LVM_FLOAT* src, LVM_FLOAT* dst, LVM_INT16 n); 28 void Copy_Float_Mc_Stereo(const LVM_FLOAT* src, LVM_FLOAT* dst, LVM_INT16 NrFrames, 29 LVM_INT32 NrChannels); 30 void Copy_Float_Stereo_Mc(const LVM_FLOAT* src, const LVM_FLOAT* StereoOut, LVM_FLOAT* dst, 31 LVM_INT16 NrFrames, LVM_INT32 NrChannels); 32 33 void Mult3s_Float(const LVM_FLOAT* src, const LVM_FLOAT val, LVM_FLOAT* dst, LVM_INT16 n); 34 35 void DelayMix_Float(const LVM_FLOAT* src, /* Source 1, to be delayed */ 36 LVM_FLOAT* delay, /* Delay buffer */ 37 LVM_INT16 size, /* Delay size */ 38 LVM_FLOAT* dst, /* Source/destination */ 39 LVM_INT16* pOffset, /* Delay offset */ 40 LVM_INT16 n, /* Number of stereo samples */ 41 LVM_INT32 NrChannels); /* Number of channels */ 42 void Add2_Sat_Float(const LVM_FLOAT* src, LVM_FLOAT* dst, LVM_INT16 n); 43 void Mac3s_Sat_Float(const LVM_FLOAT* src, const LVM_FLOAT val, LVM_FLOAT* dst, LVM_INT16 n); 44 45 /********************************************************************************** 46 SHIFT FUNCTIONS 47 ***********************************************************************************/ 48 void Shift_Sat_Float(const LVM_INT16 val, const LVM_FLOAT* src, LVM_FLOAT* dst, LVM_INT16 n); 49 /********************************************************************************** 50 AUDIO FORMAT CONVERSION FUNCTIONS 51 ***********************************************************************************/ 52 void MonoTo2I_Float(const LVM_FLOAT* src, LVM_FLOAT* dst, LVM_INT16 n); 53 void From2iToMono_Float(const LVM_FLOAT* src, LVM_FLOAT* dst, LVM_INT16 n); 54 void FromMcToMono_Float(const LVM_FLOAT* src, LVM_FLOAT* dst, LVM_INT16 NrFrames, 55 LVM_INT16 NrChannels); 56 void MSTo2i_Sat_Float(const LVM_FLOAT* srcM, const LVM_FLOAT* srcS, LVM_FLOAT* dst, LVM_INT16 n); 57 void From2iToMS_Float(const LVM_FLOAT* src, LVM_FLOAT* dstM, LVM_FLOAT* dstS, LVM_INT16 n); 58 void JoinTo2i_Float(const LVM_FLOAT* srcL, const LVM_FLOAT* srcR, LVM_FLOAT* dst, LVM_INT16 n); 59 60 /**********************************************************************************/ 61 62 #endif /* _VECTOR_ARITHMETIC_H_ */ 63 64 /**********************************************************************************/ 65