//////////////////////////////////////////////////////////////////////////// // **** WAVPACK **** // // Hybrid Lossless Wavefile Compressor // // Copyright (c) 1998 - 2004 Conifer Software. // // All Rights Reserved. // // Distributed under the BSD Software License (see license.txt) // //////////////////////////////////////////////////////////////////////////// // float.c #include "wavpack.h" int read_float_info (WavpackStream *wps, WavpackMetadata *wpmd) { int bytecnt = wpmd->byte_length; char *byteptr = wpmd->data; if (bytecnt != 4) return FALSE; wps->float_flags = *byteptr++; wps->float_shift = *byteptr++; wps->float_max_exp = *byteptr++; wps->float_norm_exp = *byteptr; return TRUE; } /* This function converts WavPack floating point data into standard Rockbox * 28-bit integers. It is assumed that clipping will be taken care of later. */ void float_values (WavpackStream *wps, int32_t *values, int32_t num_values) { int shift = wps->float_max_exp - wps->float_norm_exp + wps->float_shift + 5; if (shift > 32) shift = 32; else if (shift < -32) shift = -32; if (shift > 0) while (num_values--) *values++ <<= shift; else if (shift < 0) while (num_values--) *values++ >>= -shift; } ox/log/apps/codecs/kss.c'>logtreecommitdiff
path: root/apps/codecs/kss.c
blob: 92efcd4e5f906f8087909d8f896ff9f1eb01bc40 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111