blob: 9a01a1e85258e923dcbf9e5c66ac4d484a8d36c2 [file] [log] [blame]
Philipp Maierfe976982017-03-16 14:50:25 +01001/*
2 * Conversion
3 * Copyright (C) 2012, 2013 Thomas Tsou <tom@tsou.cc>
4 *
Pau Espin Pedrol21d03d32019-07-22 12:05:52 +02005 * SPDX-License-Identifier: LGPL-2.1+
6 *
Philipp Maierfe976982017-03-16 14:50:25 +01007 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
Philipp Maierfe976982017-03-16 14:50:25 +010016 */
17
18#include "convert.h"
19
20void base_convert_float_short(short *out, const float *in,
21 float scale, int len)
22{
23 for (int i = 0; i < len; i++)
24 out[i] = in[i] * scale;
25}
26
27void base_convert_short_float(float *out, const short *in, int len)
28{
29 for (int i = 0; i < len; i++)
30 out[i] = in[i];
31}