SonarcAudioSample.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2005 The Pentagram team
00003 
00004 This program is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU General Public License
00006 as published by the Free Software Foundation; either version 2
00007 of the License, or (at your option) any later version.
00008 
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
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

Generated on Fri Jul 27 22:27:40 2007 for pentagram by  doxygen 1.4.7