aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/arch/common/convert_base.c
blob: 9a01a1e85258e923dcbf9e5c66ac4d484a8d36c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * Conversion
 * Copyright (C) 2012, 2013 Thomas Tsou <tom@tsou.cc>
 *
 * SPDX-License-Identifier: LGPL-2.1+
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 */

#include "convert.h"

void base_convert_float_short(short *out, const float *in,
			      float scale, int len)
{
	for (int i = 0; i < len; i++)
		out[i] = in[i] * scale;
}

void base_convert_short_float(float *out, const short *in, int len)
{
	for (int i = 0; i < len; i++)
		out[i] = in[i];
}