aboutsummaryrefslogtreecommitdiffstats
path: root/libtoolame-dab/utils.h
blob: 7d98ab6aabcbe19e778ee89f86e90691b5e75b38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef _UTILS_H_
#define _UTILS_H_

#include <math.h>
#include <stdint.h>

#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))

#define NUMOF(l) (sizeof(l) / sizeof(*l))

#define linear_to_dB(x) (log10(x) * 20)

/* Calculate the little string containing a bargraph
 * 'VU-meter' from the peak value measured
 */
const char* level(int channel, int* peak);

#endif