CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/ext/at3_standalone/float_dsp.h
Views: 1401
/*1* This file is part of FFmpeg.2*3* FFmpeg is free software; you can redistribute it and/or4* modify it under the terms of the GNU Lesser General Public5* License as published by the Free Software Foundation; either6* version 2.1 of the License, or (at your option) any later version.7*8* FFmpeg is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU11* Lesser General Public License for more details.12*13* You should have received a copy of the GNU Lesser General Public14* License along with FFmpeg; if not, write to the Free Software15* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA16*/1718#pragma once1920#include "compat.h"2122inline void vector_fmul(float * av_restrict dst, const float * av_restrict src, int len) {23for (int i = 0; i < len; i++)24dst[i] = dst[i] * src[i];25}2627/**28* Multiply a vector of floats by a scalar float. Source and29* destination vectors must overlap exactly or not at all.30*/31inline void vector_fmul_scalar(float *dst, float mul, int len) {32for (int i = 0; i < len; i++)33dst[i] *= mul;34}3536/**37* Calculate the entry wise product of two vectors of floats, and store the result38* in a vector of floats. The second vector of floats is iterated over39* in reverse order.40*41* @param dst output and first input vector42* constraints: 32-byte aligned43* @param src second input vector44* constraints: 32-byte aligned45* @param len number of elements in the input46* constraints: multiple of 1647*/48inline void vector_fmul_reverse(float * av_restrict dst, const float * av_restrict src, int len) {49src += len - 1;50for (int i = 0; i < len; i++)51dst[i] *= src[-i];52}535455