Philipp Maier | fe97698 | 2017-03-16 14:50:25 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Conversion |
| 3 | * Copyright (C) 2012, 2013 Thomas Tsou <tom@tsou.cc> |
| 4 | * |
Pau Espin Pedrol | 21d03d3 | 2019-07-22 12:05:52 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: LGPL-2.1+ |
| 6 | * |
Philipp Maier | fe97698 | 2017-03-16 14:50:25 +0100 | [diff] [blame] | 7 | * 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 Maier | fe97698 | 2017-03-16 14:50:25 +0100 | [diff] [blame] | 16 | */ |
| 17 | |
| 18 | #include "convert.h" |
| 19 | |
| 20 | void 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 | |
| 27 | void 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 | } |