00001 // AudioDecoderNellymoser.h: Nellymoser decoding 00002 // 00003 // Copyright (C) 2007, 2008 Free Software Foundation, Inc. 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program; if not, write to the Free Software 00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 00019 // $Id: AudioDecoderNellymoser_8h-source.html,v 1.1 2008/03/07 02:36:16 bjacques Exp $ 00020 00021 // This file incorporates work covered by the following copyright and permission 00022 // notice: 00023 00024 /* 00025 * Copyright (c) 2007 a840bda5870ba11f19698ff6eb9581dfb0f95fa5, 00026 * 539459aeb7d425140b62a3ec7dbf6dc8e408a306, and 00027 * 520e17cd55896441042b14df2566a6eb610ed444 00028 * 00029 * Permission is hereby granted, free of charge, to any person obtaining a 00030 * copy of this software and associated documentation files (the "Software"), 00031 * to deal in the Software without restriction, including without limitation 00032 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00033 * and/or sell copies of the Software, and to permit persons to whom the 00034 * Software is furnished to do so, subject to the following conditions: 00035 * 00036 * The above copyright notice and this permission notice shall be included in 00037 * all copies or substantial portions of the Software. 00038 * 00039 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00040 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00041 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00042 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00043 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00044 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 00045 * DEALINGS IN THE SOFTWARE. 00046 */ 00047 00048 #ifndef __AUDIODECODERNELLYMOSER_H__ 00049 #define __AUDIODECODERNELLYMOSER_H__ 00050 00051 #include "log.h" 00052 #include "AudioDecoder.h" 00053 00054 #define NELLY_BLOCK_LEN 64 00055 #define NELLY_HEADER_BITS 116 00056 #define NELLY_DETAIL_BITS 198 00057 #define NELLY_BUF_LEN 128 00058 #define NELLY_FILL_LEN 124 00059 #define NELLY_BIT_CAP 6 00060 #define NELLY_BASE_OFF 4228 00061 #define NELLY_BASE_SHIFT 19 00062 00063 00064 00065 typedef struct nelly_handle_struct { 00066 float state[64]; 00067 } nelly_handle; 00068 00069 namespace gnash { 00070 namespace media { 00071 00073 class AudioDecoderNellymoser : public AudioDecoder { 00074 00075 public: 00076 AudioDecoderNellymoser(); 00077 ~AudioDecoderNellymoser(); 00078 00079 bool setup(AudioInfo* info); 00080 bool setup(SoundInfo* info); 00081 00082 boost::uint8_t* decode(boost::uint8_t* input, boost::uint32_t inputSize, boost::uint32_t& outputSize, boost::uint32_t& decodedBytes, bool parse); 00083 00085 float* decode(boost::uint8_t* in_buf, boost::uint32_t inputSize, boost::uint32_t* outputSize); 00086 00087 private: 00088 00089 // The handle used by the decoder 00090 nelly_handle* _nh; 00091 00092 // samplerate 00093 boost::uint16_t _sampleRate; 00094 00095 // stereo 00096 bool _stereo; 00097 }; 00098 00099 } // gnash.media namespace 00100 } // gnash namespace 00101 00102 #endif // __AUDIODECODERNELLYMOSER_H__ 00103
1.5.4