562
|
1 #!/bin/sh
|
|
2
|
|
3 # A script to generate dnoise.c from a plain text file with the noise numbers.
|
|
4 # In future, the plain text file (or a binary version) may be used by mpg123 at runtime instead of compiling it in.
|
|
5
|
|
6 # copyright 2006-8 by the mpg123 project - free software under the terms of the LGPL 2.1
|
|
7 # initially written by Thomas Orgis
|
|
8
|
|
9 echo '/*
|
|
10 dnoise: Noise for dithered output.
|
|
11
|
|
12 copyright 2006-8 by the mpg123 project - free software under the terms of the LGPL 2.1
|
|
13 see COPYING and AUTHORS files in distribution or http://mpg123.org
|
|
14 initially written by (in assembler) Adrian Bacon
|
|
15 */
|
|
16
|
|
17 float dithernoise[65536] =
|
|
18 {'
|
|
19
|
|
20 # If sed is there, use it.
|
|
21 if echo -n | sed ''; then
|
|
22 sed -e 's/$/f,/' < "$1"
|
|
23 else
|
|
24 # Plain sh... very slow, but works.
|
|
25 while read i
|
|
26 do
|
|
27 echo "${i}f,"
|
|
28 done < "$1"
|
|
29 fi
|
|
30
|
|
31 echo '};';
|