Niotso  git revision 558726a9f13d7c3423a683dd2f4323589b66c310
The New Implementation of The Sims Online
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
read_utk.h
Go to the documentation of this file.
1 /*
2  FileHandler - General-purpose file handling library for Niotso
3  read_utk.h - Copyright (c) 2011-2012 Niotso Project <http://niotso.org/>
4  Author(s): Fatbag <X-Fi6@phppoll.org>
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 
19 typedef struct
20 {
21  char sID[4];
22  uint32_t dwOutSize;
23  uint32_t dwWfxSize;
24  /* WAVEFORMATEX */
25  uint16_t wFormatTag;
26  uint16_t nChannels;
27  uint32_t nSamplesPerSec;
28  uint32_t nAvgBytesPerSec;
29  uint16_t nBlockAlign;
30  uint16_t wBitsPerSample;
31  uint32_t cbSize;
32 
33  unsigned Frames;
34  unsigned UTKDataSize;
35 } utkheader_t;
36 
37 typedef struct {
38  const uint8_t *InData, *InDataEnd;
39  unsigned UnreadBitsValue, UnreadBitsCount;
41  unsigned VoicedThreshold;
42  float InnovationPower[64];
43  float RC[12];
44  float History[12];
45  float Delay[324];
46  float DecompressedFrame[432];
47  float WhatIsThis[432];
48 } utkcontext_t;
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 int utk_read_header(utkheader_t * UTKHeader, const uint8_t * Buffer, size_t FileSize);
55 int utk_decode(const uint8_t *__restrict InBuffer, uint8_t *__restrict OutBuffer, size_t InSize, size_t Samples);
56 
57 #ifdef __cplusplus
58 }
59 #endif