00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef SONARCAUDIOSAMPLE_H_INCLUDED
00019 #define SONARCAUDIOSAMPLE_H_INCLUDED
00020
00021 #include "AudioSample.h"
00022
00023 namespace Pentagram {
00024
00025 class SonarcAudioSample : public AudioSample
00026 {
00027 struct SonarcDecompData {
00028 uint32 pos;
00029 uint32 sample_pos;
00030 };
00031
00032 static bool GeneratedOneTable;
00033 static int OneTable[256];
00034
00035 static void GenerateOneTable();
00036
00037 static void decode_EC(int mode, int samplecount,
00038 const uint8* source, int sourcesize,
00039 uint8* dest);
00040 static void decode_LPC(int order, int nsamples,
00041 uint8* dest, const uint8* factors);
00042 static int audio_decode(const uint8* source, uint8* dest);
00043
00044 uint32 src_offset;
00045
00046 public:
00047 SonarcAudioSample(uint8 *buffer_, uint32 size_);
00048 virtual ~SonarcAudioSample(void);
00049
00050 virtual void initDecompressor(void *DecompData) const;
00051 virtual uint32 decompressFrame(void *DecompData, void *samples) const;
00052 virtual void rewind(void *DecompData) const;
00053 };
00054
00055 };
00056
00057 #endif