Removed DecMPA and FAAD2, since they are no longer needed.
This commit is contained in:
parent
0d249ce0ff
commit
03faafa971
234 changed files with 0 additions and 93377 deletions
|
@ -1,499 +0,0 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 42;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
|
||||
8EBDF1A409F28836004F2528 /* decmpa.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1A309F28836004F2528 /* decmpa.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
8EBDF1FB09F2884B004F2528 /* DecMPA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1A509F2884A004F2528 /* DecMPA.cpp */; };
|
||||
8EBDF1FC09F2884B004F2528 /* DecMPAFileAccess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1A609F2884A004F2528 /* DecMPAFileAccess.cpp */; };
|
||||
8EBDF1FD09F2884B004F2528 /* DecMPAFileAccess.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1A709F2884A004F2528 /* DecMPAFileAccess.h */; };
|
||||
8EBDF1FE09F2884B004F2528 /* DecodeEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1A809F2884A004F2528 /* DecodeEngine.h */; };
|
||||
8EBDF1FF09F2884B004F2528 /* DefInc.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1A909F2884A004F2528 /* DefInc.h */; };
|
||||
8EBDF20009F2884B004F2528 /* audioFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1AB09F2884A004F2528 /* audioFrame.cpp */; };
|
||||
8EBDF20109F2884B004F2528 /* audioFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1AC09F2884A004F2528 /* audioFrame.h */; };
|
||||
8EBDF20209F2884B004F2528 /* floatFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1AD09F2884A004F2528 /* floatFrame.cpp */; };
|
||||
8EBDF20309F2884B004F2528 /* floatFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1AE09F2884A004F2528 /* floatFrame.h */; };
|
||||
8EBDF20409F2884B004F2528 /* frame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1AF09F2884A004F2528 /* frame.cpp */; };
|
||||
8EBDF20509F2884B004F2528 /* frame.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1B009F2884A004F2528 /* frame.h */; };
|
||||
8EBDF20609F2884B004F2528 /* pcmFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1B109F2884A004F2528 /* pcmFrame.cpp */; };
|
||||
8EBDF20709F2884B004F2528 /* pcmFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1B209F2884A004F2528 /* pcmFrame.h */; };
|
||||
8EBDF20809F2884B004F2528 /* rawDataBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1B309F2884A004F2528 /* rawDataBuffer.cpp */; };
|
||||
8EBDF20909F2884B004F2528 /* rawDataBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1B409F2884A004F2528 /* rawDataBuffer.h */; };
|
||||
8EBDF20A09F2884B004F2528 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1B609F2884A004F2528 /* common.c */; };
|
||||
8EBDF20B09F2884B004F2528 /* common.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1B709F2884A004F2528 /* common.h */; };
|
||||
8EBDF20C09F2884B004F2528 /* dct64_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1B809F2884A004F2528 /* dct64_i386.c */; };
|
||||
8EBDF20D09F2884B004F2528 /* dct64_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1B909F2884A004F2528 /* dct64_i386.h */; };
|
||||
8EBDF20E09F2884B004F2528 /* decode_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1BA09F2884A004F2528 /* decode_i386.c */; };
|
||||
8EBDF20F09F2884B004F2528 /* decode_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1BB09F2884A004F2528 /* decode_i386.h */; };
|
||||
8EBDF21009F2884B004F2528 /* DecodeEngine_Hip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1BC09F2884A004F2528 /* DecodeEngine_Hip.cpp */; };
|
||||
8EBDF21109F2884B004F2528 /* HIPDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1BD09F2884A004F2528 /* HIPDefines.h */; };
|
||||
8EBDF21209F2884B004F2528 /* huffman.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1BE09F2884A004F2528 /* huffman.h */; };
|
||||
8EBDF21309F2884B004F2528 /* interface.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1BF09F2884A004F2528 /* interface.c */; };
|
||||
8EBDF21409F2884B004F2528 /* interface.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1C009F2884A004F2528 /* interface.h */; };
|
||||
8EBDF21509F2884B004F2528 /* l2tables.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1C109F2884A004F2528 /* l2tables.h */; };
|
||||
8EBDF21609F2884B004F2528 /* layer1.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1C209F2884A004F2528 /* layer1.c */; };
|
||||
8EBDF21709F2884B004F2528 /* layer1.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1C309F2884A004F2528 /* layer1.h */; };
|
||||
8EBDF21809F2884B004F2528 /* layer2.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1C409F2884A004F2528 /* layer2.c */; };
|
||||
8EBDF21909F2884B004F2528 /* layer2.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1C509F2884A004F2528 /* layer2.h */; };
|
||||
8EBDF21A09F2884B004F2528 /* layer3.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1C609F2884A004F2528 /* layer3.c */; };
|
||||
8EBDF21B09F2884B004F2528 /* layer3.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1C709F2884A004F2528 /* layer3.h */; };
|
||||
8EBDF21C09F2884B004F2528 /* mpg123.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1C809F2884A004F2528 /* mpg123.h */; };
|
||||
8EBDF21D09F2884B004F2528 /* mpglib.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1C909F2884A004F2528 /* mpglib.h */; };
|
||||
8EBDF21E09F2884B004F2528 /* tabinit.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1CA09F2884A004F2528 /* tabinit.c */; };
|
||||
8EBDF21F09F2884B004F2528 /* tabinit.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1CB09F2884A004F2528 /* tabinit.h */; };
|
||||
8EBDF22009F2884B004F2528 /* VbrTag.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1CC09F2884A004F2528 /* VbrTag.c */; };
|
||||
8EBDF22109F2884B004F2528 /* VbrTag.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1CD09F2884A004F2528 /* VbrTag.h */; };
|
||||
8EBDF22209F2884B004F2528 /* IFileAccess.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1CE09F2884B004F2528 /* IFileAccess.h */; };
|
||||
8EBDF22309F2884B004F2528 /* MemBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1CF09F2884B004F2528 /* MemBuffer.h */; };
|
||||
8EBDF22409F2884B004F2528 /* MPADecoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1D009F2884B004F2528 /* MPADecoder.cpp */; };
|
||||
8EBDF22509F2884B004F2528 /* MPADecoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1D109F2884B004F2528 /* MPADecoder.h */; };
|
||||
8EBDF22609F2884B004F2528 /* MPAFrameFinder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1D209F2884B004F2528 /* MPAFrameFinder.cpp */; };
|
||||
8EBDF22709F2884B004F2528 /* MPAFrameFinder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1D309F2884B004F2528 /* MPAFrameFinder.h */; };
|
||||
8EBDF22809F2884B004F2528 /* MPAInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1D409F2884B004F2528 /* MPAInfo.cpp */; };
|
||||
8EBDF22909F2884B004F2528 /* MPAInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1D509F2884B004F2528 /* MPAInfo.h */; };
|
||||
8EBDF22A09F2884B004F2528 /* dxHead.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1D709F2884B004F2528 /* dxHead.cpp */; };
|
||||
8EBDF22B09F2884B004F2528 /* dxHead.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1D809F2884B004F2528 /* dxHead.h */; };
|
||||
8EBDF22C09F2884B004F2528 /* mpegAudioHeader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF1D909F2884B004F2528 /* mpegAudioHeader.cpp */; };
|
||||
8EBDF22D09F2884B004F2528 /* mpegAudioHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF1DA09F2884B004F2528 /* mpegAudioHeader.h */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
8DC2EF5B0486A6940098B216 /* DecMPA.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DecMPA.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8EBDF1A309F28836004F2528 /* decmpa.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = decmpa.h; path = Files/include/decmpa.h; sourceTree = "<group>"; };
|
||||
8EBDF1A509F2884A004F2528 /* DecMPA.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = DecMPA.cpp; path = Files/src/DecMPA.cpp; sourceTree = "<group>"; };
|
||||
8EBDF1A609F2884A004F2528 /* DecMPAFileAccess.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = DecMPAFileAccess.cpp; path = Files/src/DecMPAFileAccess.cpp; sourceTree = "<group>"; };
|
||||
8EBDF1A709F2884A004F2528 /* DecMPAFileAccess.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DecMPAFileAccess.h; path = Files/src/DecMPAFileAccess.h; sourceTree = "<group>"; };
|
||||
8EBDF1A809F2884A004F2528 /* DecodeEngine.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DecodeEngine.h; path = Files/src/DecodeEngine.h; sourceTree = "<group>"; };
|
||||
8EBDF1A909F2884A004F2528 /* DefInc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DefInc.h; path = Files/src/DefInc.h; sourceTree = "<group>"; };
|
||||
8EBDF1AB09F2884A004F2528 /* audioFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = audioFrame.cpp; sourceTree = "<group>"; };
|
||||
8EBDF1AC09F2884A004F2528 /* audioFrame.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = audioFrame.h; sourceTree = "<group>"; };
|
||||
8EBDF1AD09F2884A004F2528 /* floatFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = floatFrame.cpp; sourceTree = "<group>"; };
|
||||
8EBDF1AE09F2884A004F2528 /* floatFrame.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = floatFrame.h; sourceTree = "<group>"; };
|
||||
8EBDF1AF09F2884A004F2528 /* frame.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = frame.cpp; sourceTree = "<group>"; };
|
||||
8EBDF1B009F2884A004F2528 /* frame.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = frame.h; sourceTree = "<group>"; };
|
||||
8EBDF1B109F2884A004F2528 /* pcmFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = pcmFrame.cpp; sourceTree = "<group>"; };
|
||||
8EBDF1B209F2884A004F2528 /* pcmFrame.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = pcmFrame.h; sourceTree = "<group>"; };
|
||||
8EBDF1B309F2884A004F2528 /* rawDataBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = rawDataBuffer.cpp; sourceTree = "<group>"; };
|
||||
8EBDF1B409F2884A004F2528 /* rawDataBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = rawDataBuffer.h; sourceTree = "<group>"; };
|
||||
8EBDF1B609F2884A004F2528 /* common.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = common.c; sourceTree = "<group>"; };
|
||||
8EBDF1B709F2884A004F2528 /* common.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = "<group>"; };
|
||||
8EBDF1B809F2884A004F2528 /* dct64_i386.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = dct64_i386.c; sourceTree = "<group>"; };
|
||||
8EBDF1B909F2884A004F2528 /* dct64_i386.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dct64_i386.h; sourceTree = "<group>"; };
|
||||
8EBDF1BA09F2884A004F2528 /* decode_i386.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = decode_i386.c; sourceTree = "<group>"; };
|
||||
8EBDF1BB09F2884A004F2528 /* decode_i386.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = decode_i386.h; sourceTree = "<group>"; };
|
||||
8EBDF1BC09F2884A004F2528 /* DecodeEngine_Hip.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DecodeEngine_Hip.cpp; sourceTree = "<group>"; };
|
||||
8EBDF1BD09F2884A004F2528 /* HIPDefines.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HIPDefines.h; sourceTree = "<group>"; };
|
||||
8EBDF1BE09F2884A004F2528 /* huffman.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = huffman.h; sourceTree = "<group>"; };
|
||||
8EBDF1BF09F2884A004F2528 /* interface.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = interface.c; sourceTree = "<group>"; };
|
||||
8EBDF1C009F2884A004F2528 /* interface.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = interface.h; sourceTree = "<group>"; };
|
||||
8EBDF1C109F2884A004F2528 /* l2tables.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = l2tables.h; sourceTree = "<group>"; };
|
||||
8EBDF1C209F2884A004F2528 /* layer1.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = layer1.c; sourceTree = "<group>"; };
|
||||
8EBDF1C309F2884A004F2528 /* layer1.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = layer1.h; sourceTree = "<group>"; };
|
||||
8EBDF1C409F2884A004F2528 /* layer2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = layer2.c; sourceTree = "<group>"; };
|
||||
8EBDF1C509F2884A004F2528 /* layer2.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = layer2.h; sourceTree = "<group>"; };
|
||||
8EBDF1C609F2884A004F2528 /* layer3.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = layer3.c; sourceTree = "<group>"; };
|
||||
8EBDF1C709F2884A004F2528 /* layer3.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = layer3.h; sourceTree = "<group>"; };
|
||||
8EBDF1C809F2884A004F2528 /* mpg123.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mpg123.h; sourceTree = "<group>"; };
|
||||
8EBDF1C909F2884A004F2528 /* mpglib.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mpglib.h; sourceTree = "<group>"; };
|
||||
8EBDF1CA09F2884A004F2528 /* tabinit.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = tabinit.c; sourceTree = "<group>"; };
|
||||
8EBDF1CB09F2884A004F2528 /* tabinit.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = tabinit.h; sourceTree = "<group>"; };
|
||||
8EBDF1CC09F2884A004F2528 /* VbrTag.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = VbrTag.c; sourceTree = "<group>"; };
|
||||
8EBDF1CD09F2884A004F2528 /* VbrTag.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VbrTag.h; sourceTree = "<group>"; };
|
||||
8EBDF1CE09F2884B004F2528 /* IFileAccess.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = IFileAccess.h; path = Files/src/IFileAccess.h; sourceTree = "<group>"; };
|
||||
8EBDF1CF09F2884B004F2528 /* MemBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MemBuffer.h; path = Files/src/MemBuffer.h; sourceTree = "<group>"; };
|
||||
8EBDF1D009F2884B004F2528 /* MPADecoder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MPADecoder.cpp; path = Files/src/MPADecoder.cpp; sourceTree = "<group>"; };
|
||||
8EBDF1D109F2884B004F2528 /* MPADecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MPADecoder.h; path = Files/src/MPADecoder.h; sourceTree = "<group>"; };
|
||||
8EBDF1D209F2884B004F2528 /* MPAFrameFinder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MPAFrameFinder.cpp; path = Files/src/MPAFrameFinder.cpp; sourceTree = "<group>"; };
|
||||
8EBDF1D309F2884B004F2528 /* MPAFrameFinder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MPAFrameFinder.h; path = Files/src/MPAFrameFinder.h; sourceTree = "<group>"; };
|
||||
8EBDF1D409F2884B004F2528 /* MPAInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MPAInfo.cpp; path = Files/src/MPAInfo.cpp; sourceTree = "<group>"; };
|
||||
8EBDF1D509F2884B004F2528 /* MPAInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MPAInfo.h; path = Files/src/MPAInfo.h; sourceTree = "<group>"; };
|
||||
8EBDF1D709F2884B004F2528 /* dxHead.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dxHead.cpp; sourceTree = "<group>"; };
|
||||
8EBDF1D809F2884B004F2528 /* dxHead.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dxHead.h; sourceTree = "<group>"; };
|
||||
8EBDF1D909F2884B004F2528 /* mpegAudioHeader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = mpegAudioHeader.cpp; sourceTree = "<group>"; };
|
||||
8EBDF1DA09F2884B004F2528 /* mpegAudioHeader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mpegAudioHeader.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
8DC2EF560486A6940098B216 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
034768DFFF38A50411DB9C8B /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8DC2EF5B0486A6940098B216 /* DecMPA.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0867D691FE84028FC02AAC07 /* DecMPA */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EBDF1A109F2881A004F2528 /* Headers */,
|
||||
8EBDF1A209F2881F004F2528 /* Source */,
|
||||
089C1665FE841158C02AAC07 /* Resources */,
|
||||
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
|
||||
034768DFFF38A50411DB9C8B /* Products */,
|
||||
);
|
||||
name = DecMPA;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */,
|
||||
1058C7B2FEA5585E11CA2CBB /* Other Frameworks */,
|
||||
);
|
||||
name = "External Frameworks and Libraries";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
089C1665FE841158C02AAC07 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8DC2EF5A0486A6940098B216 /* Info.plist */,
|
||||
089C1666FE841158C02AAC07 /* InfoPlist.strings */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = "Linked Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7B2FEA5585E11CA2CBB /* Other Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EBDF1A109F2881A004F2528 /* Headers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EBDF1A309F28836004F2528 /* decmpa.h */,
|
||||
);
|
||||
name = Headers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EBDF1A209F2881F004F2528 /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EBDF1A509F2884A004F2528 /* DecMPA.cpp */,
|
||||
8EBDF1A609F2884A004F2528 /* DecMPAFileAccess.cpp */,
|
||||
8EBDF1A709F2884A004F2528 /* DecMPAFileAccess.h */,
|
||||
8EBDF1A809F2884A004F2528 /* DecodeEngine.h */,
|
||||
8EBDF1A909F2884A004F2528 /* DefInc.h */,
|
||||
8EBDF1AA09F2884A004F2528 /* frame */,
|
||||
8EBDF1B509F2884A004F2528 /* hip */,
|
||||
8EBDF1CE09F2884B004F2528 /* IFileAccess.h */,
|
||||
8EBDF1CF09F2884B004F2528 /* MemBuffer.h */,
|
||||
8EBDF1D009F2884B004F2528 /* MPADecoder.cpp */,
|
||||
8EBDF1D109F2884B004F2528 /* MPADecoder.h */,
|
||||
8EBDF1D209F2884B004F2528 /* MPAFrameFinder.cpp */,
|
||||
8EBDF1D309F2884B004F2528 /* MPAFrameFinder.h */,
|
||||
8EBDF1D409F2884B004F2528 /* MPAInfo.cpp */,
|
||||
8EBDF1D509F2884B004F2528 /* MPAInfo.h */,
|
||||
8EBDF1D609F2884B004F2528 /* mpegAudioFrame */,
|
||||
);
|
||||
name = Source;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EBDF1AA09F2884A004F2528 /* frame */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EBDF1AB09F2884A004F2528 /* audioFrame.cpp */,
|
||||
8EBDF1AC09F2884A004F2528 /* audioFrame.h */,
|
||||
8EBDF1AD09F2884A004F2528 /* floatFrame.cpp */,
|
||||
8EBDF1AE09F2884A004F2528 /* floatFrame.h */,
|
||||
8EBDF1AF09F2884A004F2528 /* frame.cpp */,
|
||||
8EBDF1B009F2884A004F2528 /* frame.h */,
|
||||
8EBDF1B109F2884A004F2528 /* pcmFrame.cpp */,
|
||||
8EBDF1B209F2884A004F2528 /* pcmFrame.h */,
|
||||
8EBDF1B309F2884A004F2528 /* rawDataBuffer.cpp */,
|
||||
8EBDF1B409F2884A004F2528 /* rawDataBuffer.h */,
|
||||
);
|
||||
name = frame;
|
||||
path = Files/src/frame;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EBDF1B509F2884A004F2528 /* hip */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EBDF1B609F2884A004F2528 /* common.c */,
|
||||
8EBDF1B709F2884A004F2528 /* common.h */,
|
||||
8EBDF1B809F2884A004F2528 /* dct64_i386.c */,
|
||||
8EBDF1B909F2884A004F2528 /* dct64_i386.h */,
|
||||
8EBDF1BA09F2884A004F2528 /* decode_i386.c */,
|
||||
8EBDF1BB09F2884A004F2528 /* decode_i386.h */,
|
||||
8EBDF1BC09F2884A004F2528 /* DecodeEngine_Hip.cpp */,
|
||||
8EBDF1BD09F2884A004F2528 /* HIPDefines.h */,
|
||||
8EBDF1BE09F2884A004F2528 /* huffman.h */,
|
||||
8EBDF1BF09F2884A004F2528 /* interface.c */,
|
||||
8EBDF1C009F2884A004F2528 /* interface.h */,
|
||||
8EBDF1C109F2884A004F2528 /* l2tables.h */,
|
||||
8EBDF1C209F2884A004F2528 /* layer1.c */,
|
||||
8EBDF1C309F2884A004F2528 /* layer1.h */,
|
||||
8EBDF1C409F2884A004F2528 /* layer2.c */,
|
||||
8EBDF1C509F2884A004F2528 /* layer2.h */,
|
||||
8EBDF1C609F2884A004F2528 /* layer3.c */,
|
||||
8EBDF1C709F2884A004F2528 /* layer3.h */,
|
||||
8EBDF1C809F2884A004F2528 /* mpg123.h */,
|
||||
8EBDF1C909F2884A004F2528 /* mpglib.h */,
|
||||
8EBDF1CA09F2884A004F2528 /* tabinit.c */,
|
||||
8EBDF1CB09F2884A004F2528 /* tabinit.h */,
|
||||
8EBDF1CC09F2884A004F2528 /* VbrTag.c */,
|
||||
8EBDF1CD09F2884A004F2528 /* VbrTag.h */,
|
||||
);
|
||||
name = hip;
|
||||
path = Files/src/hip;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EBDF1D609F2884B004F2528 /* mpegAudioFrame */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EBDF1D709F2884B004F2528 /* dxHead.cpp */,
|
||||
8EBDF1D809F2884B004F2528 /* dxHead.h */,
|
||||
8EBDF1D909F2884B004F2528 /* mpegAudioHeader.cpp */,
|
||||
8EBDF1DA09F2884B004F2528 /* mpegAudioHeader.h */,
|
||||
);
|
||||
name = mpegAudioFrame;
|
||||
path = Files/src/mpegAudioFrame;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
8DC2EF500486A6940098B216 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8EBDF1A409F28836004F2528 /* decmpa.h in Headers */,
|
||||
8EBDF1FD09F2884B004F2528 /* DecMPAFileAccess.h in Headers */,
|
||||
8EBDF1FE09F2884B004F2528 /* DecodeEngine.h in Headers */,
|
||||
8EBDF1FF09F2884B004F2528 /* DefInc.h in Headers */,
|
||||
8EBDF20109F2884B004F2528 /* audioFrame.h in Headers */,
|
||||
8EBDF20309F2884B004F2528 /* floatFrame.h in Headers */,
|
||||
8EBDF20509F2884B004F2528 /* frame.h in Headers */,
|
||||
8EBDF20709F2884B004F2528 /* pcmFrame.h in Headers */,
|
||||
8EBDF20909F2884B004F2528 /* rawDataBuffer.h in Headers */,
|
||||
8EBDF20B09F2884B004F2528 /* common.h in Headers */,
|
||||
8EBDF20D09F2884B004F2528 /* dct64_i386.h in Headers */,
|
||||
8EBDF20F09F2884B004F2528 /* decode_i386.h in Headers */,
|
||||
8EBDF21109F2884B004F2528 /* HIPDefines.h in Headers */,
|
||||
8EBDF21209F2884B004F2528 /* huffman.h in Headers */,
|
||||
8EBDF21409F2884B004F2528 /* interface.h in Headers */,
|
||||
8EBDF21509F2884B004F2528 /* l2tables.h in Headers */,
|
||||
8EBDF21709F2884B004F2528 /* layer1.h in Headers */,
|
||||
8EBDF21909F2884B004F2528 /* layer2.h in Headers */,
|
||||
8EBDF21B09F2884B004F2528 /* layer3.h in Headers */,
|
||||
8EBDF21C09F2884B004F2528 /* mpg123.h in Headers */,
|
||||
8EBDF21D09F2884B004F2528 /* mpglib.h in Headers */,
|
||||
8EBDF21F09F2884B004F2528 /* tabinit.h in Headers */,
|
||||
8EBDF22109F2884B004F2528 /* VbrTag.h in Headers */,
|
||||
8EBDF22209F2884B004F2528 /* IFileAccess.h in Headers */,
|
||||
8EBDF22309F2884B004F2528 /* MemBuffer.h in Headers */,
|
||||
8EBDF22509F2884B004F2528 /* MPADecoder.h in Headers */,
|
||||
8EBDF22709F2884B004F2528 /* MPAFrameFinder.h in Headers */,
|
||||
8EBDF22909F2884B004F2528 /* MPAInfo.h in Headers */,
|
||||
8EBDF22B09F2884B004F2528 /* dxHead.h in Headers */,
|
||||
8EBDF22D09F2884B004F2528 /* mpegAudioHeader.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
8DC2EF4F0486A6940098B216 /* DecMPA */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "DecMPA" */;
|
||||
buildPhases = (
|
||||
8DC2EF500486A6940098B216 /* Headers */,
|
||||
8DC2EF520486A6940098B216 /* Resources */,
|
||||
8DC2EF540486A6940098B216 /* Sources */,
|
||||
8DC2EF560486A6940098B216 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = DecMPA;
|
||||
productInstallPath = "$(HOME)/Library/Frameworks";
|
||||
productName = DecMPA;
|
||||
productReference = 8DC2EF5B0486A6940098B216 /* DecMPA.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
0867D690FE84028FC02AAC07 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "DecMPA" */;
|
||||
hasScannedForEncodings = 1;
|
||||
mainGroup = 0867D691FE84028FC02AAC07 /* DecMPA */;
|
||||
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
|
||||
projectDirPath = "";
|
||||
targets = (
|
||||
8DC2EF4F0486A6940098B216 /* DecMPA */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
8DC2EF520486A6940098B216 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
8DC2EF540486A6940098B216 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8EBDF1FB09F2884B004F2528 /* DecMPA.cpp in Sources */,
|
||||
8EBDF1FC09F2884B004F2528 /* DecMPAFileAccess.cpp in Sources */,
|
||||
8EBDF20009F2884B004F2528 /* audioFrame.cpp in Sources */,
|
||||
8EBDF20209F2884B004F2528 /* floatFrame.cpp in Sources */,
|
||||
8EBDF20409F2884B004F2528 /* frame.cpp in Sources */,
|
||||
8EBDF20609F2884B004F2528 /* pcmFrame.cpp in Sources */,
|
||||
8EBDF20809F2884B004F2528 /* rawDataBuffer.cpp in Sources */,
|
||||
8EBDF20A09F2884B004F2528 /* common.c in Sources */,
|
||||
8EBDF20C09F2884B004F2528 /* dct64_i386.c in Sources */,
|
||||
8EBDF20E09F2884B004F2528 /* decode_i386.c in Sources */,
|
||||
8EBDF21009F2884B004F2528 /* DecodeEngine_Hip.cpp in Sources */,
|
||||
8EBDF21309F2884B004F2528 /* interface.c in Sources */,
|
||||
8EBDF21609F2884B004F2528 /* layer1.c in Sources */,
|
||||
8EBDF21809F2884B004F2528 /* layer2.c in Sources */,
|
||||
8EBDF21A09F2884B004F2528 /* layer3.c in Sources */,
|
||||
8EBDF21E09F2884B004F2528 /* tabinit.c in Sources */,
|
||||
8EBDF22009F2884B004F2528 /* VbrTag.c in Sources */,
|
||||
8EBDF22409F2884B004F2528 /* MPADecoder.cpp in Sources */,
|
||||
8EBDF22609F2884B004F2528 /* MPAFrameFinder.cpp in Sources */,
|
||||
8EBDF22809F2884B004F2528 /* MPAInfo.cpp in Sources */,
|
||||
8EBDF22A09F2884B004F2528 /* dxHead.cpp in Sources */,
|
||||
8EBDF22C09F2884B004F2528 /* mpegAudioHeader.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
089C1666FE841158C02AAC07 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
089C1667FE841158C02AAC07 /* English */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
1DEB91AE08733DA50010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
FRAMEWORK_VERSION = A;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Library/Frameworks";
|
||||
PRODUCT_NAME = DecMPA;
|
||||
WRAPPER_EXTENSION = framework;
|
||||
ZERO_LINK = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1DEB91AF08733DA50010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
ppc,
|
||||
i386,
|
||||
);
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
FRAMEWORK_VERSION = A;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "@executable_path/../Frameworks";
|
||||
PRODUCT_NAME = DecMPA;
|
||||
WRAPPER_EXTENSION = framework;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
1DEB91B208733DA50010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1DEB91B308733DA50010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "DecMPA" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1DEB91AE08733DA50010E9CD /* Debug */,
|
||||
1DEB91AF08733DA50010E9CD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "DecMPA" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1DEB91B208733DA50010E9CD /* Debug */,
|
||||
1DEB91B308733DA50010E9CD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||
}
|
Binary file not shown.
|
@ -1,125 +0,0 @@
|
|||
0.4.1
|
||||
|
||||
- improved detection of invalid frames and, therefore, of non-MPEG Audio files
|
||||
|
||||
- worked through HIP code:
|
||||
- removed printfs and exits
|
||||
- activated layer 1 and 2 support
|
||||
- changed some interface things to work better with DecMPA
|
||||
|
||||
0.4.0
|
||||
|
||||
- reorganized API in a way that should allow it to remain downward
|
||||
compatible in future releases
|
||||
|
||||
- the decoder parameters are no longer passed directly to DecMPA_Create
|
||||
but are now set using a new function, DecMPA_SetParam.
|
||||
|
||||
- added API version checking to ensure that the DLL is compatible
|
||||
|
||||
- added a new function DecMPA_DecodeNoData to the API. It can be used
|
||||
to perform a quick scan through a file without actually decoding
|
||||
any audio data
|
||||
|
||||
- added an ease-of-use function (DecMPA_CreateForFile) for creating a
|
||||
decoder object that reads its input data from a file
|
||||
|
||||
- ID3v2 data can now be returned
|
||||
|
||||
- more code clean-up
|
||||
|
||||
- revamped seek code - seeks are now performed instantly when the
|
||||
Seek function is called, instead of at the next decode
|
||||
|
||||
- more accurate calculation of seek position for VBR streams
|
||||
|
||||
- better calculation of decode-time
|
||||
|
||||
- improved duration estimation
|
||||
|
||||
- corrected some issues on big endian systems
|
||||
|
||||
- fixed a few other bugs
|
||||
|
||||
|
||||
0.3.0
|
||||
|
||||
- integrated new decoding routines (from Lame/HIP) in addition to the "old"
|
||||
SPlay decoding
|
||||
|
||||
- added a mechanism to choose between HIP and SPlay decoding routines at
|
||||
compile time
|
||||
|
||||
- wrote a new frame finder that adds quite a bit of robustness and also
|
||||
allows DecMPA to detect if the data is not mpeg audio. The new finder
|
||||
also greatly reduces the risk to detect frames wrong after seeking.
|
||||
|
||||
- threw out more old unnecessary Mpeglib stuff and rewrote/simplified some
|
||||
other parts.
|
||||
|
||||
|
||||
0.2.2
|
||||
|
||||
- disabled "downsampling" again - it only reduced the frequency by half instead
|
||||
of synthesizing with twice the frequency and THEN reducing it by half.
|
||||
Thus the quality was definitely NOT improved.
|
||||
|
||||
0.2.1
|
||||
|
||||
- added workaround for Visual C++ compiler bug that caused occasional
|
||||
artifacts when decoding some MP3s
|
||||
|
||||
|
||||
0.2
|
||||
|
||||
- MP3 synthesis is now performed with downsampling, resulting in improved
|
||||
quality
|
||||
|
||||
- leading ID3v2 tags are now automatically skipped over, fixing some
|
||||
problems with corrupted tags that contain unescaped "sync" values.
|
||||
This also improves length detection for files with big ID3 tags.
|
||||
|
||||
- removed some more old MPEGLib code that is unnecessary for pure audio
|
||||
decoding
|
||||
|
||||
|
||||
|
||||
0.1.8
|
||||
|
||||
- added an example application "decodefile"
|
||||
|
||||
- added makefile and project file for new example to the "build" directory
|
||||
|
||||
- cleaned the code up a bit, removed some unnecessary includes
|
||||
|
||||
- the source files in the tar.gz archive now have UNIX-style linebreaks.
|
||||
this fixes some issues with compilers that weren't able to cope with the
|
||||
Windows-style linebreaks
|
||||
|
||||
- changed some code in the build-tools for potability.
|
||||
|
||||
- added makefiles for Digital Unix and Cygwin GCC
|
||||
|
||||
|
||||
0.1.5
|
||||
|
||||
- added ability to create documentation with makefiles
|
||||
|
||||
- added readme files about makefile usage
|
||||
|
||||
- changed the interface of DecMPA_Create - it now accepts a POINTER to
|
||||
DecMPA_Callbacks rather than an object.
|
||||
|
||||
- fixed some portability issues
|
||||
|
||||
- fixed a nasty bug in decmpa.h: DecMPA_Create did not have the DECMPA_CC
|
||||
calling convention (resulting in possible loss of binary interoperability
|
||||
with dlls created by different compilers)
|
||||
|
||||
- fixed gcc commandline when creating a DLL - the DLL is now relocatable
|
||||
and binary compatible with the VC6 generated DLL
|
||||
|
||||
|
||||
0.1
|
||||
|
||||
- initial release
|
|
@ -1,459 +0,0 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
|
@ -1,131 +0,0 @@
|
|||
*** DecMPA v0.4.1 - Simple MPEG Audio Decoder ***
|
||||
|
||||
DecMPA is a small library for decoding MPEG Audio (layer 1,2 and 3). You may
|
||||
use it under the terms of the GNU Lesser General Public License
|
||||
(see License.txt).
|
||||
|
||||
DecMPA uses some parts of project MPEGLib v0.4.1 by Martin Vogt
|
||||
(see http://mpeglib.sourceforge.net/) which itself uses modified SPlay
|
||||
decoding routines (see http://splay.sourceforge.net).
|
||||
DecMPA v0.3.0 and higher also uses code from Lame's HIP decoding
|
||||
engine (see http://lame.sourceforge.net/).
|
||||
|
||||
Essentially DecMPA is a mixture of "raw" decoding routines from other projects
|
||||
(with a few bug fixes and extensions), with a new interface coded on top of
|
||||
it. The goal is to provide a powerful MPEG Audio decoding library that can
|
||||
be easily integrated into applications.
|
||||
|
||||
The project homepage can be found at
|
||||
http://decmpa.sourceforge.net
|
||||
|
||||
|
||||
************************************************************
|
||||
** IMPORTANT NOTE for users of versions older than v0.4.0 **
|
||||
************************************************************
|
||||
|
||||
In version 0.4.0 the API has changed a little, in particular the parameters
|
||||
you pass to the DecMPA_CreateXXX functions. The output type is not passed
|
||||
directly to Create anymore, but can now be set using DecMPA_SetParam.
|
||||
|
||||
Also note that the structure DecMPA_Callbacks now contains an additional
|
||||
pointer to a "GetPosition" function that HAS to be provided. Be sure to
|
||||
initialize it!
|
||||
|
||||
Please read the documentation for additional information.
|
||||
|
||||
These changes allow a greater flexibility when adding new features and will
|
||||
hopefully enable future releases to be fully downward compatible to earlier
|
||||
versions.
|
||||
|
||||
|
||||
** Documentation
|
||||
|
||||
Documentation is available in the subdirectory 'doc'.
|
||||
|
||||
|
||||
** Compiling
|
||||
|
||||
If you want to compile DecMPA yourself, project files and make files for
|
||||
some target systems and compilers are located in build/SYSTEM, where
|
||||
SYSTEM is:
|
||||
|
||||
vc6: Windows, Visual C++ 6.0
|
||||
gcc-mingw32: Windows, GCC Mingw32
|
||||
gcc-cygwin: Windows, GCC Cygwin
|
||||
gcc-linux: Linux, GCC
|
||||
gcc-digux: Digital Unix, GCC
|
||||
|
||||
For gcc systems, just open a shell/command prompt, got to the appropriate
|
||||
build/SYSTEM directory and run "make" (or possibly "gmake" if the default
|
||||
make for your system is not GNU make).
|
||||
|
||||
DecMPA can use two different decoding engines: HIP and SPlay. HIP is the
|
||||
default, but if you want to use SPlay instead you can pass "ENGINE=splay"
|
||||
as a parameter to you call to make.
|
||||
|
||||
More information about the make files can be found in build/MakeGoals.txt
|
||||
|
||||
Generated libraries, shared objects and import libraries are placed in
|
||||
lib/SYSTEM.
|
||||
Generated DLLs and example executables are placed in bin/SYSTEM.
|
||||
|
||||
|
||||
** Usage
|
||||
|
||||
Include include/decmpa.h in your code files and link with the
|
||||
appropriate library or import library for your target system from lib/SYSTEM.
|
||||
|
||||
All library files except those for Windows/Visual C++ have to be compiled
|
||||
first (see Compiling).
|
||||
|
||||
Note that the LGPL might require you to use the dll/shared object instead
|
||||
of the static library if your application is not released under the GPL
|
||||
(see License.txt).
|
||||
|
||||
|
||||
** Examples
|
||||
|
||||
Example applications are located in the "examples" subdirectory.
|
||||
The makefiles and project files for the examples are found exactly where
|
||||
the library make files are (see "Compiling").
|
||||
|
||||
For GNU make files, the example make files are integrated into the
|
||||
normal make files. They can be executed by calling GNU Make with the goal
|
||||
"example_NAME" where NAME is the directory name of the example. For example
|
||||
"make example_decodefile" builds the decodefile example application.
|
||||
More information about the make files can be found in build/MakeGoals.txt
|
||||
|
||||
|
||||
** Portability
|
||||
|
||||
DecMPA has been compiled under a few systems, including Windows and Linux
|
||||
(see "Compiling"). It will probably compile well on other UNIXes with the
|
||||
Linux or Digital Unix makefiles, but that has not been tested yet.
|
||||
|
||||
If you successfully compiled DecMPA on other systems, I would appreciate if
|
||||
you could drop me a note (and maybe contribute your makefiles or project files
|
||||
- see below).
|
||||
|
||||
|
||||
|
||||
** Suggestions, fixes, extensions, feedback
|
||||
|
||||
If you have any suggestions, small extension or bug fixes that you would like to
|
||||
be incorporated into this library, send them to hazard_hd@users.sourceforge.net
|
||||
|
||||
If you send me any of your code, you must agree that it will be released under
|
||||
LGPL.
|
||||
|
||||
If you want to continuously help with the development, please send a short resume
|
||||
describing your qualifications and experience to hazard_hd@users.sourceforge.net.
|
||||
If I think you will "fit in" I'll add you to the developer list, thus allowing
|
||||
you direct access to the project CVS.
|
||||
|
||||
I would also like to hear from you if you find this library useful and decide
|
||||
to use it in one of your projects.
|
||||
|
||||
|
||||
|
||||
Copyright 2002 Hauke Duden
|
||||
hazard_hd@users.sourceforge.net
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
- Test on other operating systems
|
||||
|
||||
- clean the code up a little more
|
|
@ -1,556 +0,0 @@
|
|||
/* DecMPA - simple MPEG Audio decoding library.
|
||||
Copyright (C) 2002 Hauke Duden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
#ifndef _DECMPA_H_
|
||||
#define _DECMPA_H_
|
||||
|
||||
|
||||
/**\file
|
||||
Specifies the DecMPA API.*/
|
||||
|
||||
|
||||
#ifndef DECMPA_VERSION
|
||||
|
||||
/**DecMPA API version number.*/
|
||||
#define DECMPA_VERSION 1
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(_WINDOWS) || defined(_WIN32)
|
||||
|
||||
#ifndef CALLBACK
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#define DECMPA_CC CALLBACK
|
||||
|
||||
#else
|
||||
|
||||
#define DECMPA_CC
|
||||
|
||||
#endif
|
||||
|
||||
/**\def DECMPA_CC
|
||||
Macro for the calling convention used by DecMPA functions.*/
|
||||
|
||||
|
||||
/**\defgroup GroupFunctions Functions*/
|
||||
|
||||
/**\defgroup GroupResults Result Codes
|
||||
Description of the result codes that are returned by most DecMPA functions.
|
||||
|
||||
Codes of the form DECMPA_ERROR_*** represent errors and are all negative.
|
||||
The other result codes, all >=0, indicate different degrees of success.*/
|
||||
|
||||
/**\defgroup GroupParamIDs Configuations Parameters
|
||||
Description of the possible parameters that can be defined using
|
||||
#DecMPA_SetParam.
|
||||
*/
|
||||
|
||||
/**\defgroup GroupParamValues Configuration Parameter Values
|
||||
Description of the value constants that can be assigned to some configuration
|
||||
parameters.*/
|
||||
|
||||
/**\defgroup GroupStructs Structures*/
|
||||
|
||||
|
||||
/**\addtogroup GroupStructs*/
|
||||
/*@{*/
|
||||
|
||||
/**This structure contains pointers to the functions that are used
|
||||
to read the MP3 data during DecMPA_Decode.*/
|
||||
typedef struct
|
||||
{
|
||||
/**Pointer to the function that is used to read data. If this pointer
|
||||
is NULL, DecMPA will read from stdin and ignore the other callback
|
||||
functions.
|
||||
|
||||
@param pContext context pointer that was passed to
|
||||
#DecMPA_CreateUsingCallbacks
|
||||
@param pBuffer buffer that the data should be stored into
|
||||
@param nBytes number of bytes to read
|
||||
@return the number of bytes read or -1 if an error occurred. If
|
||||
the returned value is less than nBytes it is assumed that the end
|
||||
of the data stream was reached.
|
||||
|
||||
\note the function that the pointer points to should have the calling
|
||||
convention DECMPA_CC, i.e. it should be defined as:
|
||||
\code
|
||||
long DECMPA_CC MyReadFuncName(void* pContext,void* pBuffer,long nBytes);
|
||||
\endcode*/
|
||||
long (DECMPA_CC* Read)(void* pContext,void* pBuffer,long nBytes);
|
||||
|
||||
|
||||
|
||||
/**Pointer to function that seeks to the specified data stream position.
|
||||
This function pointer should be set to NULL if seeking is not supported.
|
||||
|
||||
@param pContext context pointer that was passed to
|
||||
#DecMPA_CreateUsingCallbacks
|
||||
@param DestPos destination position, in bytes.
|
||||
@return nonzero if successful, 0 otherwise.
|
||||
|
||||
\note the function that the pointer points to should have the calling
|
||||
convention DECMPA_CC, i.e. it should be defined as:
|
||||
\code
|
||||
int DECMPA_CC MySeekFuncName(void* pContext,long DestPos);
|
||||
\endcode*/
|
||||
int (DECMPA_CC* Seek)(void* pContext,long DestPos);
|
||||
|
||||
|
||||
|
||||
/**Pointer to a function that returns the length of the data stream.
|
||||
This function pointer can be set to NULL if the length cannot be
|
||||
determined. Alternatively the function can return -1,
|
||||
|
||||
@param pContext context pointer that was passed to
|
||||
#DecMPA_CreateUsingCallbacks
|
||||
@return the length, in bytes. -1 if unknown.
|
||||
|
||||
\note the function that the pointer points to should have the calling
|
||||
convention DECMPA_CC, i.e. it should be defined as:
|
||||
\code
|
||||
long DECMPA_CC MyGetLengthFuncName(void* pContext);
|
||||
\endcode*/
|
||||
long (DECMPA_CC* GetLength)(void* pContext);
|
||||
|
||||
|
||||
|
||||
/**Pointer to a function that returns the current position in the data
|
||||
stream. This function pointer can only be NULL if Read is also NULL.
|
||||
|
||||
@param pContext context pointer that was passed to
|
||||
#DecMPA_CreateUsingCallbacks
|
||||
@return the current position, in bytes or -1 if an error occurred.
|
||||
|
||||
\note the function that the pointer points to should have the calling
|
||||
convention DECMPA_CC, i.e. it should be defined as:
|
||||
\code
|
||||
long DECMPA_CC MyGetPositionFuncName(void* pContext);
|
||||
\endcode*/
|
||||
long (DECMPA_CC* GetPosition)(void* pContext);
|
||||
|
||||
} DecMPA_Callbacks;
|
||||
|
||||
|
||||
|
||||
/**This structure provides information extracted from an MPEG Audio header.*/
|
||||
typedef struct
|
||||
{
|
||||
/**The original header data.*/
|
||||
unsigned char aRawData[4];
|
||||
|
||||
/**Protection*/
|
||||
int bProtection;
|
||||
/**Layer*/
|
||||
int nLayer;
|
||||
/**Version*/
|
||||
int nVersion;
|
||||
/**Padding*/
|
||||
int bPadding;
|
||||
/**Frequency index*/
|
||||
int nFrequencyIndex;
|
||||
/**Frequency in Hz*/
|
||||
int nFrequency;
|
||||
/**Bitrate index*/
|
||||
int nBitRateIndex;
|
||||
/**Extended mode*/
|
||||
int nExtendedMode;
|
||||
/**Mode*/
|
||||
int nMode;
|
||||
/**Input stereo*/
|
||||
int bInputStereo;
|
||||
/**MPEG 2.5*/
|
||||
int bMPEG25;
|
||||
|
||||
/**Frame size in bytes*/
|
||||
int nFrameSize;
|
||||
/**Number of decoded samples per frame. If the data is stereo, a sample
|
||||
consists of one value for the left channel and one for the right.*/
|
||||
int nDecodedSamplesPerFrame;
|
||||
/**Bitrate in Kbps.*/
|
||||
int nBitRateKbps;
|
||||
|
||||
} DecMPA_MPEGHeader;
|
||||
|
||||
|
||||
/**DecMPA_OutputFormat objects are used to specify the format of the decoded
|
||||
audio data that is returned by DecMPA_Decode.*/
|
||||
typedef struct
|
||||
{
|
||||
/**Specifies the type of the data. Can be either DECMPA_OUTPUT_INT16 or
|
||||
DECMPA_OUTPUT_FLOAT*/
|
||||
int nType;
|
||||
|
||||
/**Specifies the frequency of the data.*/
|
||||
int nFrequency;
|
||||
|
||||
/**Specifies the number of channels. Can be 1 for mono or 2 for stereo.*/
|
||||
int nChannels;
|
||||
|
||||
} DecMPA_OutputFormat;
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
||||
/**\addtogroup GroupResults*/
|
||||
/*@{*/
|
||||
|
||||
/**The operation has been successfully completed.*/
|
||||
#define DECMPA_OK 0
|
||||
|
||||
/**The end of the stream was reached and there is no more data to decode.*/
|
||||
#define DECMPA_END 1
|
||||
|
||||
/**An invalid parameter was passed to a function.*/
|
||||
#define DECMPA_ERROR_PARAM (-1)
|
||||
|
||||
/**The operation is not supported.*/
|
||||
#define DECMPA_ERROR_UNSUPPORTED (-2)
|
||||
|
||||
/**There is not enough free memory.*/
|
||||
#define DECMPA_ERROR_MEMORY (-3)
|
||||
|
||||
/**An internal error occurred in the decoding routines.*/
|
||||
#define DECMPA_ERROR_INTERNAL (-4)
|
||||
|
||||
/**Indicates an error during decoding, which usually means that the input data
|
||||
is invalid or corrupted.*/
|
||||
#define DECMPA_ERROR_DECODE (-5)
|
||||
|
||||
/**An error occurred during the reading of new data.*/
|
||||
#define DECMPA_ERROR_READ (-6)
|
||||
|
||||
/**An error occurred when it was tried to seek to a different position in
|
||||
the data stream.*/
|
||||
#define DECMPA_ERROR_SEEK (-7)
|
||||
|
||||
/**An error occurred when opening a file.*/
|
||||
#define DECMPA_ERROR_OPENFILE (-8)
|
||||
|
||||
/**The decoder is in the wrong state to perform the specified
|
||||
function.*/
|
||||
#define DECMPA_ERROR_WRONGSTATE (-9)
|
||||
|
||||
/**The requested resource is not available*/
|
||||
#define DECMPA_ERROR_NOTAVAILABLE (-10)
|
||||
|
||||
/**The version of the DecMPA library that is used is incompatible:*/
|
||||
#define DECMPA_ERROR_INCOMPATIBLEVERSION (-11)
|
||||
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
||||
|
||||
|
||||
/**\addtogroup GroupParamIDs*/
|
||||
/*@{*/
|
||||
|
||||
/**Specifies the format DecMPA will use to output the decoded audio samples.
|
||||
Can be either #DECMPA_OUTPUT_INT16 or #DECMPA_OUTPUT_FLOAT.
|
||||
|
||||
Default value: #DECMPA_OUTPUT_INT16.*/
|
||||
#define DECMPA_PARAM_OUTPUT 0
|
||||
|
||||
/**Specifies wether the decoder should load a leading ID3v2 tag and
|
||||
make it available through #DecMPA_GetID3v2Data. Can be either
|
||||
#DECMPA_YES or #DECMPA_NO.
|
||||
|
||||
Default value: #DECMPA_NO.*/
|
||||
#define DECMPA_PARAM_PROVIDEID3V2 1
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**Constant indicating the number of definable parameters.*/
|
||||
#define DECMPA_PARAMCOUNT 2
|
||||
|
||||
|
||||
|
||||
/**\addtogroup GroupParamValues*/
|
||||
/*@{*/
|
||||
|
||||
/**\defgroup GroupParamGeneric Generic values*/
|
||||
/*@{*/
|
||||
|
||||
/**Indicates that the specified function is activated.*/
|
||||
#define DECMPA_YES 1
|
||||
|
||||
/**Indicates that the specified function is not activated.*/
|
||||
#define DECMPA_NO 0
|
||||
|
||||
/*@}*/
|
||||
|
||||
/**\defgroup GroupParamOutput DECMPA_PARAM_OUTPUT values*/
|
||||
/*@{*/
|
||||
|
||||
/**Indicates that the audio samples are signed 16 bit integers (one per
|
||||
channel). -32768 is the minimum and 32767 is the maximum value.
|
||||
|
||||
\note As of version 0.3.0 DecMPA uses integers internally. That means that
|
||||
#DECMPA_OUTPUT_INT16 is a little faster than #DECMPA_OUTPUT_FLOAT because the
|
||||
latter requires an additional conversion.*/
|
||||
#define DECMPA_OUTPUT_INT16 0
|
||||
|
||||
/**Indicates that the audio samples are floats (one per channel).
|
||||
-1.0 is the minimum and 1.0 is the maximum value.
|
||||
|
||||
\note As of version 0.3.0 DecMPA uses integers internally. That means that
|
||||
#DECMPA_OUTPUT_INT16 is a little faster than #DECMPA_OUTPUT_FLOAT because the
|
||||
latter requires an additional conversion.*/
|
||||
#define DECMPA_OUTPUT_FLOAT 1
|
||||
|
||||
/*@}*/
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
||||
|
||||
|
||||
/**\addtogroup GroupFunctions*/
|
||||
/*@{*/
|
||||
|
||||
|
||||
/**Creates a new decoder that obtains its input data from a file.
|
||||
|
||||
If you want to provide the input data in some other customized way, use
|
||||
#DecMPA_CreateUsingCallbacks instead.
|
||||
|
||||
After the decoder is created, additional parameters can be configured with
|
||||
#DecMPA_SetParam.
|
||||
|
||||
@param ppDecoder pointer to a void* variable that receives the address of the
|
||||
decoder object.
|
||||
@param sFilePath path of the file to open
|
||||
@param APIVersion version number of the DecMPA API. You should always
|
||||
pass the constant #DECMPA_VERSION for this parameter.
|
||||
@return a DecMPA result code (see \ref GroupResults).*/
|
||||
int DECMPA_CC DecMPA_CreateUsingFile(void** ppDecoder,const char* sFilePath,int APIVersion);
|
||||
|
||||
|
||||
|
||||
/**Creates a new decoder that obtains its input data using callback functions.
|
||||
|
||||
After the decoder is created, additional parameters can be configured with
|
||||
#DecMPA_SetParam.
|
||||
|
||||
@param ppDecoder pointer to a void* variable that receives the address of the
|
||||
decoder object.
|
||||
@param pCallbacks structure containing pointers to the callback functions that
|
||||
are used to retrieve the MPEG Audio data.
|
||||
@param pCallbackContext a pointer that is simply passed to the callback
|
||||
functions. It has no meaning to the decoder and is only meant to be used
|
||||
to pass arbitrary data to the callback functions.
|
||||
@param APIVersion version number of the DecMPA API. You should always
|
||||
pass the constant #DECMPA_VERSION for this parameter.
|
||||
@return a DecMPA result code (see \ref GroupResults).*/
|
||||
int DECMPA_CC DecMPA_CreateUsingCallbacks(void** ppDecoder,const DecMPA_Callbacks* pCallbacks,void* pCallbackContext,int APIVersion);
|
||||
|
||||
|
||||
|
||||
/**Sets additional DecMPA parameters.
|
||||
|
||||
Calling this function is completely optional - if you don't call it
|
||||
or only call it for some parameters, the remaining parameters will simply keep
|
||||
their default values.
|
||||
|
||||
This function should only be called directly after the decoder was created,
|
||||
before calling any of the other functions. Otherwise DecMPA_SetParam may return
|
||||
#DECMPA_ERROR_WRONGSTATE.
|
||||
|
||||
@param pDecoder the decoder object
|
||||
@param ID ID of the parameter to set. See \ref GroupParamIDs.
|
||||
@param Value the new value for the specified parameter. Which values are possible
|
||||
depends of the parameter.
|
||||
@return a DecMPA result code (see \ref GroupResults).*/
|
||||
int DECMPA_CC DecMPA_SetParam(void* pDecoder,int ID,long Value);
|
||||
|
||||
|
||||
|
||||
/**Returns the current value of a DecMPA parameter.
|
||||
|
||||
@param pDecoder the decoder object
|
||||
@param ID ID of the parameter. See \ref GroupParamIDs.
|
||||
@return the current value of the specified parameter.
|
||||
@see #DecMPA_SetParam
|
||||
*/
|
||||
long DECMPA_CC DecMPA_GetParam(void* pDecoder,int ID);
|
||||
|
||||
|
||||
|
||||
/**Decodes some data and stores it in the supplied buffer. The buffer is not
|
||||
necessarily completely filled. Always check the value stored in pBytesDecoded
|
||||
to find out how much data has been decoded.
|
||||
|
||||
The format of the data (frequency and number of channels) can be obtained by
|
||||
calling #DecMPA_GetOutputFormat <b>after</b> DecMPA_Decode. The format may
|
||||
change from one call of DecMPA_Decode to the next. Wether the format has
|
||||
changed can be checked using #DecMPA_OutputFormatChanged.
|
||||
|
||||
@param pDecoder the decoder object
|
||||
@param pBuffer pointer to a buffer that receives the decoded data.
|
||||
@param nBufferBytes size of the buffer, in bytes
|
||||
@param pBytesDecoded pointer to a variable that receives the number of bytes
|
||||
that were stored in the buffer.
|
||||
@return a DecMPA result code (see \ref GroupResults).*/
|
||||
int DECMPA_CC DecMPA_Decode(void* pDecoder,void* pBuffer,long nBufferBytes,long* pBytesDecoded);
|
||||
|
||||
|
||||
|
||||
/**This is a special version of #DecMPA_Decode that does not actually decode
|
||||
any MPEG Audio data, but only decodes the header information.
|
||||
|
||||
This function is a lot faster than #DecMPA_Decode and can be used
|
||||
to make a quick run through the file and obtain accurate information about
|
||||
its properties, like the exact duration or decoded file size.
|
||||
|
||||
The function behaves in all ways like #DecMPA_Decode, except that it does not
|
||||
return any data. In particular, the output format and mpeg audio header
|
||||
information returned by #DecMPA_GetOutputFormat and #DecMPA_GetMPEGHeader will
|
||||
be properly updated, just as #DecMPA_Decode does.
|
||||
|
||||
@param pDecoder the decoder object
|
||||
@param pDecodedBytes pointer to a variable that receives the decoded size
|
||||
(in bytes) of the current MPEG audio frame. If #DecMPA_Decode was called
|
||||
before and some parts of the current frame have already been read, the
|
||||
size of the remaining data is returned
|
||||
@return a DecMPA result code (see \ref GroupResults).*/
|
||||
int DECMPA_CC DecMPA_DecodeNoData(void* pDecoder,long* pDecodedBytes);
|
||||
|
||||
|
||||
|
||||
/**Changes the decoding position to the specified time, relative to the
|
||||
beginning of the data stream.
|
||||
|
||||
If #DecMPA_CreateUsingCallbacks was used to create the decoder and no
|
||||
Seek callback function has been specified, seeking is not supported and
|
||||
#DECMPA_ERROR_UNSUPPORTED is returned.
|
||||
|
||||
@param pDecoder the decoder object
|
||||
@param Millis the target time, in milliseconds
|
||||
@return a DecMPA result code (see \ref GroupResults).*/
|
||||
int DECMPA_CC DecMPA_SeekToTime(void* pDecoder,long Millis);
|
||||
|
||||
|
||||
|
||||
/**Retrieves the current decoding time. The decoding time corresponds to
|
||||
the time that it takes to play the data that has been decoded up to now.
|
||||
|
||||
@param pDecoder the decoder object
|
||||
@param pTime pointer to a variable that receives the time, in milliseconds.
|
||||
@return a DecMPA result code (see \ref GroupResults).*/
|
||||
int DECMPA_CC DecMPA_GetTime(void* pDecoder,long* pTime);
|
||||
|
||||
|
||||
|
||||
/**Retrieves the time that it takes to play back the whole data stream.
|
||||
If the duration is not known -1 is returned.
|
||||
|
||||
\note The duration is an estimation that can be slightly wrong for some files
|
||||
but is pretty accurate for the wide majority of files. If you need a
|
||||
100% accurate duration value, there is really no other way than to read through
|
||||
the whole file with #DecMPA_Decode or #DecMPA_DecodeNoData and add up the
|
||||
\c DecodedBytes values that are returned by those functions. Note that
|
||||
if you only make this pass through the file to get the duration, i.e. you do
|
||||
not need decoded audio data, you can use #DecMPA_DecodeNoData which is a lot
|
||||
faster than #DecMPA_Decode.
|
||||
|
||||
@param pDecoder the decoder object
|
||||
@param pDuration pointer to a variable that receives the duration, in
|
||||
milliseconds.
|
||||
@return a DecMPA result code (see \ref GroupResults).*/
|
||||
int DECMPA_CC DecMPA_GetDuration(void* pDecoder,long* pDuration);
|
||||
|
||||
|
||||
|
||||
/**Retrieves the format of the data that was returned by the last call to
|
||||
DecMPA_Decode.
|
||||
|
||||
The nType member of DecMPA_OutputFormat never changes and its value is
|
||||
defined by the #DECMPA_PARAM_OUTPUT parameter that can be set using
|
||||
#DecMPA_SetParam. If the value has not been explicitly changed using
|
||||
#DecMPA_SetParam it will be #DECMPA_OUTPUT_INT16, indicating 16 bit signed
|
||||
samples.
|
||||
|
||||
The remaining fields of the structure may change after calls to
|
||||
#DecMPA_Decode or #DecMPA_DecodeNoData.
|
||||
|
||||
@param pDecoder the decoder object
|
||||
@param pFormat pointer to a DecMPA_OutputFormat object that is filled with
|
||||
the format data
|
||||
@return a DecMPA result code (see \ref GroupResults).*/
|
||||
int DECMPA_CC DecMPA_GetOutputFormat(void* pDecoder,DecMPA_OutputFormat* pFormat);
|
||||
|
||||
|
||||
|
||||
/**Checks wether the output format has changed during the last call to
|
||||
DecMPA_Decode.
|
||||
|
||||
@return nonzero if the format has changed, zero otherwise.*/
|
||||
int DECMPA_CC DecMPA_OutputFormatChanged(void* pDecoder);
|
||||
|
||||
|
||||
|
||||
/**Retrieve mpeg header of the data that was returned by the last call to
|
||||
DecMPA_Decode. This function is only supplied for information purposes.
|
||||
|
||||
@param pDecoder the decoder object
|
||||
@param pHeader pointer to a DecMPA_MPEGHeader object that received the data.
|
||||
@return a DecMPA result code (see \ref GroupResults).*/
|
||||
int DECMPA_CC DecMPA_GetMPEGHeader(void* pDecoder,DecMPA_MPEGHeader* pHeader);
|
||||
|
||||
|
||||
|
||||
/**Returns the file's ID3v2 tag, if it has one. If the file has no ID3v2
|
||||
tag, #DECMPA_ERROR_NOTAVAILABLE is returned.
|
||||
|
||||
This function will always return #DECMPA_ERROR_NOTAVAILABLE if the decoder parameter
|
||||
#DECMPA_PARAM_PROVIDEID3V2 has not been set to #DECMPA_YES with #DecMPA_SetParam.
|
||||
|
||||
\note There are other libraries that can be used to parse the returned
|
||||
data, one of them being id3lib. It can be found at
|
||||
http://id3lib.sourceforge.net/ .
|
||||
|
||||
@param pDecoder the decoder object
|
||||
@param ppData pointer to a pointer variable that will receive the address
|
||||
of the ID3v2 data. The memory that contains the data will remain valid
|
||||
until the decoder is destroyed.
|
||||
@param pDataSize pointer to a variable that will receive the size of the
|
||||
ID3v2 data, in bytes.
|
||||
@return a DecMPA result code (see \ref GroupResults).*/
|
||||
int DECMPA_CC DecMPA_GetID3v2Data(void* pDecoder,unsigned char** ppData,long* pDataSize);
|
||||
|
||||
|
||||
|
||||
/**Destroys a decoder.
|
||||
|
||||
@param pDecoder decoder object.*/
|
||||
void DECMPA_CC DecMPA_Destroy(void* pDecoder);
|
||||
|
||||
|
||||
/**Returns the version number of the DecMPA API used by the library.*/
|
||||
int DECMPA_CC DecMPA_GetVersion(void);
|
||||
|
||||
/*@}*/
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,262 +0,0 @@
|
|||
/* DecMPA - simple MPEG Audio decoding library.
|
||||
Copyright (C) 2002 Hauke Duden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
|
||||
#include "DefInc.h"
|
||||
#include "../include/decmpa.h"
|
||||
#include "MPADecoder.h"
|
||||
|
||||
#include <exception>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#if defined(__GNUC__) && (defined(_WINDOWS) || defined(_WIN32))
|
||||
#define DLLEXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define DLLEXPORT
|
||||
#endif
|
||||
|
||||
long DECMPA_CC DecMPA_StdioRead(void* pContext,void* pBuffer,long nBytes)
|
||||
{
|
||||
long nBytesRead;
|
||||
|
||||
nBytesRead=fread(pBuffer,1,nBytes,(FILE*)pContext);
|
||||
if(nBytesRead!=nBytes)
|
||||
{
|
||||
if(ferror((FILE*)pContext))
|
||||
return -1;
|
||||
}
|
||||
|
||||
return nBytesRead;
|
||||
}
|
||||
|
||||
|
||||
int DECMPA_CC DecMPA_StdioSeek(void* pContext,long DestPos)
|
||||
{
|
||||
if(fseek((FILE*)pContext,DestPos,SEEK_SET)!=0)
|
||||
return 0; //error
|
||||
else
|
||||
return 1; //no error
|
||||
}
|
||||
|
||||
long DECMPA_CC DecMPA_StdioGetLength(void* pContext)
|
||||
{
|
||||
long nOldPos;
|
||||
long nLength=-1;
|
||||
|
||||
nOldPos=ftell((FILE*)pContext);
|
||||
if(fseek((FILE*)pContext,0,SEEK_END)==0)
|
||||
{
|
||||
nLength=ftell((FILE*)pContext);
|
||||
fseek((FILE*)pContext,nOldPos,SEEK_SET);
|
||||
}
|
||||
|
||||
return nLength;
|
||||
}
|
||||
|
||||
long DECMPA_CC DecMPA_StdioGetPosition(void* pContext)
|
||||
{
|
||||
return ftell((FILE*)pContext);
|
||||
}
|
||||
|
||||
void DecMPA_StdioDestroyNotify(void* pContext)
|
||||
{
|
||||
fclose((FILE*)pContext);
|
||||
}
|
||||
|
||||
DLLEXPORT int DECMPA_CC DecMPA_CreateUsingFile(void** ppDecoder,const char* sFilePath,int Version)
|
||||
{
|
||||
FILE* pFile;
|
||||
DecMPA_Callbacks Callbacks;
|
||||
int nResult;
|
||||
|
||||
if(Version>DECMPA_VERSION)
|
||||
return DECMPA_ERROR_INCOMPATIBLEVERSION;
|
||||
|
||||
pFile=fopen(sFilePath,"rb");
|
||||
if(pFile==NULL)
|
||||
return DECMPA_ERROR_OPENFILE;
|
||||
|
||||
Callbacks.Read=DecMPA_StdioRead;
|
||||
Callbacks.Seek=DecMPA_StdioSeek;
|
||||
Callbacks.GetLength=DecMPA_StdioGetLength;
|
||||
Callbacks.GetPosition=DecMPA_StdioGetPosition;
|
||||
|
||||
nResult=DecMPA_CreateUsingCallbacks(ppDecoder,&Callbacks,pFile,Version);
|
||||
if(nResult!=DECMPA_OK)
|
||||
fclose(pFile);
|
||||
|
||||
((CMPADecoder*)(*ppDecoder))->SetDestroyNotify(DecMPA_StdioDestroyNotify,pFile);
|
||||
|
||||
return nResult;
|
||||
}
|
||||
|
||||
|
||||
DLLEXPORT int DECMPA_CC DecMPA_CreateUsingCallbacks(void** ppDecoder,const DecMPA_Callbacks* pCallbacks,void* pContext,int Version)
|
||||
{
|
||||
DecMPA_Callbacks Callbacks=*pCallbacks;
|
||||
|
||||
if(Callbacks.Read==NULL)
|
||||
{
|
||||
Callbacks.Read=DecMPA_StdioRead;
|
||||
Callbacks.Seek=NULL;
|
||||
Callbacks.GetLength=NULL;
|
||||
Callbacks.GetPosition=DecMPA_StdioGetPosition;
|
||||
|
||||
pContext=stdin;
|
||||
}
|
||||
|
||||
if(Version>DECMPA_VERSION)
|
||||
return DECMPA_ERROR_INCOMPATIBLEVERSION;
|
||||
|
||||
if(ppDecoder==NULL || Callbacks.GetPosition==NULL)
|
||||
return DECMPA_ERROR_PARAM;
|
||||
|
||||
try
|
||||
{
|
||||
*ppDecoder=new CMPADecoder(Callbacks,pContext);
|
||||
|
||||
return DECMPA_OK;
|
||||
}
|
||||
catch(std::bad_alloc e)
|
||||
{
|
||||
return DECMPA_ERROR_MEMORY;
|
||||
}
|
||||
catch(std::exception e)
|
||||
{
|
||||
return DECMPA_ERROR_INTERNAL;
|
||||
}
|
||||
}
|
||||
|
||||
DLLEXPORT int DECMPA_CC DecMPA_SetParam(void* pDecoder,int ID,long Value)
|
||||
{
|
||||
if(pDecoder==NULL)
|
||||
return DECMPA_ERROR_PARAM;
|
||||
|
||||
return ((CMPADecoder*)pDecoder)->SetParam(ID,Value);
|
||||
}
|
||||
|
||||
DLLEXPORT long DECMPA_CC DecMPA_GetParam(void* pDecoder,int ID)
|
||||
{
|
||||
if(pDecoder==NULL)
|
||||
return DECMPA_ERROR_PARAM;
|
||||
|
||||
return ((CMPADecoder*)pDecoder)->GetParam(ID);
|
||||
}
|
||||
|
||||
DLLEXPORT int DECMPA_CC DecMPA_Decode(void* pDecoder,void* pBuffer,long nBufferBytes,long* pBytesDecoded)
|
||||
{
|
||||
if(pDecoder==NULL || pBytesDecoded==NULL || (pBuffer==NULL && nBufferBytes!=0))
|
||||
return DECMPA_ERROR_PARAM;
|
||||
|
||||
return ((CMPADecoder*)pDecoder)->Decode(pBuffer,nBufferBytes,*pBytesDecoded);
|
||||
}
|
||||
|
||||
DLLEXPORT int DECMPA_CC DecMPA_DecodeNoData(void* pDecoder,long* pDecodedBytes)
|
||||
{
|
||||
if(pDecoder==NULL || pDecodedBytes==NULL)
|
||||
return DECMPA_ERROR_PARAM;
|
||||
|
||||
return ((CMPADecoder*)pDecoder)->DecodeNoData(*pDecodedBytes);
|
||||
}
|
||||
|
||||
DLLEXPORT int DECMPA_CC DecMPA_SeekToTime(void* pDecoder,long Millis)
|
||||
{
|
||||
if(pDecoder==NULL)
|
||||
return DECMPA_ERROR_PARAM;
|
||||
|
||||
return ((CMPADecoder*)pDecoder)->SeekToTime(Millis);
|
||||
}
|
||||
|
||||
DLLEXPORT int DECMPA_CC DecMPA_GetTime(void* pDecoder,long* pTime)
|
||||
{
|
||||
if(pDecoder==NULL || pTime==NULL)
|
||||
return DECMPA_ERROR_PARAM;
|
||||
|
||||
return ((CMPADecoder*)pDecoder)->GetTime(*pTime);
|
||||
}
|
||||
|
||||
DLLEXPORT int DECMPA_CC DecMPA_GetDuration(void* pDecoder,long* pDuration)
|
||||
{
|
||||
if(pDecoder==NULL || pDuration==NULL)
|
||||
return DECMPA_ERROR_PARAM;
|
||||
|
||||
return ((CMPADecoder*)pDecoder)->GetDuration(*pDuration);
|
||||
}
|
||||
|
||||
DLLEXPORT int DECMPA_CC DecMPA_GetOutputFormat(void* pDecoder,DecMPA_OutputFormat* pFormat)
|
||||
{
|
||||
if(pDecoder==NULL || pFormat==NULL)
|
||||
return DECMPA_ERROR_PARAM;
|
||||
|
||||
((CMPADecoder*)pDecoder)->GetOutputFormat(*pFormat);
|
||||
|
||||
return DECMPA_OK;
|
||||
}
|
||||
|
||||
DLLEXPORT int DECMPA_CC DecMPA_OutputFormatChanged(void* pDecoder)
|
||||
{
|
||||
if(pDecoder==NULL)
|
||||
return 0;
|
||||
|
||||
return ((CMPADecoder*)pDecoder)->OutputFormatChanged() ? 1 : 0;
|
||||
}
|
||||
|
||||
DLLEXPORT int DECMPA_CC DecMPA_GetMPEGHeader(void* pDecoder,DecMPA_MPEGHeader* pHeader)
|
||||
{
|
||||
if(pDecoder==NULL || pHeader==NULL)
|
||||
return DECMPA_ERROR_PARAM;
|
||||
|
||||
((CMPADecoder*)pDecoder)->GetMPEGHeader(*pHeader);
|
||||
|
||||
return DECMPA_OK;
|
||||
}
|
||||
|
||||
DLLEXPORT int DECMPA_CC DecMPA_GetID3v2Data(void* pDecoder,unsigned char** ppData,long* pDataSize)
|
||||
{
|
||||
if(pDecoder==NULL || ppData==NULL || pDataSize==NULL)
|
||||
return DECMPA_ERROR_PARAM;
|
||||
|
||||
return ((CMPADecoder*)pDecoder)->GetID3v2Data(*ppData,*pDataSize);
|
||||
}
|
||||
|
||||
DLLEXPORT void DECMPA_CC DecMPA_Destroy(void* pDecoder)
|
||||
{
|
||||
if(pDecoder!=NULL)
|
||||
{
|
||||
try
|
||||
{
|
||||
delete (CMPADecoder*)pDecoder;
|
||||
}
|
||||
catch(std::exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DLLEXPORT int DECMPA_CC DecMPA_GetVersion(void)
|
||||
{
|
||||
return DECMPA_VERSION;
|
||||
}
|
||||
|
||||
|
|
@ -1,326 +0,0 @@
|
|||
/* DecMPA - simple MPEG Audio decoding library.
|
||||
Copyright (C) 2002 Hauke Duden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
#include "DefInc.h"
|
||||
#include "DecMPAFileAccess.h"
|
||||
|
||||
#include <memory.h>
|
||||
|
||||
CDecMPAFileAccess::CDecMPAFileAccess(const DecMPA_Callbacks& Callbacks,void* pContext)
|
||||
{
|
||||
m_Callbacks=Callbacks;
|
||||
m_pCallbackContext=pContext;
|
||||
|
||||
m_nPosition=Callbacks.GetPosition(pContext);
|
||||
if(m_nPosition<0)
|
||||
m_nPosition=0;
|
||||
|
||||
m_bEOF=false;
|
||||
|
||||
m_pUndoBuffer=NULL;
|
||||
m_nUndoBufferSize=0;
|
||||
|
||||
m_nUndoBufferFilled=0;
|
||||
m_nUndoBufferPos=0;
|
||||
|
||||
m_nUndoRecordingCount=0;
|
||||
|
||||
m_LastError=DECMPA_OK;
|
||||
|
||||
m_pSkipBuffer=NULL;
|
||||
m_nSkipBufferSize=0;
|
||||
}
|
||||
|
||||
CDecMPAFileAccess::~CDecMPAFileAccess()
|
||||
{
|
||||
if(m_pUndoBuffer!=NULL)
|
||||
delete[] m_pUndoBuffer;
|
||||
|
||||
if(m_pSkipBuffer!=NULL)
|
||||
delete[] m_pSkipBuffer;
|
||||
}
|
||||
|
||||
int CDecMPAFileAccess::Read(void* pDest,int nBytes)
|
||||
{
|
||||
long nResult=0;
|
||||
long nRedoBytes=0;
|
||||
|
||||
nRedoBytes=m_nUndoBufferFilled-m_nUndoBufferPos;
|
||||
if(nRedoBytes>0)
|
||||
{
|
||||
if(nRedoBytes>nBytes)
|
||||
nRedoBytes=nBytes;
|
||||
memcpy(pDest,m_pUndoBuffer+m_nUndoBufferPos,nRedoBytes);
|
||||
m_nUndoBufferPos+=nRedoBytes;
|
||||
nBytes-=nRedoBytes;
|
||||
pDest=((char*)pDest)+nRedoBytes;
|
||||
|
||||
m_nPosition+=nRedoBytes;
|
||||
|
||||
if(m_nUndoBufferPos==m_nUndoBufferFilled && m_nUndoRecordingCount==0)
|
||||
{
|
||||
m_nUndoBufferFilled=0;
|
||||
m_nUndoBufferPos=0;
|
||||
}
|
||||
|
||||
nResult+=nRedoBytes;
|
||||
}
|
||||
|
||||
if(nBytes>0)
|
||||
{
|
||||
long nRead;
|
||||
|
||||
nRead=m_Callbacks.Read(m_pCallbackContext,pDest,nBytes);
|
||||
if(nRead>=0)
|
||||
{
|
||||
if(nRead!=nBytes)
|
||||
m_bEOF=true;
|
||||
m_nPosition+=nRead;
|
||||
|
||||
if(m_nUndoRecordingCount>0)
|
||||
{
|
||||
EnsureUndoBufferFree(nRead);
|
||||
memcpy(m_pUndoBuffer+m_nUndoBufferPos,pDest,nRead);
|
||||
m_nUndoBufferFilled+=nRead;
|
||||
m_nUndoBufferPos+=nRead;
|
||||
}
|
||||
|
||||
nResult+=nRead;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_LastError=DECMPA_ERROR_READ;
|
||||
nResult=-1;
|
||||
}
|
||||
}
|
||||
|
||||
return nResult;
|
||||
}
|
||||
|
||||
long CDecMPAFileAccess::Skip(long nBytes)
|
||||
{
|
||||
long nResult=0;
|
||||
long nRedoBytes=0;
|
||||
bool bSeekFailed=false;
|
||||
|
||||
nRedoBytes=m_nUndoBufferFilled-m_nUndoBufferPos;
|
||||
if(nRedoBytes>0)
|
||||
{
|
||||
if(nRedoBytes>nBytes)
|
||||
nRedoBytes=nBytes;
|
||||
m_nUndoBufferPos+=nRedoBytes;
|
||||
nBytes-=nRedoBytes;
|
||||
|
||||
m_nPosition+=nRedoBytes;
|
||||
|
||||
if(m_nUndoBufferPos==m_nUndoBufferFilled && m_nUndoRecordingCount==0)
|
||||
{
|
||||
m_nUndoBufferFilled=0;
|
||||
m_nUndoBufferPos=0;
|
||||
}
|
||||
|
||||
nResult+=nRedoBytes;
|
||||
}
|
||||
|
||||
if(nBytes>0)
|
||||
{
|
||||
//first try to skip using seek
|
||||
|
||||
if(nBytes>1024 && m_Callbacks.Seek!=NULL && m_nUndoRecordingCount==0)
|
||||
{
|
||||
long nLength=GetLength();
|
||||
|
||||
if(nLength!=-1)
|
||||
{
|
||||
long nToSkip=nBytes;
|
||||
|
||||
if(m_nPosition+nToSkip>nLength)
|
||||
nToSkip=nLength-m_nPosition;
|
||||
|
||||
if(m_Callbacks.Seek(m_pCallbackContext,m_nPosition+nToSkip)!=0)
|
||||
{
|
||||
m_nPosition+=nToSkip;
|
||||
nResult+=nToSkip;
|
||||
nBytes-=nToSkip;
|
||||
}
|
||||
else
|
||||
{
|
||||
//seek failed - not critical, we can still try to skip
|
||||
//using read.
|
||||
bSeekFailed=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(nBytes>0)
|
||||
{
|
||||
int nToRead;
|
||||
int nRead;
|
||||
|
||||
if(m_pSkipBuffer==NULL)
|
||||
{
|
||||
m_nSkipBufferSize=8192;
|
||||
m_pSkipBuffer=new unsigned char[m_nSkipBufferSize];
|
||||
}
|
||||
|
||||
while(nBytes>0 && !m_bEOF)
|
||||
{
|
||||
nToRead=(nBytes<=m_nSkipBufferSize) ? nBytes : m_nSkipBufferSize;
|
||||
|
||||
nRead=m_Callbacks.Read(m_pCallbackContext,m_pSkipBuffer,nToRead);
|
||||
if(nRead>=0)
|
||||
{
|
||||
if(nRead!=nToRead)
|
||||
m_bEOF=true;
|
||||
m_nPosition+=nRead;
|
||||
|
||||
if(m_nUndoRecordingCount>0)
|
||||
{
|
||||
EnsureUndoBufferFree(nRead);
|
||||
memcpy(m_pUndoBuffer+m_nUndoBufferPos,m_pSkipBuffer,nRead);
|
||||
m_nUndoBufferFilled+=nRead;
|
||||
m_nUndoBufferPos+=nRead;
|
||||
}
|
||||
|
||||
nResult+=nRead;
|
||||
nBytes-=nRead;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(bSeekFailed)
|
||||
{
|
||||
//if seek also failed before we report a seek error
|
||||
m_LastError=DECMPA_ERROR_SEEK;
|
||||
}
|
||||
else
|
||||
m_LastError=DECMPA_ERROR_READ;
|
||||
|
||||
nResult=-1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nResult;
|
||||
}
|
||||
|
||||
bool CDecMPAFileAccess::IsEndOfFile()
|
||||
{
|
||||
return m_bEOF;
|
||||
}
|
||||
|
||||
bool CDecMPAFileAccess::Seek(long pos)
|
||||
{
|
||||
bool bResult=false;
|
||||
|
||||
if(pos==m_nPosition)
|
||||
bResult=true;
|
||||
else
|
||||
{
|
||||
if(m_nUndoRecordingCount==0)
|
||||
{
|
||||
if(m_Callbacks.Seek!=NULL)
|
||||
{
|
||||
if(m_Callbacks.Seek(m_pCallbackContext,pos)!=0)
|
||||
{
|
||||
m_nPosition=pos;
|
||||
bResult=true;
|
||||
}
|
||||
else
|
||||
m_LastError=DECMPA_ERROR_SEEK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
long CDecMPAFileAccess::GetPosition()
|
||||
{
|
||||
return m_nPosition;
|
||||
}
|
||||
|
||||
long CDecMPAFileAccess::GetLength()
|
||||
{
|
||||
long nLength=-1;
|
||||
|
||||
if(m_Callbacks.GetLength!=NULL)
|
||||
nLength=m_Callbacks.GetLength(m_pCallbackContext);
|
||||
|
||||
return nLength;
|
||||
}
|
||||
|
||||
long CDecMPAFileAccess::StartUndoRecording()
|
||||
{
|
||||
m_nUndoRecordingCount++;
|
||||
|
||||
return m_nUndoBufferPos;
|
||||
}
|
||||
|
||||
void CDecMPAFileAccess::EndUndoRecording(long ID,bool bUndo)
|
||||
{
|
||||
if(m_nUndoRecordingCount>0)
|
||||
{
|
||||
if(bUndo)
|
||||
{
|
||||
m_nPosition-=m_nUndoBufferPos-ID;
|
||||
if(m_nUndoBufferPos!=ID)
|
||||
m_bEOF=false;
|
||||
|
||||
m_nUndoBufferPos=ID;
|
||||
}
|
||||
|
||||
m_nUndoRecordingCount--;
|
||||
}
|
||||
}
|
||||
|
||||
void CDecMPAFileAccess::EnsureUndoBufferFree(long nBytes)
|
||||
{
|
||||
if(m_nUndoBufferPos+nBytes>m_nUndoBufferSize)
|
||||
{
|
||||
unsigned char* pNew;
|
||||
long nAdd=m_nUndoBufferPos+nBytes-m_nUndoBufferSize;
|
||||
|
||||
if((nAdd & 8191)!=0)
|
||||
nAdd+=8192-(nAdd & 8191);
|
||||
|
||||
pNew=new unsigned char[m_nUndoBufferSize+nAdd];
|
||||
memcpy(pNew,m_pUndoBuffer,m_nUndoBufferFilled);
|
||||
m_nUndoBufferSize+=nAdd;
|
||||
|
||||
if(m_pUndoBuffer!=NULL)
|
||||
delete[] m_pUndoBuffer;
|
||||
m_pUndoBuffer=pNew;
|
||||
}
|
||||
}
|
||||
|
||||
int CDecMPAFileAccess::GetLastError()
|
||||
{
|
||||
return m_LastError;
|
||||
}
|
||||
|
||||
bool CDecMPAFileAccess::CanSeek()
|
||||
{
|
||||
return (m_Callbacks.Seek!=NULL);
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
/* DecMPA - simple MPEG Audio decoding library.
|
||||
Copyright (C) 2002 Hauke Duden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
#ifndef _DECMPAFILEACCESS_H_
|
||||
#define _DECMPAFILEACCESS_H_
|
||||
|
||||
#include "../include/decmpa.h"
|
||||
|
||||
#include "IFileAccess.h"
|
||||
|
||||
class CDecMPAFileAccess : public IFileAccess
|
||||
{
|
||||
public:
|
||||
CDecMPAFileAccess(const DecMPA_Callbacks& Callbacks,void* pContext);
|
||||
~CDecMPAFileAccess();
|
||||
|
||||
int Read(void* pDest,int nBytes);
|
||||
long Skip(long nBytes);
|
||||
|
||||
bool IsEndOfFile();
|
||||
|
||||
bool CanSeek();
|
||||
bool Seek(long pos);
|
||||
|
||||
long GetPosition();
|
||||
long GetLength();
|
||||
|
||||
long StartUndoRecording();
|
||||
void EndUndoRecording(long ID,bool bUndo);
|
||||
|
||||
int GetLastError();
|
||||
|
||||
protected:
|
||||
void EnsureUndoBufferFree(long nBytes);
|
||||
|
||||
DecMPA_Callbacks m_Callbacks;
|
||||
void* m_pCallbackContext;
|
||||
|
||||
long m_nPosition;
|
||||
bool m_bEOF;
|
||||
|
||||
unsigned char* m_pUndoBuffer;
|
||||
long m_nUndoBufferSize;
|
||||
long m_nUndoBufferFilled;
|
||||
long m_nUndoBufferPos;
|
||||
|
||||
int m_nUndoRecordingCount;
|
||||
|
||||
unsigned char* m_pSkipBuffer;
|
||||
long m_nSkipBufferSize;
|
||||
|
||||
int m_LastError;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
/* DecMPA - simple MPEG Audio decoding library.
|
||||
Copyright (C) 2002 Hauke Duden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _DECODEENGINE_H_
|
||||
#define _DECODEENGINE_H_
|
||||
|
||||
#include "frame/audioFrame.h"
|
||||
|
||||
void* DecodeEngine_Create();
|
||||
|
||||
bool DecodeEngine_Decode(void* pEngine,AudioFrame* pDest,void* pData,long nDataLength);
|
||||
void DecodeEngine_Flush(void* pEngine);
|
||||
|
||||
void DecodeEngine_Destroy(void* pEngine);
|
||||
|
||||
#endif
|
|
@ -1,25 +0,0 @@
|
|||
/* DecMPA - simple MPEG Audio decoding library.
|
||||
Copyright (C) 2002 Hauke Duden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
|
||||
#include <new>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
/* DecMPA - simple MPEG Audio decoding library.
|
||||
Copyright (C) 2002 Hauke Duden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
#ifndef _IFILEACCESS_H_
|
||||
#define _IFILEACCESS_H_
|
||||
|
||||
class IFileAccess
|
||||
{
|
||||
public:
|
||||
virtual int Read(void* pDest,int nBytes)=0;
|
||||
virtual long Skip(long nBytes)=0;
|
||||
virtual bool IsEndOfFile()=0;
|
||||
|
||||
virtual bool CanSeek()=0;
|
||||
virtual bool Seek(long nPosition)=0;
|
||||
|
||||
virtual long GetPosition()=0;
|
||||
virtual long GetLength()=0;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,638 +0,0 @@
|
|||
/* DecMPA - simple MPEG Audio decoding library.
|
||||
Copyright (C) 2002 Hauke Duden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
//This file is a heavily modified version of SPlayPlugin.cpp from the original
|
||||
//mpeglib. See Readme.txt for details.
|
||||
|
||||
#include "DefInc.h"
|
||||
#include "MPADecoder.h"
|
||||
|
||||
#include "DecodeEngine.h"
|
||||
|
||||
#include <exception>
|
||||
#include <memory>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
||||
CMPADecoder::CMPADecoder(const DecMPA_Callbacks& Callbacks,void* pCallbackContext)
|
||||
{
|
||||
pow(6.0,3.0); // fixes bug in __math.h
|
||||
|
||||
m_Callbacks=Callbacks;
|
||||
m_pCallbackContext=pCallbackContext;
|
||||
|
||||
m_pFileAccess=new CDecMPAFileAccess(Callbacks,pCallbackContext);
|
||||
|
||||
m_nResyncCounter=0;
|
||||
|
||||
m_nBufferBytes=0;
|
||||
m_nUsedBufferBytes=0;
|
||||
m_pBuffer=NULL;
|
||||
|
||||
m_OutputFormat.nType=0;
|
||||
m_OutputFormat.nFrequency=0;
|
||||
m_OutputFormat.nChannels=0;
|
||||
m_bOutputFormatChanged=false;
|
||||
|
||||
memset(&m_MPEGHeader,0,sizeof(m_MPEGHeader));
|
||||
|
||||
m_bDoFloat=false;
|
||||
m_pPCMFrame=new PCMFrame(MP3FRAMESIZE);
|
||||
m_pFloatFrame=new FloatFrame(MP3FRAMESIZE);
|
||||
m_pAudioFrame=NULL;
|
||||
|
||||
m_pFormatFrame=new AudioFrame;
|
||||
|
||||
m_nReadTime=0;
|
||||
m_nBufferStartTime=0;
|
||||
m_nDecodeTime=0;
|
||||
|
||||
m_bPrepared=false;
|
||||
m_bHasFrame=false;
|
||||
|
||||
m_bFirstDecode=true;
|
||||
|
||||
m_pDecodeEngine=DecodeEngine_Create();
|
||||
|
||||
m_bStoreID3v2=false;
|
||||
m_pID3v2Data=(unsigned char*)0;
|
||||
m_nID3v2DataSize=0;
|
||||
|
||||
m_pDestroyNotify=(void (*)(void*))0;
|
||||
m_pDestroyNotifyContext=(void*)0;
|
||||
|
||||
m_aParams[DECMPA_PARAM_OUTPUT]=DECMPA_OUTPUT_INT16;
|
||||
m_aParams[DECMPA_PARAM_PROVIDEID3V2]=DECMPA_NO;
|
||||
|
||||
m_bNotMPEG=false;
|
||||
|
||||
m_bDecoderNeedsFlush=false;
|
||||
}
|
||||
|
||||
CMPADecoder::~CMPADecoder()
|
||||
{
|
||||
if(m_pDestroyNotify!=(void (*)(void*))0)
|
||||
m_pDestroyNotify(m_pDestroyNotifyContext);
|
||||
|
||||
delete m_pPCMFrame;
|
||||
delete m_pFloatFrame;
|
||||
|
||||
delete m_pFileAccess;
|
||||
delete m_pFormatFrame;
|
||||
|
||||
DecodeEngine_Destroy(m_pDecodeEngine);
|
||||
}
|
||||
|
||||
int CMPADecoder::DecodeNoData(long& nDecodedBytes)
|
||||
{
|
||||
return Decode(NULL,-1,nDecodedBytes);
|
||||
}
|
||||
|
||||
int CMPADecoder::Decode(void* pBuffer,long nBufferBytes,long& nBytesDecoded)
|
||||
{
|
||||
int Result=DECMPA_OK;
|
||||
|
||||
if(pBuffer==NULL)
|
||||
nBufferBytes=-1;
|
||||
|
||||
nBytesDecoded=0;
|
||||
m_bOutputFormatChanged=false;
|
||||
|
||||
if((Result=EnsurePrepared())!=DECMPA_OK)
|
||||
return Result;
|
||||
|
||||
try
|
||||
{
|
||||
while(!ReadDecodedData(pBuffer,nBufferBytes,nBytesDecoded))
|
||||
{
|
||||
Result=DecodeNextFrame(pBuffer==NULL);
|
||||
if(Result!=DECMPA_OK)
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch(std::bad_alloc)
|
||||
{
|
||||
return DECMPA_ERROR_MEMORY;
|
||||
}
|
||||
catch(std::exception)
|
||||
{
|
||||
return DECMPA_ERROR_INTERNAL;
|
||||
}
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
int CMPADecoder::DecodeNextFrame(bool bNoData)
|
||||
{
|
||||
int Result=DECMPA_OK;
|
||||
|
||||
//find and read the next frame
|
||||
//we may still have one frame buffered that was read to find out
|
||||
//the file information. In that case don't read another one
|
||||
if(!m_bHasFrame)
|
||||
m_bHasFrame=ReadNextFrame();
|
||||
if(m_bHasFrame)
|
||||
{
|
||||
bool bDecodeOK;
|
||||
|
||||
//don't use this frame again
|
||||
m_bHasFrame=false;
|
||||
|
||||
//if bNoData==true we don't decode any audio data but only
|
||||
//parse the frame headers
|
||||
//this allows the user to do a quick pass over the file and
|
||||
//get an accurate estimate of the files properties
|
||||
//(actual duration, decoded size, etc...).
|
||||
if(!bNoData)
|
||||
{
|
||||
if(m_bDecoderNeedsFlush)
|
||||
{
|
||||
DecodeEngine_Flush(m_pDecodeEngine);
|
||||
m_bDecoderNeedsFlush=false;
|
||||
}
|
||||
|
||||
bDecodeOK=DecodeEngine_Decode(m_pDecodeEngine,m_pAudioFrame,m_FrameFinder.GetFrameData(),m_FrameFinder.GetFrameSize());
|
||||
}
|
||||
else
|
||||
{
|
||||
MpegAudioHeader* pHeader=m_FrameFinder.GetFrameHeader();
|
||||
long nDecodedFrameSize;
|
||||
|
||||
m_bDecoderNeedsFlush=true;
|
||||
|
||||
nDecodedFrameSize=pHeader->getpcmperframe();
|
||||
if(pHeader->getInputstereo()==1)
|
||||
nDecodedFrameSize*=2;
|
||||
|
||||
//pretend that we have decoded something
|
||||
m_pAudioFrame->setLen(nDecodedFrameSize);
|
||||
m_pAudioFrame->setFrameFormat(pHeader->getInputstereo(),pHeader->getFrequencyHz());
|
||||
|
||||
//note that this "ghost data" will never be retrieved because the call
|
||||
//to ReadDecodedData that follows will always remove all of it
|
||||
//(see Decode)
|
||||
|
||||
bDecodeOK=true;
|
||||
}
|
||||
|
||||
if(bDecodeOK)
|
||||
{
|
||||
//make the decoded data available to the "user"
|
||||
HandleDecodedData(m_pAudioFrame);
|
||||
}
|
||||
//ignore if the decoding of the frame failed. Just continue with
|
||||
//the next frame
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_FrameFinder.IsStreamInvalid())
|
||||
Result=DECMPA_ERROR_DECODE;
|
||||
else
|
||||
{
|
||||
if(m_pFileAccess->IsEndOfFile())
|
||||
{
|
||||
//end of file reached
|
||||
if(!m_FrameFinder.KnowsCharacteristics())
|
||||
{
|
||||
//the end was reached without being able to find out
|
||||
//essential stream characteristics
|
||||
//=> not an MPEG Audio file (or one that has less than 4 frames)
|
||||
Result=DECMPA_ERROR_DECODE;
|
||||
}
|
||||
else
|
||||
Result=DECMPA_END;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_pFileAccess->GetLastError()!=DECMPA_OK)
|
||||
Result=m_pFileAccess->GetLastError();
|
||||
else
|
||||
{
|
||||
//should never happen - an invalid stream, end of file
|
||||
//or a read error are the only things that could cause
|
||||
//ReadNextFrame to fail
|
||||
Result=DECMPA_ERROR_INTERNAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
void CMPADecoder::Flush()
|
||||
{
|
||||
m_FrameFinder.Flush();
|
||||
DecodeEngine_Flush(m_pDecodeEngine);
|
||||
|
||||
m_nBufferBytes=0;
|
||||
m_nUsedBufferBytes=0;
|
||||
}
|
||||
|
||||
bool CMPADecoder::ReadDecodedData(void* pDest,long nBytes,long& nRead)
|
||||
{
|
||||
long nAvailBytes=m_nBufferBytes-m_nUsedBufferBytes;
|
||||
|
||||
if(nAvailBytes>0)
|
||||
{
|
||||
if(nBytes>nAvailBytes || nBytes==-1)
|
||||
nBytes=nAvailBytes;
|
||||
nBytes&=~m_nOutputBlockSize; //only full samples
|
||||
|
||||
if(pDest!=NULL)
|
||||
memcpy(pDest,m_pBuffer+m_nUsedBufferBytes,nBytes);
|
||||
m_nUsedBufferBytes+=nBytes;
|
||||
|
||||
nRead=nBytes;
|
||||
|
||||
m_nReadTime=m_nBufferStartTime+(((double)(m_nUsedBufferBytes/m_nOutputBlockSize))*1000)/m_pFormatFrame->getFrequenceHZ();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
long CMPADecoder::GetFilePositionFromTime(long Millis)
|
||||
{
|
||||
int nResult;
|
||||
|
||||
if((nResult=EnsurePrepared())!=DECMPA_OK)
|
||||
return nResult;
|
||||
|
||||
return m_Info.GetFilePositionFromTime(Millis);
|
||||
}
|
||||
|
||||
int CMPADecoder::SeekToTime(long Millis)
|
||||
{
|
||||
int Result=DECMPA_OK;
|
||||
|
||||
if(!m_pFileAccess->CanSeek())
|
||||
Result=DECMPA_ERROR_UNSUPPORTED;
|
||||
else
|
||||
{
|
||||
long nFilePos;
|
||||
|
||||
if((Result=EnsurePrepared())==DECMPA_OK)
|
||||
{
|
||||
nFilePos=m_Info.GetFilePositionFromTime(Millis);
|
||||
if(nFilePos==-1)
|
||||
Result=DECMPA_ERROR_UNSUPPORTED;
|
||||
else
|
||||
{
|
||||
if(!m_pFileAccess->Seek(nFilePos))
|
||||
Result=DECMPA_ERROR_SEEK;
|
||||
else
|
||||
{
|
||||
//throw away buffered data
|
||||
Flush();
|
||||
|
||||
if(Millis!=0)
|
||||
{
|
||||
//initiate resync (skip next 5 frames until back
|
||||
//references are ok again)
|
||||
m_nResyncCounter=5;
|
||||
}
|
||||
|
||||
m_nDecodeTime=Millis;
|
||||
m_nBufferStartTime=Millis;
|
||||
m_nReadTime=Millis;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
int CMPADecoder::GetTime(long& Time)
|
||||
{
|
||||
Time=(long)m_nReadTime;
|
||||
|
||||
return DECMPA_OK;
|
||||
}
|
||||
|
||||
int CMPADecoder::GetDuration(long& Duration)
|
||||
{
|
||||
int nResult;
|
||||
|
||||
try
|
||||
{
|
||||
if((nResult=EnsurePrepared())!=DECMPA_OK)
|
||||
return nResult;
|
||||
|
||||
Duration=m_Info.GetDuration();
|
||||
|
||||
return DECMPA_OK;
|
||||
}
|
||||
catch(std::bad_alloc)
|
||||
{
|
||||
return DECMPA_ERROR_MEMORY;
|
||||
}
|
||||
catch(std::exception)
|
||||
{
|
||||
return DECMPA_ERROR_INTERNAL;
|
||||
}
|
||||
}
|
||||
|
||||
bool CMPADecoder::ReadNextFrame()
|
||||
{
|
||||
while(!m_FrameFinder.ReadNextFrame())
|
||||
{
|
||||
if(m_FrameFinder.IsStreamInvalid())
|
||||
return false;
|
||||
|
||||
if(!m_FrameFinder.ReadInput(m_pFileAccess))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CMPADecoder::SetOutputFormat(AudioFrame* pNewFormatFrame)
|
||||
{
|
||||
pNewFormatFrame->copyFormat(m_pFormatFrame);
|
||||
|
||||
m_OutputFormat.nFrequency=m_pFormatFrame->getFrequenceHZ();
|
||||
m_OutputFormat.nChannels=m_pFormatFrame->getStereo() ? 2 : 1;
|
||||
|
||||
m_bOutputFormatChanged=true;
|
||||
|
||||
m_nOutputBlockSize=m_pFormatFrame->getSampleSize()/8;
|
||||
m_nOutputBlockSize*=m_OutputFormat.nChannels;
|
||||
}
|
||||
|
||||
void CMPADecoder::UpdateMPEGHeader(MpegAudioHeader* pHeader)
|
||||
{
|
||||
memcpy(m_MPEGHeader.aRawData,pHeader->getHeader(),4);
|
||||
m_MPEGHeader.bProtection=pHeader->getProtection()!=0;
|
||||
|
||||
m_MPEGHeader.nLayer=pHeader->getLayer();
|
||||
m_MPEGHeader.nVersion=pHeader->getVersion();
|
||||
m_MPEGHeader.bPadding=pHeader->getPadding()!=0;
|
||||
m_MPEGHeader.nFrequencyIndex=pHeader->getFrequency();
|
||||
m_MPEGHeader.nFrequency=pHeader->getFrequencyHz();
|
||||
m_MPEGHeader.nBitRateIndex=pHeader->getBitrateindex();
|
||||
m_MPEGHeader.nExtendedMode=pHeader->getExtendedmode();
|
||||
m_MPEGHeader.nMode=pHeader->getMode();
|
||||
m_MPEGHeader.bInputStereo=pHeader->getInputstereo()!=0;
|
||||
m_MPEGHeader.bMPEG25=pHeader->getLayer25()!=0;
|
||||
|
||||
m_MPEGHeader.nFrameSize=pHeader->getFramesize();
|
||||
m_MPEGHeader.nDecodedSamplesPerFrame=pHeader->getpcmperframe();
|
||||
m_MPEGHeader.nBitRateKbps=pHeader->GetBitRateKbps();
|
||||
}
|
||||
|
||||
bool CMPADecoder::OutputFormatChanged()
|
||||
{
|
||||
return m_bOutputFormatChanged;
|
||||
}
|
||||
|
||||
void CMPADecoder::GetOutputFormat(DecMPA_OutputFormat& Format)
|
||||
{
|
||||
Format=m_OutputFormat;
|
||||
}
|
||||
|
||||
void CMPADecoder::GetMPEGHeader(DecMPA_MPEGHeader& Header)
|
||||
{
|
||||
Header=m_MPEGHeader;
|
||||
}
|
||||
|
||||
|
||||
void CMPADecoder::HandleDecodedData(AudioFrame* pDecodedFrame)
|
||||
{
|
||||
int nDecodedSamples;
|
||||
|
||||
if(m_bFirstDecode)
|
||||
{
|
||||
SetOutputFormat(pDecodedFrame);
|
||||
m_bFirstDecode=false;
|
||||
}
|
||||
|
||||
nDecodedSamples=pDecodedFrame->getLen();
|
||||
if(pDecodedFrame->getStereo()==1)
|
||||
nDecodedSamples/=2;
|
||||
|
||||
m_nBufferStartTime=m_nDecodeTime;
|
||||
m_nDecodeTime+=(((double)nDecodedSamples)*1000)/pDecodedFrame->getFrequenceHZ();
|
||||
|
||||
if(m_nResyncCounter>0)
|
||||
{
|
||||
//we need to resync = read a few frames to make sure
|
||||
//that the back references are ok again
|
||||
//do not output any of the decoded data
|
||||
m_nResyncCounter--;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!m_pFormatFrame->isFormatEqual(pDecodedFrame))
|
||||
SetOutputFormat(pDecodedFrame);
|
||||
|
||||
UpdateMPEGHeader(m_FrameFinder.GetFrameHeader());
|
||||
|
||||
if(m_bDoFloat)
|
||||
{
|
||||
m_nBufferBytes=m_pFloatFrame->getLen()*sizeof(float);
|
||||
m_pBuffer=(unsigned char*)m_pFloatFrame->getData();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_nBufferBytes=m_pPCMFrame->getLen()*sizeof(short);
|
||||
m_pBuffer=(unsigned char*)m_pPCMFrame->getData();
|
||||
}
|
||||
m_nUsedBufferBytes=0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int CMPADecoder::EnsurePrepared()
|
||||
{
|
||||
int Result=DECMPA_OK;
|
||||
|
||||
if(!m_bPrepared)
|
||||
{
|
||||
if(m_bNotMPEG)
|
||||
Result=DECMPA_ERROR_DECODE;
|
||||
else
|
||||
{
|
||||
m_bStoreID3v2=(m_aParams[DECMPA_PARAM_PROVIDEID3V2]==DECMPA_YES);
|
||||
|
||||
m_bDoFloat=(m_aParams[DECMPA_PARAM_OUTPUT]==DECMPA_OUTPUT_FLOAT);
|
||||
m_nOutputBlockSize=1;
|
||||
if(m_bDoFloat)
|
||||
m_pAudioFrame=m_pFloatFrame;
|
||||
else
|
||||
m_pAudioFrame=m_pPCMFrame;
|
||||
|
||||
m_OutputFormat.nType=m_aParams[DECMPA_PARAM_OUTPUT];
|
||||
|
||||
//Skip or store any leading ID3 tags - some tags are not
|
||||
//correctly escaped and contain "sync" codes that can confuse
|
||||
//the decoder
|
||||
HandleID3Tag();
|
||||
|
||||
if(!m_Info.InitInfo(&m_FrameFinder,m_pFileAccess))
|
||||
{
|
||||
m_bNotMPEG=true;
|
||||
Result=DECMPA_ERROR_DECODE;
|
||||
}
|
||||
else
|
||||
{
|
||||
//info reads up to one frame.
|
||||
//we can use this in decoding, we only have to remember not
|
||||
//to read a fresh one in the first iteration of Decode
|
||||
m_bHasFrame=m_FrameFinder.HasFrame();
|
||||
|
||||
m_bPrepared=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
void CMPADecoder::HandleID3Tag()
|
||||
{
|
||||
unsigned char aHeaderData[10];
|
||||
struct ID3v2Header
|
||||
{
|
||||
char sID[3];
|
||||
unsigned char Version;
|
||||
unsigned char Revision;
|
||||
unsigned char Flags;
|
||||
unsigned long Size;
|
||||
} Header;
|
||||
|
||||
int nBytesRead;
|
||||
long UndoID;
|
||||
|
||||
UndoID=m_pFileAccess->StartUndoRecording();
|
||||
|
||||
if((nBytesRead=m_pFileAccess->Read((char*)&aHeaderData,10))==10)
|
||||
{
|
||||
//we do not read directly into the header because the fields may
|
||||
//have been padded by the compiler
|
||||
memcpy(Header.sID,aHeaderData,3);
|
||||
Header.Version=aHeaderData[3];
|
||||
Header.Revision=aHeaderData[4];
|
||||
Header.Flags=aHeaderData[5];
|
||||
Header.Size=aHeaderData[6];
|
||||
Header.Size<<=8;
|
||||
Header.Size|=aHeaderData[7];
|
||||
Header.Size<<=8;
|
||||
Header.Size|=aHeaderData[8];
|
||||
Header.Size<<=8;
|
||||
Header.Size|=aHeaderData[9];
|
||||
|
||||
//make sure its an ID3 header
|
||||
if(strncmp(Header.sID,"ID3",3)==0 && Header.Version!=0xff && Header.Revision!=0xff
|
||||
&& (Header.Size & 0x80808080)==0)
|
||||
{
|
||||
unsigned long TagSize=Header.Size;
|
||||
|
||||
//ok, we have an ID3 tag - no need for undo
|
||||
m_pFileAccess->EndUndoRecording(UndoID,false);
|
||||
UndoID=-1;
|
||||
|
||||
//correct "unsyncing" of tag size
|
||||
TagSize=(TagSize & 0x7f) | ((TagSize & 0x7f00)>>1)
|
||||
| ((TagSize & 0x7f0000)>>2) | ((TagSize & 0x7f000000)>>3);
|
||||
|
||||
if(m_bStoreID3v2)
|
||||
{
|
||||
//read ID3 tag
|
||||
|
||||
m_pID3v2Data=new unsigned char[10+TagSize];
|
||||
memcpy(m_pID3v2Data,aHeaderData,10);
|
||||
|
||||
if(m_pFileAccess->Read(m_pID3v2Data+10,TagSize)==(long)TagSize)
|
||||
m_nID3v2DataSize=TagSize+10;
|
||||
else
|
||||
{
|
||||
delete[] m_pID3v2Data;
|
||||
m_pID3v2Data=(unsigned char*)0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//skip the ID3 tag
|
||||
m_pFileAccess->Skip(TagSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(UndoID!=-1)
|
||||
{
|
||||
//no ID3 tag found
|
||||
//=> undo read operations
|
||||
m_pFileAccess->EndUndoRecording(UndoID,true);
|
||||
}
|
||||
}
|
||||
|
||||
int CMPADecoder::GetID3v2Data(unsigned char*& pData,long& nDataSize)
|
||||
{
|
||||
int nResult;
|
||||
|
||||
if((nResult=EnsurePrepared())!=DECMPA_OK)
|
||||
return nResult;
|
||||
|
||||
if(m_pID3v2Data==(unsigned char*)0)
|
||||
return DECMPA_ERROR_NOTAVAILABLE;
|
||||
|
||||
pData=m_pID3v2Data;
|
||||
nDataSize=m_nID3v2DataSize;
|
||||
|
||||
return DECMPA_OK;
|
||||
}
|
||||
|
||||
|
||||
int CMPADecoder::SetParam(int ID,long Value)
|
||||
{
|
||||
bool bOK=false;
|
||||
|
||||
if(m_bPrepared)
|
||||
return DECMPA_ERROR_WRONGSTATE;
|
||||
|
||||
switch(ID)
|
||||
{
|
||||
case DECMPA_PARAM_OUTPUT: bOK=(Value==DECMPA_OUTPUT_INT16 || Value==DECMPA_OUTPUT_FLOAT);
|
||||
break;
|
||||
case DECMPA_PARAM_PROVIDEID3V2: bOK=(Value==DECMPA_YES || Value==DECMPA_NO);
|
||||
break;
|
||||
}
|
||||
if(!bOK)
|
||||
return DECMPA_ERROR_PARAM;
|
||||
|
||||
m_aParams[ID]=Value;
|
||||
|
||||
return DECMPA_OK;
|
||||
|
||||
}
|
||||
|
||||
long CMPADecoder::GetParam(int ID)
|
||||
{
|
||||
if(ID<0 || ID>=DECMPA_PARAMCOUNT)
|
||||
return 0;
|
||||
|
||||
return m_aParams[ID];
|
||||
}
|
|
@ -1,143 +0,0 @@
|
|||
/* DecMPA - simple MPEG Audio decoding library.
|
||||
Copyright (C) 2002 Hauke Duden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
//This file is a heavily modified version of SPlayPlugin.h from the original
|
||||
//mpeglib. See Readme.txt for details.
|
||||
|
||||
|
||||
#ifndef _MPADECODER_H_
|
||||
#define _MPADECODER_H_
|
||||
|
||||
#include "../include/decmpa.h"
|
||||
|
||||
#include "DecMPAFileAccess.h"
|
||||
|
||||
#include "frame/pcmFrame.h"
|
||||
#include "frame/floatFrame.h"
|
||||
|
||||
#include "MPAFrameFinder.h"
|
||||
#include "MPAInfo.h"
|
||||
|
||||
class CMPADecoder
|
||||
{
|
||||
public:
|
||||
CMPADecoder(const DecMPA_Callbacks& Callbacks,void* pCallbackContext);
|
||||
~CMPADecoder();
|
||||
|
||||
int Decode(void* pBuffer,long nBufferBytes,long& nBytesDecoded);
|
||||
int DecodeNoData(long& nDecodedBytes);
|
||||
|
||||
int SeekToTime(long Millis);
|
||||
|
||||
int GetTime(long& Time);
|
||||
int GetDuration(long& Duration);
|
||||
|
||||
bool OutputFormatChanged();
|
||||
void GetOutputFormat(DecMPA_OutputFormat& Format);
|
||||
|
||||
void GetMPEGHeader(DecMPA_MPEGHeader& Header);
|
||||
|
||||
int GetID3v2Data(unsigned char*& pData,long& nDataSize);
|
||||
|
||||
inline void SetDestroyNotify(void (*pNotify)(void*),void* pContext);
|
||||
|
||||
long GetFilePositionFromTime(long Millis);
|
||||
|
||||
int SetParam(int ID,long Value);
|
||||
long GetParam(int ID);
|
||||
|
||||
protected:
|
||||
int DecodeNextFrame(bool bNoData);
|
||||
bool ReadNextFrame();
|
||||
|
||||
void HandleDecodedData(AudioFrame* playFrame);
|
||||
void SetOutputFormat(AudioFrame* pNewFormatFrame);
|
||||
|
||||
bool ReadDecodedData(void* pDest,long nBytes,long& nRead);
|
||||
|
||||
void Flush();
|
||||
|
||||
int EnsurePrepared();
|
||||
void HandleID3Tag();
|
||||
|
||||
void UpdateMPEGHeader(MpegAudioHeader* pHeader);
|
||||
|
||||
DecMPA_Callbacks m_Callbacks;
|
||||
void* m_pCallbackContext;
|
||||
|
||||
bool m_bDoFloat;
|
||||
|
||||
AudioFrame* m_pAudioFrame;
|
||||
FloatFrame* m_pFloatFrame;
|
||||
PCMFrame* m_pPCMFrame;
|
||||
|
||||
AudioFrame* m_pFormatFrame;
|
||||
int m_nOutputBlockSize;
|
||||
|
||||
CDecMPAFileAccess* m_pFileAccess;
|
||||
|
||||
long m_nBufferBytes;
|
||||
long m_nUsedBufferBytes;
|
||||
unsigned char* m_pBuffer;
|
||||
|
||||
double m_nReadTime;
|
||||
double m_nBufferStartTime;
|
||||
double m_nDecodeTime;
|
||||
|
||||
DecMPA_OutputFormat m_OutputFormat;
|
||||
bool m_bOutputFormatChanged;
|
||||
|
||||
DecMPA_MPEGHeader m_MPEGHeader;
|
||||
|
||||
bool m_bFirstDecode;
|
||||
bool m_bPrepared;
|
||||
bool m_bHasFrame;
|
||||
|
||||
int m_nResyncCounter;
|
||||
|
||||
void* m_pDecodeEngine;
|
||||
|
||||
CMPAFrameFinder m_FrameFinder;
|
||||
CMPAInfo m_Info;
|
||||
|
||||
bool m_bStoreID3v2;
|
||||
unsigned char* m_pID3v2Data;
|
||||
long m_nID3v2DataSize;
|
||||
|
||||
void (*m_pDestroyNotify)(void*);
|
||||
void* m_pDestroyNotifyContext;
|
||||
|
||||
long m_aParams[DECMPA_PARAMCOUNT];
|
||||
|
||||
bool m_bNotMPEG;
|
||||
|
||||
bool m_bDecoderNeedsFlush;
|
||||
};
|
||||
|
||||
inline void CMPADecoder::SetDestroyNotify(void (*pNotify)(void*),void* pContext)
|
||||
{
|
||||
m_pDestroyNotify=pNotify;
|
||||
m_pDestroyNotifyContext=pContext;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,550 +0,0 @@
|
|||
/* DecMPA - simple MPEG Audio decoding library.
|
||||
Copyright (C) 2002 Hauke Duden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
|
||||
#include "MPAFrameFinder.h"
|
||||
|
||||
#include <memory.h>
|
||||
|
||||
CMPAFrameFinder::CMPAFrameFinder()
|
||||
{
|
||||
// max size of buffer is:
|
||||
// header: 4
|
||||
// max bitrate: 448
|
||||
// min freq: 22050
|
||||
// padding: 1
|
||||
// ------------------
|
||||
// maxsize: 4+144000*max(bitrate)/min(freq)+1 ca: 2931 byte
|
||||
// then we add a "sentinel" at the end these are 4 byte.
|
||||
// so we should be ok, with a 4KB buffer.
|
||||
m_OutBuffer.Alloc(4096);
|
||||
m_OutBuffer.SetSize(4096);
|
||||
|
||||
m_MyInBuffer.Alloc(65536);
|
||||
|
||||
m_pFirstHeader=(HeaderRecord*)0;
|
||||
m_pLastHeader=(HeaderRecord*)0;
|
||||
m_pNewHeaderRecord=(HeaderRecord*)0;
|
||||
|
||||
m_bStreamInvalid=false;
|
||||
m_nLayer=-1;
|
||||
|
||||
m_bAllowFrequencyChanges=false;
|
||||
|
||||
m_nLookAheadFrames=3; //try to find 4 consistent frames by default
|
||||
|
||||
m_nReadStartPosition=0;
|
||||
|
||||
Restart();
|
||||
}
|
||||
|
||||
CMPAFrameFinder::~CMPAFrameFinder()
|
||||
{
|
||||
DeleteHeaderRecords();
|
||||
}
|
||||
|
||||
bool CMPAFrameFinder::ReadNextFrame()
|
||||
{
|
||||
bool bNeedMoreThanAvailable;
|
||||
|
||||
if(m_State==STATE_HAVEFRAME)
|
||||
ResetState();
|
||||
|
||||
while(true)
|
||||
{
|
||||
bNeedMoreThanAvailable=false;
|
||||
while(m_State!=STATE_HAVEFRAME && m_pInBuffer->HasMoreData() && !bNeedMoreThanAvailable)
|
||||
{
|
||||
switch(m_State)
|
||||
{
|
||||
case STATE_FINDCHARACTERISTICS: if(!FindCharacteristics())
|
||||
{
|
||||
//need more data, but we may still have
|
||||
//up to 3 bytes buffered
|
||||
//so, break manually here
|
||||
bNeedMoreThanAvailable=true;
|
||||
}
|
||||
break;
|
||||
case STATE_FINDSYNC: FindNextSync();
|
||||
break;
|
||||
case STATE_READHEADER: ReadHeader();
|
||||
break;
|
||||
case STATE_CHECKHEADER: CheckHeader();
|
||||
break;
|
||||
case STATE_READFRAME: ReadFrame();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(m_State!=STATE_HAVEFRAME && m_State>=STATE_FINDSYNC && m_pInBuffer==&m_MyInBuffer)
|
||||
{
|
||||
//we need more data, but were still reading
|
||||
//from our own preread data that was used to find out the
|
||||
//stream characteristics
|
||||
|
||||
//switch to user buffer (it may already contain some data)
|
||||
m_pInBuffer=&m_UserInBuffer;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if(m_State==STATE_FINDCHARACTERISTICS && m_MyInBuffer.GetSize()==m_MyInBuffer.GetCapacity())
|
||||
{
|
||||
//we have read the maximum of data and not found m_nLookAheadFrames+1 consistent
|
||||
//frames
|
||||
|
||||
//the stream does probably not contain valid MPEG Audio data
|
||||
m_bStreamInvalid=true;
|
||||
}
|
||||
|
||||
return (m_State==STATE_HAVEFRAME); //otherwise we need more data
|
||||
}
|
||||
|
||||
bool CMPAFrameFinder::FindCharacteristics()
|
||||
{
|
||||
unsigned char* pData;
|
||||
|
||||
//we read up to 64k data and try to find at least
|
||||
//m_nLookAheadFrames+1 frame headers that are consistent with one
|
||||
//another
|
||||
|
||||
while(m_MyInBuffer.GetBytesLeft()>=4)
|
||||
{
|
||||
pData=m_MyInBuffer.GetPosPtr();
|
||||
|
||||
if(pData[0]==0xff && (pData[1] & 0xe0)==0xe0)
|
||||
{
|
||||
//found sync
|
||||
//parse the header
|
||||
if(m_pNewHeaderRecord==(HeaderRecord*)0)
|
||||
m_pNewHeaderRecord=new HeaderRecord;
|
||||
|
||||
if(m_pNewHeaderRecord->Header.parseHeader(pData))
|
||||
{
|
||||
if(IsValidHeader(&m_pNewHeaderRecord->Header))
|
||||
{
|
||||
//seems to be a valid header.
|
||||
//add the a header record to the list
|
||||
|
||||
m_pNewHeaderRecord->nPosition=m_MyInBuffer.GetPos();
|
||||
m_pNewHeaderRecord->pNext=(HeaderRecord*)0;
|
||||
|
||||
if(m_pLastHeader==(HeaderRecord*)0)
|
||||
m_pFirstHeader=m_pLastHeader=m_pNewHeaderRecord;
|
||||
else
|
||||
{
|
||||
m_pLastHeader->pNext=m_pNewHeaderRecord;
|
||||
m_pLastHeader=m_pNewHeaderRecord;
|
||||
}
|
||||
m_pNewHeaderRecord=(HeaderRecord*)0;
|
||||
|
||||
//check wether we have found m_nLookAheadFrames+1 consistent headers yet
|
||||
if(FindConsistentHeaders())
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_MyInBuffer.AddToPos(1);
|
||||
}
|
||||
|
||||
return (m_State>=STATE_FINDSYNC);
|
||||
}
|
||||
|
||||
bool CMPAFrameFinder::FindConsistentHeaders()
|
||||
{
|
||||
HeaderRecord* pRecord;
|
||||
|
||||
//ok, we have found some headers in the data stream
|
||||
//now we try to find m_nLookAheadFrames+1 that are consistent
|
||||
//and assume that they correspond to valid frames in the stream
|
||||
|
||||
pRecord=m_pFirstHeader;
|
||||
while(pRecord!=(HeaderRecord*)0)
|
||||
{
|
||||
//be prejudiced for early headers
|
||||
if(!CanHaveConsistentHeaders(pRecord,m_nLookAheadFrames))
|
||||
{
|
||||
//if we haven't yet read enough data to find
|
||||
//consistent headers for the first headers, stop
|
||||
//here
|
||||
pRecord=(HeaderRecord*)0;
|
||||
break;
|
||||
}
|
||||
|
||||
//find two headers that are consistent with this one
|
||||
if(HasConsistentHeaders(pRecord,pRecord->pNext,m_nLookAheadFrames))
|
||||
break;
|
||||
|
||||
pRecord=pRecord->pNext;
|
||||
}
|
||||
|
||||
if(pRecord!=(HeaderRecord*)0)
|
||||
{
|
||||
//yay! we found m_nLookAheadFrames+1 consistent headers.
|
||||
//The first of them is pRecord
|
||||
|
||||
//store stream characteristics
|
||||
m_nLayer=pRecord->Header.getLayer();
|
||||
m_nInputStereo=pRecord->Header.getInputstereo();
|
||||
m_nFrequency=pRecord->Header.getFrequencyHz();
|
||||
m_nLayer25=pRecord->Header.getLayer25();
|
||||
m_nVersion=pRecord->Header.getVersion();
|
||||
|
||||
//set input buffer to start of first frame
|
||||
m_MyInBuffer.SetPos(pRecord->nPosition);
|
||||
|
||||
m_nFirstFramePosition=pRecord->nPosition+m_nReadStartPosition;
|
||||
|
||||
//throw away the header records
|
||||
DeleteHeaderRecords();
|
||||
|
||||
//got to next state (start extracting frame data)
|
||||
m_State++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CMPAFrameFinder::CanHaveConsistentHeaders(CMPAFrameFinder::HeaderRecord* pRecord,int nHeaderCount)
|
||||
{
|
||||
long nFirstFrameBegin;
|
||||
int nFrameSize;
|
||||
long nLastFrameHeaderEnd;
|
||||
|
||||
nFirstFrameBegin=pRecord->nPosition;
|
||||
nFrameSize=pRecord->Header.getFramesize();
|
||||
|
||||
//assume that the frames have a size difference of at most 512 bytes
|
||||
//(or at most 512 bytes of data in between)
|
||||
nLastFrameHeaderEnd=nFirstFrameBegin+((nFrameSize+512)*nHeaderCount)+4;
|
||||
|
||||
if(m_MyInBuffer.GetPos()<nLastFrameHeaderEnd)
|
||||
{
|
||||
//abort because we have not yet read parsed enough data
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CMPAFrameFinder::HasConsistentHeaders(CMPAFrameFinder::HeaderRecord* pCheckRecord,HeaderRecord* pRecord,int nHeadersNeeded)
|
||||
{
|
||||
while(pRecord!=(HeaderRecord*)0)
|
||||
{
|
||||
if(AreHeadersConsistent(pCheckRecord,pRecord))
|
||||
{
|
||||
nHeadersNeeded--;
|
||||
if(nHeadersNeeded==0)
|
||||
return true;
|
||||
|
||||
pCheckRecord=pRecord;
|
||||
}
|
||||
|
||||
pRecord=pRecord->pNext;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CMPAFrameFinder::AreHeadersConsistent(HeaderRecord* pFirst,HeaderRecord* pSecond)
|
||||
{
|
||||
//do the corresponding frames overlap?
|
||||
if(pFirst->nPosition+pFirst->Header.getFramesize()>pSecond->nPosition)
|
||||
return false;
|
||||
|
||||
//different layers?
|
||||
if(pFirst->Header.getLayer()!=pSecond->Header.getLayer())
|
||||
return false;
|
||||
|
||||
//one stereo, the other not?
|
||||
if(pFirst->Header.getInputstereo()!=pSecond->Header.getInputstereo())
|
||||
return false;
|
||||
|
||||
//mpeg 2.5?
|
||||
if(pFirst->Header.getLayer25()!=pSecond->Header.getLayer25())
|
||||
return false;
|
||||
|
||||
//version?
|
||||
if(pFirst->Header.getVersion()!=pSecond->Header.getVersion())
|
||||
return false;
|
||||
|
||||
if(!m_bAllowFrequencyChanges)
|
||||
{
|
||||
if(pFirst->Header.getFrequencyHz()!=pSecond->Header.getFrequencyHz())
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CMPAFrameFinder::IsConformingHeader(MpegAudioHeader* pHeader)
|
||||
{
|
||||
//check wether the header conforms with the detected stream characteristics
|
||||
|
||||
if(pHeader->getInputstereo()==m_nInputStereo
|
||||
&& pHeader->getLayer()==m_nLayer
|
||||
&& pHeader->getLayer25()==m_nLayer25
|
||||
&& pHeader->getVersion()==m_nVersion
|
||||
&& (pHeader->getFrequencyHz()==m_nFrequency || m_bAllowFrequencyChanges))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CMPAFrameFinder::FindNextSync()
|
||||
{
|
||||
unsigned char* pOut=m_OutBuffer.GetPosPtr();
|
||||
|
||||
while(m_pInBuffer->HasMoreData())
|
||||
{
|
||||
// shift
|
||||
pOut[0]=pOut[1];
|
||||
pOut[1]=m_pInBuffer->ReadByte();
|
||||
|
||||
if (pOut[0] == 0xff)
|
||||
{
|
||||
// upper 4 bit are syncword, except bit one
|
||||
// which is layer 2.5 indicator.
|
||||
if ( (pOut[1] & 0xe0) == 0xe0)
|
||||
{
|
||||
m_OutBuffer.SetPos(2);
|
||||
m_State++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMPAFrameFinder::ReadHeader()
|
||||
{
|
||||
while(m_pInBuffer->HasMoreData())
|
||||
{
|
||||
if(m_OutBuffer.GetPos()>=4)
|
||||
{
|
||||
m_State++;
|
||||
break;
|
||||
}
|
||||
|
||||
m_OutBuffer.WriteByte(m_pInBuffer->ReadByte());
|
||||
}
|
||||
}
|
||||
|
||||
void CMPAFrameFinder::CheckHeader()
|
||||
{
|
||||
bool bHeaderOK=false;
|
||||
|
||||
if(m_Header.parseHeader(m_OutBuffer.GetPtr()))
|
||||
{
|
||||
if(IsValidHeader(&m_Header))
|
||||
{
|
||||
//make sure the header conforms to the established stream
|
||||
//characteristics
|
||||
if(IsConformingHeader(&m_Header))
|
||||
{
|
||||
m_nFrameSize=m_Header.getFramesize();
|
||||
bHeaderOK=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(bHeaderOK)
|
||||
m_State++;
|
||||
else
|
||||
ResetState();
|
||||
}
|
||||
|
||||
void CMPAFrameFinder::ReadFrame()
|
||||
{
|
||||
int nBytesNeeded;
|
||||
int nBytesAvailable;
|
||||
int nCopyBytes;
|
||||
|
||||
do
|
||||
{
|
||||
nBytesNeeded=m_nFrameSize-m_OutBuffer.GetPos();
|
||||
nBytesAvailable=m_pInBuffer->GetSize()-m_pInBuffer->GetPos();
|
||||
|
||||
nCopyBytes=(nBytesAvailable<nBytesNeeded) ? nBytesAvailable : nBytesNeeded;
|
||||
|
||||
memcpy(m_OutBuffer.GetPosPtr(),m_pInBuffer->GetPosPtr(),nCopyBytes);
|
||||
m_OutBuffer.AddToPos(nCopyBytes);
|
||||
m_pInBuffer->AddToPos(nCopyBytes);
|
||||
|
||||
if(nBytesNeeded==nCopyBytes)
|
||||
{
|
||||
m_State++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
while(m_pInBuffer->HasMoreData());
|
||||
}
|
||||
|
||||
void CMPAFrameFinder::SetInput(void* pBuffer,int nBufferBytes,long nStreamPosition)
|
||||
{
|
||||
if(m_State==STATE_FINDCHARACTERISTICS)
|
||||
{
|
||||
int nCopyBytes=m_MyInBuffer.GetCapacity()-m_MyInBuffer.GetSize();
|
||||
|
||||
//copy it in into our own buffer
|
||||
if(nCopyBytes>nBufferBytes)
|
||||
nCopyBytes=nBufferBytes;
|
||||
|
||||
if(m_MyInBuffer.GetSize()==0)
|
||||
m_nReadStartPosition=nStreamPosition;
|
||||
|
||||
memcpy(m_MyInBuffer.GetPtr()+m_MyInBuffer.GetSize(),pBuffer,nCopyBytes);
|
||||
m_MyInBuffer.SetSize(m_MyInBuffer.GetSize()+nCopyBytes);
|
||||
|
||||
pBuffer=((unsigned char*)pBuffer)+nCopyBytes;
|
||||
nBufferBytes-=nCopyBytes;
|
||||
|
||||
//attach the rest to the user buffer
|
||||
}
|
||||
|
||||
m_UserInBuffer.Attach(pBuffer,nBufferBytes);
|
||||
}
|
||||
|
||||
bool CMPAFrameFinder::ReadInput(IFileAccess* pFileAccess)
|
||||
{
|
||||
int nResult;
|
||||
|
||||
if(m_State==STATE_FINDCHARACTERISTICS)
|
||||
{
|
||||
int nFree=m_MyInBuffer.GetCapacity()-m_MyInBuffer.GetSize();
|
||||
|
||||
//read data into our own buffer
|
||||
if(nFree>0)
|
||||
{
|
||||
//read in small chunks
|
||||
if(nFree>4096)
|
||||
nFree=4096;
|
||||
|
||||
if(m_MyInBuffer.GetSize()==0) //first input
|
||||
m_nReadStartPosition=pFileAccess->GetPosition();
|
||||
|
||||
nResult=pFileAccess->Read((char*)m_MyInBuffer.GetPtr()+m_MyInBuffer.GetSize(),nFree);
|
||||
if(nResult<=0)
|
||||
return false;
|
||||
|
||||
m_MyInBuffer.SetSize(m_MyInBuffer.GetSize()+nResult);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_UserInBuffer.IsAttached())
|
||||
m_UserInBuffer.Alloc(4096);
|
||||
|
||||
nResult=pFileAccess->Read((char*)m_UserInBuffer.GetPtr(),m_UserInBuffer.GetCapacity());
|
||||
if(nResult<=0)
|
||||
return false;
|
||||
|
||||
m_UserInBuffer.SetSize(nResult);
|
||||
m_UserInBuffer.SetPos(0);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CMPAFrameFinder::Flush()
|
||||
{
|
||||
ResetState();
|
||||
|
||||
m_UserInBuffer.SetSize(0);
|
||||
m_MyInBuffer.SetSize(0);
|
||||
|
||||
DeleteHeaderRecords();
|
||||
}
|
||||
|
||||
void CMPAFrameFinder::ResetState()
|
||||
{
|
||||
m_OutBuffer.SetPos(0);
|
||||
|
||||
//make sure that we do not accidentally treat
|
||||
//"leftover" data in the buffer as a sync mark
|
||||
m_OutBuffer.GetPtr()[0]=0;
|
||||
m_OutBuffer.GetPtr()[1]=0;
|
||||
|
||||
if(m_State>=STATE_FINDSYNC)
|
||||
m_State=STATE_FINDSYNC;
|
||||
}
|
||||
|
||||
void CMPAFrameFinder::Restart()
|
||||
{
|
||||
Flush();
|
||||
|
||||
m_State=STATE_FINDCHARACTERISTICS;
|
||||
m_pInBuffer=&m_MyInBuffer;
|
||||
|
||||
m_bStreamInvalid=false;
|
||||
|
||||
m_nFirstFramePosition=0;
|
||||
}
|
||||
|
||||
void CMPAFrameFinder::DeleteHeaderRecords()
|
||||
{
|
||||
HeaderRecord* pRecord;
|
||||
|
||||
while(m_pFirstHeader!=(HeaderRecord*)0)
|
||||
{
|
||||
pRecord=m_pFirstHeader;
|
||||
m_pFirstHeader=m_pFirstHeader->pNext;
|
||||
|
||||
delete pRecord;
|
||||
}
|
||||
|
||||
m_pLastHeader=(HeaderRecord*)0;
|
||||
|
||||
if(m_pNewHeaderRecord!=(HeaderRecord*)0)
|
||||
{
|
||||
delete m_pNewHeaderRecord;
|
||||
m_pNewHeaderRecord=(HeaderRecord*)0;
|
||||
}
|
||||
}
|
||||
|
||||
bool CMPAFrameFinder::IsValidHeader(MpegAudioHeader* pHeader)
|
||||
{
|
||||
int nFrameSize;
|
||||
|
||||
nFrameSize=pHeader->getFramesize();
|
||||
|
||||
// don't allow stupid framesizes:
|
||||
// if framesize <4 or > max mepg framsize its an error
|
||||
if(nFrameSize<4 || nFrameSize+4>4096)
|
||||
return false;
|
||||
|
||||
if(pHeader->GetBitRateKbps()==0)
|
||||
{
|
||||
//skip frames with bitrate 0 (empty)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,201 +0,0 @@
|
|||
/* DecMPA - simple MPEG Audio decoding library.
|
||||
Copyright (C) 2002 Hauke Duden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MPAFRAMEFINDER_H_
|
||||
#define _MPAFRAMEFINDER_H_
|
||||
|
||||
#include "IFileAccess.h"
|
||||
#include "mpegAudioFrame/mpegAudioHeader.h"
|
||||
|
||||
#include "MemBuffer.h"
|
||||
|
||||
class CMPAFrameFinder
|
||||
{
|
||||
public:
|
||||
CMPAFrameFinder();
|
||||
~CMPAFrameFinder();
|
||||
|
||||
inline void SetLookAheadFrames(int nFrames);
|
||||
inline void SetAllowFrequencyChanges(bool bAllow);
|
||||
|
||||
inline int GetLookAheadFrames();
|
||||
inline bool GetAllowFrequencyChanges();
|
||||
|
||||
//if false, the finder needs more input data or the stream
|
||||
//invalid
|
||||
bool ReadNextFrame();
|
||||
|
||||
inline bool IsStreamInvalid();
|
||||
inline bool KnowsCharacteristics();
|
||||
|
||||
inline bool HasFrame();
|
||||
inline void* GetFrameData();
|
||||
inline int GetFrameSize();
|
||||
inline double GetAvgFrameSize();
|
||||
inline MpegAudioHeader* GetFrameHeader();
|
||||
|
||||
void SetInput(void* pBuffer,int nBytes,long nStreamPosition);
|
||||
bool ReadInput(IFileAccess* pAccess);
|
||||
|
||||
//throw away buffered data and find next frame
|
||||
void Flush();
|
||||
|
||||
//start with a completely blank slate for a new data stream
|
||||
void Restart();
|
||||
|
||||
inline long GetFirstFramePosition();
|
||||
|
||||
protected:
|
||||
struct HeaderRecord
|
||||
{
|
||||
MpegAudioHeader Header;
|
||||
long nPosition;
|
||||
|
||||
HeaderRecord* pNext;
|
||||
};
|
||||
|
||||
bool FindCharacteristics();
|
||||
bool FindConsistentHeaders();
|
||||
bool CanHaveConsistentHeaders(HeaderRecord* pRecord,int nHeaderCount);
|
||||
bool HasConsistentHeaders(HeaderRecord* pCheckRecord,HeaderRecord* pRecord,int nHeadersNeeded);
|
||||
bool AreHeadersConsistent(HeaderRecord* pFirst,HeaderRecord* pSecond);
|
||||
|
||||
bool IsConformingHeader(MpegAudioHeader* pHeader);
|
||||
|
||||
void FindNextSync();
|
||||
void ReadHeader();
|
||||
void CheckHeader();
|
||||
void ReadFrame();
|
||||
|
||||
void ResetState();
|
||||
|
||||
void DeleteHeaderRecords();
|
||||
|
||||
static bool IsValidHeader(MpegAudioHeader* pHeader);
|
||||
|
||||
CMemBuffer m_OutBuffer;
|
||||
|
||||
CMemBuffer* m_pInBuffer;
|
||||
CMemBuffer m_MyInBuffer;
|
||||
CMemBuffer m_UserInBuffer;
|
||||
|
||||
int m_State;
|
||||
|
||||
int m_nLookAheadFrames;
|
||||
bool m_bAllowFrequencyChanges;
|
||||
|
||||
int m_nLayer;
|
||||
int m_nInputStereo;
|
||||
int m_nFrequency;
|
||||
int m_nLayer25;
|
||||
int m_nVersion;
|
||||
|
||||
MpegAudioHeader m_Header;
|
||||
int m_nFrameSize;
|
||||
|
||||
long m_nReadStartPosition;
|
||||
long m_nFirstFramePosition;
|
||||
|
||||
enum
|
||||
{
|
||||
STATE_FINDCHARACTERISTICS=0,
|
||||
STATE_FINDSYNC,
|
||||
STATE_READHEADER,
|
||||
STATE_CHECKHEADER,
|
||||
STATE_READFRAME,
|
||||
|
||||
STATE_HAVEFRAME
|
||||
};
|
||||
|
||||
HeaderRecord* m_pFirstHeader;
|
||||
HeaderRecord* m_pLastHeader;
|
||||
|
||||
HeaderRecord* m_pNewHeaderRecord;
|
||||
|
||||
bool m_bStreamInvalid;
|
||||
};
|
||||
|
||||
inline void CMPAFrameFinder::SetLookAheadFrames(int nFrames)
|
||||
{
|
||||
if(nFrames<0)
|
||||
nFrames=0;
|
||||
|
||||
m_nLookAheadFrames=nFrames;
|
||||
}
|
||||
|
||||
inline void CMPAFrameFinder::SetAllowFrequencyChanges(bool bAllow)
|
||||
{
|
||||
m_bAllowFrequencyChanges=bAllow;
|
||||
}
|
||||
|
||||
inline int CMPAFrameFinder::GetLookAheadFrames()
|
||||
{
|
||||
return m_nLookAheadFrames;
|
||||
}
|
||||
|
||||
inline bool CMPAFrameFinder::GetAllowFrequencyChanges()
|
||||
{
|
||||
return m_bAllowFrequencyChanges;
|
||||
}
|
||||
|
||||
inline bool CMPAFrameFinder::HasFrame()
|
||||
{
|
||||
return (m_State==STATE_HAVEFRAME);
|
||||
}
|
||||
|
||||
inline void* CMPAFrameFinder::GetFrameData()
|
||||
{
|
||||
return m_OutBuffer.GetPtr();
|
||||
}
|
||||
|
||||
inline int CMPAFrameFinder::GetFrameSize()
|
||||
{
|
||||
return m_OutBuffer.GetPos();
|
||||
}
|
||||
|
||||
inline double CMPAFrameFinder::GetAvgFrameSize()
|
||||
{
|
||||
return m_Header.GetAvgFrameSize();
|
||||
}
|
||||
|
||||
inline MpegAudioHeader* CMPAFrameFinder::GetFrameHeader()
|
||||
{
|
||||
return &m_Header;
|
||||
}
|
||||
|
||||
inline bool CMPAFrameFinder::IsStreamInvalid()
|
||||
{
|
||||
return m_bStreamInvalid;
|
||||
}
|
||||
|
||||
inline bool CMPAFrameFinder::KnowsCharacteristics()
|
||||
{
|
||||
return (m_State>STATE_FINDCHARACTERISTICS);
|
||||
}
|
||||
|
||||
inline long CMPAFrameFinder::GetFirstFramePosition()
|
||||
{
|
||||
return m_nFirstFramePosition;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,200 +0,0 @@
|
|||
/* DecMPA - simple MPEG Audio decoding library.
|
||||
Copyright (C) 2002 Hauke Duden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
|
||||
#include "MPAInfo.h"
|
||||
|
||||
CMPAInfo::CMPAInfo()
|
||||
{
|
||||
m_nEncodedDataSize=-1;
|
||||
m_nEncodedDataOffset=0;
|
||||
m_nDuration=-1;
|
||||
m_bXingVBR=false;
|
||||
|
||||
m_XingHeader.toc=m_aXingTOC;
|
||||
}
|
||||
|
||||
CMPAInfo::~CMPAInfo()
|
||||
{
|
||||
}
|
||||
|
||||
bool CMPAInfo::InitInfo(CMPAFrameFinder* pFrameFinder,IFileAccess* pFileAccess)
|
||||
{
|
||||
m_nEncodedDataSize=-1;
|
||||
m_nEncodedDataOffset=0;
|
||||
m_nDuration=-1;
|
||||
m_bXingVBR=false;
|
||||
|
||||
while(!pFrameFinder->ReadNextFrame())
|
||||
{
|
||||
if(pFrameFinder->IsStreamInvalid())
|
||||
return false;
|
||||
|
||||
if(!pFrameFinder->ReadInput(pFileAccess))
|
||||
return false;
|
||||
}
|
||||
|
||||
m_nEncodedDataOffset=pFrameFinder->GetFirstFramePosition();
|
||||
|
||||
m_nEncodedDataSize=pFileAccess->GetLength();
|
||||
if(m_nEncodedDataSize!=-1)
|
||||
{
|
||||
//ignore any leading non-MPEG-Audio data
|
||||
m_nEncodedDataSize-=m_nEncodedDataOffset;
|
||||
}
|
||||
|
||||
Init(pFrameFinder);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CMPAInfo::Init(CMPAFrameFinder* pFrameFinder)
|
||||
{
|
||||
double nAvgFrameSize;
|
||||
int nFrameSize;
|
||||
long nFrameCount=-1;
|
||||
|
||||
nAvgFrameSize=pFrameFinder->GetAvgFrameSize();
|
||||
nFrameSize=pFrameFinder->GetFrameSize();
|
||||
if(nAvgFrameSize>0)
|
||||
{
|
||||
if(ReadXingHeader(pFrameFinder->GetFrameData(),nFrameSize))
|
||||
{
|
||||
m_bXingVBR=true;
|
||||
nFrameCount=m_XingHeader.frames;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_nEncodedDataSize>=0)
|
||||
nFrameCount=(long)(m_nEncodedDataSize/nAvgFrameSize);
|
||||
}
|
||||
}
|
||||
|
||||
if(nFrameCount!=-1)
|
||||
{
|
||||
MpegAudioHeader* pHeader=pFrameFinder->GetFrameHeader();
|
||||
int nDecodedSamplesPerFrame;
|
||||
int nFrequency;
|
||||
double nDecodedSamples;
|
||||
|
||||
nDecodedSamplesPerFrame=pHeader->getpcmperframe();
|
||||
nFrequency=pHeader->getFrequencyHz();
|
||||
|
||||
nDecodedSamples=((double)nFrameCount)*nDecodedSamplesPerFrame;
|
||||
|
||||
if(nFrequency!=0)
|
||||
m_nDuration=(long)((nDecodedSamples*1000)/nFrequency);
|
||||
}
|
||||
}
|
||||
|
||||
bool CMPAInfo::ReadXingHeader(void* pFrameData,int nFrameSize)
|
||||
{
|
||||
if(nFrameSize<152) //cannot have xing header
|
||||
return false;
|
||||
|
||||
if(::GetXingHeader(&m_XingHeader,(unsigned char*)pFrameData)==0)
|
||||
return false;
|
||||
|
||||
//we use floats so that we won't loose precision
|
||||
//with the un-compensation stuff below
|
||||
for(int i=0;i<100;i++)
|
||||
m_aTOC[i]=((float)m_XingHeader.toc[i])/256.0f;
|
||||
m_aTOC[100]=1.0f;
|
||||
|
||||
if(m_aTOC[0]!=0)
|
||||
{
|
||||
//the Xing table of contents compensates for some
|
||||
//leading non-MP3 data (maybe an ID3 tag or something)
|
||||
//Since that data may never have been passed to the library
|
||||
//(or if it has been passed, it should have been skipped)
|
||||
//we undo this compensation
|
||||
float FullSizeValue;
|
||||
|
||||
FullSizeValue=1.0f-m_aTOC[0];
|
||||
|
||||
for(int i=100;i>=0;i--)
|
||||
m_aTOC[i]=(m_aTOC[i]-m_aTOC[0])/FullSizeValue;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
long CMPAInfo::GetFilePositionFromTime(long Millis)
|
||||
{
|
||||
long nPos=-1;
|
||||
double nTimeFraction;
|
||||
|
||||
if(m_nDuration>0 && m_nEncodedDataSize>=0)
|
||||
{
|
||||
nTimeFraction=((double)Millis)/m_nDuration;
|
||||
|
||||
if(m_bXingVBR)
|
||||
{
|
||||
nPos=GetEncodedDataPositionFromTOC((float)nTimeFraction);
|
||||
|
||||
if(nPos>=m_nEncodedDataSize)
|
||||
nPos=m_nEncodedDataSize;
|
||||
}
|
||||
else
|
||||
nPos=(long)(nTimeFraction*m_nEncodedDataSize);
|
||||
}
|
||||
|
||||
if(nPos==-1)
|
||||
{
|
||||
//ok, we couldn't find the correct position because
|
||||
//we don't know enough about the stream
|
||||
|
||||
//however, ONE position we know: the beginning
|
||||
if(Millis==0)
|
||||
nPos=0;
|
||||
}
|
||||
|
||||
nPos+=m_nEncodedDataOffset;
|
||||
|
||||
return nPos;
|
||||
}
|
||||
|
||||
long CMPAInfo::GetEncodedDataPositionFromTOC(float TimeFract)
|
||||
{
|
||||
// interpolate in TOC to get file seek point in bytes
|
||||
int nTOCIndex;
|
||||
float LowerPosFract;
|
||||
float UpperPosFract;
|
||||
float PosFract;
|
||||
float Percent=TimeFract*100.0f;
|
||||
|
||||
if(Percent<0.0f)
|
||||
Percent=0.0f;
|
||||
if(Percent>100.0f)
|
||||
Percent=100.0f;
|
||||
|
||||
nTOCIndex=(int)Percent;
|
||||
if(nTOCIndex>99)
|
||||
nTOCIndex=99;
|
||||
LowerPosFract=m_aTOC[nTOCIndex];
|
||||
UpperPosFract=m_aTOC[nTOCIndex+1];
|
||||
|
||||
PosFract=LowerPosFract + ((UpperPosFract-LowerPosFract)*(Percent-nTOCIndex));
|
||||
|
||||
return (long)(PosFract*m_nEncodedDataSize);
|
||||
}
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
/* DecMPA - simple MPEG Audio decoding library.
|
||||
Copyright (C) 2002 Hauke Duden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MPAINFO_H_
|
||||
#define _MPAINFO_H_
|
||||
|
||||
#include "IFileAccess.h"
|
||||
#include "MPAFrameFinder.h"
|
||||
#include "mpegAudioFrame/dxHead.h"
|
||||
|
||||
class CMPAInfo
|
||||
{
|
||||
public:
|
||||
CMPAInfo();
|
||||
~CMPAInfo();
|
||||
|
||||
bool InitInfo(CMPAFrameFinder* pFrameFinder,IFileAccess* pFileAccess);
|
||||
|
||||
//-1 if unknown
|
||||
inline long GetDuration();
|
||||
|
||||
//-1 if unknown
|
||||
long GetFilePositionFromTime(long Millis);
|
||||
|
||||
inline bool IsXingVBR();
|
||||
inline XHEADDATA* GetXingHeader();
|
||||
|
||||
protected:
|
||||
void Init(CMPAFrameFinder* pFrameFinder);
|
||||
bool ReadXingHeader(void* pFrameData,int nFrameSize);
|
||||
long GetEncodedDataPositionFromTOC(float TimeFract);
|
||||
|
||||
long m_nEncodedDataSize;
|
||||
long m_nEncodedDataOffset;
|
||||
|
||||
long m_nDuration;
|
||||
|
||||
bool m_bXingVBR;
|
||||
XHEADDATA m_XingHeader;
|
||||
unsigned char m_aXingTOC[100];
|
||||
|
||||
float m_aTOC[101];
|
||||
};
|
||||
|
||||
inline long CMPAInfo::GetDuration()
|
||||
{
|
||||
return m_nDuration;
|
||||
}
|
||||
|
||||
inline bool CMPAInfo::IsXingVBR()
|
||||
{
|
||||
return m_bXingVBR;
|
||||
}
|
||||
|
||||
inline XHEADDATA* CMPAInfo::GetXingHeader()
|
||||
{
|
||||
return &m_XingHeader;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
|
@ -1,157 +0,0 @@
|
|||
/* DecMPA - simple MPEG Audio decoding library.
|
||||
Copyright (C) 2002 Hauke Duden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MEMBUFFER_H_
|
||||
#define _MEMBUFFER_H_
|
||||
|
||||
class CMemBuffer
|
||||
{
|
||||
public:
|
||||
inline CMemBuffer()
|
||||
{
|
||||
m_pBuffer=(unsigned char*)0;
|
||||
m_nSize=0;
|
||||
m_nCapacity=0;
|
||||
m_bAllocated=false;
|
||||
m_nPos=0;
|
||||
}
|
||||
|
||||
inline ~CMemBuffer()
|
||||
{
|
||||
Free();
|
||||
}
|
||||
|
||||
inline void Alloc(int nBytes)
|
||||
{
|
||||
Free();
|
||||
if(nBytes>0)
|
||||
{
|
||||
m_pBuffer=new unsigned char[nBytes];
|
||||
m_bAllocated=true;
|
||||
}
|
||||
m_nCapacity=nBytes;
|
||||
}
|
||||
|
||||
inline void Free()
|
||||
{
|
||||
if(m_bAllocated)
|
||||
delete[] m_pBuffer;
|
||||
Detach();
|
||||
}
|
||||
|
||||
inline void Attach(void* pMem,int nBytes)
|
||||
{
|
||||
Free();
|
||||
m_pBuffer=(unsigned char*)pMem;
|
||||
m_nSize=nBytes;
|
||||
m_nCapacity=nBytes;
|
||||
}
|
||||
|
||||
inline void Detach()
|
||||
{
|
||||
m_pBuffer=(unsigned char*)0;
|
||||
m_nSize=0;
|
||||
m_nCapacity=0;
|
||||
m_bAllocated=false;
|
||||
m_nPos=0;
|
||||
}
|
||||
|
||||
inline int GetPos()
|
||||
{
|
||||
return m_nPos;
|
||||
}
|
||||
|
||||
inline void SetPos(int Pos)
|
||||
{
|
||||
m_nPos=Pos;
|
||||
}
|
||||
|
||||
inline void AddToPos(int Add)
|
||||
{
|
||||
m_nPos+=Add;
|
||||
}
|
||||
|
||||
inline unsigned char ReadByte()
|
||||
{
|
||||
return m_pBuffer[m_nPos++];
|
||||
}
|
||||
|
||||
inline void WriteByte(unsigned char Value)
|
||||
{
|
||||
m_pBuffer[m_nPos++]=Value;
|
||||
}
|
||||
|
||||
inline int GetSize()
|
||||
{
|
||||
return m_nSize;
|
||||
}
|
||||
|
||||
inline int GetCapacity()
|
||||
{
|
||||
return m_nCapacity;
|
||||
}
|
||||
|
||||
inline int GetBytesLeft()
|
||||
{
|
||||
return m_nSize-m_nPos;
|
||||
}
|
||||
|
||||
inline void SetSize(int nSize)
|
||||
{
|
||||
if(nSize>m_nCapacity)
|
||||
nSize=m_nCapacity;
|
||||
m_nSize=nSize;
|
||||
if(m_nPos>m_nSize)
|
||||
m_nPos=m_nSize;
|
||||
}
|
||||
|
||||
inline unsigned char* GetPosPtr()
|
||||
{
|
||||
return &m_pBuffer[m_nPos];
|
||||
}
|
||||
|
||||
inline unsigned char* GetPtr()
|
||||
{
|
||||
return m_pBuffer;
|
||||
}
|
||||
|
||||
inline bool IsAttached()
|
||||
{
|
||||
return !m_bAllocated;
|
||||
}
|
||||
|
||||
inline bool HasMoreData()
|
||||
{
|
||||
return m_nPos<m_nSize;
|
||||
}
|
||||
|
||||
protected:
|
||||
unsigned char* m_pBuffer;
|
||||
int m_nSize;
|
||||
int m_nCapacity;
|
||||
bool m_bAllocated;
|
||||
|
||||
int m_nPos;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,119 +0,0 @@
|
|||
/*
|
||||
abstract definition of an audio frame
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - removed cout and exit stuff
|
||||
|
||||
|
||||
#include "audioFrame.h"
|
||||
|
||||
|
||||
AudioFrame::AudioFrame() {
|
||||
|
||||
stereo=-1;
|
||||
frequencyHZ=-1;
|
||||
|
||||
sampleSize=-1;
|
||||
lBigEndian=-1;
|
||||
lSigned=-1;
|
||||
setFrameType(_FRAME_AUDIO_BASE);
|
||||
}
|
||||
|
||||
|
||||
AudioFrame::~AudioFrame() {
|
||||
}
|
||||
|
||||
|
||||
int AudioFrame::getLen() {
|
||||
//cout << "direct virtual call AudioFrame::getLen"<<endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void AudioFrame::setLen(int ) {
|
||||
//cout << "direct virtual call AudioFrame::setLen"<<endl;
|
||||
}
|
||||
|
||||
|
||||
int AudioFrame::getSize() {
|
||||
//cout << "direct virtual call AudioFrame::getSize"<<endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void AudioFrame::putFloatData(float* ,int ) {
|
||||
//cout << "direct virtual call AudioFrame::putFloatData"<<endl;
|
||||
}
|
||||
|
||||
void AudioFrame::putFloatData(float* ,float* ,int ) {
|
||||
//cout << "direct virtual call AudioFrame::putFloatData L/R version"<<endl;
|
||||
}
|
||||
|
||||
void AudioFrame::putInt16Data(short* pdata,int nLength)
|
||||
{
|
||||
}
|
||||
|
||||
void AudioFrame::putSilence(int nLength)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void AudioFrame::clearrawdata() {
|
||||
//cout << "direct virtual call AudioFrame::clearrawdata"<<endl;
|
||||
}
|
||||
|
||||
void AudioFrame::setFrameFormat(int stereo,int freq) {
|
||||
this->stereo=stereo;
|
||||
this->frequencyHZ=freq;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int AudioFrame::isFormatEqual(AudioFrame* compare) {
|
||||
if(compare->getStereo() != stereo) {
|
||||
return false;
|
||||
}
|
||||
if(compare->getSampleSize() != sampleSize) {
|
||||
return false;
|
||||
}
|
||||
if(compare->getBigEndian() != lBigEndian) {
|
||||
return false;
|
||||
}
|
||||
if(compare->getFrequenceHZ() != frequencyHZ) {
|
||||
return false;
|
||||
}
|
||||
if(compare->getSigned() != lSigned) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void AudioFrame::print(const char* msg) {
|
||||
/*cout << "PCMFrame::print:"<<msg<<endl;
|
||||
cout << "stereo:"<<stereo<<endl;
|
||||
cout << "sampleSize:"<<sampleSize<<endl;
|
||||
cout << "lBigEndian:"<<lBigEndian<<endl;
|
||||
cout << "frequencyHZ:"<<frequencyHZ<<endl;
|
||||
cout << "lSigned:"<<lSigned<<endl;*/
|
||||
}
|
||||
|
||||
|
||||
void AudioFrame::copyFormat(AudioFrame* dest) {
|
||||
//if (dest->getFrameType() != _FRAME_AUDIO_BASE) {
|
||||
// cout << "cannot copy frameFormat into frametype!= _FRAME_AUDIO_BASE"<<endl;
|
||||
// exit(0);
|
||||
//}
|
||||
dest->setFrameFormat(getStereo(),getFrequenceHZ());
|
||||
dest->sampleSize=getSampleSize();
|
||||
dest->lBigEndian=getBigEndian();
|
||||
dest->lSigned=getSigned();
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
/*
|
||||
abstract definition of an audio frame
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef __AUDIOFRAME_H
|
||||
#define __AUDIOFRAME_H
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
#define AUDIOFRAME_BIGENDIAN 1
|
||||
#else
|
||||
#define AUDIOFRAME_BIGENDIAN 0
|
||||
#endif
|
||||
|
||||
#include "frame.h"
|
||||
|
||||
#define SCALFACTOR SHRT_MAX
|
||||
#define MP3FRAMESIZE (2*2*2*32*18)
|
||||
|
||||
|
||||
class AudioFrame : public Frame {
|
||||
|
||||
int stereo;
|
||||
int frequencyHZ;
|
||||
|
||||
public:
|
||||
AudioFrame();
|
||||
virtual ~AudioFrame();
|
||||
|
||||
// info about "import" data
|
||||
void setFrameFormat(int stereo,int freq);
|
||||
|
||||
inline int getStereo() { return stereo; }
|
||||
inline int getFrequenceHZ() { return frequencyHZ; }
|
||||
|
||||
// these return values depend on the implementation
|
||||
// how the data is stored internally after "import"
|
||||
inline int getSampleSize() { return sampleSize; }
|
||||
inline int getBigEndian() { return lBigEndian; }
|
||||
inline int getSigned() { return lSigned; }
|
||||
|
||||
// info about output
|
||||
virtual int getLen();
|
||||
virtual void setLen(int len);
|
||||
virtual int getSize();
|
||||
virtual void clearrawdata();
|
||||
|
||||
// data import
|
||||
virtual void putFloatData(float* data,int len);
|
||||
virtual void putFloatData(float* left,float* right,int len);
|
||||
|
||||
virtual void putInt16Data(short* pdata,int nLength);
|
||||
|
||||
virtual void putSilence(int nLength);
|
||||
|
||||
int isFormatEqual(AudioFrame* compare);
|
||||
// Note: this can only be called with _real_ AudioFrame's as dest
|
||||
void copyFormat(AudioFrame* dest);
|
||||
|
||||
void print(const char* msg);
|
||||
|
||||
protected:
|
||||
int sampleSize;
|
||||
int lBigEndian;
|
||||
int lSigned;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
|
@ -1,71 +0,0 @@
|
|||
/*
|
||||
stores frames as floats.
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - removed cout and exit stuff
|
||||
// - added #include <new> to ensure that bad_alloc will be thrown on mem error
|
||||
|
||||
#include "floatFrame.h"
|
||||
|
||||
#include <new>
|
||||
#include <memory.h>
|
||||
|
||||
|
||||
FloatFrame::FloatFrame(int size) {
|
||||
data=new float[size];
|
||||
len=0;
|
||||
this->size=size;
|
||||
this->sampleSize=sizeof(float)*8;
|
||||
this->lSigned=true;
|
||||
this->lBigEndian=AUDIOFRAME_BIGENDIAN;
|
||||
setFrameType(_FRAME_AUDIO_FLOAT);
|
||||
}
|
||||
|
||||
|
||||
FloatFrame::~FloatFrame() {
|
||||
delete data;
|
||||
}
|
||||
|
||||
|
||||
void FloatFrame::putFloatData(float* in,int lenCopy) {
|
||||
//if ((len+lenCopy) > size) {
|
||||
// cout << "cannot copy putFloatData. Does not fit"<<endl;
|
||||
// exit(0);
|
||||
//}
|
||||
memcpy(data+len,in,lenCopy*sizeof(float));
|
||||
len+=lenCopy;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void FloatFrame::putFloatData(float* left,float* right,int len) {
|
||||
//cout << "not yet implemented"<<endl;
|
||||
}
|
||||
|
||||
|
||||
void FloatFrame::putInt16Data(short* pData,int nLength)
|
||||
{
|
||||
for(int i=0;i<nLength;i++)
|
||||
data[i]=((float)pData[i])/32768.0f;
|
||||
|
||||
len=nLength;
|
||||
}
|
||||
|
||||
void FloatFrame::putSilence(int nLength)
|
||||
{
|
||||
for(int i=0;i<nLength;i++)
|
||||
data[i]=0.0f;
|
||||
|
||||
len=nLength;
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
/*
|
||||
stores frames as floats.
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef __FLOATFRAME_H
|
||||
#define __FLOATFRAME_H
|
||||
|
||||
#include "audioFrame.h"
|
||||
|
||||
// this format has a sampleSize of sizeof(float), signed, endian==machine
|
||||
|
||||
class FloatFrame : public AudioFrame {
|
||||
|
||||
float* data;
|
||||
int len;
|
||||
int size;
|
||||
|
||||
|
||||
public:
|
||||
FloatFrame(int size);
|
||||
~FloatFrame();
|
||||
|
||||
int getLen() { return len; }
|
||||
void setLen(int len) { this->len=len; }
|
||||
int getSize() { return size; }
|
||||
float* getData() { return data; }
|
||||
|
||||
void putFloatData(float* data,int len);
|
||||
void putFloatData(float* left,float* right,int len);
|
||||
|
||||
void putInt16Data(short* pdata,int nLength);
|
||||
void putSilence(int nLength);
|
||||
|
||||
void clearrawdata() { len=0; }
|
||||
|
||||
|
||||
|
||||
};
|
||||
#endif
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
base class for frames
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "frame.h"
|
||||
|
||||
|
||||
Frame::Frame() {
|
||||
type=_FRAME_UNK;
|
||||
}
|
||||
|
||||
|
||||
Frame::~Frame() {
|
||||
}
|
||||
|
||||
|
||||
const char* Frame::getMajorFrameName(int type) {
|
||||
int majorID=type >> 12;
|
||||
switch(majorID) {
|
||||
case _FRAME_UNK:
|
||||
return "_FRAME_UNK";
|
||||
case _FRAME_RAW:
|
||||
return "_FRAME_RAW";
|
||||
case _FRAME_AUDIO:
|
||||
return "_FRAME_AUDIO";
|
||||
case _FRAME_VIDEO:
|
||||
return "_FRAME_VIDEO";
|
||||
case _FRAME_PAKET:
|
||||
return "_FRAME_PAKET";
|
||||
default:
|
||||
return "unknown major frameType";
|
||||
}
|
||||
return "never happens Frame::getMajorFrameName";
|
||||
}
|
||||
|
||||
|
||||
|
||||
const char* Frame::getFrameName(int type) {
|
||||
switch(type) {
|
||||
// Raw
|
||||
case _FRAME_RAW_BASE:
|
||||
return "_FRAME_RAW_BASE";
|
||||
case _FRAME_RAW_OGG:
|
||||
return "_FRAME_RAW_OGG";
|
||||
|
||||
|
||||
// Audio
|
||||
case _FRAME_AUDIO_BASE:
|
||||
return "_FRAME_AUDIO_BASE";
|
||||
case _FRAME_AUDIO_PCM:
|
||||
return "_FRAME_AUDIO_PCM";
|
||||
case _FRAME_AUDIO_FLOAT:
|
||||
return "_FRAME_AUDIO_FLOAT";
|
||||
|
||||
|
||||
|
||||
// Rest
|
||||
default:
|
||||
return "cannot find name";
|
||||
}
|
||||
return "never happens Frame::getFrameName";
|
||||
}
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
/*
|
||||
base class for frames
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/11/2002 (by Hauke Duden):
|
||||
// - removed unnecessary includes
|
||||
|
||||
#ifndef __FRAME_H
|
||||
#define __FRAME_H
|
||||
|
||||
|
||||
//#include <iostream.h>
|
||||
//#include <stdio.h>
|
||||
//#include <limits.h>
|
||||
//#include <stdlib.h>
|
||||
//#include <string.h>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
The base class for frames. Every derived class from this class
|
||||
must belong to some "major" class type and it must have an unique
|
||||
id for itsself. Even if it is a base class it must have a unique id.
|
||||
|
||||
How does this work. We have an int for the Frame id. In the int
|
||||
itsself we but the majorid as well.
|
||||
The Start codes are all multiple of 2 so for example
|
||||
0..127 belongs to FRAME UNK
|
||||
128..255 belongs to FRAME RAW
|
||||
|
||||
So we can with a simple shift operation find out the major class
|
||||
*/
|
||||
#define _FRAME_SHIFT 7
|
||||
#define _FRAME_ID_MAX 128 //(2^_FRAME_SHIFT)
|
||||
|
||||
|
||||
// Major Frame classes
|
||||
#define _FRAME_UNK 0
|
||||
#define _FRAME_RAW 1
|
||||
#define _FRAME_AUDIO 2
|
||||
#define _FRAME_VIDEO 3
|
||||
#define _FRAME_PAKET 4
|
||||
|
||||
// start ids of minor classes
|
||||
|
||||
#define _FRAME_UNK_START (0)
|
||||
#define _FRAME_RAW_START (_FRAME_ID_MAX)
|
||||
#define _FRAME_AUDIO_START (_FRAME_ID_MAX*2)
|
||||
#define _FRAME_VIDEO_START (_FRAME_ID_MAX*2*2)
|
||||
#define _FRAME_PAKET_START (_FRAME_ID_MAX*2*2*2)
|
||||
|
||||
// Minor Frame type IDs
|
||||
|
||||
|
||||
// Raw
|
||||
#define _FRAME_RAW_BASE (_FRAME_RAW_START+1)
|
||||
#define _FRAME_RAW_OGG (_FRAME_RAW_START+2)
|
||||
#define _FRAME_RAW_MPEG_I_VIDEO (_FRAME_RAW_START+3)
|
||||
#define _FRAME_RAW_MPEG_SYSTEM (_FRAME_RAW_START+4)
|
||||
|
||||
|
||||
// Audio:
|
||||
#define _FRAME_AUDIO_BASE (_FRAME_AUDIO_START+1)
|
||||
#define _FRAME_AUDIO_PCM (_FRAME_AUDIO_START+2)
|
||||
#define _FRAME_AUDIO_FLOAT (_FRAME_AUDIO_START+3)
|
||||
|
||||
// Video:
|
||||
#define _FRAME_VIDEO_BASE (_FRAME_VIDEO_START+1)
|
||||
#define _FRAME_VIDEO_YUV (_FRAME_VIDEO_START+2)
|
||||
#define _FRAME_VIDEO_RGB_8 (_FRAME_VIDEO_START+3)
|
||||
#define _FRAME_VIDEO_RGB_16 (_FRAME_VIDEO_START+4)
|
||||
#define _FRAME_VIDEO_RGB_32 (_FRAME_VIDEO_START+5)
|
||||
|
||||
// Packet:
|
||||
#define _FRAME_PACKET_SYNC (_FRAME_PAKET_START+1)
|
||||
#define _FRAME_PACKET_PACKET_CONTAINER (_FRAME_PAKET_START+2)
|
||||
|
||||
|
||||
|
||||
|
||||
class Frame {
|
||||
int type;
|
||||
|
||||
public:
|
||||
Frame();
|
||||
~Frame();
|
||||
inline int getMajorFrameType() { return (type>>_FRAME_SHIFT);}
|
||||
inline int getFrameType() { return type; }
|
||||
inline void setFrameType(int type) { this->type=type; }
|
||||
|
||||
|
||||
static const char* getMajorFrameName(int type);
|
||||
static const char* getFrameName(int type);
|
||||
};
|
||||
#endif
|
|
@ -1,143 +0,0 @@
|
|||
/*
|
||||
pcm frame description.
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - removed cout and exit stuff
|
||||
// - added #include <new> to ensure that bad_alloc will be thrown on mem error
|
||||
|
||||
#include "pcmFrame.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <new>
|
||||
#include <limits.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
//anscheinend ist die range der Werte -1,1
|
||||
/*#define convMacro(in,dtemp,tmp) \
|
||||
tmp=(int)(in[0]*32768*0.9f); \
|
||||
in++; \
|
||||
if(tmp>32767) \
|
||||
tmp=32767; \
|
||||
else if(tmp<-32768) \
|
||||
tmp=-32768;*/
|
||||
|
||||
|
||||
#define convMacro(in,dtemp,tmp) \
|
||||
in[0]*=SCALFACTOR; \
|
||||
dtemp = ((((65536.0 * 65536.0 * 16)+(65536.0 * 0.5))* 65536.0))+(in[0]); \
|
||||
tmp = ((*(int *)&dtemp) - 0x80000000); \
|
||||
in++; \
|
||||
if(tmp>32767) { \
|
||||
tmp=32767; \
|
||||
} else if (tmp<-32768) { \
|
||||
tmp =-0x8000; \
|
||||
}
|
||||
|
||||
|
||||
|
||||
PCMFrame::PCMFrame(int size) {
|
||||
data=new short int[size];
|
||||
len=0;
|
||||
this->size=size;
|
||||
// this format has a sampleSize of 16, signed, endian==machine
|
||||
this->sampleSize=sizeof(short int)*8;
|
||||
this->lSigned=true;
|
||||
this->lBigEndian=AUDIOFRAME_BIGENDIAN;
|
||||
setFrameType(_FRAME_AUDIO_PCM);
|
||||
}
|
||||
|
||||
|
||||
PCMFrame::~PCMFrame() {
|
||||
delete data;
|
||||
}
|
||||
|
||||
|
||||
void PCMFrame::putFloatData(float* left,float* right,int copyLen) {
|
||||
int destSize=0;
|
||||
if (left != NULL) destSize++;
|
||||
if (right != NULL) destSize++;
|
||||
destSize*=copyLen;
|
||||
/*if ((len+destSize) > size) {
|
||||
cout << "cannot copy putFloatData L/R version . Does not fit"<<endl;
|
||||
exit(0);
|
||||
}*/
|
||||
double dtemp;
|
||||
int tmp;
|
||||
int i=copyLen;
|
||||
switch(getStereo()) {
|
||||
case 1:
|
||||
while(i > 0) {
|
||||
convMacro(left,dtemp,tmp);
|
||||
data[len++]=(short int)tmp;
|
||||
convMacro(right,dtemp,tmp);
|
||||
data[len++]=(short int)tmp;
|
||||
i--;
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
if (left != NULL) {
|
||||
int i=copyLen;
|
||||
while(i > 0) {
|
||||
convMacro(left,dtemp,tmp);
|
||||
data[len++]=(short int)tmp;
|
||||
i--;
|
||||
// right channel empty
|
||||
len++;
|
||||
}
|
||||
}
|
||||
if (right != NULL) {
|
||||
int i=copyLen;
|
||||
len=len-destSize;
|
||||
while(i > 0) {
|
||||
// select right channel
|
||||
len++;
|
||||
convMacro(right,dtemp,tmp);
|
||||
data[len++]=(short int)tmp;
|
||||
i--;
|
||||
// left channel already copied
|
||||
}
|
||||
}
|
||||
default:
|
||||
/*cout << "unknown stereo value in pcmFrame"<<endl;
|
||||
exit(0);*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PCMFrame::putFloatData(float* in,int lenCopy) {
|
||||
|
||||
/*if ((len+lenCopy) > size) {
|
||||
cout << "cannot copy putFloatData. Does not fit"<<endl;
|
||||
exit(0);
|
||||
}*/
|
||||
double dtemp;
|
||||
int tmp;
|
||||
while(lenCopy > 0) {
|
||||
convMacro(in,dtemp,tmp);
|
||||
data[len++]=(short int)tmp;
|
||||
lenCopy--;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void PCMFrame::putInt16Data(short* pData,int nLength)
|
||||
{
|
||||
memcpy(data,pData,nLength*sizeof(short));
|
||||
len=nLength;
|
||||
}
|
||||
|
||||
void PCMFrame::putSilence(int nLength)
|
||||
{
|
||||
memset(data,0,nLength*sizeof(short));
|
||||
len=nLength;
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
/*
|
||||
pcm frame description.
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef __PCMFRAME_H
|
||||
#define __PCMFRAME_H
|
||||
|
||||
|
||||
#include "audioFrame.h"
|
||||
|
||||
// this format has a sampleSize of 16, signed, endian==machine
|
||||
|
||||
class PCMFrame : public AudioFrame {
|
||||
|
||||
short int* data;
|
||||
int len;
|
||||
int size;
|
||||
|
||||
public:
|
||||
PCMFrame(int size);
|
||||
~PCMFrame();
|
||||
|
||||
int getLen() { return len; }
|
||||
void setLen(int len) { this->len=len; }
|
||||
int getSize() { return size; }
|
||||
short int* getData() { return data; }
|
||||
|
||||
void putFloatData(float* data,int len);
|
||||
void putFloatData(float* left,float* right,int len);
|
||||
|
||||
void putInt16Data(short* pdata,int nLength);
|
||||
|
||||
void putSilence(int nLength);
|
||||
|
||||
|
||||
void clearrawdata() { len=0; }
|
||||
|
||||
|
||||
};
|
||||
#endif
|
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
stores simple buffer information. does not allocate anything
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include "rawDataBuffer.h"
|
||||
|
||||
// hm
|
||||
|
||||
RawDataBuffer::~RawDataBuffer() {
|
||||
}
|
||||
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
/*
|
||||
stores simple buffer information. does not allocate anything
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef __RAWDATABUFFER_H
|
||||
#define __RAWDATABUFFER_H
|
||||
|
||||
|
||||
class RawDataBuffer {
|
||||
|
||||
int _size;
|
||||
unsigned char* _ptr;
|
||||
int _pos;
|
||||
|
||||
public:
|
||||
RawDataBuffer(unsigned char* ptr,int size) { set(ptr,size,0); }
|
||||
~RawDataBuffer();
|
||||
|
||||
|
||||
|
||||
unsigned char* ptr() { return _ptr; }
|
||||
unsigned char* current() { return _ptr+_pos; }
|
||||
int size() { return _size; }
|
||||
int pos() { return _pos; }
|
||||
int untilend() { return _size-_pos; }
|
||||
int eof() { return _pos>=_size; }
|
||||
|
||||
void inc() { this->_pos++; }
|
||||
void inc(int val) { this->_pos+=val; }
|
||||
void setpos(int val) { this->_pos=val; }
|
||||
void setptr(unsigned char* ptr) { this->_ptr=ptr; }
|
||||
void setsize(int size) { this->_size=size; }
|
||||
|
||||
void set(unsigned char* ptr,
|
||||
int size,int pos) { setpos(pos);setptr(ptr);setsize(size);}
|
||||
|
||||
};
|
||||
#endif
|
|
@ -1,135 +0,0 @@
|
|||
/* DecMPA - simple MPEG Audio decoding library.
|
||||
Copyright (C) 2002 Hauke Duden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
|
||||
#include <math.h>
|
||||
#include "interface.h"
|
||||
|
||||
#include "../DecodeEngine.h"
|
||||
|
||||
#include "../frame/pcmFrame.h"
|
||||
|
||||
#include <new>
|
||||
|
||||
extern const long freqs[9];
|
||||
|
||||
struct DecodeEngine
|
||||
{
|
||||
MPSTR Decoder;
|
||||
short aTempBuffer[MP3FRAMESIZE*2];
|
||||
};
|
||||
|
||||
void* DecodeEngine_Create()
|
||||
{
|
||||
DecodeEngine* pEngine=new DecodeEngine;
|
||||
|
||||
if(!InitMP3(&pEngine->Decoder))
|
||||
{
|
||||
delete pEngine;
|
||||
pEngine=(DecodeEngine*)0;
|
||||
}
|
||||
|
||||
return pEngine;
|
||||
}
|
||||
|
||||
void DecodeEngine_Destroy(void* pEng)
|
||||
{
|
||||
DecodeEngine* pEngine=(DecodeEngine*)pEng;
|
||||
|
||||
ExitMP3(&pEngine->Decoder);
|
||||
|
||||
delete pEngine;
|
||||
}
|
||||
|
||||
bool DecodeEngine_Decode(void* pEng,AudioFrame* pDest,void* pData,long nDataLength)
|
||||
{
|
||||
DecodeEngine* pEngine=(DecodeEngine*)pEng;
|
||||
int nDone;
|
||||
int nResult;
|
||||
char* pOut;
|
||||
int nOutSize;
|
||||
int nChannels;
|
||||
|
||||
if(pDest->getFrameType()==_FRAME_AUDIO_PCM)
|
||||
{
|
||||
pOut=(char*)((PCMFrame*)pDest)->getData();
|
||||
nOutSize=pDest->getSize();
|
||||
}
|
||||
else
|
||||
{
|
||||
pOut=(char*)pEngine->aTempBuffer;
|
||||
nOutSize=sizeof(pEngine->aTempBuffer)/sizeof(short);
|
||||
}
|
||||
|
||||
nResult=decodeMP3(&pEngine->Decoder,(unsigned char*)pData,nDataLength,pOut,nOutSize,&nDone);
|
||||
if(nResult==MP3_OK)
|
||||
{
|
||||
nDone/=sizeof(short);
|
||||
nChannels=pEngine->Decoder.fr.stereo;
|
||||
|
||||
if(pDest->getFrameType()!=_FRAME_AUDIO_PCM)
|
||||
pDest->putInt16Data((short*)pOut,nDone);
|
||||
else
|
||||
pDest->setLen(nDone);
|
||||
|
||||
pDest->setFrameFormat((nChannels==2) ? 1 : 0,freqs[pEngine->Decoder.fr.sampling_frequency]);
|
||||
|
||||
return true;
|
||||
}
|
||||
else if(nResult==MP3_NEED_MORE)
|
||||
{
|
||||
//should never happen otherwise because only whole frames
|
||||
//are passed to HIP and the modified version of HIP we use
|
||||
//here does not buffer data from the beginning for later use
|
||||
|
||||
//not critical, though
|
||||
|
||||
pDest->setLen(0);
|
||||
pDest->setFrameFormat(1,44100);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//error
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void DecodeEngine_Flush(void* pEng)
|
||||
{
|
||||
DecodeEngine* pEngine=(DecodeEngine*)pEng;
|
||||
|
||||
//complete reinit
|
||||
ExitMP3(&pEngine->Decoder);
|
||||
InitMP3(&pEngine->Decoder);
|
||||
|
||||
/*while(pEngine->Decoder.tail!=NULL)
|
||||
remove_buf(&pEngine->Decoder);
|
||||
pEngine->Decoder.bsize=0;
|
||||
|
||||
pEngine->Decoder.header_parsed=0;
|
||||
pEngine->Decoder.side_parsed=0;
|
||||
pEngine->Decoder.data_parsed=0;
|
||||
pEngine->Decoder.sync_bitstream=1;*/
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
#ifndef _HIPDEFINES_H_
|
||||
#define _HIPDEFINES_H_
|
||||
|
||||
#define NOANALYSIS
|
||||
#define USE_LAYER_1
|
||||
#define USE_LAYER_2
|
||||
|
||||
#define MPEG1
|
||||
|
||||
#endif
|
|
@ -1,176 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
#include "VbrTag.h"
|
||||
#include <stdio.h>
|
||||
|
||||
/* stuff from lame's tables.c */
|
||||
const int bitrate_table [3] [16] = {
|
||||
{ 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, -1 },
|
||||
{ 0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1 },
|
||||
{ 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, -1 },
|
||||
};
|
||||
|
||||
const int samplerate_table [3] [4] = {
|
||||
{ 22050, 24000, 16000, -1 }, /* MPEG 2 */
|
||||
{ 44100, 48000, 32000, -1 }, /* MPEG 1 */
|
||||
{ 11025, 12000, 8000, -1 }, /* MPEG 2.5 */
|
||||
};
|
||||
/* end stuff from lame's tables.c */
|
||||
|
||||
|
||||
/* stuff from VbrTag.c/.h */
|
||||
const static char VBRTag[]={"Xing"};
|
||||
const static char VBRTag2[]={"Info"};
|
||||
|
||||
/* from lame's VbrTag.c */
|
||||
static int
|
||||
ExtractI4(unsigned char *buf)
|
||||
{
|
||||
int x;
|
||||
/* big endian extract */
|
||||
x = buf[0];
|
||||
x <<= 8;
|
||||
x |= buf[1];
|
||||
x <<= 8;
|
||||
x |= buf[2];
|
||||
x <<= 8;
|
||||
x |= buf[3];
|
||||
return x;
|
||||
}
|
||||
|
||||
/* from lame's VbrTag.c */
|
||||
int
|
||||
GetVbrTag(VBRTAGDATA *pTagData, unsigned char *buf)
|
||||
{
|
||||
int i, head_flags;
|
||||
int h_bitrate,h_id, h_mode, h_sr_index;
|
||||
int enc_delay,enc_padding;
|
||||
|
||||
/* get Vbr header data */
|
||||
pTagData->flags = 0;
|
||||
|
||||
/* get selected MPEG header data */
|
||||
h_id = (buf[1] >> 3) & 1;
|
||||
h_sr_index = (buf[2] >> 2) & 3;
|
||||
h_mode = (buf[3] >> 6) & 3;
|
||||
h_bitrate = ((buf[2]>>4)&0xf);
|
||||
h_bitrate = bitrate_table[h_id][h_bitrate];
|
||||
|
||||
/* check for FFE syncword */
|
||||
if ((buf[1]>>4)==0xE)
|
||||
pTagData->samprate = samplerate_table[2][h_sr_index];
|
||||
else
|
||||
pTagData->samprate = samplerate_table[h_id][h_sr_index];
|
||||
// if( h_id == 0 )
|
||||
// pTagData->samprate >>= 1;
|
||||
|
||||
/* determine offset of header */
|
||||
if( h_id )
|
||||
{
|
||||
/* mpeg1 */
|
||||
if( h_mode != 3 ) buf+=(32+4);
|
||||
else buf+=(17+4);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* mpeg2 */
|
||||
if( h_mode != 3 ) buf+=(17+4);
|
||||
else buf+=(9+4);
|
||||
}
|
||||
|
||||
if( buf[0] != VBRTag[0] && buf[0] != VBRTag2[0] ) return 0; /* fail */
|
||||
if( buf[1] != VBRTag[1] && buf[1] != VBRTag2[1]) return 0; /* header not found*/
|
||||
if( buf[2] != VBRTag[2] && buf[2] != VBRTag2[2]) return 0;
|
||||
if( buf[3] != VBRTag[3] && buf[3] != VBRTag2[3]) return 0;
|
||||
|
||||
buf+=4;
|
||||
|
||||
pTagData->h_id = h_id;
|
||||
|
||||
head_flags = pTagData->flags = ExtractI4(buf); buf+=4; /* get flags */
|
||||
|
||||
if( head_flags & FRAMES_FLAG )
|
||||
{
|
||||
pTagData->frames = ExtractI4(buf); buf+=4;
|
||||
}
|
||||
|
||||
if( head_flags & BYTES_FLAG )
|
||||
{
|
||||
pTagData->bytes = ExtractI4(buf); buf+=4;
|
||||
}
|
||||
|
||||
if( head_flags & TOC_FLAG )
|
||||
{
|
||||
if( pTagData->toc != NULL )
|
||||
{
|
||||
for(i=0;i<NUMTOCENTRIES;i++)
|
||||
pTagData->toc[i] = buf[i];
|
||||
}
|
||||
buf+=NUMTOCENTRIES;
|
||||
}
|
||||
|
||||
pTagData->vbr_scale = -1;
|
||||
|
||||
if( head_flags & VBR_SCALE_FLAG )
|
||||
{
|
||||
pTagData->vbr_scale = ExtractI4(buf); buf+=4;
|
||||
}
|
||||
|
||||
pTagData->headersize =
|
||||
((h_id+1)*72000*h_bitrate) / pTagData->samprate;
|
||||
|
||||
buf+=21;
|
||||
enc_delay = buf[0] << 4;
|
||||
enc_delay += buf[1] >> 4;
|
||||
enc_padding= (buf[1] & 0x0F)<<8;
|
||||
enc_padding += buf[2];
|
||||
// check for reasonable values (this may be an old Xing header,
|
||||
// not a INFO tag)
|
||||
if (enc_delay<0 || enc_delay > 3000) enc_delay=-1;
|
||||
if (enc_padding<0 || enc_padding > 3000) enc_padding=-1;
|
||||
|
||||
pTagData->enc_delay=enc_delay;
|
||||
pTagData->enc_padding=enc_padding;
|
||||
|
||||
#ifdef HIP_DEBUG
|
||||
fprintf(stderr,"exit GetVbrTag:\n");
|
||||
fprintf(stderr," tag = %s\n",VBRTag);
|
||||
fprintf(stderr," head_flags = %d\n",head_flags);
|
||||
fprintf(stderr," bytes = %d\n",pTagData->bytes);
|
||||
fprintf(stderr," frames = %d\n",pTagData->frames);
|
||||
fprintf(stderr," VBR Scale = %d\n",pTagData->vbr_scale);
|
||||
fprintf(stderr," enc_delay = %i \n",enc_delay);
|
||||
fprintf(stderr," enc_padding = %i \n",enc_padding);
|
||||
fprintf(stderr," toc =\n");
|
||||
if( pTagData->toc != NULL )
|
||||
{
|
||||
for(i=0;i<NUMTOCENTRIES;i++)
|
||||
{
|
||||
if( (i%10) == 0 ) fprintf(stderr,"\n");
|
||||
fprintf(stderr," %3d", (int)(pTagData->toc[i]));
|
||||
}
|
||||
}
|
||||
fprintf(stderr,"\n");
|
||||
#endif
|
||||
return 1; /* success */
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
*
|
||||
* Xing VBR tagging for LAME.
|
||||
*
|
||||
* Copyright (c) 1999 A.L. Faber
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef LAME_VRBTAG_H
|
||||
#define LAME_VRBTAG_H
|
||||
/* -----------------------------------------------------------
|
||||
* A Vbr header may be present in the ancillary
|
||||
* data field of the first frame of an mp3 bitstream
|
||||
* The Vbr header (optionally) contains
|
||||
* frames total number of audio frames in the bitstream
|
||||
* bytes total number of bytes in the bitstream
|
||||
* toc table of contents
|
||||
|
||||
* toc (table of contents) gives seek points
|
||||
* for random access
|
||||
* the ith entry determines the seek point for
|
||||
* i-percent duration
|
||||
* seek point in bytes = (toc[i]/256.0) * total_bitstream_bytes
|
||||
* e.g. half duration seek point = (toc[50]/256.0) * total_bitstream_bytes
|
||||
*/
|
||||
|
||||
|
||||
#define FRAMES_FLAG 0x0001
|
||||
#define BYTES_FLAG 0x0002
|
||||
#define TOC_FLAG 0x0004
|
||||
#define VBR_SCALE_FLAG 0x0008
|
||||
|
||||
#define NUMTOCENTRIES 100
|
||||
|
||||
#define FRAMES_AND_BYTES (FRAMES_FLAG | BYTES_FLAG)
|
||||
|
||||
|
||||
|
||||
/*structure to receive extracted header */
|
||||
/* toc may be NULL*/
|
||||
typedef struct
|
||||
{
|
||||
int h_id; /* from MPEG header, 0=MPEG2, 1=MPEG1 */
|
||||
int samprate; /* determined from MPEG header */
|
||||
int flags; /* from Vbr header data */
|
||||
int frames; /* total bit stream frames from Vbr header data */
|
||||
int bytes; /* total bit stream bytes from Vbr header data*/
|
||||
int vbr_scale; /* encoded vbr scale from Vbr header data*/
|
||||
unsigned char toc[NUMTOCENTRIES]; /* may be NULL if toc not desired*/
|
||||
int headersize; /* size of VBR header, in bytes */
|
||||
int enc_delay; /* encoder delay */
|
||||
int enc_padding; /* encoder paddign added at end of stream */
|
||||
} VBRTAGDATA;
|
||||
|
||||
int CheckVbrTag(unsigned char *buf);
|
||||
int GetVbrTag(VBRTAGDATA *pTagData, unsigned char *buf);
|
||||
|
||||
/*
|
||||
int SeekPoint(unsigned char TOC[NUMTOCENTRIES], int file_bytes, float percent);
|
||||
int InitVbrTag(lame_global_flags *gfp);
|
||||
int PutVbrTag(lame_global_flags *gfp,FILE *fid,int nVbrScale);
|
||||
int PutLameVBR(lame_global_flags *gfp, FILE *fpStream, uint8_t *pbtStreamBuffer, uint32_t id3v2size, uint16_t crc);
|
||||
void AddVbrFrame(lame_global_flags *gfp);
|
||||
void ReportLameTagProgress(lame_global_flags *gfp,int nStart);
|
||||
void UpdateMusicCRC(uint16_t *crc,unsigned char *buffer, int size);
|
||||
*/
|
||||
|
||||
#endif
|
|
@ -1,320 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#ifdef macintosh
|
||||
#include <types.h>
|
||||
#include <stat.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#ifdef WITH_DMALLOC
|
||||
#include <dmalloc.h>
|
||||
#endif
|
||||
|
||||
// In C++ the array first must be prototyped, why ?
|
||||
|
||||
extern const int tabsel_123 [2] [3] [16];
|
||||
|
||||
const int tabsel_123 [2] [3] [16] = {
|
||||
{ {0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,},
|
||||
{0,32,48,56, 64, 80, 96,112,128,160,192,224,256,320,384,},
|
||||
{0,32,40,48, 56, 64, 80, 96,112,128,160,192,224,256,320,} },
|
||||
|
||||
{ {0,32,48,56,64,80,96,112,128,144,160,176,192,224,256,},
|
||||
{0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,},
|
||||
{0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,} }
|
||||
};
|
||||
|
||||
const long freqs[9] = { 44100, 48000, 32000,
|
||||
22050, 24000, 16000,
|
||||
11025, 12000, 8000 };
|
||||
|
||||
int bitindex;
|
||||
unsigned char *wordpointer;
|
||||
unsigned char *pcm_sample;
|
||||
int pcm_point = 0;
|
||||
|
||||
|
||||
#if defined( USE_LAYER_1 ) || defined ( USE_LAYER_2 )
|
||||
real muls[27][64];
|
||||
#endif
|
||||
|
||||
#define HDRCMPMASK 0xfffffd00
|
||||
|
||||
|
||||
int head_check(unsigned long head,int check_layer)
|
||||
{
|
||||
/*
|
||||
look for a valid header.
|
||||
if check_layer > 0, then require that
|
||||
nLayer = check_layer.
|
||||
*/
|
||||
|
||||
/* bits 13-14 = layer 3 */
|
||||
int nLayer=4-((head>>17)&3);
|
||||
|
||||
if( (head & 0xffe00000) != 0xffe00000) {
|
||||
/* syncword */
|
||||
return FALSE;
|
||||
}
|
||||
#if 0
|
||||
if(!((head>>17)&3)) {
|
||||
/* bits 13-14 = layer 3 */
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (3 != nLayer)
|
||||
{
|
||||
#if defined (USE_LAYER_1) || defined (USE_LAYER_2)
|
||||
if (4==nLayer)
|
||||
return FALSE;
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (check_layer>0) {
|
||||
if (nLayer != check_layer) return FALSE;
|
||||
}
|
||||
|
||||
if( ((head>>12)&0xf) == 0xf) {
|
||||
/* bits 16,17,18,19 = 1111 invalid bitrate */
|
||||
return FALSE;
|
||||
}
|
||||
if( ((head>>10)&0x3) == 0x3 ) {
|
||||
/* bits 20,21 = 11 invalid sampling freq */
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* the code a header and write the information
|
||||
* into the frame structure
|
||||
*/
|
||||
int decode_header(struct frame *fr,unsigned long newhead)
|
||||
{
|
||||
|
||||
|
||||
if( newhead & (1<<20) ) {
|
||||
fr->lsf = (newhead & (1<<19)) ? 0x0 : 0x1;
|
||||
fr->mpeg25 = 0;
|
||||
}
|
||||
else {
|
||||
fr->lsf = 1;
|
||||
fr->mpeg25 = 1;
|
||||
}
|
||||
|
||||
|
||||
fr->lay = 4-((newhead>>17)&3);
|
||||
if( ((newhead>>10)&0x3) == 0x3)
|
||||
{
|
||||
//fprintf(stderr,"Stream error\n");
|
||||
//exit(1);
|
||||
return 0;
|
||||
}
|
||||
if(fr->mpeg25) {
|
||||
fr->sampling_frequency = 6 + ((newhead>>10)&0x3);
|
||||
}
|
||||
else
|
||||
fr->sampling_frequency = ((newhead>>10)&0x3) + (fr->lsf*3);
|
||||
|
||||
fr->error_protection = ((newhead>>16)&0x1)^0x1;
|
||||
|
||||
if(fr->mpeg25) /* allow Bitrate change for 2.5 ... */
|
||||
fr->bitrate_index = ((newhead>>12)&0xf);
|
||||
|
||||
fr->bitrate_index = ((newhead>>12)&0xf);
|
||||
fr->padding = ((newhead>>9)&0x1);
|
||||
fr->extension = ((newhead>>8)&0x1);
|
||||
fr->mode = ((newhead>>6)&0x3);
|
||||
fr->mode_ext = ((newhead>>4)&0x3);
|
||||
fr->copyright = ((newhead>>3)&0x1);
|
||||
fr->original = ((newhead>>2)&0x1);
|
||||
fr->emphasis = newhead & 0x3;
|
||||
|
||||
fr->stereo = (fr->mode == MPG_MD_MONO) ? 1 : 2;
|
||||
|
||||
switch(fr->lay)
|
||||
{
|
||||
#ifdef USE_LAYER_1
|
||||
case 1:
|
||||
fr->framesize = (long) tabsel_123[fr->lsf][0][fr->bitrate_index] * 12000;
|
||||
fr->framesize /= freqs[fr->sampling_frequency];
|
||||
fr->framesize = ((fr->framesize+fr->padding)<<2)-4;
|
||||
fr->down_sample=0;
|
||||
fr->down_sample_sblimit = SBLIMIT>>(fr->down_sample);
|
||||
break;
|
||||
#endif
|
||||
#ifdef USE_LAYER_2
|
||||
case 2:
|
||||
fr->framesize = (long) tabsel_123[fr->lsf][1][fr->bitrate_index] * 144000;
|
||||
fr->framesize /= freqs[fr->sampling_frequency];
|
||||
fr->framesize += fr->padding - 4;
|
||||
fr->down_sample=0;
|
||||
fr->down_sample_sblimit = SBLIMIT>>(fr->down_sample);
|
||||
break;
|
||||
#endif
|
||||
case 3:
|
||||
#if 0
|
||||
fr->do_layer = do_layer3;
|
||||
if(fr->lsf)
|
||||
ssize = (fr->stereo == 1) ? 9 : 17;
|
||||
else
|
||||
ssize = (fr->stereo == 1) ? 17 : 32;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
if(fr->error_protection)
|
||||
ssize += 2;
|
||||
#endif
|
||||
if (fr->bitrate_index==0)
|
||||
fr->framesize=0;
|
||||
else{
|
||||
fr->framesize = (long) tabsel_123[fr->lsf][2][fr->bitrate_index] * 144000;
|
||||
fr->framesize /= freqs[fr->sampling_frequency]<<(fr->lsf);
|
||||
fr->framesize = fr->framesize + fr->padding - 4;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
//fprintf(stderr,"Sorry, layer %d not supported\n",fr->lay);
|
||||
return (0);
|
||||
}
|
||||
/* print_header(fr); */
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/*#if 1
|
||||
void print_header(struct frame *fr)
|
||||
{
|
||||
static const char *modes[4] = { "Stereo", "Joint-Stereo", "Dual-Channel", "Single-Channel" };
|
||||
static const char *layers[4] = { "Unknown" , "I", "II", "III" };
|
||||
|
||||
fprintf(stderr,"MPEG %s, Layer: %s, Freq: %ld, mode: %s, modext: %d, BPF : %d\n",
|
||||
fr->mpeg25 ? "2.5" : (fr->lsf ? "2.0" : "1.0"),
|
||||
layers[fr->lay],freqs[fr->sampling_frequency],
|
||||
modes[fr->mode],fr->mode_ext,fr->framesize+4);
|
||||
fprintf(stderr,"Channels: %d, copyright: %s, original: %s, CRC: %s, emphasis: %d.\n",
|
||||
fr->stereo,fr->copyright?"Yes":"No",
|
||||
fr->original?"Yes":"No",fr->error_protection?"Yes":"No",
|
||||
fr->emphasis);
|
||||
fprintf(stderr,"Bitrate: %d Kbits/s, Extension value: %d\n",
|
||||
tabsel_123[fr->lsf][fr->lay-1][fr->bitrate_index],fr->extension);
|
||||
}
|
||||
|
||||
void print_header_compact(struct frame *fr)
|
||||
{
|
||||
static const char *modes[4] = { "stereo", "joint-stereo", "dual-channel", "mono" };
|
||||
static const char *layers[4] = { "Unknown" , "I", "II", "III" };
|
||||
|
||||
fprintf(stderr,"MPEG %s layer %s, %d kbit/s, %ld Hz %s\n",
|
||||
fr->mpeg25 ? "2.5" : (fr->lsf ? "2.0" : "1.0"),
|
||||
layers[fr->lay],
|
||||
tabsel_123[fr->lsf][fr->lay-1][fr->bitrate_index],
|
||||
freqs[fr->sampling_frequency], modes[fr->mode]);
|
||||
}
|
||||
|
||||
#endif*/
|
||||
|
||||
unsigned int getbits(int number_of_bits)
|
||||
{
|
||||
unsigned long rval;
|
||||
|
||||
if(!number_of_bits)
|
||||
return 0;
|
||||
|
||||
{
|
||||
rval = wordpointer[0];
|
||||
rval <<= 8;
|
||||
rval |= wordpointer[1];
|
||||
rval <<= 8;
|
||||
rval |= wordpointer[2];
|
||||
rval <<= bitindex;
|
||||
rval &= 0xffffff;
|
||||
|
||||
bitindex += number_of_bits;
|
||||
|
||||
rval >>= (24-number_of_bits);
|
||||
|
||||
wordpointer += (bitindex>>3);
|
||||
bitindex &= 7;
|
||||
}
|
||||
return rval;
|
||||
}
|
||||
|
||||
unsigned int getbits_fast(int number_of_bits)
|
||||
{
|
||||
unsigned long rval;
|
||||
|
||||
{
|
||||
rval = wordpointer[0];
|
||||
rval <<= 8;
|
||||
rval |= wordpointer[1];
|
||||
rval <<= bitindex;
|
||||
rval &= 0xffff;
|
||||
bitindex += number_of_bits;
|
||||
|
||||
rval >>= (16-number_of_bits);
|
||||
|
||||
wordpointer += (bitindex>>3);
|
||||
bitindex &= 7;
|
||||
}
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
||||
int set_pointer( PMPSTR mp, long backstep)
|
||||
{
|
||||
unsigned char *bsbufold;
|
||||
|
||||
if(mp->fsizeold < 0 && backstep > 0) {
|
||||
//fprintf(stderr,"Can't step back %ld!\n",backstep);
|
||||
return MP3_ERR;
|
||||
}
|
||||
bsbufold = mp->bsspace[1-mp->bsnum] + 512;
|
||||
wordpointer -= backstep;
|
||||
if (backstep)
|
||||
memcpy(wordpointer,bsbufold+mp->fsizeold-backstep,(size_t)backstep);
|
||||
bitindex = 0;
|
||||
return MP3_OK;
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
/*
|
||||
** Copyright (C) 2000 Albert L. Faber
|
||||
**/
|
||||
|
||||
|
||||
#ifndef COMMON_H_INCLUDED
|
||||
#define COMMON_H_INCLUDED
|
||||
|
||||
#include "HIPDefines.h"
|
||||
|
||||
#include "mpg123.h"
|
||||
#include "mpglib.h"
|
||||
|
||||
extern const int tabsel_123[2][3][16];
|
||||
extern const long freqs[9];
|
||||
extern unsigned char *wordpointer;
|
||||
extern int bitindex;
|
||||
|
||||
|
||||
#if defined( USE_LAYER_1 ) || defined ( USE_LAYER_2 )
|
||||
extern real muls[27][64];
|
||||
#endif
|
||||
|
||||
int head_check(unsigned long head,int check_layer);
|
||||
int decode_header(struct frame *fr,unsigned long newhead);
|
||||
void print_header(struct frame *fr);
|
||||
void print_header_compact(struct frame *fr);
|
||||
unsigned int getbits(int number_of_bits);
|
||||
unsigned int getbits_fast(int number_of_bits);
|
||||
int set_pointer( PMPSTR mp, long backstep);
|
||||
|
||||
#endif
|
|
@ -1,348 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Discrete Cosine Tansform (DCT) for subband synthesis
|
||||
* optimized for machines with no auto-increment.
|
||||
* The performance is highly compiler dependend. Maybe
|
||||
* the dct64.c version for 'normal' processor may be faster
|
||||
* even for Intel processors.
|
||||
*/
|
||||
|
||||
/* $Id: dct64_i386.c 3 2005-06-02 18:16:43Z vspader $ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "dct64_i386.h"
|
||||
#include "tabinit.h"
|
||||
|
||||
#ifdef WITH_DMALLOC
|
||||
#include <dmalloc.h>
|
||||
#endif
|
||||
|
||||
static void dct64_1(real *out0,real *out1,real *b1,real *b2,real *samples)
|
||||
{
|
||||
|
||||
{
|
||||
register real *costab = pnts[0];
|
||||
|
||||
b1[0x00] = samples[0x00] + samples[0x1F];
|
||||
b1[0x1F] = (samples[0x00] - samples[0x1F]) * costab[0x0];
|
||||
|
||||
b1[0x01] = samples[0x01] + samples[0x1E];
|
||||
b1[0x1E] = (samples[0x01] - samples[0x1E]) * costab[0x1];
|
||||
|
||||
b1[0x02] = samples[0x02] + samples[0x1D];
|
||||
b1[0x1D] = (samples[0x02] - samples[0x1D]) * costab[0x2];
|
||||
|
||||
b1[0x03] = samples[0x03] + samples[0x1C];
|
||||
b1[0x1C] = (samples[0x03] - samples[0x1C]) * costab[0x3];
|
||||
|
||||
b1[0x04] = samples[0x04] + samples[0x1B];
|
||||
b1[0x1B] = (samples[0x04] - samples[0x1B]) * costab[0x4];
|
||||
|
||||
b1[0x05] = samples[0x05] + samples[0x1A];
|
||||
b1[0x1A] = (samples[0x05] - samples[0x1A]) * costab[0x5];
|
||||
|
||||
b1[0x06] = samples[0x06] + samples[0x19];
|
||||
b1[0x19] = (samples[0x06] - samples[0x19]) * costab[0x6];
|
||||
|
||||
b1[0x07] = samples[0x07] + samples[0x18];
|
||||
b1[0x18] = (samples[0x07] - samples[0x18]) * costab[0x7];
|
||||
|
||||
b1[0x08] = samples[0x08] + samples[0x17];
|
||||
b1[0x17] = (samples[0x08] - samples[0x17]) * costab[0x8];
|
||||
|
||||
b1[0x09] = samples[0x09] + samples[0x16];
|
||||
b1[0x16] = (samples[0x09] - samples[0x16]) * costab[0x9];
|
||||
|
||||
b1[0x0A] = samples[0x0A] + samples[0x15];
|
||||
b1[0x15] = (samples[0x0A] - samples[0x15]) * costab[0xA];
|
||||
|
||||
b1[0x0B] = samples[0x0B] + samples[0x14];
|
||||
b1[0x14] = (samples[0x0B] - samples[0x14]) * costab[0xB];
|
||||
|
||||
b1[0x0C] = samples[0x0C] + samples[0x13];
|
||||
b1[0x13] = (samples[0x0C] - samples[0x13]) * costab[0xC];
|
||||
|
||||
b1[0x0D] = samples[0x0D] + samples[0x12];
|
||||
b1[0x12] = (samples[0x0D] - samples[0x12]) * costab[0xD];
|
||||
|
||||
b1[0x0E] = samples[0x0E] + samples[0x11];
|
||||
b1[0x11] = (samples[0x0E] - samples[0x11]) * costab[0xE];
|
||||
|
||||
b1[0x0F] = samples[0x0F] + samples[0x10];
|
||||
b1[0x10] = (samples[0x0F] - samples[0x10]) * costab[0xF];
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
register real *costab = pnts[1];
|
||||
|
||||
b2[0x00] = b1[0x00] + b1[0x0F];
|
||||
b2[0x0F] = (b1[0x00] - b1[0x0F]) * costab[0];
|
||||
b2[0x01] = b1[0x01] + b1[0x0E];
|
||||
b2[0x0E] = (b1[0x01] - b1[0x0E]) * costab[1];
|
||||
b2[0x02] = b1[0x02] + b1[0x0D];
|
||||
b2[0x0D] = (b1[0x02] - b1[0x0D]) * costab[2];
|
||||
b2[0x03] = b1[0x03] + b1[0x0C];
|
||||
b2[0x0C] = (b1[0x03] - b1[0x0C]) * costab[3];
|
||||
b2[0x04] = b1[0x04] + b1[0x0B];
|
||||
b2[0x0B] = (b1[0x04] - b1[0x0B]) * costab[4];
|
||||
b2[0x05] = b1[0x05] + b1[0x0A];
|
||||
b2[0x0A] = (b1[0x05] - b1[0x0A]) * costab[5];
|
||||
b2[0x06] = b1[0x06] + b1[0x09];
|
||||
b2[0x09] = (b1[0x06] - b1[0x09]) * costab[6];
|
||||
b2[0x07] = b1[0x07] + b1[0x08];
|
||||
b2[0x08] = (b1[0x07] - b1[0x08]) * costab[7];
|
||||
|
||||
b2[0x10] = b1[0x10] + b1[0x1F];
|
||||
b2[0x1F] = (b1[0x1F] - b1[0x10]) * costab[0];
|
||||
b2[0x11] = b1[0x11] + b1[0x1E];
|
||||
b2[0x1E] = (b1[0x1E] - b1[0x11]) * costab[1];
|
||||
b2[0x12] = b1[0x12] + b1[0x1D];
|
||||
b2[0x1D] = (b1[0x1D] - b1[0x12]) * costab[2];
|
||||
b2[0x13] = b1[0x13] + b1[0x1C];
|
||||
b2[0x1C] = (b1[0x1C] - b1[0x13]) * costab[3];
|
||||
b2[0x14] = b1[0x14] + b1[0x1B];
|
||||
b2[0x1B] = (b1[0x1B] - b1[0x14]) * costab[4];
|
||||
b2[0x15] = b1[0x15] + b1[0x1A];
|
||||
b2[0x1A] = (b1[0x1A] - b1[0x15]) * costab[5];
|
||||
b2[0x16] = b1[0x16] + b1[0x19];
|
||||
b2[0x19] = (b1[0x19] - b1[0x16]) * costab[6];
|
||||
b2[0x17] = b1[0x17] + b1[0x18];
|
||||
b2[0x18] = (b1[0x18] - b1[0x17]) * costab[7];
|
||||
}
|
||||
|
||||
{
|
||||
register real *costab = pnts[2];
|
||||
|
||||
b1[0x00] = b2[0x00] + b2[0x07];
|
||||
b1[0x07] = (b2[0x00] - b2[0x07]) * costab[0];
|
||||
b1[0x01] = b2[0x01] + b2[0x06];
|
||||
b1[0x06] = (b2[0x01] - b2[0x06]) * costab[1];
|
||||
b1[0x02] = b2[0x02] + b2[0x05];
|
||||
b1[0x05] = (b2[0x02] - b2[0x05]) * costab[2];
|
||||
b1[0x03] = b2[0x03] + b2[0x04];
|
||||
b1[0x04] = (b2[0x03] - b2[0x04]) * costab[3];
|
||||
|
||||
b1[0x08] = b2[0x08] + b2[0x0F];
|
||||
b1[0x0F] = (b2[0x0F] - b2[0x08]) * costab[0];
|
||||
b1[0x09] = b2[0x09] + b2[0x0E];
|
||||
b1[0x0E] = (b2[0x0E] - b2[0x09]) * costab[1];
|
||||
b1[0x0A] = b2[0x0A] + b2[0x0D];
|
||||
b1[0x0D] = (b2[0x0D] - b2[0x0A]) * costab[2];
|
||||
b1[0x0B] = b2[0x0B] + b2[0x0C];
|
||||
b1[0x0C] = (b2[0x0C] - b2[0x0B]) * costab[3];
|
||||
|
||||
b1[0x10] = b2[0x10] + b2[0x17];
|
||||
b1[0x17] = (b2[0x10] - b2[0x17]) * costab[0];
|
||||
b1[0x11] = b2[0x11] + b2[0x16];
|
||||
b1[0x16] = (b2[0x11] - b2[0x16]) * costab[1];
|
||||
b1[0x12] = b2[0x12] + b2[0x15];
|
||||
b1[0x15] = (b2[0x12] - b2[0x15]) * costab[2];
|
||||
b1[0x13] = b2[0x13] + b2[0x14];
|
||||
b1[0x14] = (b2[0x13] - b2[0x14]) * costab[3];
|
||||
|
||||
b1[0x18] = b2[0x18] + b2[0x1F];
|
||||
b1[0x1F] = (b2[0x1F] - b2[0x18]) * costab[0];
|
||||
b1[0x19] = b2[0x19] + b2[0x1E];
|
||||
b1[0x1E] = (b2[0x1E] - b2[0x19]) * costab[1];
|
||||
b1[0x1A] = b2[0x1A] + b2[0x1D];
|
||||
b1[0x1D] = (b2[0x1D] - b2[0x1A]) * costab[2];
|
||||
b1[0x1B] = b2[0x1B] + b2[0x1C];
|
||||
b1[0x1C] = (b2[0x1C] - b2[0x1B]) * costab[3];
|
||||
}
|
||||
|
||||
{
|
||||
register real const cos0 = pnts[3][0];
|
||||
register real const cos1 = pnts[3][1];
|
||||
|
||||
b2[0x00] = b1[0x00] + b1[0x03];
|
||||
b2[0x03] = (b1[0x00] - b1[0x03]) * cos0;
|
||||
b2[0x01] = b1[0x01] + b1[0x02];
|
||||
b2[0x02] = (b1[0x01] - b1[0x02]) * cos1;
|
||||
|
||||
b2[0x04] = b1[0x04] + b1[0x07];
|
||||
b2[0x07] = (b1[0x07] - b1[0x04]) * cos0;
|
||||
b2[0x05] = b1[0x05] + b1[0x06];
|
||||
b2[0x06] = (b1[0x06] - b1[0x05]) * cos1;
|
||||
|
||||
b2[0x08] = b1[0x08] + b1[0x0B];
|
||||
b2[0x0B] = (b1[0x08] - b1[0x0B]) * cos0;
|
||||
b2[0x09] = b1[0x09] + b1[0x0A];
|
||||
b2[0x0A] = (b1[0x09] - b1[0x0A]) * cos1;
|
||||
|
||||
b2[0x0C] = b1[0x0C] + b1[0x0F];
|
||||
b2[0x0F] = (b1[0x0F] - b1[0x0C]) * cos0;
|
||||
b2[0x0D] = b1[0x0D] + b1[0x0E];
|
||||
b2[0x0E] = (b1[0x0E] - b1[0x0D]) * cos1;
|
||||
|
||||
b2[0x10] = b1[0x10] + b1[0x13];
|
||||
b2[0x13] = (b1[0x10] - b1[0x13]) * cos0;
|
||||
b2[0x11] = b1[0x11] + b1[0x12];
|
||||
b2[0x12] = (b1[0x11] - b1[0x12]) * cos1;
|
||||
|
||||
b2[0x14] = b1[0x14] + b1[0x17];
|
||||
b2[0x17] = (b1[0x17] - b1[0x14]) * cos0;
|
||||
b2[0x15] = b1[0x15] + b1[0x16];
|
||||
b2[0x16] = (b1[0x16] - b1[0x15]) * cos1;
|
||||
|
||||
b2[0x18] = b1[0x18] + b1[0x1B];
|
||||
b2[0x1B] = (b1[0x18] - b1[0x1B]) * cos0;
|
||||
b2[0x19] = b1[0x19] + b1[0x1A];
|
||||
b2[0x1A] = (b1[0x19] - b1[0x1A]) * cos1;
|
||||
|
||||
b2[0x1C] = b1[0x1C] + b1[0x1F];
|
||||
b2[0x1F] = (b1[0x1F] - b1[0x1C]) * cos0;
|
||||
b2[0x1D] = b1[0x1D] + b1[0x1E];
|
||||
b2[0x1E] = (b1[0x1E] - b1[0x1D]) * cos1;
|
||||
}
|
||||
|
||||
{
|
||||
register real const cos0 = pnts[4][0];
|
||||
|
||||
b1[0x00] = b2[0x00] + b2[0x01];
|
||||
b1[0x01] = (b2[0x00] - b2[0x01]) * cos0;
|
||||
b1[0x02] = b2[0x02] + b2[0x03];
|
||||
b1[0x03] = (b2[0x03] - b2[0x02]) * cos0;
|
||||
b1[0x02] += b1[0x03];
|
||||
|
||||
b1[0x04] = b2[0x04] + b2[0x05];
|
||||
b1[0x05] = (b2[0x04] - b2[0x05]) * cos0;
|
||||
b1[0x06] = b2[0x06] + b2[0x07];
|
||||
b1[0x07] = (b2[0x07] - b2[0x06]) * cos0;
|
||||
b1[0x06] += b1[0x07];
|
||||
b1[0x04] += b1[0x06];
|
||||
b1[0x06] += b1[0x05];
|
||||
b1[0x05] += b1[0x07];
|
||||
|
||||
b1[0x08] = b2[0x08] + b2[0x09];
|
||||
b1[0x09] = (b2[0x08] - b2[0x09]) * cos0;
|
||||
b1[0x0A] = b2[0x0A] + b2[0x0B];
|
||||
b1[0x0B] = (b2[0x0B] - b2[0x0A]) * cos0;
|
||||
b1[0x0A] += b1[0x0B];
|
||||
|
||||
b1[0x0C] = b2[0x0C] + b2[0x0D];
|
||||
b1[0x0D] = (b2[0x0C] - b2[0x0D]) * cos0;
|
||||
b1[0x0E] = b2[0x0E] + b2[0x0F];
|
||||
b1[0x0F] = (b2[0x0F] - b2[0x0E]) * cos0;
|
||||
b1[0x0E] += b1[0x0F];
|
||||
b1[0x0C] += b1[0x0E];
|
||||
b1[0x0E] += b1[0x0D];
|
||||
b1[0x0D] += b1[0x0F];
|
||||
|
||||
b1[0x10] = b2[0x10] + b2[0x11];
|
||||
b1[0x11] = (b2[0x10] - b2[0x11]) * cos0;
|
||||
b1[0x12] = b2[0x12] + b2[0x13];
|
||||
b1[0x13] = (b2[0x13] - b2[0x12]) * cos0;
|
||||
b1[0x12] += b1[0x13];
|
||||
|
||||
b1[0x14] = b2[0x14] + b2[0x15];
|
||||
b1[0x15] = (b2[0x14] - b2[0x15]) * cos0;
|
||||
b1[0x16] = b2[0x16] + b2[0x17];
|
||||
b1[0x17] = (b2[0x17] - b2[0x16]) * cos0;
|
||||
b1[0x16] += b1[0x17];
|
||||
b1[0x14] += b1[0x16];
|
||||
b1[0x16] += b1[0x15];
|
||||
b1[0x15] += b1[0x17];
|
||||
|
||||
b1[0x18] = b2[0x18] + b2[0x19];
|
||||
b1[0x19] = (b2[0x18] - b2[0x19]) * cos0;
|
||||
b1[0x1A] = b2[0x1A] + b2[0x1B];
|
||||
b1[0x1B] = (b2[0x1B] - b2[0x1A]) * cos0;
|
||||
b1[0x1A] += b1[0x1B];
|
||||
|
||||
b1[0x1C] = b2[0x1C] + b2[0x1D];
|
||||
b1[0x1D] = (b2[0x1C] - b2[0x1D]) * cos0;
|
||||
b1[0x1E] = b2[0x1E] + b2[0x1F];
|
||||
b1[0x1F] = (b2[0x1F] - b2[0x1E]) * cos0;
|
||||
b1[0x1E] += b1[0x1F];
|
||||
b1[0x1C] += b1[0x1E];
|
||||
b1[0x1E] += b1[0x1D];
|
||||
b1[0x1D] += b1[0x1F];
|
||||
}
|
||||
|
||||
out0[0x10*16] = b1[0x00];
|
||||
out0[0x10*12] = b1[0x04];
|
||||
out0[0x10* 8] = b1[0x02];
|
||||
out0[0x10* 4] = b1[0x06];
|
||||
out0[0x10* 0] = b1[0x01];
|
||||
out1[0x10* 0] = b1[0x01];
|
||||
out1[0x10* 4] = b1[0x05];
|
||||
out1[0x10* 8] = b1[0x03];
|
||||
out1[0x10*12] = b1[0x07];
|
||||
|
||||
b1[0x08] += b1[0x0C];
|
||||
out0[0x10*14] = b1[0x08];
|
||||
b1[0x0C] += b1[0x0a];
|
||||
out0[0x10*10] = b1[0x0C];
|
||||
b1[0x0A] += b1[0x0E];
|
||||
out0[0x10* 6] = b1[0x0A];
|
||||
b1[0x0E] += b1[0x09];
|
||||
out0[0x10* 2] = b1[0x0E];
|
||||
b1[0x09] += b1[0x0D];
|
||||
out1[0x10* 2] = b1[0x09];
|
||||
b1[0x0D] += b1[0x0B];
|
||||
out1[0x10* 6] = b1[0x0D];
|
||||
b1[0x0B] += b1[0x0F];
|
||||
out1[0x10*10] = b1[0x0B];
|
||||
out1[0x10*14] = b1[0x0F];
|
||||
|
||||
b1[0x18] += b1[0x1C];
|
||||
out0[0x10*15] = b1[0x10] + b1[0x18];
|
||||
out0[0x10*13] = b1[0x18] + b1[0x14];
|
||||
b1[0x1C] += b1[0x1a];
|
||||
out0[0x10*11] = b1[0x14] + b1[0x1C];
|
||||
out0[0x10* 9] = b1[0x1C] + b1[0x12];
|
||||
b1[0x1A] += b1[0x1E];
|
||||
out0[0x10* 7] = b1[0x12] + b1[0x1A];
|
||||
out0[0x10* 5] = b1[0x1A] + b1[0x16];
|
||||
b1[0x1E] += b1[0x19];
|
||||
out0[0x10* 3] = b1[0x16] + b1[0x1E];
|
||||
out0[0x10* 1] = b1[0x1E] + b1[0x11];
|
||||
b1[0x19] += b1[0x1D];
|
||||
out1[0x10* 1] = b1[0x11] + b1[0x19];
|
||||
out1[0x10* 3] = b1[0x19] + b1[0x15];
|
||||
b1[0x1D] += b1[0x1B];
|
||||
out1[0x10* 5] = b1[0x15] + b1[0x1D];
|
||||
out1[0x10* 7] = b1[0x1D] + b1[0x13];
|
||||
b1[0x1B] += b1[0x1F];
|
||||
out1[0x10* 9] = b1[0x13] + b1[0x1B];
|
||||
out1[0x10*11] = b1[0x1B] + b1[0x17];
|
||||
out1[0x10*13] = b1[0x17] + b1[0x1F];
|
||||
out1[0x10*15] = b1[0x1F];
|
||||
}
|
||||
|
||||
/*
|
||||
* the call via dct64 is a trick to force GCC to use
|
||||
* (new) registers for the b1,b2 pointer to the bufs[xx] field
|
||||
*/
|
||||
void dct64( real *a,real *b,real *c)
|
||||
{
|
||||
real bufs[0x40];
|
||||
dct64_1(a,b,bufs,bufs+0x20,c);
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
/*
|
||||
** Copyright (C) 2000 Albert L. Faber
|
||||
**/
|
||||
|
||||
|
||||
#ifndef MPGLIB_DCT64_I386_H_INCLUDED
|
||||
#define MPGLIB_DCT64_I386_H_INCLUDED
|
||||
|
||||
#include "common.h"
|
||||
|
||||
void dct64( real *a,real *b,real *c);
|
||||
|
||||
|
||||
#endif
|
|
@ -1,202 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Mpeg Layer-1,2,3 audio decoder
|
||||
* ------------------------------
|
||||
* copyright (c) 1995,1996,1997 by Michael Hipp, All rights reserved.
|
||||
* See also 'README'
|
||||
*
|
||||
* slighlty optimized for machines without autoincrement/decrement.
|
||||
* The performance is highly compiler dependend. Maybe
|
||||
* the decode.c version for 'normal' processor may be faster
|
||||
* even for Intel processors.
|
||||
*/
|
||||
|
||||
/* $Id: decode_i386.c 3 2005-06-02 18:16:43Z vspader $ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
//#ifdef STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
//#else
|
||||
/*# ifndef HAVE_STRCHR
|
||||
# define strchr index
|
||||
# define strrchr rindex
|
||||
# endif
|
||||
char *strchr (), *strrchr ();
|
||||
/*# ifndef HAVE_MEMCPY
|
||||
# define memcpy(d, s, n) bcopy ((s), (d), (n))
|
||||
# define memmove(d, s, n) bcopy ((s), (d), (n))
|
||||
# endif
|
||||
#endif*/
|
||||
|
||||
#if defined(__riscos__) && defined(FPA10)
|
||||
#include "ymath.h"
|
||||
#else
|
||||
#include <math.h>
|
||||
#endif
|
||||
|
||||
#include "decode_i386.h"
|
||||
#include "dct64_i386.h"
|
||||
#include "tabinit.h"
|
||||
|
||||
#ifdef WITH_DMALLOC
|
||||
#include <dmalloc.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* old WRITE_SAMPLE */
|
||||
#define WRITE_SAMPLE(samples,sum,clip) \
|
||||
if( (sum) > 32767.0) { *(samples) = 0x7fff; (clip)++; } \
|
||||
else if( (sum) < -32768.0) { *(samples) = -0x8000; (clip)++; } \
|
||||
else { *(samples) = (short)( ((sum)>0 ? (sum)+0.5 : (sum)-0.5) ); }
|
||||
|
||||
int synth_1to1_mono(PMPSTR mp, real *bandPtr,unsigned char *samples,int *pnt)
|
||||
{
|
||||
short samples_tmp[64];
|
||||
short *tmp1 = samples_tmp;
|
||||
int i,ret;
|
||||
int pnt1 = 0;
|
||||
|
||||
ret = synth_1to1(mp,bandPtr,0,(unsigned char *) samples_tmp,&pnt1);
|
||||
samples += *pnt;
|
||||
|
||||
for(i=0;i<32;i++) {
|
||||
*( (short *) samples) = *tmp1;
|
||||
samples += 2;
|
||||
tmp1 += 2;
|
||||
}
|
||||
*pnt += 64;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int synth_1to1(PMPSTR mp, real *bandPtr,int channel,unsigned char *out,int *pnt)
|
||||
{
|
||||
static const int step = 2;
|
||||
int bo;
|
||||
short *samples = (short *) (out + *pnt);
|
||||
|
||||
real *b0,(*buf)[0x110];
|
||||
int clip = 0;
|
||||
int bo1;
|
||||
|
||||
bo = mp->synth_bo;
|
||||
|
||||
if(!channel) {
|
||||
bo--;
|
||||
bo &= 0xf;
|
||||
buf = mp->synth_buffs[0];
|
||||
}
|
||||
else {
|
||||
samples++;
|
||||
buf = mp->synth_buffs[1];
|
||||
}
|
||||
|
||||
if(bo & 0x1) {
|
||||
b0 = buf[0];
|
||||
bo1 = bo;
|
||||
dct64(buf[1]+((bo+1)&0xf),buf[0]+bo,bandPtr);
|
||||
}
|
||||
else {
|
||||
b0 = buf[1];
|
||||
bo1 = bo+1;
|
||||
dct64(buf[0]+bo,buf[1]+bo+1,bandPtr);
|
||||
}
|
||||
|
||||
mp->synth_bo = bo;
|
||||
|
||||
{
|
||||
register int j;
|
||||
real *window = decwin + 16 - bo1;
|
||||
|
||||
for (j=16;j;j--,b0+=0x10,window+=0x20,samples+=step)
|
||||
{
|
||||
real sum;
|
||||
sum = window[0x0] * b0[0x0];
|
||||
sum -= window[0x1] * b0[0x1];
|
||||
sum += window[0x2] * b0[0x2];
|
||||
sum -= window[0x3] * b0[0x3];
|
||||
sum += window[0x4] * b0[0x4];
|
||||
sum -= window[0x5] * b0[0x5];
|
||||
sum += window[0x6] * b0[0x6];
|
||||
sum -= window[0x7] * b0[0x7];
|
||||
sum += window[0x8] * b0[0x8];
|
||||
sum -= window[0x9] * b0[0x9];
|
||||
sum += window[0xA] * b0[0xA];
|
||||
sum -= window[0xB] * b0[0xB];
|
||||
sum += window[0xC] * b0[0xC];
|
||||
sum -= window[0xD] * b0[0xD];
|
||||
sum += window[0xE] * b0[0xE];
|
||||
sum -= window[0xF] * b0[0xF];
|
||||
|
||||
WRITE_SAMPLE(samples,sum,clip);
|
||||
}
|
||||
|
||||
{
|
||||
real sum;
|
||||
sum = window[0x0] * b0[0x0];
|
||||
sum += window[0x2] * b0[0x2];
|
||||
sum += window[0x4] * b0[0x4];
|
||||
sum += window[0x6] * b0[0x6];
|
||||
sum += window[0x8] * b0[0x8];
|
||||
sum += window[0xA] * b0[0xA];
|
||||
sum += window[0xC] * b0[0xC];
|
||||
sum += window[0xE] * b0[0xE];
|
||||
WRITE_SAMPLE(samples,sum,clip);
|
||||
b0-=0x10,window-=0x20,samples+=step;
|
||||
}
|
||||
window += bo1<<1;
|
||||
|
||||
for (j=15;j;j--,b0-=0x10,window-=0x20,samples+=step)
|
||||
{
|
||||
real sum;
|
||||
sum = -window[-0x1] * b0[0x0];
|
||||
sum -= window[-0x2] * b0[0x1];
|
||||
sum -= window[-0x3] * b0[0x2];
|
||||
sum -= window[-0x4] * b0[0x3];
|
||||
sum -= window[-0x5] * b0[0x4];
|
||||
sum -= window[-0x6] * b0[0x5];
|
||||
sum -= window[-0x7] * b0[0x6];
|
||||
sum -= window[-0x8] * b0[0x7];
|
||||
sum -= window[-0x9] * b0[0x8];
|
||||
sum -= window[-0xA] * b0[0x9];
|
||||
sum -= window[-0xB] * b0[0xA];
|
||||
sum -= window[-0xC] * b0[0xB];
|
||||
sum -= window[-0xD] * b0[0xC];
|
||||
sum -= window[-0xE] * b0[0xD];
|
||||
sum -= window[-0xF] * b0[0xE];
|
||||
sum -= window[-0x0] * b0[0xF];
|
||||
|
||||
WRITE_SAMPLE(samples,sum,clip);
|
||||
}
|
||||
}
|
||||
*pnt += 128;
|
||||
|
||||
return clip;
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
/*
|
||||
** Copyright (C) 2000 Albert L. Faber
|
||||
**/
|
||||
|
||||
|
||||
#ifndef DECODE_I386_H_INCLUDED
|
||||
#define DECODE_I386_H_INCLUDED
|
||||
|
||||
#include "common.h"
|
||||
|
||||
int synth_1to1_mono(PMPSTR mp, real *bandPtr,unsigned char *samples,int *pnt);
|
||||
int synth_1to1(PMPSTR mp, real *bandPtr,int channel,unsigned char *out,int *pnt);
|
||||
|
||||
#endif
|
|
@ -1,354 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
/*
|
||||
* huffman tables ... recalcualted to work with my optimzed
|
||||
* decoder scheme (MH)
|
||||
*
|
||||
* probably we could save a few bytes of memory, because the
|
||||
* smaller tables are often the part of a bigger table
|
||||
*/
|
||||
|
||||
struct newhuff
|
||||
{
|
||||
const unsigned int linbits;
|
||||
const short * const table;
|
||||
};
|
||||
|
||||
static const short tab0[] =
|
||||
{
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab1[] =
|
||||
{
|
||||
-5, -3, -1, 17, 1, 16, 0
|
||||
};
|
||||
|
||||
static const short tab2[] =
|
||||
{
|
||||
-15, -11, -9, -5, -3, -1, 34, 2, 18, -1, 33, 32, 17, -1, 1,
|
||||
16, 0
|
||||
};
|
||||
|
||||
static const short tab3[] =
|
||||
{
|
||||
-13, -11, -9, -5, -3, -1, 34, 2, 18, -1, 33, 32, 16, 17, -1,
|
||||
1, 0
|
||||
};
|
||||
|
||||
static const short tab5[] =
|
||||
{
|
||||
-29, -25, -23, -15, -7, -5, -3, -1, 51, 35, 50, 49, -3, -1, 19,
|
||||
3, -1, 48, 34, -3, -1, 18, 33, -1, 2, 32, 17, -1, 1, 16,
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab6[] =
|
||||
{
|
||||
-25, -19, -13, -9, -5, -3, -1, 51, 3, 35, -1, 50, 48, -1, 19,
|
||||
49, -3, -1, 34, 2, 18, -3, -1, 33, 32, 1, -1, 17, -1, 16,
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab7[] =
|
||||
{
|
||||
-69, -65, -57, -39, -29, -17, -11, -7, -3, -1, 85, 69, -1, 84, 83,
|
||||
-1, 53, 68, -3, -1, 37, 82, 21, -5, -1, 81, -1, 5, 52, -1,
|
||||
80, -1, 67, 51, -5, -3, -1, 36, 66, 20, -1, 65, 64, -11, -7,
|
||||
-3, -1, 4, 35, -1, 50, 3, -1, 19, 49, -3, -1, 48, 34, 18,
|
||||
-5, -1, 33, -1, 2, 32, 17, -1, 1, 16, 0
|
||||
};
|
||||
|
||||
static const short tab8[] =
|
||||
{
|
||||
-65, -63, -59, -45, -31, -19, -13, -7, -5, -3, -1, 85, 84, 69, 83,
|
||||
-3, -1, 53, 68, 37, -3, -1, 82, 5, 21, -5, -1, 81, -1, 52,
|
||||
67, -3, -1, 80, 51, 36, -5, -3, -1, 66, 20, 65, -3, -1, 4,
|
||||
64, -1, 35, 50, -9, -7, -3, -1, 19, 49, -1, 3, 48, 34, -1,
|
||||
2, 32, -1, 18, 33, 17, -3, -1, 1, 16, 0
|
||||
};
|
||||
|
||||
static const short tab9[] =
|
||||
{
|
||||
-63, -53, -41, -29, -19, -11, -5, -3, -1, 85, 69, 53, -1, 83, -1,
|
||||
84, 5, -3, -1, 68, 37, -1, 82, 21, -3, -1, 81, 52, -1, 67,
|
||||
-1, 80, 4, -7, -3, -1, 36, 66, -1, 51, 64, -1, 20, 65, -5,
|
||||
-3, -1, 35, 50, 19, -1, 49, -1, 3, 48, -5, -3, -1, 34, 2,
|
||||
18, -1, 33, 32, -3, -1, 17, 1, -1, 16, 0
|
||||
};
|
||||
|
||||
static const short tab10[] =
|
||||
{
|
||||
-125,-121,-111, -83, -55, -35, -21, -13, -7, -3, -1, 119, 103, -1, 118,
|
||||
87, -3, -1, 117, 102, 71, -3, -1, 116, 86, -1, 101, 55, -9, -3,
|
||||
-1, 115, 70, -3, -1, 85, 84, 99, -1, 39, 114, -11, -5, -3, -1,
|
||||
100, 7, 112, -1, 98, -1, 69, 53, -5, -1, 6, -1, 83, 68, 23,
|
||||
-17, -5, -1, 113, -1, 54, 38, -5, -3, -1, 37, 82, 21, -1, 81,
|
||||
-1, 52, 67, -3, -1, 22, 97, -1, 96, -1, 5, 80, -19, -11, -7,
|
||||
-3, -1, 36, 66, -1, 51, 4, -1, 20, 65, -3, -1, 64, 35, -1,
|
||||
50, 3, -3, -1, 19, 49, -1, 48, 34, -7, -3, -1, 18, 33, -1,
|
||||
2, 32, 17, -1, 1, 16, 0
|
||||
};
|
||||
|
||||
static const short tab11[] =
|
||||
{
|
||||
-121,-113, -89, -59, -43, -27, -17, -7, -3, -1, 119, 103, -1, 118, 117,
|
||||
-3, -1, 102, 71, -1, 116, -1, 87, 85, -5, -3, -1, 86, 101, 55,
|
||||
-1, 115, 70, -9, -7, -3, -1, 69, 84, -1, 53, 83, 39, -1, 114,
|
||||
-1, 100, 7, -5, -1, 113, -1, 23, 112, -3, -1, 54, 99, -1, 96,
|
||||
-1, 68, 37, -13, -7, -5, -3, -1, 82, 5, 21, 98, -3, -1, 38,
|
||||
6, 22, -5, -1, 97, -1, 81, 52, -5, -1, 80, -1, 67, 51, -1,
|
||||
36, 66, -15, -11, -7, -3, -1, 20, 65, -1, 4, 64, -1, 35, 50,
|
||||
-1, 19, 49, -5, -3, -1, 3, 48, 34, 33, -5, -1, 18, -1, 2,
|
||||
32, 17, -3, -1, 1, 16, 0
|
||||
};
|
||||
|
||||
static const short tab12[] =
|
||||
{
|
||||
-115, -99, -73, -45, -27, -17, -9, -5, -3, -1, 119, 103, 118, -1, 87,
|
||||
117, -3, -1, 102, 71, -1, 116, 101, -3, -1, 86, 55, -3, -1, 115,
|
||||
85, 39, -7, -3, -1, 114, 70, -1, 100, 23, -5, -1, 113, -1, 7,
|
||||
112, -1, 54, 99, -13, -9, -3, -1, 69, 84, -1, 68, -1, 6, 5,
|
||||
-1, 38, 98, -5, -1, 97, -1, 22, 96, -3, -1, 53, 83, -1, 37,
|
||||
82, -17, -7, -3, -1, 21, 81, -1, 52, 67, -5, -3, -1, 80, 4,
|
||||
36, -1, 66, 20, -3, -1, 51, 65, -1, 35, 50, -11, -7, -5, -3,
|
||||
-1, 64, 3, 48, 19, -1, 49, 34, -1, 18, 33, -7, -5, -3, -1,
|
||||
2, 32, 0, 17, -1, 1, 16
|
||||
};
|
||||
|
||||
static const short tab13[] =
|
||||
{
|
||||
-509,-503,-475,-405,-333,-265,-205,-153,-115, -83, -53, -35, -21, -13, -9,
|
||||
-7, -5, -3, -1, 254, 252, 253, 237, 255, -1, 239, 223, -3, -1, 238,
|
||||
207, -1, 222, 191, -9, -3, -1, 251, 206, -1, 220, -1, 175, 233, -1,
|
||||
236, 221, -9, -5, -3, -1, 250, 205, 190, -1, 235, 159, -3, -1, 249,
|
||||
234, -1, 189, 219, -17, -9, -3, -1, 143, 248, -1, 204, -1, 174, 158,
|
||||
-5, -1, 142, -1, 127, 126, 247, -5, -1, 218, -1, 173, 188, -3, -1,
|
||||
203, 246, 111, -15, -7, -3, -1, 232, 95, -1, 157, 217, -3, -1, 245,
|
||||
231, -1, 172, 187, -9, -3, -1, 79, 244, -3, -1, 202, 230, 243, -1,
|
||||
63, -1, 141, 216, -21, -9, -3, -1, 47, 242, -3, -1, 110, 156, 15,
|
||||
-5, -3, -1, 201, 94, 171, -3, -1, 125, 215, 78, -11, -5, -3, -1,
|
||||
200, 214, 62, -1, 185, -1, 155, 170, -1, 31, 241, -23, -13, -5, -1,
|
||||
240, -1, 186, 229, -3, -1, 228, 140, -1, 109, 227, -5, -1, 226, -1,
|
||||
46, 14, -1, 30, 225, -15, -7, -3, -1, 224, 93, -1, 213, 124, -3,
|
||||
-1, 199, 77, -1, 139, 184, -7, -3, -1, 212, 154, -1, 169, 108, -1,
|
||||
198, 61, -37, -21, -9, -5, -3, -1, 211, 123, 45, -1, 210, 29, -5,
|
||||
-1, 183, -1, 92, 197, -3, -1, 153, 122, 195, -7, -5, -3, -1, 167,
|
||||
151, 75, 209, -3, -1, 13, 208, -1, 138, 168, -11, -7, -3, -1, 76,
|
||||
196, -1, 107, 182, -1, 60, 44, -3, -1, 194, 91, -3, -1, 181, 137,
|
||||
28, -43, -23, -11, -5, -1, 193, -1, 152, 12, -1, 192, -1, 180, 106,
|
||||
-5, -3, -1, 166, 121, 59, -1, 179, -1, 136, 90, -11, -5, -1, 43,
|
||||
-1, 165, 105, -1, 164, -1, 120, 135, -5, -1, 148, -1, 119, 118, 178,
|
||||
-11, -3, -1, 27, 177, -3, -1, 11, 176, -1, 150, 74, -7, -3, -1,
|
||||
58, 163, -1, 89, 149, -1, 42, 162, -47, -23, -9, -3, -1, 26, 161,
|
||||
-3, -1, 10, 104, 160, -5, -3, -1, 134, 73, 147, -3, -1, 57, 88,
|
||||
-1, 133, 103, -9, -3, -1, 41, 146, -3, -1, 87, 117, 56, -5, -1,
|
||||
131, -1, 102, 71, -3, -1, 116, 86, -1, 101, 115, -11, -3, -1, 25,
|
||||
145, -3, -1, 9, 144, -1, 72, 132, -7, -5, -1, 114, -1, 70, 100,
|
||||
40, -1, 130, 24, -41, -27, -11, -5, -3, -1, 55, 39, 23, -1, 113,
|
||||
-1, 85, 7, -7, -3, -1, 112, 54, -1, 99, 69, -3, -1, 84, 38,
|
||||
-1, 98, 53, -5, -1, 129, -1, 8, 128, -3, -1, 22, 97, -1, 6,
|
||||
96, -13, -9, -5, -3, -1, 83, 68, 37, -1, 82, 5, -1, 21, 81,
|
||||
-7, -3, -1, 52, 67, -1, 80, 36, -3, -1, 66, 51, 20, -19, -11,
|
||||
-5, -1, 65, -1, 4, 64, -3, -1, 35, 50, 19, -3, -1, 49, 3,
|
||||
-1, 48, 34, -3, -1, 18, 33, -1, 2, 32, -3, -1, 17, 1, 16,
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab15[] =
|
||||
{
|
||||
-495,-445,-355,-263,-183,-115, -77, -43, -27, -13, -7, -3, -1, 255, 239,
|
||||
-1, 254, 223, -1, 238, -1, 253, 207, -7, -3, -1, 252, 222, -1, 237,
|
||||
191, -1, 251, -1, 206, 236, -7, -3, -1, 221, 175, -1, 250, 190, -3,
|
||||
-1, 235, 205, -1, 220, 159, -15, -7, -3, -1, 249, 234, -1, 189, 219,
|
||||
-3, -1, 143, 248, -1, 204, 158, -7, -3, -1, 233, 127, -1, 247, 173,
|
||||
-3, -1, 218, 188, -1, 111, -1, 174, 15, -19, -11, -3, -1, 203, 246,
|
||||
-3, -1, 142, 232, -1, 95, 157, -3, -1, 245, 126, -1, 231, 172, -9,
|
||||
-3, -1, 202, 187, -3, -1, 217, 141, 79, -3, -1, 244, 63, -1, 243,
|
||||
216, -33, -17, -9, -3, -1, 230, 47, -1, 242, -1, 110, 240, -3, -1,
|
||||
31, 241, -1, 156, 201, -7, -3, -1, 94, 171, -1, 186, 229, -3, -1,
|
||||
125, 215, -1, 78, 228, -15, -7, -3, -1, 140, 200, -1, 62, 109, -3,
|
||||
-1, 214, 227, -1, 155, 185, -7, -3, -1, 46, 170, -1, 226, 30, -5,
|
||||
-1, 225, -1, 14, 224, -1, 93, 213, -45, -25, -13, -7, -3, -1, 124,
|
||||
199, -1, 77, 139, -1, 212, -1, 184, 154, -7, -3, -1, 169, 108, -1,
|
||||
198, 61, -1, 211, 210, -9, -5, -3, -1, 45, 13, 29, -1, 123, 183,
|
||||
-5, -1, 209, -1, 92, 208, -1, 197, 138, -17, -7, -3, -1, 168, 76,
|
||||
-1, 196, 107, -5, -1, 182, -1, 153, 12, -1, 60, 195, -9, -3, -1,
|
||||
122, 167, -1, 166, -1, 192, 11, -1, 194, -1, 44, 91, -55, -29, -15,
|
||||
-7, -3, -1, 181, 28, -1, 137, 152, -3, -1, 193, 75, -1, 180, 106,
|
||||
-5, -3, -1, 59, 121, 179, -3, -1, 151, 136, -1, 43, 90, -11, -5,
|
||||
-1, 178, -1, 165, 27, -1, 177, -1, 176, 105, -7, -3, -1, 150, 74,
|
||||
-1, 164, 120, -3, -1, 135, 58, 163, -17, -7, -3, -1, 89, 149, -1,
|
||||
42, 162, -3, -1, 26, 161, -3, -1, 10, 160, 104, -7, -3, -1, 134,
|
||||
73, -1, 148, 57, -5, -1, 147, -1, 119, 9, -1, 88, 133, -53, -29,
|
||||
-13, -7, -3, -1, 41, 103, -1, 118, 146, -1, 145, -1, 25, 144, -7,
|
||||
-3, -1, 72, 132, -1, 87, 117, -3, -1, 56, 131, -1, 102, 71, -7,
|
||||
-3, -1, 40, 130, -1, 24, 129, -7, -3, -1, 116, 8, -1, 128, 86,
|
||||
-3, -1, 101, 55, -1, 115, 70, -17, -7, -3, -1, 39, 114, -1, 100,
|
||||
23, -3, -1, 85, 113, -3, -1, 7, 112, 54, -7, -3, -1, 99, 69,
|
||||
-1, 84, 38, -3, -1, 98, 22, -3, -1, 6, 96, 53, -33, -19, -9,
|
||||
-5, -1, 97, -1, 83, 68, -1, 37, 82, -3, -1, 21, 81, -3, -1,
|
||||
5, 80, 52, -7, -3, -1, 67, 36, -1, 66, 51, -1, 65, -1, 20,
|
||||
4, -9, -3, -1, 35, 50, -3, -1, 64, 3, 19, -3, -1, 49, 48,
|
||||
34, -9, -7, -3, -1, 18, 33, -1, 2, 32, 17, -3, -1, 1, 16,
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab16[] =
|
||||
{
|
||||
-509,-503,-461,-323,-103, -37, -27, -15, -7, -3, -1, 239, 254, -1, 223,
|
||||
253, -3, -1, 207, 252, -1, 191, 251, -5, -1, 175, -1, 250, 159, -3,
|
||||
-1, 249, 248, 143, -7, -3, -1, 127, 247, -1, 111, 246, 255, -9, -5,
|
||||
-3, -1, 95, 245, 79, -1, 244, 243, -53, -1, 240, -1, 63, -29, -19,
|
||||
-13, -7, -5, -1, 206, -1, 236, 221, 222, -1, 233, -1, 234, 217, -1,
|
||||
238, -1, 237, 235, -3, -1, 190, 205, -3, -1, 220, 219, 174, -11, -5,
|
||||
-1, 204, -1, 173, 218, -3, -1, 126, 172, 202, -5, -3, -1, 201, 125,
|
||||
94, 189, 242, -93, -5, -3, -1, 47, 15, 31, -1, 241, -49, -25, -13,
|
||||
-5, -1, 158, -1, 188, 203, -3, -1, 142, 232, -1, 157, 231, -7, -3,
|
||||
-1, 187, 141, -1, 216, 110, -1, 230, 156, -13, -7, -3, -1, 171, 186,
|
||||
-1, 229, 215, -1, 78, -1, 228, 140, -3, -1, 200, 62, -1, 109, -1,
|
||||
214, 155, -19, -11, -5, -3, -1, 185, 170, 225, -1, 212, -1, 184, 169,
|
||||
-5, -1, 123, -1, 183, 208, 227, -7, -3, -1, 14, 224, -1, 93, 213,
|
||||
-3, -1, 124, 199, -1, 77, 139, -75, -45, -27, -13, -7, -3, -1, 154,
|
||||
108, -1, 198, 61, -3, -1, 92, 197, 13, -7, -3, -1, 138, 168, -1,
|
||||
153, 76, -3, -1, 182, 122, 60, -11, -5, -3, -1, 91, 137, 28, -1,
|
||||
192, -1, 152, 121, -1, 226, -1, 46, 30, -15, -7, -3, -1, 211, 45,
|
||||
-1, 210, 209, -5, -1, 59, -1, 151, 136, 29, -7, -3, -1, 196, 107,
|
||||
-1, 195, 167, -1, 44, -1, 194, 181, -23, -13, -7, -3, -1, 193, 12,
|
||||
-1, 75, 180, -3, -1, 106, 166, 179, -5, -3, -1, 90, 165, 43, -1,
|
||||
178, 27, -13, -5, -1, 177, -1, 11, 176, -3, -1, 105, 150, -1, 74,
|
||||
164, -5, -3, -1, 120, 135, 163, -3, -1, 58, 89, 42, -97, -57, -33,
|
||||
-19, -11, -5, -3, -1, 149, 104, 161, -3, -1, 134, 119, 148, -5, -3,
|
||||
-1, 73, 87, 103, 162, -5, -1, 26, -1, 10, 160, -3, -1, 57, 147,
|
||||
-1, 88, 133, -9, -3, -1, 41, 146, -3, -1, 118, 9, 25, -5, -1,
|
||||
145, -1, 144, 72, -3, -1, 132, 117, -1, 56, 131, -21, -11, -5, -3,
|
||||
-1, 102, 40, 130, -3, -1, 71, 116, 24, -3, -1, 129, 128, -3, -1,
|
||||
8, 86, 55, -9, -5, -1, 115, -1, 101, 70, -1, 39, 114, -5, -3,
|
||||
-1, 100, 85, 7, 23, -23, -13, -5, -1, 113, -1, 112, 54, -3, -1,
|
||||
99, 69, -1, 84, 38, -3, -1, 98, 22, -1, 97, -1, 6, 96, -9,
|
||||
-5, -1, 83, -1, 53, 68, -1, 37, 82, -1, 81, -1, 21, 5, -33,
|
||||
-23, -13, -7, -3, -1, 52, 67, -1, 80, 36, -3, -1, 66, 51, 20,
|
||||
-5, -1, 65, -1, 4, 64, -1, 35, 50, -3, -1, 19, 49, -3, -1,
|
||||
3, 48, 34, -3, -1, 18, 33, -1, 2, 32, -3, -1, 17, 1, 16,
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab24[] =
|
||||
{
|
||||
-451,-117, -43, -25, -15, -7, -3, -1, 239, 254, -1, 223, 253, -3, -1,
|
||||
207, 252, -1, 191, 251, -5, -1, 250, -1, 175, 159, -1, 249, 248, -9,
|
||||
-5, -3, -1, 143, 127, 247, -1, 111, 246, -3, -1, 95, 245, -1, 79,
|
||||
244, -71, -7, -3, -1, 63, 243, -1, 47, 242, -5, -1, 241, -1, 31,
|
||||
240, -25, -9, -1, 15, -3, -1, 238, 222, -1, 237, 206, -7, -3, -1,
|
||||
236, 221, -1, 190, 235, -3, -1, 205, 220, -1, 174, 234, -15, -7, -3,
|
||||
-1, 189, 219, -1, 204, 158, -3, -1, 233, 173, -1, 218, 188, -7, -3,
|
||||
-1, 203, 142, -1, 232, 157, -3, -1, 217, 126, -1, 231, 172, 255,-235,
|
||||
-143, -77, -45, -25, -15, -7, -3, -1, 202, 187, -1, 141, 216, -5, -3,
|
||||
-1, 14, 224, 13, 230, -5, -3, -1, 110, 156, 201, -1, 94, 186, -9,
|
||||
-5, -1, 229, -1, 171, 125, -1, 215, 228, -3, -1, 140, 200, -3, -1,
|
||||
78, 46, 62, -15, -7, -3, -1, 109, 214, -1, 227, 155, -3, -1, 185,
|
||||
170, -1, 226, 30, -7, -3, -1, 225, 93, -1, 213, 124, -3, -1, 199,
|
||||
77, -1, 139, 184, -31, -15, -7, -3, -1, 212, 154, -1, 169, 108, -3,
|
||||
-1, 198, 61, -1, 211, 45, -7, -3, -1, 210, 29, -1, 123, 183, -3,
|
||||
-1, 209, 92, -1, 197, 138, -17, -7, -3, -1, 168, 153, -1, 76, 196,
|
||||
-3, -1, 107, 182, -3, -1, 208, 12, 60, -7, -3, -1, 195, 122, -1,
|
||||
167, 44, -3, -1, 194, 91, -1, 181, 28, -57, -35, -19, -7, -3, -1,
|
||||
137, 152, -1, 193, 75, -5, -3, -1, 192, 11, 59, -3, -1, 176, 10,
|
||||
26, -5, -1, 180, -1, 106, 166, -3, -1, 121, 151, -3, -1, 160, 9,
|
||||
144, -9, -3, -1, 179, 136, -3, -1, 43, 90, 178, -7, -3, -1, 165,
|
||||
27, -1, 177, 105, -1, 150, 164, -17, -9, -5, -3, -1, 74, 120, 135,
|
||||
-1, 58, 163, -3, -1, 89, 149, -1, 42, 162, -7, -3, -1, 161, 104,
|
||||
-1, 134, 119, -3, -1, 73, 148, -1, 57, 147, -63, -31, -15, -7, -3,
|
||||
-1, 88, 133, -1, 41, 103, -3, -1, 118, 146, -1, 25, 145, -7, -3,
|
||||
-1, 72, 132, -1, 87, 117, -3, -1, 56, 131, -1, 102, 40, -17, -7,
|
||||
-3, -1, 130, 24, -1, 71, 116, -5, -1, 129, -1, 8, 128, -1, 86,
|
||||
101, -7, -5, -1, 23, -1, 7, 112, 115, -3, -1, 55, 39, 114, -15,
|
||||
-7, -3, -1, 70, 100, -1, 85, 113, -3, -1, 54, 99, -1, 69, 84,
|
||||
-7, -3, -1, 38, 98, -1, 22, 97, -5, -3, -1, 6, 96, 53, -1,
|
||||
83, 68, -51, -37, -23, -15, -9, -3, -1, 37, 82, -1, 21, -1, 5,
|
||||
80, -1, 81, -1, 52, 67, -3, -1, 36, 66, -1, 51, 20, -9, -5,
|
||||
-1, 65, -1, 4, 64, -1, 35, 50, -1, 19, 49, -7, -5, -3, -1,
|
||||
3, 48, 34, 18, -1, 33, -1, 2, 32, -3, -1, 17, 1, -1, 16,
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab_c0[] =
|
||||
{
|
||||
-29, -21, -13, -7, -3, -1, 11, 15, -1, 13, 14, -3, -1, 7, 5,
|
||||
9, -3, -1, 6, 3, -1, 10, 12, -3, -1, 2, 1, -1, 4, 8,
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab_c1[] =
|
||||
{
|
||||
-15, -7, -3, -1, 15, 14, -1, 13, 12, -3, -1, 11, 10, -1, 9,
|
||||
8, -7, -3, -1, 7, 6, -1, 5, 4, -3, -1, 3, 2, -1, 1,
|
||||
0
|
||||
};
|
||||
|
||||
|
||||
|
||||
static const struct newhuff ht[] =
|
||||
{
|
||||
{ /* 0 */ 0 , tab0 } ,
|
||||
{ /* 2 */ 0 , tab1 } ,
|
||||
{ /* 3 */ 0 , tab2 } ,
|
||||
{ /* 3 */ 0 , tab3 } ,
|
||||
{ /* 0 */ 0 , tab0 } ,
|
||||
{ /* 4 */ 0 , tab5 } ,
|
||||
{ /* 4 */ 0 , tab6 } ,
|
||||
{ /* 6 */ 0 , tab7 } ,
|
||||
{ /* 6 */ 0 , tab8 } ,
|
||||
{ /* 6 */ 0 , tab9 } ,
|
||||
{ /* 8 */ 0 , tab10 } ,
|
||||
{ /* 8 */ 0 , tab11 } ,
|
||||
{ /* 8 */ 0 , tab12 } ,
|
||||
{ /* 16 */ 0 , tab13 } ,
|
||||
{ /* 0 */ 0 , tab0 } ,
|
||||
{ /* 16 */ 0 , tab15 } ,
|
||||
|
||||
{ /* 16 */ 1 , tab16 } ,
|
||||
{ /* 16 */ 2 , tab16 } ,
|
||||
{ /* 16 */ 3 , tab16 } ,
|
||||
{ /* 16 */ 4 , tab16 } ,
|
||||
{ /* 16 */ 6 , tab16 } ,
|
||||
{ /* 16 */ 8 , tab16 } ,
|
||||
{ /* 16 */ 10, tab16 } ,
|
||||
{ /* 16 */ 13, tab16 } ,
|
||||
{ /* 16 */ 4 , tab24 } ,
|
||||
{ /* 16 */ 5 , tab24 } ,
|
||||
{ /* 16 */ 6 , tab24 } ,
|
||||
{ /* 16 */ 7 , tab24 } ,
|
||||
{ /* 16 */ 8 , tab24 } ,
|
||||
{ /* 16 */ 9 , tab24 } ,
|
||||
{ /* 16 */ 11, tab24 } ,
|
||||
{ /* 16 */ 13, tab24 }
|
||||
};
|
||||
|
||||
static const struct newhuff htc[] =
|
||||
{
|
||||
{ /* 1 , 1 , */ 0 , tab_c0 } ,
|
||||
{ /* 1 , 1 , */ 0 , tab_c1 }
|
||||
};
|
||||
|
||||
|
|
@ -1,666 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
//changes: 8/20/2002, Hauke Duden
|
||||
// - fixed potential access violation in check_vbr_header and sync_buffer
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "interface.h"
|
||||
#include "tabinit.h"
|
||||
#include "layer3.h"
|
||||
#include "VbrTag.h"
|
||||
|
||||
#ifdef USE_LAYER_1
|
||||
#include "layer1.h"
|
||||
#endif
|
||||
|
||||
#ifdef USE_LAYER_2
|
||||
#include "layer2.h"
|
||||
#endif
|
||||
|
||||
#ifdef WITH_DMALLOC
|
||||
#include <dmalloc.h>
|
||||
#endif
|
||||
|
||||
|
||||
BOOL InitMP3( PMPSTR mp)
|
||||
{
|
||||
memset(mp,0,sizeof(MPSTR));
|
||||
|
||||
mp->framesize = 0;
|
||||
mp->num_frames = 0;
|
||||
mp->enc_delay = -1;
|
||||
mp->enc_padding = -1;
|
||||
mp->vbr_header=0;
|
||||
mp->header_parsed=0;
|
||||
mp->side_parsed=0;
|
||||
mp->data_parsed=0;
|
||||
mp->free_format=0;
|
||||
mp->old_free_format=0;
|
||||
mp->ssize = 0;
|
||||
mp->dsize=0;
|
||||
mp->fsizeold = -1;
|
||||
mp->bsize = 0;
|
||||
mp->head = mp->tail = NULL;
|
||||
mp->fr.single = -1;
|
||||
mp->bsnum = 0;
|
||||
wordpointer = mp->bsspace[mp->bsnum] + 512;
|
||||
mp->synth_bo = 1;
|
||||
mp->sync_bitstream = 1;
|
||||
|
||||
make_decode_tables(32767);
|
||||
|
||||
init_layer3(SBLIMIT);
|
||||
|
||||
#ifdef USE_LAYER_2
|
||||
init_layer2();
|
||||
#endif
|
||||
|
||||
return !0;
|
||||
}
|
||||
|
||||
void ExitMP3( PMPSTR mp)
|
||||
{
|
||||
struct buf *b,*bn;
|
||||
|
||||
b = mp->tail;
|
||||
while(b) {
|
||||
free(b->pnt);
|
||||
bn = b->next;
|
||||
free(b);
|
||||
b = bn;
|
||||
}
|
||||
}
|
||||
|
||||
static struct buf *addbuf( PMPSTR mp, unsigned char *buf,int size)
|
||||
{
|
||||
struct buf *nbuf;
|
||||
|
||||
nbuf = (struct buf*) malloc( sizeof(struct buf) );
|
||||
if(!nbuf) {
|
||||
//fprintf(stderr,"Out of memory!\n");
|
||||
return NULL;
|
||||
}
|
||||
nbuf->pnt = (unsigned char*) malloc((size_t)size);
|
||||
if(!nbuf->pnt) {
|
||||
free(nbuf);
|
||||
return NULL;
|
||||
}
|
||||
nbuf->size = size;
|
||||
memcpy(nbuf->pnt,buf,(size_t)size);
|
||||
nbuf->next = NULL;
|
||||
nbuf->prev = mp->head;
|
||||
nbuf->pos = 0;
|
||||
|
||||
if(!mp->tail) {
|
||||
mp->tail = nbuf;
|
||||
}
|
||||
else {
|
||||
mp->head->next = nbuf;
|
||||
}
|
||||
|
||||
mp->head = nbuf;
|
||||
mp->bsize += size;
|
||||
|
||||
return nbuf;
|
||||
}
|
||||
|
||||
void remove_buf(PMPSTR mp)
|
||||
{
|
||||
struct buf *buf = mp->tail;
|
||||
|
||||
mp->tail = buf->next;
|
||||
if(mp->tail)
|
||||
mp->tail->prev = NULL;
|
||||
else {
|
||||
mp->tail = mp->head = NULL;
|
||||
}
|
||||
|
||||
free(buf->pnt);
|
||||
free(buf);
|
||||
|
||||
}
|
||||
|
||||
static int read_buf_byte(PMPSTR mp)
|
||||
{
|
||||
unsigned int b;
|
||||
|
||||
int pos;
|
||||
|
||||
|
||||
pos = mp->tail->pos;
|
||||
while(pos >= mp->tail->size) {
|
||||
remove_buf(mp);
|
||||
//if(!mp->tail) {
|
||||
//fprintf(stderr,"Fatal error! tried to read past mp buffer\n");
|
||||
//exit(1);
|
||||
//}
|
||||
pos = mp->tail->pos;
|
||||
}
|
||||
|
||||
b = mp->tail->pnt[pos];
|
||||
mp->bsize--;
|
||||
mp->tail->pos++;
|
||||
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void read_head(PMPSTR mp)
|
||||
{
|
||||
unsigned long head;
|
||||
|
||||
head = read_buf_byte(mp);
|
||||
head <<= 8;
|
||||
head |= read_buf_byte(mp);
|
||||
head <<= 8;
|
||||
head |= read_buf_byte(mp);
|
||||
head <<= 8;
|
||||
head |= read_buf_byte(mp);
|
||||
|
||||
mp->header = head;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void copy_mp(PMPSTR mp,int size,unsigned char *ptr)
|
||||
{
|
||||
int len = 0;
|
||||
|
||||
while(len < size) {
|
||||
int nlen;
|
||||
int blen = mp->tail->size - mp->tail->pos;
|
||||
if( (size - len) <= blen) {
|
||||
nlen = size-len;
|
||||
}
|
||||
else {
|
||||
nlen = blen;
|
||||
}
|
||||
memcpy(ptr+len,mp->tail->pnt+mp->tail->pos,(size_t)nlen);
|
||||
len += nlen;
|
||||
mp->tail->pos += nlen;
|
||||
mp->bsize -= nlen;
|
||||
if(mp->tail->pos == mp->tail->size) {
|
||||
remove_buf(mp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// number of bytes needed by GetVbrTag to parse header
|
||||
#define XING_HEADER_SIZE 194
|
||||
|
||||
// traverse mp data structure without changing it
|
||||
// (just like sync_buffer)
|
||||
// pull out Xing bytes
|
||||
// call vbr header check code from LAME
|
||||
// if we find a header, parse it and also compute the VBR header size
|
||||
// if no header, do nothing.
|
||||
//
|
||||
// bytes = number of bytes before MPEG header. skip this many bytes
|
||||
// before starting to read
|
||||
// return value: number of bytes in VBR header, including syncword
|
||||
int check_vbr_header(PMPSTR mp,int bytes)
|
||||
{
|
||||
int i,pos;
|
||||
struct buf *buf=mp->tail;
|
||||
unsigned char xing[XING_HEADER_SIZE];
|
||||
VBRTAGDATA pTagData;
|
||||
|
||||
pos = buf->pos;
|
||||
// skip to valid header
|
||||
for (i=0; i<bytes; ++i) {
|
||||
while(pos >= buf->size) {
|
||||
buf = buf->next;
|
||||
//fixed by Hauke Duden
|
||||
//this has to be checked BEFORE accessing buf->pos
|
||||
if(!buf) return -1; /* fatal error */
|
||||
pos = buf->pos;
|
||||
}
|
||||
++pos;
|
||||
}
|
||||
// now read header
|
||||
for (i=0; i<XING_HEADER_SIZE; ++i) {
|
||||
while(pos >= buf->size)
|
||||
{
|
||||
buf = buf->next;
|
||||
|
||||
//fixed by Hauke Duden
|
||||
//this has to be checked BEFORE accessing buf->pos
|
||||
if(!buf) return -1; /* fatal error */
|
||||
|
||||
pos = buf->pos;
|
||||
}
|
||||
xing[i] = buf->pnt[pos];
|
||||
++pos;
|
||||
}
|
||||
|
||||
/* check first bytes for Xing header */
|
||||
mp->vbr_header = GetVbrTag(&pTagData,xing);
|
||||
if (mp->vbr_header) {
|
||||
mp->num_frames=pTagData.frames;
|
||||
mp->enc_delay=pTagData.enc_delay;
|
||||
mp->enc_padding=pTagData.enc_padding;
|
||||
|
||||
//fprintf(stderr,"\rmpglib: delays: %i %i \n",mp->enc_delay,mp->enc_padding);
|
||||
// fprintf(stderr,"\rmpglib: Xing VBR header dectected. MP3 file has %i frames\n", pTagData.frames);
|
||||
return pTagData.headersize;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int sync_buffer(PMPSTR mp,int free_match)
|
||||
{
|
||||
/* traverse mp structure without modifing pointers, looking
|
||||
* for a frame valid header.
|
||||
* if free_format, valid header must also have the same
|
||||
* samplerate.
|
||||
* return number of bytes in mp, before the header
|
||||
* return -1 if header is not found
|
||||
*/
|
||||
unsigned int b[4]={0,0,0,0};
|
||||
int i,h,pos;
|
||||
struct buf *buf=mp->tail;
|
||||
|
||||
pos = buf->pos;
|
||||
for (i=0; i<mp->bsize; i++)
|
||||
{
|
||||
/* get 4 bytes */
|
||||
|
||||
b[0]=b[1]; b[1]=b[2]; b[2]=b[3];
|
||||
while(pos >= buf->size)
|
||||
{
|
||||
buf = buf->next;
|
||||
//fixed by Hauke Duden
|
||||
//this has to be checked BEFORE accessing buf->pos
|
||||
if(!buf)
|
||||
{
|
||||
return -1;
|
||||
/* not enough data to read 4 bytes */
|
||||
}
|
||||
pos = buf->pos;
|
||||
}
|
||||
b[3] = buf->pnt[pos];
|
||||
++pos;
|
||||
|
||||
if (i>=3)
|
||||
{
|
||||
struct frame *fr = &mp->fr;
|
||||
unsigned long head;
|
||||
|
||||
head = b[0];
|
||||
head <<= 8;
|
||||
head |= b[1];
|
||||
head <<= 8;
|
||||
head |= b[2];
|
||||
head <<= 8;
|
||||
head |= b[3];
|
||||
h = head_check(head,fr->lay);
|
||||
|
||||
if (h && free_match)
|
||||
{
|
||||
/* just to be even more thorough, match the sample rate */
|
||||
int mode,stereo,sampling_frequency,mpeg25,lsf;
|
||||
|
||||
if( head & (1<<20) )
|
||||
{
|
||||
lsf = (head & (1<<19)) ? 0x0 : 0x1;
|
||||
mpeg25 = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
lsf = 1;
|
||||
mpeg25 = 1;
|
||||
}
|
||||
|
||||
mode = ((head>>6)&0x3);
|
||||
stereo = (mode == MPG_MD_MONO) ? 1 : 2;
|
||||
|
||||
if(mpeg25)
|
||||
sampling_frequency = 6 + ((head>>10)&0x3);
|
||||
else
|
||||
sampling_frequency = ((head>>10)&0x3) + (lsf*3);
|
||||
h = ((stereo==fr->stereo) && (lsf==fr->lsf) && (mpeg25==fr->mpeg25) &&
|
||||
(sampling_frequency == fr->sampling_frequency));
|
||||
}
|
||||
|
||||
if (h)
|
||||
return i-3;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int decodeMP3( PMPSTR mp,unsigned char *in,int isize,char *out,
|
||||
int osize,int *done)
|
||||
{
|
||||
int i,iret,bits,bytes;
|
||||
|
||||
if(osize < 4608)
|
||||
{
|
||||
//fprintf(stderr,"To less out space\n");
|
||||
return MP3_ERR;
|
||||
}
|
||||
|
||||
if(in!=NULL)
|
||||
{
|
||||
if(addbuf(mp,in,isize) == NULL)
|
||||
return MP3_ERR;
|
||||
}
|
||||
|
||||
|
||||
/* First decode header */
|
||||
if(!mp->header_parsed)
|
||||
{
|
||||
if (mp->fsizeold==-1 || mp->sync_bitstream)
|
||||
{
|
||||
int vbrbytes;
|
||||
|
||||
mp->sync_bitstream=0;
|
||||
|
||||
/* This is the very first call. sync with anything */
|
||||
/* bytes= number of bytes before header */
|
||||
bytes=sync_buffer(mp,0);
|
||||
|
||||
/* now look for Xing VBR header */
|
||||
if (mp->bsize >= bytes+XING_HEADER_SIZE )
|
||||
{
|
||||
/* vbrbytes = number of bytes in entire vbr header */
|
||||
vbrbytes=check_vbr_header(mp,bytes);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* not enough data to look for Xing header */
|
||||
|
||||
//changed for DecMPA
|
||||
//since DecMPA only passes in full frames and there is
|
||||
//not enough data for a xing header, there is no Xing header.
|
||||
if(mp->bsize==0)
|
||||
return MP3_NEED_MORE; //no data at all, need next frame
|
||||
else
|
||||
{
|
||||
//frame too small for xing header => no xing header
|
||||
mp->vbr_header=0;
|
||||
vbrbytes=0;
|
||||
}
|
||||
//return MP3_NEED_MORE;
|
||||
|
||||
}
|
||||
|
||||
if (mp->vbr_header)
|
||||
{
|
||||
/* do we have enough data to parse entire Xing header? */
|
||||
if (bytes+vbrbytes > mp->bsize)
|
||||
return MP3_NEED_MORE;
|
||||
|
||||
/* read in Xing header. Buffer data in case it
|
||||
* is used by a non zero main_data_begin for the next
|
||||
* frame, but otherwise dont decode Xing header */
|
||||
/*fprintf(stderr,"found xing header, skipping %i bytes\n",vbrbytes+bytes);*/
|
||||
for (i=0; i<vbrbytes+bytes; ++i)
|
||||
read_buf_byte(mp);
|
||||
|
||||
/* now we need to find another syncword */
|
||||
/* just return and make user send in more data */
|
||||
return MP3_NEED_MORE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* match channels, samplerate, etc, when syncing */
|
||||
bytes=sync_buffer(mp,1);
|
||||
}
|
||||
|
||||
if (bytes<0)
|
||||
return MP3_NEED_MORE;
|
||||
if (bytes>0)
|
||||
{
|
||||
/* there were some extra bytes in front of header.
|
||||
* bitstream problem, but we are now resynced
|
||||
* should try to buffer previous data in case new
|
||||
* frame has nonzero main_data_begin, but we need
|
||||
* to make sure we do not overflow buffer
|
||||
*/
|
||||
int size;
|
||||
|
||||
//fprintf(stderr,"bitstream problem: resyncing...\n");
|
||||
mp->old_free_format=0;
|
||||
mp->sync_bitstream=1;
|
||||
|
||||
/* skip some bytes, buffer the rest */
|
||||
size = (int) (wordpointer - (mp->bsspace[mp->bsnum]+512));
|
||||
|
||||
if (size > MAXFRAMESIZE)
|
||||
{
|
||||
/* wordpointer buffer is trashed. probably cant recover, but try anyway */
|
||||
//fprintf(stderr,"mpglib: wordpointer trashed. size=%i (%i) bytes=%i \n",
|
||||
//size,MAXFRAMESIZE,bytes);
|
||||
size=0;
|
||||
wordpointer = mp->bsspace[mp->bsnum]+512;
|
||||
}
|
||||
|
||||
/* buffer contains 'size' data right now
|
||||
we want to add 'bytes' worth of data, but do not
|
||||
exceed MAXFRAMESIZE, so we through away 'i' bytes */
|
||||
i = (size+bytes)-MAXFRAMESIZE;
|
||||
for (; i>0; --i)
|
||||
{
|
||||
--bytes;
|
||||
read_buf_byte(mp);
|
||||
}
|
||||
|
||||
copy_mp(mp,bytes,wordpointer);
|
||||
mp->fsizeold += bytes;
|
||||
}
|
||||
|
||||
read_head(mp);
|
||||
decode_header(&mp->fr,mp->header);
|
||||
mp->header_parsed=1;
|
||||
mp->framesize = mp->fr.framesize;
|
||||
mp->free_format = (mp->framesize==0);
|
||||
|
||||
if(mp->fr.lsf)
|
||||
mp->ssize = (mp->fr.stereo == 1) ? 9 : 17;
|
||||
else
|
||||
mp->ssize = (mp->fr.stereo == 1) ? 17 : 32;
|
||||
if (mp->fr.error_protection)
|
||||
mp->ssize += 2;
|
||||
|
||||
mp->bsnum = 1-mp->bsnum; /* toggle buffer */
|
||||
wordpointer = mp->bsspace[mp->bsnum] + 512;
|
||||
bitindex = 0;
|
||||
|
||||
/* for very first header, never parse rest of data */
|
||||
//Hauke Duden: why? header_parsed is 1 so continuing here is the same
|
||||
//as returning and then being called again with no new data (or not
|
||||
//enough new data)
|
||||
//=> removed
|
||||
//if (mp->fsizeold==-1)
|
||||
//return MP3_NEED_MORE;
|
||||
|
||||
}
|
||||
|
||||
/* now decode side information */
|
||||
if (!mp->side_parsed)
|
||||
{
|
||||
/* Layer 3 only */
|
||||
if (mp->fr.lay==3)
|
||||
{
|
||||
if (mp->bsize < mp->ssize)
|
||||
return MP3_NEED_MORE;
|
||||
|
||||
copy_mp(mp,mp->ssize,wordpointer);
|
||||
|
||||
if(mp->fr.error_protection)
|
||||
getbits(16);
|
||||
bits=do_layer3_sideinfo(&mp->fr);
|
||||
|
||||
/* bits = actual number of bits needed to parse this frame */
|
||||
/* can be negative, if all bits needed are in the reservoir */
|
||||
if (bits<0)
|
||||
bits=0;
|
||||
|
||||
/* read just as many bytes as necessary before decoding */
|
||||
mp->dsize = (bits+7)/8;
|
||||
|
||||
/* this will force mpglib to read entire frame before decoding */
|
||||
/* mp->dsize= mp->framesize - mp->ssize;*/
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Layers 1 and 2 */
|
||||
|
||||
/* check if there is enough input data */
|
||||
if(mp->fr.framesize > mp->bsize)
|
||||
return MP3_NEED_MORE;
|
||||
|
||||
/* takes care that the right amount of data is copied into wordpointer */
|
||||
mp->dsize=mp->fr.framesize;
|
||||
mp->ssize=0;
|
||||
}
|
||||
|
||||
mp->side_parsed=1;
|
||||
}
|
||||
|
||||
/* now decode main data */
|
||||
iret=MP3_NEED_MORE;
|
||||
if (!mp->data_parsed )
|
||||
{
|
||||
if(mp->dsize > mp->bsize)
|
||||
return MP3_NEED_MORE;
|
||||
|
||||
copy_mp(mp,mp->dsize,wordpointer);
|
||||
|
||||
*done = 0;
|
||||
|
||||
//do_layer3(&mp->fr,(unsigned char *) out,done);
|
||||
switch (mp->fr.lay)
|
||||
{
|
||||
#ifdef USE_LAYER_1
|
||||
case 1:
|
||||
if(mp->fr.error_protection)
|
||||
getbits(16);
|
||||
|
||||
do_layer1(mp,(unsigned char *) out,done);
|
||||
break;
|
||||
#endif
|
||||
#ifdef USE_LAYER_2
|
||||
case 2:
|
||||
if(mp->fr.error_protection)
|
||||
getbits(16);
|
||||
|
||||
do_layer2(mp,(unsigned char *) out,done);
|
||||
break;
|
||||
#endif
|
||||
case 3:
|
||||
do_layer3(mp,(unsigned char *) out,done);
|
||||
break;
|
||||
default:
|
||||
//fprintf(stderr,"invalid layer %d\n",mp->fr.lay);
|
||||
break;
|
||||
}
|
||||
|
||||
wordpointer = mp->bsspace[mp->bsnum] + 512 + mp->ssize + mp->dsize;
|
||||
|
||||
mp->data_parsed=1;
|
||||
iret=MP3_OK;
|
||||
}
|
||||
|
||||
|
||||
/* remaining bits are ancillary data, or reservoir for next frame
|
||||
* If free format, scan stream looking for next frame to determine
|
||||
* mp->framesize */
|
||||
if (mp->free_format)
|
||||
{
|
||||
if (mp->old_free_format)
|
||||
{
|
||||
/* free format. bitrate must not vary */
|
||||
mp->framesize=mp->fsizeold_nopadding + (mp->fr.padding);
|
||||
}
|
||||
else
|
||||
{
|
||||
bytes=sync_buffer(mp,1);
|
||||
if (bytes<0)
|
||||
return iret;
|
||||
mp->framesize = bytes + mp->ssize+mp->dsize;
|
||||
mp->fsizeold_nopadding= mp->framesize - mp->fr.padding;
|
||||
/*
|
||||
fprintf(stderr,"freeformat bitstream: estimated bitrate=%ikbs \n",
|
||||
8*(4+mp->framesize)*freqs[mp->fr.sampling_frequency]/
|
||||
(1000*576*(2-mp->fr.lsf)));
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
/* buffer the ancillary data and reservoir for next frame */
|
||||
bytes = mp->framesize-(mp->ssize+mp->dsize);
|
||||
if (bytes > mp->bsize)
|
||||
return iret;
|
||||
|
||||
if (bytes>0)
|
||||
{
|
||||
int size;
|
||||
copy_mp(mp,bytes,wordpointer);
|
||||
wordpointer += bytes;
|
||||
|
||||
size = (int) (wordpointer - (mp->bsspace[mp->bsnum]+512));
|
||||
if (size > MAXFRAMESIZE)
|
||||
{
|
||||
//fprintf(stderr,"fatal error. MAXFRAMESIZE not large enough.\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* the above frame is completey parsed. start looking for next frame */
|
||||
mp->fsizeold = mp->framesize;
|
||||
mp->old_free_format = mp->free_format;
|
||||
mp->framesize =0;
|
||||
mp->header_parsed=0;
|
||||
mp->side_parsed=0;
|
||||
mp->data_parsed=0;
|
||||
|
||||
return iret;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
/*
|
||||
** Copyright (C) 2000 Albert L. Faber
|
||||
**/
|
||||
|
||||
#ifndef INTERFACE_H_INCLUDED
|
||||
#define INTERFACE_H_INCLUDED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "common.h"
|
||||
|
||||
BOOL InitMP3(PMPSTR mp);
|
||||
int decodeMP3(PMPSTR mp,unsigned char *inmemory,int inmemsize,char *outmemory,int outmemsize,int *done);
|
||||
void ExitMP3(PMPSTR mp);
|
||||
|
||||
/* added remove_buf to support mpglib seeking */
|
||||
void remove_buf(PMPSTR mp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,177 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Layer 2 Alloc tables ..
|
||||
* most other tables are calculated on program start (which is (of course)
|
||||
* not ISO-conform) ..
|
||||
* Layer-3 huffman table is in huffman.h
|
||||
*/
|
||||
|
||||
const struct al_table2 alloc_0[] = {
|
||||
{4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
|
||||
{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
|
||||
{4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
|
||||
{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
|
||||
{4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
|
||||
{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767} };
|
||||
|
||||
const struct al_table2 alloc_1[] = {
|
||||
{4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
|
||||
{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
|
||||
{4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
|
||||
{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
|
||||
{4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
|
||||
{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767} };
|
||||
|
||||
const struct al_table2 alloc_2[] = {
|
||||
{4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
|
||||
{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
|
||||
{4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
|
||||
{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63} };
|
||||
|
||||
const struct al_table2 alloc_3[] = {
|
||||
{4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
|
||||
{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
|
||||
{4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
|
||||
{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63} };
|
||||
|
||||
const struct al_table2 alloc_4[] = {
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9} };
|
||||
|
|
@ -1,194 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mpeg Layer-1 audio decoder
|
||||
* --------------------------
|
||||
* copyright (c) 1995 by Michael Hipp, All rights reserved. See also 'README'
|
||||
* near unoptimzed ...
|
||||
*
|
||||
* may have a few bugs after last optimization ...
|
||||
*
|
||||
*/
|
||||
|
||||
/* $Id: layer1.c 3 2005-06-02 18:16:43Z vspader $ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "HIPDefines.h"
|
||||
|
||||
#ifdef USE_LAYER_1
|
||||
|
||||
#include <assert.h>
|
||||
#include "common.h"
|
||||
#include "decode_i386.h"
|
||||
|
||||
#ifdef WITH_DMALLOC
|
||||
#include <dmalloc.h>
|
||||
#endif
|
||||
|
||||
void I_step_one(unsigned int balloc[], unsigned int scale_index[2][SBLIMIT],struct frame *fr)
|
||||
{
|
||||
unsigned int *ba=balloc;
|
||||
unsigned int *sca = (unsigned int *) scale_index;
|
||||
|
||||
assert ( fr->stereo == 0 || fr->stereo == 1 );
|
||||
if(fr->stereo) {
|
||||
int i;
|
||||
int jsbound = fr->jsbound;
|
||||
for (i=0;i<jsbound;i++) {
|
||||
*ba++ = getbits(4);
|
||||
*ba++ = getbits(4);
|
||||
}
|
||||
for (i=jsbound;i<SBLIMIT;i++)
|
||||
*ba++ = getbits(4);
|
||||
|
||||
ba = balloc;
|
||||
|
||||
for (i=0;i<jsbound;i++) {
|
||||
if ((*ba++))
|
||||
*sca++ = getbits(6);
|
||||
if ((*ba++))
|
||||
*sca++ = getbits(6);
|
||||
}
|
||||
for (i=jsbound;i<SBLIMIT;i++)
|
||||
if ((*ba++)) {
|
||||
*sca++ = getbits(6);
|
||||
*sca++ = getbits(6);
|
||||
}
|
||||
}
|
||||
else {
|
||||
int i;
|
||||
for (i=0;i<SBLIMIT;i++)
|
||||
*ba++ = getbits(4);
|
||||
ba = balloc;
|
||||
for (i=0;i<SBLIMIT;i++)
|
||||
if ((*ba++))
|
||||
*sca++ = getbits(6);
|
||||
}
|
||||
}
|
||||
|
||||
void I_step_two(real fraction[2][SBLIMIT],unsigned int balloc[2*SBLIMIT],
|
||||
unsigned int scale_index[2][SBLIMIT],struct frame *fr)
|
||||
{
|
||||
int i,n;
|
||||
int smpb[2*SBLIMIT]; /* values: 0-65535 */
|
||||
int *sample;
|
||||
register unsigned int *ba;
|
||||
register unsigned int *sca = (unsigned int *) scale_index;
|
||||
|
||||
assert ( fr->stereo == 0 || fr->stereo == 1 );
|
||||
if(fr->stereo) {
|
||||
int jsbound = fr->jsbound;
|
||||
register real *f0 = fraction[0];
|
||||
register real *f1 = fraction[1];
|
||||
ba = balloc;
|
||||
for (sample=smpb,i=0;i<jsbound;i++) {
|
||||
if ((n = *ba++))
|
||||
*sample++ = getbits(n+1);
|
||||
if ((n = *ba++))
|
||||
*sample++ = getbits(n+1);
|
||||
}
|
||||
for (i=jsbound;i<SBLIMIT;i++)
|
||||
if ((n = *ba++))
|
||||
*sample++ = getbits(n+1);
|
||||
|
||||
ba = balloc;
|
||||
for (sample=smpb,i=0;i<jsbound;i++) {
|
||||
if((n=*ba++))
|
||||
*f0++ = (real) ( ((-1)<<n) + (*sample++) + 1) * muls[n+1][*sca++];
|
||||
else
|
||||
*f0++ = 0.0;
|
||||
if((n=*ba++))
|
||||
*f1++ = (real) ( ((-1)<<n) + (*sample++) + 1) * muls[n+1][*sca++];
|
||||
else
|
||||
*f1++ = 0.0;
|
||||
}
|
||||
for (i=jsbound;i<SBLIMIT;i++) {
|
||||
if ((n=*ba++)) {
|
||||
real samp = (real)( ((-1)<<n) + (*sample++) + 1);
|
||||
*f0++ = samp * muls[n+1][*sca++];
|
||||
*f1++ = samp * muls[n+1][*sca++];
|
||||
}
|
||||
else
|
||||
*f0++ = *f1++ = 0.0;
|
||||
}
|
||||
for(i=fr->down_sample_sblimit;i<32;i++)
|
||||
fraction[0][i] = fraction[1][i] = 0.0;
|
||||
}
|
||||
else {
|
||||
register real *f0 = fraction[0];
|
||||
ba = balloc;
|
||||
for (sample=smpb,i=0;i<SBLIMIT;i++)
|
||||
if ((n = *ba++))
|
||||
*sample++ = getbits(n+1);
|
||||
ba = balloc;
|
||||
for (sample=smpb,i=0;i<SBLIMIT;i++) {
|
||||
if((n=*ba++))
|
||||
*f0++ = (real) ( ((-1)<<n) + (*sample++) + 1) * muls[n+1][*sca++];
|
||||
else
|
||||
*f0++ = 0.0;
|
||||
}
|
||||
for(i=fr->down_sample_sblimit;i<32;i++)
|
||||
fraction[0][i] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
//int do_layer1(struct frame *fr,int outmode,struct audio_info_struct *ai)
|
||||
int do_layer1(PMPSTR mp, unsigned char *pcm_sample,int *pcm_point)
|
||||
{
|
||||
int clip=0;
|
||||
unsigned int balloc[2*SBLIMIT];
|
||||
unsigned int scale_index[2][SBLIMIT];
|
||||
real fraction[2][SBLIMIT];
|
||||
struct frame *fr=&(mp->fr);
|
||||
int i,stereo = fr->stereo;
|
||||
int single = fr->single;
|
||||
|
||||
fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ? (fr->mode_ext<<2)+4 : 32;
|
||||
|
||||
if(stereo == 1 || single == 3)
|
||||
single = 0;
|
||||
|
||||
I_step_one(balloc,scale_index,fr);
|
||||
|
||||
for (i=0;i<SCALE_BLOCK;i++)
|
||||
{
|
||||
I_step_two(fraction,balloc,scale_index,fr);
|
||||
|
||||
if(single >= 0)
|
||||
{
|
||||
clip += synth_1to1_mono( mp, (real *) fraction[single],pcm_sample,pcm_point);
|
||||
}
|
||||
else {
|
||||
int p1 = *pcm_point;
|
||||
clip += synth_1to1( mp, (real *) fraction[0],0,pcm_sample,&p1);
|
||||
clip += synth_1to1( mp, (real *) fraction[1],1,pcm_sample,pcm_point);
|
||||
}
|
||||
}
|
||||
|
||||
return clip;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,33 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
/*
|
||||
** Copyright (C) 2000 Albert L. Faber
|
||||
**/
|
||||
|
||||
|
||||
#ifndef LAYER1_H_INCLUDED
|
||||
#define LAYER1_H_INCLUDED
|
||||
|
||||
int do_layer1(PMPSTR mp, unsigned char *pcm_sample,int *pcm_point);
|
||||
|
||||
#endif
|
|
@ -1,333 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mpeg Layer-2 audio decoder
|
||||
* --------------------------
|
||||
* copyright (c) 1995 by Michael Hipp, All rights reserved. See also 'README'
|
||||
*
|
||||
*/
|
||||
|
||||
/* $Id: layer2.c 3 2005-06-02 18:16:43Z vspader $ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "HIPDefines.h"
|
||||
|
||||
#ifdef USE_LAYER_2
|
||||
|
||||
|
||||
#include "common.h"
|
||||
#include "layer2.h"
|
||||
#include "l2tables.h"
|
||||
#include "decode_i386.h"
|
||||
|
||||
#ifdef WITH_DMALLOC
|
||||
#include <dmalloc.h>
|
||||
#endif
|
||||
|
||||
static int grp_3tab[32 * 3] = { 0, }; /* used: 27 */
|
||||
static int grp_5tab[128 * 3] = { 0, }; /* used: 125 */
|
||||
static int grp_9tab[1024 * 3] = { 0, }; /* used: 729 */
|
||||
|
||||
void init_layer2(void)
|
||||
{
|
||||
static const double mulmul[27] = {
|
||||
0.0 , -2.0/3.0 , 2.0/3.0 ,
|
||||
2.0/7.0 , 2.0/15.0 , 2.0/31.0, 2.0/63.0 , 2.0/127.0 , 2.0/255.0 ,
|
||||
2.0/511.0 , 2.0/1023.0 , 2.0/2047.0 , 2.0/4095.0 , 2.0/8191.0 ,
|
||||
2.0/16383.0 , 2.0/32767.0 , 2.0/65535.0 ,
|
||||
-4.0/5.0 , -2.0/5.0 , 2.0/5.0, 4.0/5.0 ,
|
||||
-8.0/9.0 , -4.0/9.0 , -2.0/9.0 , 2.0/9.0 , 4.0/9.0 , 8.0/9.0 };
|
||||
static const int base[3][9] = {
|
||||
{ 1 , 0, 2 , } ,
|
||||
{ 17, 18, 0 , 19, 20 , } ,
|
||||
{ 21, 1, 22, 23, 0, 24, 25, 2, 26 } };
|
||||
int i,j,k,l,len;
|
||||
real *table;
|
||||
static const int tablen[3] = { 3 , 5 , 9 };
|
||||
static int *itable,*tables[3] = { grp_3tab , grp_5tab , grp_9tab };
|
||||
|
||||
for(i=0;i<3;i++)
|
||||
{
|
||||
itable = tables[i];
|
||||
len = tablen[i];
|
||||
for(j=0;j<len;j++)
|
||||
for(k=0;k<len;k++)
|
||||
for(l=0;l<len;l++)
|
||||
{
|
||||
*itable++ = base[i][l];
|
||||
*itable++ = base[i][k];
|
||||
*itable++ = base[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
for(k=0;k<27;k++)
|
||||
{
|
||||
double m=mulmul[k];
|
||||
table = muls[k];
|
||||
for(j=3,i=0;i<63;i++,j--)
|
||||
*table++ = (real)(m * pow(2.0,(double) j / 3.0));
|
||||
*table++ = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void II_step_one(unsigned int *bit_alloc,int *scale,struct frame *fr)
|
||||
{
|
||||
int stereo = fr->stereo-1;
|
||||
int sblimit = fr->II_sblimit;
|
||||
int jsbound = fr->jsbound;
|
||||
int sblimit2 = fr->II_sblimit<<stereo;
|
||||
struct al_table2 *alloc1 = fr->alloc;
|
||||
int i;
|
||||
static unsigned int scfsi_buf[64];
|
||||
unsigned int *scfsi,*bita;
|
||||
int sc,step;
|
||||
|
||||
bita = bit_alloc;
|
||||
if(stereo)
|
||||
{
|
||||
for (i=jsbound;i;i--,alloc1+=(1<<step))
|
||||
{
|
||||
*bita++ = (char) getbits(step=alloc1->bits);
|
||||
*bita++ = (char) getbits(step);
|
||||
}
|
||||
for (i=sblimit-jsbound;i;i--,alloc1+=(1<<step))
|
||||
{
|
||||
bita[0] = (char) getbits(step=alloc1->bits);
|
||||
bita[1] = bita[0];
|
||||
bita+=2;
|
||||
}
|
||||
bita = bit_alloc;
|
||||
scfsi=scfsi_buf;
|
||||
for (i=sblimit2;i;i--)
|
||||
if (*bita++)
|
||||
*scfsi++ = (char) getbits_fast(2);
|
||||
}
|
||||
else /* mono */
|
||||
{
|
||||
for (i=sblimit;i;i--,alloc1+=(1<<step))
|
||||
*bita++ = (char) getbits(step=alloc1->bits);
|
||||
bita = bit_alloc;
|
||||
scfsi=scfsi_buf;
|
||||
for (i=sblimit;i;i--)
|
||||
if (*bita++)
|
||||
*scfsi++ = (char) getbits_fast(2);
|
||||
}
|
||||
|
||||
bita = bit_alloc;
|
||||
scfsi=scfsi_buf;
|
||||
for (i=sblimit2;i;i--)
|
||||
if (*bita++)
|
||||
switch (*scfsi++)
|
||||
{
|
||||
case 0:
|
||||
*scale++ = getbits_fast(6);
|
||||
*scale++ = getbits_fast(6);
|
||||
*scale++ = getbits_fast(6);
|
||||
break;
|
||||
case 1 :
|
||||
*scale++ = sc = getbits_fast(6);
|
||||
*scale++ = sc;
|
||||
*scale++ = getbits_fast(6);
|
||||
break;
|
||||
case 2:
|
||||
*scale++ = sc = getbits_fast(6);
|
||||
*scale++ = sc;
|
||||
*scale++ = sc;
|
||||
break;
|
||||
default: /* case 3 */
|
||||
*scale++ = getbits_fast(6);
|
||||
*scale++ = sc = getbits_fast(6);
|
||||
*scale++ = sc;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void II_step_two(unsigned int *bit_alloc,real fraction[2][4][SBLIMIT],int *scale,struct frame *fr,int x1)
|
||||
{
|
||||
int i,j,k,ba;
|
||||
int stereo = fr->stereo;
|
||||
int sblimit = fr->II_sblimit;
|
||||
int jsbound = fr->jsbound;
|
||||
struct al_table2 *alloc2,*alloc1 = fr->alloc;
|
||||
unsigned int *bita=bit_alloc;
|
||||
int d1,step;
|
||||
|
||||
for (i=0;i<jsbound;i++,alloc1+=(1<<step))
|
||||
{
|
||||
step = alloc1->bits;
|
||||
for (j=0;j<stereo;j++)
|
||||
{
|
||||
if ( (ba=*bita++) )
|
||||
{
|
||||
k=(alloc2 = alloc1+ba)->bits;
|
||||
if( (d1=alloc2->d) < 0)
|
||||
{
|
||||
real cm=muls[k][scale[x1]];
|
||||
fraction[j][0][i] = ((real) ((int)getbits(k) + d1)) * cm;
|
||||
fraction[j][1][i] = ((real) ((int)getbits(k) + d1)) * cm;
|
||||
fraction[j][2][i] = ((real) ((int)getbits(k) + d1)) * cm;
|
||||
}
|
||||
else
|
||||
{
|
||||
static int *table[] = { 0,0,0,grp_3tab,0,grp_5tab,0,0,0,grp_9tab };
|
||||
unsigned int idx,*tab,m=scale[x1];
|
||||
idx = (unsigned int) getbits(k);
|
||||
tab = (unsigned int *) (table[d1] + idx + idx + idx);
|
||||
fraction[j][0][i] = muls[*tab++][m];
|
||||
fraction[j][1][i] = muls[*tab++][m];
|
||||
fraction[j][2][i] = muls[*tab][m];
|
||||
}
|
||||
scale+=3;
|
||||
}
|
||||
else
|
||||
fraction[j][0][i] = fraction[j][1][i] = fraction[j][2][i] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
for (i=jsbound;i<sblimit;i++,alloc1+=(1<<step))
|
||||
{
|
||||
step = alloc1->bits;
|
||||
bita++; /* channel 1 and channel 2 bitalloc are the same */
|
||||
if ( (ba=*bita++) )
|
||||
{
|
||||
k=(alloc2 = alloc1+ba)->bits;
|
||||
if( (d1=alloc2->d) < 0)
|
||||
{
|
||||
real cm;
|
||||
cm=muls[k][scale[x1+3]];
|
||||
fraction[1][0][i] = (fraction[0][0][i] = (real) ((int)getbits(k) + d1) ) * cm;
|
||||
fraction[1][1][i] = (fraction[0][1][i] = (real) ((int)getbits(k) + d1) ) * cm;
|
||||
fraction[1][2][i] = (fraction[0][2][i] = (real) ((int)getbits(k) + d1) ) * cm;
|
||||
cm=muls[k][scale[x1]];
|
||||
fraction[0][0][i] *= cm; fraction[0][1][i] *= cm; fraction[0][2][i] *= cm;
|
||||
}
|
||||
else
|
||||
{
|
||||
static int *table[] = { 0,0,0,grp_3tab,0,grp_5tab,0,0,0,grp_9tab };
|
||||
unsigned int idx,*tab,m1,m2;
|
||||
m1 = scale[x1]; m2 = scale[x1+3];
|
||||
idx = (unsigned int) getbits(k);
|
||||
tab = (unsigned int *) (table[d1] + idx + idx + idx);
|
||||
fraction[0][0][i] = muls[*tab][m1]; fraction[1][0][i] = muls[*tab++][m2];
|
||||
fraction[0][1][i] = muls[*tab][m1]; fraction[1][1][i] = muls[*tab++][m2];
|
||||
fraction[0][2][i] = muls[*tab][m1]; fraction[1][2][i] = muls[*tab][m2];
|
||||
}
|
||||
scale+=6;
|
||||
}
|
||||
else {
|
||||
fraction[0][0][i] = fraction[0][1][i] = fraction[0][2][i] =
|
||||
fraction[1][0][i] = fraction[1][1][i] = fraction[1][2][i] = 0.0;
|
||||
}
|
||||
/*
|
||||
should we use individual scalefac for channel 2 or
|
||||
is the current way the right one , where we just copy channel 1 to
|
||||
channel 2 ??
|
||||
The current 'strange' thing is, that we throw away the scalefac
|
||||
values for the second channel ...!!
|
||||
-> changed .. now we use the scalefac values of channel one !!
|
||||
*/
|
||||
}
|
||||
|
||||
// if(sblimit > (fr->down_sample_sblimit) )
|
||||
// sblimit = fr->down_sample_sblimit;
|
||||
|
||||
for(i=sblimit;i<SBLIMIT;i++)
|
||||
for (j=0;j<stereo;j++)
|
||||
fraction[j][0][i] = fraction[j][1][i] = fraction[j][2][i] = 0.0;
|
||||
|
||||
}
|
||||
|
||||
static void II_select_table(struct frame *fr)
|
||||
{
|
||||
static const int translate[3][2][16] =
|
||||
{ { { 0,2,2,2,2,2,2,0,0,0,1,1,1,1,1,0 } ,
|
||||
{ 0,2,2,0,0,0,1,1,1,1,1,1,1,1,1,0 } } ,
|
||||
{ { 0,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0 } ,
|
||||
{ 0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0 } } ,
|
||||
{ { 0,3,3,3,3,3,3,0,0,0,1,1,1,1,1,0 } ,
|
||||
{ 0,3,3,0,0,0,1,1,1,1,1,1,1,1,1,0 } } };
|
||||
|
||||
int table,sblim;
|
||||
static const struct al_table2 *tables[5] =
|
||||
{ alloc_0, alloc_1, alloc_2, alloc_3 , alloc_4 };
|
||||
static const int sblims[5] = { 27 , 30 , 8, 12 , 30 };
|
||||
|
||||
if(fr->lsf)
|
||||
table = 4;
|
||||
else
|
||||
table = translate[fr->sampling_frequency][2-fr->stereo][fr->bitrate_index];
|
||||
sblim = sblims[table];
|
||||
|
||||
fr->alloc = (struct al_table2*)tables[table];
|
||||
fr->II_sblimit = sblim;
|
||||
}
|
||||
|
||||
|
||||
int do_layer2( PMPSTR mp,unsigned char *pcm_sample,int *pcm_point)
|
||||
//int do_layer2(struct frame *fr,int outmode,struct audio_info_struct *ai)
|
||||
{
|
||||
int clip=0;
|
||||
int i,j;
|
||||
real fraction[2][4][SBLIMIT]; /* pick_table clears unused subbands */
|
||||
unsigned int bit_alloc[64];
|
||||
int scale[192];
|
||||
struct frame *fr=&(mp->fr);
|
||||
int stereo = fr->stereo;
|
||||
int single = fr->single;
|
||||
|
||||
II_select_table(fr);
|
||||
fr->jsbound = (fr->mode == MPG_MD_JOINT_STEREO) ?
|
||||
(fr->mode_ext<<2)+4 : fr->II_sblimit;
|
||||
|
||||
if(stereo == 1 || single == 3)
|
||||
single = 0;
|
||||
|
||||
II_step_one(bit_alloc, scale, fr);
|
||||
|
||||
for (i=0;i<SCALE_BLOCK;i++)
|
||||
{
|
||||
II_step_two(bit_alloc,fraction,scale,fr,i>>2);
|
||||
for (j=0;j<3;j++)
|
||||
{
|
||||
if(single >= 0)
|
||||
{
|
||||
clip += synth_1to1_mono(mp, fraction[single][j],pcm_sample,pcm_point);
|
||||
}
|
||||
else {
|
||||
int p1 = *pcm_point;
|
||||
clip += synth_1to1(mp, fraction[0][j],0,pcm_sample,&p1);
|
||||
clip += synth_1to1(mp, fraction[1][j],1,pcm_sample,pcm_point);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return clip;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
|
@ -1,49 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
/*
|
||||
** Copyright (C) 2000 Albert L. Faber
|
||||
**/
|
||||
|
||||
#ifdef USE_LAYER_2
|
||||
|
||||
#ifndef LAYER2_H_INCLUDED
|
||||
#define LAYER2_H_INCLUDED
|
||||
|
||||
|
||||
struct al_table2
|
||||
{
|
||||
short bits;
|
||||
short d;
|
||||
};
|
||||
|
||||
|
||||
|
||||
void init_layer2(void);
|
||||
void II_step_one(unsigned int *bit_alloc,int *scale,struct frame *fr);
|
||||
void II_step_two(unsigned int *bit_alloc,real fraction[2][4][SBLIMIT],int *scale,struct frame *fr,int x1);
|
||||
int do_layer2( PMPSTR mp,unsigned char *pcm_sample,int *pcm_point);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -1,35 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
/*
|
||||
** Copyright (C) 2000 Albert L. Faber
|
||||
**/
|
||||
|
||||
#ifndef LAYER3_H_INCLUDED
|
||||
#define LAYER3_H_INCLUDED
|
||||
|
||||
void init_layer3(int);
|
||||
int do_layer3_sideinfo(struct frame *fr);
|
||||
int do_layer3( PMPSTR mp,unsigned char *pcm_sample,int *pcm_point);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
|
||||
#ifndef MPG123_H_INCLUDED
|
||||
#define MPG123_H_INCLUDED
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
//#ifdef STDC_HEADERS
|
||||
# include <string.h>
|
||||
//#else
|
||||
/*# ifndef HAVE_STRCHR
|
||||
# define strchr index
|
||||
# define strrchr rindex
|
||||
# endif
|
||||
char *strchr (), *strrchr ();
|
||||
# ifndef HAVE_MEMCPY
|
||||
# define memcpy(d, s, n) bcopy ((s), (d), (n))
|
||||
# define memmove(d, s, n) bcopy ((s), (d), (n))
|
||||
# endif
|
||||
#endif*/
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
|
||||
#if defined(__riscos__) && defined(FPA10)
|
||||
#include "ymath.h"
|
||||
#else
|
||||
#include <math.h>
|
||||
#endif
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
#ifndef M_SQRT2
|
||||
#define M_SQRT2 1.41421356237309504880
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef REAL_IS_FLOAT
|
||||
# define real float
|
||||
#elif defined(REAL_IS_LONG_DOUBLE)
|
||||
# define real long double
|
||||
#else
|
||||
# define real double
|
||||
#endif
|
||||
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#define SBLIMIT 32
|
||||
#define SSLIMIT 18
|
||||
|
||||
#define MPG_MD_STEREO 0
|
||||
#define MPG_MD_JOINT_STEREO 1
|
||||
#define MPG_MD_DUAL_CHANNEL 2
|
||||
#define MPG_MD_MONO 3
|
||||
|
||||
#define MAXFRAMESIZE 1792
|
||||
|
||||
/* AF: ADDED FOR LAYER1/LAYER2 */
|
||||
#define SCALE_BLOCK 12
|
||||
|
||||
|
||||
/* Pre Shift fo 16 to 8 bit converter table */
|
||||
#define AUSHIFT (3)
|
||||
|
||||
struct frame {
|
||||
int stereo;
|
||||
int jsbound;
|
||||
int single;
|
||||
int lsf;
|
||||
int mpeg25;
|
||||
int header_change;
|
||||
int lay;
|
||||
int error_protection;
|
||||
int bitrate_index;
|
||||
int sampling_frequency;
|
||||
int padding;
|
||||
int extension;
|
||||
int mode;
|
||||
int mode_ext;
|
||||
int copyright;
|
||||
int original;
|
||||
int emphasis;
|
||||
int framesize; /* computed framesize */
|
||||
|
||||
/* AF: ADDED FOR LAYER1/LAYER2 */
|
||||
#if defined(USE_LAYER_2) || defined(USE_LAYER_1)
|
||||
int II_sblimit;
|
||||
struct al_table2 *alloc;
|
||||
int down_sample_sblimit;
|
||||
int down_sample;
|
||||
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
struct gr_info_s {
|
||||
int scfsi;
|
||||
unsigned part2_3_length;
|
||||
unsigned big_values;
|
||||
unsigned scalefac_compress;
|
||||
unsigned block_type;
|
||||
unsigned mixed_block_flag;
|
||||
unsigned table_select[3];
|
||||
unsigned subblock_gain[3];
|
||||
unsigned maxband[3];
|
||||
unsigned maxbandl;
|
||||
unsigned maxb;
|
||||
unsigned region1start;
|
||||
unsigned region2start;
|
||||
unsigned preflag;
|
||||
unsigned scalefac_scale;
|
||||
unsigned count1table_select;
|
||||
real *full_gain[3];
|
||||
real *pow2gain;
|
||||
};
|
||||
|
||||
struct III_sideinfo
|
||||
{
|
||||
unsigned main_data_begin;
|
||||
unsigned private_bits;
|
||||
struct {
|
||||
struct gr_info_s gr[2];
|
||||
} ch[2];
|
||||
};
|
||||
|
||||
|
||||
#endif
|
|
@ -1,90 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MPGLIB_H_
|
||||
#define _MPGLIB_H_
|
||||
|
||||
/*
|
||||
#ifndef NOANALYSIS
|
||||
extern plotting_data *mpg123_pinfo;
|
||||
#endif
|
||||
*/
|
||||
|
||||
struct buf {
|
||||
unsigned char *pnt;
|
||||
long size;
|
||||
long pos;
|
||||
struct buf *next;
|
||||
struct buf *prev;
|
||||
};
|
||||
|
||||
struct framebuf {
|
||||
struct buf *buf;
|
||||
long pos;
|
||||
struct frame *next;
|
||||
struct frame *prev;
|
||||
};
|
||||
|
||||
typedef struct mpstr_tag {
|
||||
struct buf *head,*tail;
|
||||
int vbr_header; /* 1 if valid Xing vbr header detected */
|
||||
int num_frames; /* set if vbr header present */
|
||||
int enc_delay; /* set if vbr header present */
|
||||
int enc_padding; /* set if vbr header present */
|
||||
int header_parsed;
|
||||
int side_parsed;
|
||||
int data_parsed;
|
||||
int free_format; /* 1 = free format frame */
|
||||
int old_free_format; /* 1 = last frame was free format */
|
||||
int bsize;
|
||||
int framesize;
|
||||
int ssize;
|
||||
int dsize;
|
||||
int fsizeold;
|
||||
int fsizeold_nopadding;
|
||||
struct frame fr;
|
||||
unsigned char bsspace[2][MAXFRAMESIZE+512]; /* MAXFRAMESIZE */
|
||||
real hybrid_block[2][2][SBLIMIT*SSLIMIT];
|
||||
int hybrid_blc[2];
|
||||
unsigned long header;
|
||||
int bsnum;
|
||||
real synth_buffs[2][2][0x110];
|
||||
int synth_bo;
|
||||
int sync_bitstream;
|
||||
|
||||
} MPSTR, *PMPSTR;
|
||||
|
||||
|
||||
#if ( defined(_MSC_VER) || defined(__BORLANDC__) )
|
||||
typedef int BOOL; /* windef.h contains the same definition */
|
||||
#else
|
||||
#define BOOL int
|
||||
#endif
|
||||
|
||||
#define MP3_ERR -1
|
||||
#define MP3_OK 0
|
||||
#define MP3_NEED_MORE 1
|
||||
|
||||
|
||||
|
||||
#endif /* _MPGLIB_H_ */
|
|
@ -1,143 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "tabinit.h"
|
||||
#include "mpg123.h"
|
||||
|
||||
#ifdef WITH_DMALLOC
|
||||
#include <dmalloc.h>
|
||||
#endif
|
||||
|
||||
real decwin[512+32];
|
||||
static real cos64[16],cos32[8],cos16[4],cos8[2],cos4[1];
|
||||
real *pnts[] = { cos64,cos32,cos16,cos8,cos4 };
|
||||
|
||||
const double dewin[512] = {
|
||||
0.000000000,-0.000015259,-0.000015259,-0.000015259,
|
||||
-0.000015259,-0.000015259,-0.000015259,-0.000030518,
|
||||
-0.000030518,-0.000030518,-0.000030518,-0.000045776,
|
||||
-0.000045776,-0.000061035,-0.000061035,-0.000076294,
|
||||
-0.000076294,-0.000091553,-0.000106812,-0.000106812,
|
||||
-0.000122070,-0.000137329,-0.000152588,-0.000167847,
|
||||
-0.000198364,-0.000213623,-0.000244141,-0.000259399,
|
||||
-0.000289917,-0.000320435,-0.000366211,-0.000396729,
|
||||
-0.000442505,-0.000473022,-0.000534058,-0.000579834,
|
||||
-0.000625610,-0.000686646,-0.000747681,-0.000808716,
|
||||
-0.000885010,-0.000961304,-0.001037598,-0.001113892,
|
||||
-0.001205444,-0.001296997,-0.001388550,-0.001480103,
|
||||
-0.001586914,-0.001693726,-0.001785278,-0.001907349,
|
||||
-0.002014160,-0.002120972,-0.002243042,-0.002349854,
|
||||
-0.002456665,-0.002578735,-0.002685547,-0.002792358,
|
||||
-0.002899170,-0.002990723,-0.003082275,-0.003173828,
|
||||
-0.003250122,-0.003326416,-0.003387451,-0.003433228,
|
||||
-0.003463745,-0.003479004,-0.003479004,-0.003463745,
|
||||
-0.003417969,-0.003372192,-0.003280640,-0.003173828,
|
||||
-0.003051758,-0.002883911,-0.002700806,-0.002487183,
|
||||
-0.002227783,-0.001937866,-0.001617432,-0.001266479,
|
||||
-0.000869751,-0.000442505, 0.000030518, 0.000549316,
|
||||
0.001098633, 0.001693726, 0.002334595, 0.003005981,
|
||||
0.003723145, 0.004486084, 0.005294800, 0.006118774,
|
||||
0.007003784, 0.007919312, 0.008865356, 0.009841919,
|
||||
0.010848999, 0.011886597, 0.012939453, 0.014022827,
|
||||
0.015121460, 0.016235352, 0.017349243, 0.018463135,
|
||||
0.019577026, 0.020690918, 0.021789551, 0.022857666,
|
||||
0.023910522, 0.024932861, 0.025909424, 0.026840210,
|
||||
0.027725220, 0.028533936, 0.029281616, 0.029937744,
|
||||
0.030532837, 0.031005859, 0.031387329, 0.031661987,
|
||||
0.031814575, 0.031845093, 0.031738281, 0.031478882,
|
||||
0.031082153, 0.030517578, 0.029785156, 0.028884888,
|
||||
0.027801514, 0.026535034, 0.025085449, 0.023422241,
|
||||
0.021575928, 0.019531250, 0.017257690, 0.014801025,
|
||||
0.012115479, 0.009231567, 0.006134033, 0.002822876,
|
||||
-0.000686646,-0.004394531,-0.008316040,-0.012420654,
|
||||
-0.016708374,-0.021179199,-0.025817871,-0.030609131,
|
||||
-0.035552979,-0.040634155,-0.045837402,-0.051132202,
|
||||
-0.056533813,-0.061996460,-0.067520142,-0.073059082,
|
||||
-0.078628540,-0.084182739,-0.089706421,-0.095169067,
|
||||
-0.100540161,-0.105819702,-0.110946655,-0.115921021,
|
||||
-0.120697021,-0.125259399,-0.129562378,-0.133590698,
|
||||
-0.137298584,-0.140670776,-0.143676758,-0.146255493,
|
||||
-0.148422241,-0.150115967,-0.151306152,-0.151962280,
|
||||
-0.152069092,-0.151596069,-0.150497437,-0.148773193,
|
||||
-0.146362305,-0.143264771,-0.139450073,-0.134887695,
|
||||
-0.129577637,-0.123474121,-0.116577148,-0.108856201,
|
||||
-0.100311279,-0.090927124,-0.080688477,-0.069595337,
|
||||
-0.057617187,-0.044784546,-0.031082153,-0.016510010,
|
||||
-0.001068115, 0.015228271, 0.032379150, 0.050354004,
|
||||
0.069168091, 0.088775635, 0.109161377, 0.130310059,
|
||||
0.152206421, 0.174789429, 0.198059082, 0.221984863,
|
||||
0.246505737, 0.271591187, 0.297210693, 0.323318481,
|
||||
0.349868774, 0.376800537, 0.404083252, 0.431655884,
|
||||
0.459472656, 0.487472534, 0.515609741, 0.543823242,
|
||||
0.572036743, 0.600219727, 0.628295898, 0.656219482,
|
||||
0.683914185, 0.711318970, 0.738372803, 0.765029907,
|
||||
0.791213989, 0.816864014, 0.841949463, 0.866363525,
|
||||
0.890090942, 0.913055420, 0.935195923, 0.956481934,
|
||||
0.976852417, 0.996246338, 1.014617920, 1.031936646,
|
||||
1.048156738, 1.063217163, 1.077117920, 1.089782715,
|
||||
1.101211548, 1.111373901, 1.120223999, 1.127746582,
|
||||
1.133926392, 1.138763428, 1.142211914, 1.144287109,
|
||||
1.144989014
|
||||
};
|
||||
|
||||
void make_decode_tables(long scaleval)
|
||||
{
|
||||
int i,j,k,kr,divv;
|
||||
real *table,*costab;
|
||||
|
||||
|
||||
for(i=0;i<5;i++)
|
||||
{
|
||||
kr=0x10>>i; divv=0x40>>i;
|
||||
costab = pnts[i];
|
||||
for(k=0;k<kr;k++)
|
||||
costab[k] = (real)( 1.0 / (2.0 * cos(M_PI * ((double) k * 2.0 + 1.0) / (double) divv)) );
|
||||
}
|
||||
|
||||
table = decwin;
|
||||
scaleval = -scaleval;
|
||||
for(i=0,j=0;i<256;i++,j++,table+=32)
|
||||
{
|
||||
if(table < decwin+512+16)
|
||||
table[16] = table[0] = (real)( dewin[j] * scaleval );
|
||||
if(i % 32 == 31)
|
||||
table -= 1023;
|
||||
if(i % 64 == 63)
|
||||
scaleval = - scaleval;
|
||||
}
|
||||
|
||||
for( /* i=256 */ ;i<512;i++,j--,table+=32)
|
||||
{
|
||||
if(table < decwin+512+16)
|
||||
table[16] = table[0] = (real) ( dewin[j] * scaleval );
|
||||
if(i % 32 == 31)
|
||||
table -= 1023;
|
||||
if(i % 64 == 63)
|
||||
scaleval = - scaleval;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
/* DecMPA decoding routines from Lame/HIP (Myers W. Carpenter)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
/*
|
||||
** Copyright (C) 2000 Albert L. Faber
|
||||
**/
|
||||
|
||||
#ifndef MPGLIB_TABINIT_H_INCLUDED
|
||||
#define MPGLIB_TABINIT_H_INCLUDED
|
||||
|
||||
#include "mpg123.h"
|
||||
|
||||
extern real decwin[512+32];
|
||||
extern real *pnts[5];
|
||||
|
||||
void make_decode_tables(long scale);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,138 +0,0 @@
|
|||
/*---- DXhead.c --------------------------------------------
|
||||
|
||||
decoder MPEG Layer III
|
||||
handle Xing header
|
||||
mod 12/7/98 add vbr scale
|
||||
|
||||
Copyright 1998 Xing Technology Corp.
|
||||
-----------------------------------------------------------*/
|
||||
|
||||
|
||||
//changes 8/11/2002 (by Hauke Duden):
|
||||
// - removed unnecessary includes
|
||||
|
||||
|
||||
//#include <stdlib.h>
|
||||
//#include <stdio.h>
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
#include "dxHead.h"
|
||||
|
||||
// 4 Xing
|
||||
// 4 flags
|
||||
// 4 frames
|
||||
// 4 bytes
|
||||
// 100 toc
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
static int ExtractI4(unsigned char *buf)
|
||||
{
|
||||
int x;
|
||||
// big endian extract
|
||||
|
||||
x = buf[0];
|
||||
x <<= 8;
|
||||
x |= buf[1];
|
||||
x <<= 8;
|
||||
x |= buf[2];
|
||||
x <<= 8;
|
||||
x |= buf[3];
|
||||
|
||||
return x;
|
||||
}
|
||||
/*-------------------------------------------------------------*/
|
||||
int GetXingHeader(XHEADDATA *X, unsigned char *buf)
|
||||
{
|
||||
int i, head_flags;
|
||||
int h_id, h_mode, h_sr_index;
|
||||
static const int sr_table[4] = { 44100, 48000, 32000, 99999 };
|
||||
|
||||
// get Xing header data
|
||||
|
||||
|
||||
X->flags = 0; // clear to null incase fail
|
||||
|
||||
|
||||
// get selected MPEG header data
|
||||
h_id = (buf[1] >> 3) & 1;
|
||||
h_sr_index = (buf[2] >> 2) & 3;
|
||||
h_mode = (buf[3] >> 6) & 3;
|
||||
|
||||
|
||||
// determine offset of header
|
||||
if( h_id ) { // mpeg1
|
||||
if( h_mode != 3 ) buf+=(32+4);
|
||||
else buf+=(17+4);
|
||||
}
|
||||
else { // mpeg2
|
||||
if( h_mode != 3 ) buf+=(17+4);
|
||||
else buf+=(9+4);
|
||||
}
|
||||
|
||||
if( buf[0] != 'X' ) return 0; // fail
|
||||
if( buf[1] != 'i' ) return 0; // header not found
|
||||
if( buf[2] != 'n' ) return 0;
|
||||
if( buf[3] != 'g' ) return 0;
|
||||
buf+=4;
|
||||
|
||||
X->h_id = h_id;
|
||||
X->samprate = sr_table[h_sr_index];
|
||||
if( h_id == 0 ) X->samprate >>= 1;
|
||||
|
||||
head_flags = X->flags = ExtractI4(buf); buf+=4; // get flags
|
||||
|
||||
if( head_flags & FRAMES_FLAG ) {X->frames = ExtractI4(buf); buf+=4;}
|
||||
if( head_flags & BYTES_FLAG ) {X->bytes = ExtractI4(buf); buf+=4;}
|
||||
|
||||
if( head_flags & TOC_FLAG ) {
|
||||
if( X->toc != (unsigned char*)0 ) {
|
||||
for(i=0;i<100;i++) X->toc[i] = buf[i];
|
||||
}
|
||||
buf+=100;
|
||||
}
|
||||
|
||||
X->vbr_scale = -1;
|
||||
if( head_flags & VBR_SCALE_FLAG ) {X->vbr_scale = ExtractI4(buf); buf+=4;}
|
||||
|
||||
//if( X->toc != NULL ) {
|
||||
//for(i=0;i<100;i++) {
|
||||
// if( (i%10) == 0 ) printf("\n");
|
||||
// printf(" %3d", (int)(X->toc[i]));
|
||||
//}
|
||||
//}
|
||||
|
||||
return 1; // success
|
||||
}
|
||||
/*-------------------------------------------------------------*/
|
||||
int SeekPoint(unsigned char TOC[100], int file_bytes, float percent)
|
||||
{
|
||||
// interpolate in TOC to get file seek point in bytes
|
||||
int a, seekpoint;
|
||||
float fa, fb, fx;
|
||||
|
||||
if( percent < 0.0f )
|
||||
percent = 0.0f;
|
||||
if( percent > 100.0f )
|
||||
percent = 100.0f;
|
||||
|
||||
a = (int)percent;
|
||||
if( a > 99 )
|
||||
a = 99;
|
||||
fa = TOC[a];
|
||||
if( a < 99 )
|
||||
{
|
||||
fb = TOC[a+1];
|
||||
}
|
||||
else
|
||||
{
|
||||
fb = 256.0f;
|
||||
}
|
||||
|
||||
fx = fa + (fb-fa)*(percent-a);
|
||||
//printf("%f ....... %f ...... %f\n",fa,fb,fx);
|
||||
|
||||
seekpoint = (int)((1.0f/256.0f)*fx*file_bytes);
|
||||
|
||||
return seekpoint;
|
||||
}
|
||||
/*-------------------------------------------------------------*/
|
|
@ -1,66 +0,0 @@
|
|||
/*---- DXhead.h -------------------------------------------
|
||||
|
||||
|
||||
decoder MPEG Layer III
|
||||
|
||||
handle Xing header
|
||||
|
||||
|
||||
Copyright 1998 Xing Technology Corp.
|
||||
-----------------------------------------------------------*/
|
||||
// A Xing header may be present in the ancillary
|
||||
// data field of the first frame of an mp3 bitstream
|
||||
// The Xing header (optionally) contains
|
||||
// frames total number of audio frames in the bitstream
|
||||
// bytes total number of bytes in the bitstream
|
||||
// toc table of contents
|
||||
|
||||
// toc (table of contents^) gives seek points
|
||||
// for random access
|
||||
// the ith entry determines the seek point for
|
||||
// i-percent duration
|
||||
// seek point in bytes = (toc[i]/256.0) * total_bitstream_bytes
|
||||
// e.g. half duration seek point = (toc[50]/256.0) * total_bitstream_bytes
|
||||
|
||||
#ifndef __DXHEAD_H
|
||||
#define __DXHEAD_H
|
||||
|
||||
#define FRAMES_FLAG 0x0001
|
||||
#define BYTES_FLAG 0x0002
|
||||
#define TOC_FLAG 0x0004
|
||||
#define VBR_SCALE_FLAG 0x0008
|
||||
|
||||
#define FRAMES_AND_BYTES (FRAMES_FLAG | BYTES_FLAG)
|
||||
|
||||
// structure to receive extracted header
|
||||
// toc may be NULL
|
||||
|
||||
typedef struct XHEADDATA_s {
|
||||
int h_id; // from MPEG header, 0=MPEG2, 1=MPEG1
|
||||
int samprate; // determined from MPEG header
|
||||
int flags; // from Xing header data
|
||||
int frames; // total bit stream frames from Xing header data
|
||||
int bytes; // total bit stream bytes from Xing header data
|
||||
int vbr_scale; // encoded vbr scale from Xing header data
|
||||
unsigned char *toc; // pointer to unsigned char toc_buffer[100]
|
||||
// may be NULL if toc not desired
|
||||
} XHEADDATA;
|
||||
|
||||
int GetXingHeader(XHEADDATA *X, unsigned char *buf);
|
||||
|
||||
// return 0=fail, 1=success
|
||||
// X structure to receive header data (output)
|
||||
// buf bitstream input
|
||||
|
||||
|
||||
int SeekPoint(unsigned char TOC[100], int file_bytes, float percent);
|
||||
// return seekpoint in bytes (may be at eof if percent=100.0)
|
||||
// TOC = table of contents from Xing header
|
||||
// file_bytes = number of bytes in mp3 file
|
||||
// percent = play time percentage of total playtime. May be
|
||||
// fractional (e.g. 87.245)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,281 +0,0 @@
|
|||
/*
|
||||
stores information after we found a header.
|
||||
Copyright (C) 2000 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - removed cout and exit stuff
|
||||
// - added bitratekbps variable
|
||||
|
||||
#include "mpegAudioHeader.h"
|
||||
|
||||
#define DEBUG_HEADER(x)
|
||||
//#define DEBUG_HEADER(x) x
|
||||
|
||||
|
||||
|
||||
static const int frequencies[3][3]= {
|
||||
{44100,48000,32000}, // MPEG 1
|
||||
{22050,24000,16000}, // MPEG 2
|
||||
{11025,12000,8000} // MPEG 2.5
|
||||
};
|
||||
|
||||
static int translate[3][2][16] = { { { 2,0,0,2,2,2,3,3,3,3,3,3,3,3,3,2 } ,
|
||||
{ 2,0,0,0,0,0,0,2,2,2,3,3,3,3,3,2 } } ,
|
||||
{ { 2,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2 } ,
|
||||
{ 2,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2 } } ,
|
||||
{ { 2,1,1,2,2,2,3,3,3,3,3,3,3,3,3,2 } ,
|
||||
{ 2,1,1,1,1,1,1,2,2,2,3,3,3,3,3,2 } } };
|
||||
|
||||
|
||||
static int sblims[5] = { 8 , 12 , 27, 30 , 30 };
|
||||
|
||||
|
||||
static const int bitrate[2][3][15]= {
|
||||
// MPEG 1
|
||||
{{0,32,64,96,128,160,192,224,256,288,320,352,384,416,448},
|
||||
{0,32,48,56,64,80,96,112,128,160,192,224,256,320,384},
|
||||
{0,32,40,48,56,64,80,96,112,128,160,192,224,256,320}},
|
||||
|
||||
// MPEG 2
|
||||
{{0,32,48,56,64,80,96,112,128,144,160,176,192,224,256},
|
||||
{0,8,16,24,32,40,48,56,64,80,96,112,128,144,160},
|
||||
{0,8,16,24,32,40,48,56,64,80,96,112,128,144,160}}
|
||||
};
|
||||
|
||||
|
||||
MpegAudioHeader::MpegAudioHeader() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
MpegAudioHeader::~MpegAudioHeader() {
|
||||
}
|
||||
|
||||
|
||||
int MpegAudioHeader::getChannelbitrate() {
|
||||
//cout << "getChannelbitrate not implemented"<<endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MpegAudioHeader::parseHeader(unsigned char* buf){
|
||||
|
||||
int c;
|
||||
int mpeg25=false;
|
||||
|
||||
|
||||
// Analyzing
|
||||
header[0]=buf[0];
|
||||
header[1]=buf[1];
|
||||
header[2]=buf[2];
|
||||
header[3]=buf[3];
|
||||
|
||||
c=buf[1];
|
||||
lmpeg25=false;
|
||||
if ( (c&0xf0) == 0xe0) {
|
||||
lmpeg25=true;
|
||||
}
|
||||
|
||||
c&=0xf;
|
||||
protection=c&1;
|
||||
layer=4-((c>>1)&3);
|
||||
// we catch the layer==4 error later, for now go on with parsing
|
||||
version=(int)(((c>>3)&1)^1);
|
||||
if ((version==0) && lmpeg25) {
|
||||
//DEBUG_HEADER(cout << "wrong lsf/mpeg25 combination"<<endl;)
|
||||
return false;
|
||||
}
|
||||
c=buf[2];
|
||||
|
||||
c=((c))>>1;
|
||||
padding=(c&1);
|
||||
c>>=1;
|
||||
frequency=(int)(c&3);
|
||||
c>>=2;
|
||||
bitrateindex=(int)c;
|
||||
if(bitrateindex>=15) {
|
||||
//DEBUG_HEADER(cout << "bitrateindex error"<<endl;)
|
||||
return false;
|
||||
}
|
||||
c=buf[3];
|
||||
|
||||
c=((unsigned int)(c))>>4;
|
||||
extendedmode=c&3;
|
||||
mode=(int)(c>>2);
|
||||
|
||||
|
||||
// Making information
|
||||
inputstereo= (mode==_MODE_SINGLE)?0:1;
|
||||
|
||||
//
|
||||
// frequency can be 0,1 or 2 but the mask above allows 3 as well
|
||||
// check now.
|
||||
if (frequency > 2) {
|
||||
//DEBUG_HEADER(cout << "frequency value out of range"<<endl;)
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// does not belong here should be in the layer specific parts. [START]
|
||||
//
|
||||
|
||||
switch(layer) {
|
||||
case 3:
|
||||
subbandnumber=0;
|
||||
stereobound=0;
|
||||
tableindex=0;
|
||||
break;
|
||||
case 2:
|
||||
tableindex = translate[frequency][inputstereo][bitrateindex];
|
||||
subbandnumber = sblims[tableindex];
|
||||
stereobound = subbandnumber;
|
||||
/*
|
||||
Now merge the tableindex, for the bitalloclengthtable
|
||||
*/
|
||||
tableindex=tableindex>>1;
|
||||
if(mode==_MODE_SINGLE)stereobound=0;
|
||||
if(mode==_MODE_JOINT)stereobound=(extendedmode+1)<<2;
|
||||
|
||||
break;
|
||||
case 1:
|
||||
subbandnumber=MAXSUBBAND;
|
||||
stereobound=subbandnumber;
|
||||
tableindex=0;
|
||||
if(mode==_MODE_SINGLE)stereobound=0;
|
||||
if(mode==_MODE_JOINT)stereobound=(extendedmode+1)<<2;
|
||||
break;
|
||||
default:
|
||||
//DEBUG_HEADER(cout <<"unknown layer"<<endl;)
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// does not belong here should be in the layer specific parts. [END]
|
||||
//
|
||||
frequencyHz=frequencies[version+lmpeg25][frequency];
|
||||
// framesize & slots
|
||||
if(layer==1)
|
||||
{
|
||||
if (frequencyHz <= 0)
|
||||
return false;
|
||||
|
||||
m_AvgFrameSize=(12000.0*bitrate[version][0][bitrateindex]*4.0)/frequencyHz;
|
||||
|
||||
framesize=(12000*bitrate[version][0][bitrateindex])/frequencyHz;
|
||||
|
||||
if(frequency==_FREQUENCY_44100 && padding)
|
||||
framesize++;
|
||||
framesize<<=2;
|
||||
}
|
||||
else
|
||||
{
|
||||
int freq=frequencyHz<<version;
|
||||
if (freq <= 0)
|
||||
return false;
|
||||
|
||||
m_AvgFrameSize=(144000.0*bitrate[version][layer-1][bitrateindex])/freq;
|
||||
|
||||
//the padding seems to be used to increase the size of some
|
||||
//frames so that the bitrate has exactly the specified value.
|
||||
//In other words, it is used to compensate for the rounding of the
|
||||
//frame sizes to full bytes
|
||||
framesize=(144000*bitrate[version][layer-1][bitrateindex])/freq;
|
||||
if(padding)
|
||||
framesize++;
|
||||
|
||||
if(layer==3)
|
||||
{
|
||||
if(version)
|
||||
layer3slots=framesize-((mode==_MODE_SINGLE)?9:17) -(protection?0:2) -4;
|
||||
else
|
||||
layer3slots=framesize-((mode==_MODE_SINGLE)?17:32) -(protection?0:2) -4;
|
||||
}
|
||||
}
|
||||
if (framesize <= 0)
|
||||
{
|
||||
//DEBUG_HEADER(cout << "framesize negative"<<endl;)
|
||||
return false;
|
||||
}
|
||||
|
||||
m_nBitRateKbps=bitrate[version][layer-1][bitrateindex];
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int MpegAudioHeader::getpcmperframe() {
|
||||
int s;
|
||||
|
||||
s=32;
|
||||
if(layer==3) {
|
||||
s*=18;
|
||||
if(version==0)s*=2;
|
||||
}
|
||||
else {
|
||||
s*=SCALEBLOCK;
|
||||
if(layer==2)s*=3;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
void MpegAudioHeader::copyTo(MpegAudioHeader* dest) {
|
||||
dest->protection=protection;
|
||||
dest->layer=layer;
|
||||
dest->version=version;
|
||||
dest->padding=padding;
|
||||
dest->frequency=frequency;
|
||||
dest->frequencyHz=frequencyHz;
|
||||
dest->bitrateindex=bitrateindex;
|
||||
dest->extendedmode=extendedmode;
|
||||
dest->mode=mode;
|
||||
dest->inputstereo=inputstereo;
|
||||
dest->channelbitrate=channelbitrate;
|
||||
dest->tableindex=tableindex;
|
||||
dest->subbandnumber=subbandnumber;
|
||||
dest->stereobound=stereobound;
|
||||
dest->framesize=framesize;
|
||||
dest->layer3slots=layer3slots;
|
||||
dest->lmpeg25=lmpeg25;
|
||||
}
|
||||
|
||||
|
||||
void MpegAudioHeader::print(const char* name) {
|
||||
/* cout << "MpegAudioHeader [START]:"<<name<<endl;
|
||||
printf("header:%1x%1x%1x%1x\n",header[0],header[1],header[2],header[3]);
|
||||
cout << "getProtection:"<<getProtection()<<endl;
|
||||
cout << "getLayer:"<<getLayer()<<endl;
|
||||
cout << "getVersion:"<<getVersion()<<endl;
|
||||
cout << "getPadding:"<<getPadding()<<endl;
|
||||
cout << "getFrequency:"<<getFrequency()<<endl;
|
||||
cout << "getFrequencyHz:"<<getFrequencyHz()<<endl;
|
||||
cout << "getBitrateindex:"<<getBitrateindex()<<endl;
|
||||
cout << "getExtendedmode:"<<getExtendedmode()<<endl;
|
||||
cout << "getMode():"<<getMode()<<endl;
|
||||
cout << "getInputstereo:"<<getInputstereo()<<endl;
|
||||
cout << "getChannelbitrate:"<<getChannelbitrate()<<endl;
|
||||
cout << "getTableindex:"<<getTableindex()<<endl;
|
||||
cout << "getSubbandnumber:"<<getSubbandnumber()<<endl;
|
||||
cout << "getStereobound:"<<getStereobound()<<endl;
|
||||
cout << "getFramesize:"<<getFramesize()<<endl;
|
||||
cout << "getLayer3slots:"<<getLayer3slots()<<endl;
|
||||
cout << "getpcmperframe:"<<getpcmperframe()<<endl;
|
||||
cout << "MpegAudioHeader [END]:"<<name<<endl;*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
/*
|
||||
stores information after we found a header.
|
||||
Copyright (C) 2000 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - added bitratekbps
|
||||
|
||||
//changes 8/11/2002 (by Hauke Duden):
|
||||
// - removed unnecessary includes
|
||||
|
||||
|
||||
#ifndef __MPEGHEADERINFO_H
|
||||
#define __MPEGHEADERINFO_H
|
||||
|
||||
|
||||
//#include <stdio.h>
|
||||
//#include <iostream.h>
|
||||
//#include <stdlib.h>
|
||||
//#include <string.h>
|
||||
|
||||
#define _FREQUENCY_44100 0
|
||||
#define _FREQUENCY_48000 1
|
||||
#define _FREQUENCY_32000 2
|
||||
|
||||
#define _MODE_FULLSTEREO 0
|
||||
#define _MODE_JOINT 1
|
||||
#define _MODE_DUAL 2
|
||||
#define _MODE_SINGLE 3
|
||||
|
||||
#define _VERSION_1 0
|
||||
#define _VERSION_2 1
|
||||
|
||||
|
||||
#define MAXSUBBAND 32
|
||||
#define SCALEBLOCK 12
|
||||
|
||||
|
||||
|
||||
class MpegAudioHeader {
|
||||
|
||||
int protection;
|
||||
int layer;
|
||||
int version;
|
||||
int padding;
|
||||
int frequency;
|
||||
int frequencyHz;
|
||||
int bitrateindex;
|
||||
int extendedmode;
|
||||
int mode;
|
||||
int inputstereo;
|
||||
int channelbitrate;
|
||||
int tableindex;
|
||||
int subbandnumber;
|
||||
int stereobound;
|
||||
int framesize;
|
||||
int layer3slots;
|
||||
int lmpeg25;
|
||||
unsigned char header[4];
|
||||
|
||||
int m_nBitRateKbps;
|
||||
double m_AvgFrameSize;
|
||||
|
||||
public:
|
||||
MpegAudioHeader();
|
||||
~MpegAudioHeader();
|
||||
|
||||
int parseHeader(unsigned char* buf);
|
||||
|
||||
inline int getProtection() { return protection; }
|
||||
inline int getLayer() { return layer; }
|
||||
inline int getVersion() { return version; }
|
||||
inline int getPadding() { return padding; }
|
||||
inline int getFrequency() { return frequency; }
|
||||
inline int getFrequencyHz() { return frequencyHz; }
|
||||
inline int getBitrateindex() { return bitrateindex; }
|
||||
inline int getExtendedmode() { return extendedmode; }
|
||||
inline int getMode() { return mode; }
|
||||
inline int getInputstereo() { return inputstereo; }
|
||||
inline int getFramesize() { return framesize; }
|
||||
inline int getLayer25() { return lmpeg25; }
|
||||
|
||||
// MPEG layer 2
|
||||
inline int getTableindex() { return tableindex; }
|
||||
// MPEG layer 1/2
|
||||
inline int getSubbandnumber() { return subbandnumber; }
|
||||
inline int getStereobound() { return stereobound; }
|
||||
// MPEG layer 3
|
||||
inline int getLayer3slots() { return layer3slots; }
|
||||
|
||||
int getChannelbitrate();
|
||||
|
||||
|
||||
inline unsigned char* getHeader() { return header; }
|
||||
int getpcmperframe();
|
||||
|
||||
|
||||
void copyTo(MpegAudioHeader* dest);
|
||||
|
||||
void print(const char* name);
|
||||
void printStates(const char* name);
|
||||
|
||||
inline int GetBitRateKbps(){ return m_nBitRateKbps; }
|
||||
inline double GetAvgFrameSize() { return m_AvgFrameSize; }
|
||||
};
|
||||
#endif
|
|
@ -1,49 +0,0 @@
|
|||
/* DecMPA - simple MPEG Audio decoding library.
|
||||
Copyright (C) 2002 Hauke Duden
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
For more information look at the file License.txt in this package.
|
||||
|
||||
email: hazard_hd@users.sourceforge.net
|
||||
*/
|
||||
|
||||
|
||||
#include "splayDecoder.h"
|
||||
#include "../DecodeEngine.h"
|
||||
|
||||
#include <new>
|
||||
|
||||
void* DecodeEngine_Create()
|
||||
{
|
||||
return new SplayDecoder();
|
||||
}
|
||||
|
||||
void DecodeEngine_Destroy(void* pEng)
|
||||
{
|
||||
delete (SplayDecoder*)pEng;
|
||||
}
|
||||
|
||||
bool DecodeEngine_Decode(void* pEng,AudioFrame* pDest,void* pData,long nDataLength)
|
||||
{
|
||||
SplayDecoder* pDecoder=(SplayDecoder*)pEng;
|
||||
|
||||
return pDecoder->decode((unsigned char*)pData,nDataLength,pDest)!=0;
|
||||
}
|
||||
|
||||
void DecodeEngine_Flush(void* pEngine)
|
||||
{
|
||||
//splay doesn't store old data, so we don't have to do anything
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
align attribut definition (g++)
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __ATTRIBUTE_H
|
||||
#define __ATTRIBUTE_H
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
/* use gcc attribs to align critical data structures */
|
||||
|
||||
#ifdef ATTRIBUTE_ALIGNED_MAX
|
||||
#define ATTR_ALIGN(align) __attribute__ \
|
||||
((__aligned__ ((ATTRIBUTE_ALIGNED_MAX <align) ? \
|
||||
ATTRIBUTE_ALIGNED_MAX : align)))
|
||||
#else
|
||||
#define ATTR_ALIGN(align)
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
include header for dcts/windows
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/11/2002 (by Hauke Duden):
|
||||
// - removed unnecessary includes
|
||||
|
||||
|
||||
#ifndef __COMMON_H
|
||||
#define __COMMON_H
|
||||
|
||||
#include "attribute.h"
|
||||
//#include <stdio.h>
|
||||
|
||||
#define SSLIMIT 18
|
||||
#define SBLIMIT 32
|
||||
|
||||
|
||||
#define LS 0
|
||||
#define RS 1
|
||||
|
||||
|
||||
typedef float REAL;
|
||||
|
||||
extern "C" {
|
||||
// The inline code works on intel only with egcs >= 1.1
|
||||
#ifdef __GNUC__
|
||||
#if (__GNUC__ < 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ < 91 ) )
|
||||
#ifndef _AIX
|
||||
#warning "inline code disabled! (buggy egcs version)"
|
||||
#undef __NO_MATH_INLINES
|
||||
#define __NO_MATH_INLINES 1
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#ifndef WIN32
|
||||
#include <math.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
}
|
||||
#if defined WIN32
|
||||
#include <math.h>
|
||||
#endif
|
||||
|
||||
//#include <iostream.h>
|
||||
|
||||
#ifndef M_PI
|
||||
#define MY_PI 3.14159265358979323846
|
||||
#else
|
||||
#define MY_PI M_PI
|
||||
#endif
|
||||
|
||||
#ifdef PI
|
||||
#undef PI
|
||||
#endif
|
||||
#define PI MY_PI
|
||||
#define PI_12 (PI/12.0)
|
||||
#define PI_18 (PI/18.0)
|
||||
#define PI_24 (PI/24.0)
|
||||
#define PI_36 (PI/36.0)
|
||||
#define PI_72 (PI/72.0)
|
||||
|
||||
|
||||
#endif
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
wrapper for dcts
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __DCT_HEADER_H
|
||||
#define __DCT_HEADER_H
|
||||
|
||||
// one source:
|
||||
extern void initialize_dct64();
|
||||
|
||||
extern void dct64(REAL* out1,REAL* out2,REAL *fraction);
|
||||
|
||||
// one source:
|
||||
extern void initialize_dct64_downsample();
|
||||
extern void dct64_downsample(REAL* out1,REAL* out2,REAL *fraction);
|
||||
|
||||
// one source file:
|
||||
extern void initialize_dct12_dct36();
|
||||
|
||||
extern void dct12(REAL *in,REAL *prevblk1,REAL *prevblk2,REAL *wi,REAL *out);
|
||||
extern void dct36(REAL *inbuf,REAL *prevblk1,REAL *prevblk2,REAL *wi,REAL *out);
|
||||
|
||||
extern void initialize_win();
|
||||
#endif
|
|
@ -1,290 +0,0 @@
|
|||
/*
|
||||
wrapper for dcts
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - added some explicit casts to remove compilation warnings
|
||||
|
||||
#include "common.h"
|
||||
#include "dct.h"
|
||||
|
||||
|
||||
ATTR_ALIGN(64) static REAL hsec_12[3];
|
||||
ATTR_ALIGN(64) static REAL cos2_6=(REAL)cos(PI/6.0*2.0);
|
||||
ATTR_ALIGN(64) static REAL cos1_6=(REAL)cos(PI/6.0*1.0);
|
||||
ATTR_ALIGN(64) static REAL hsec_36[9];
|
||||
ATTR_ALIGN(64) static REAL cos_18[9];
|
||||
|
||||
|
||||
/**
|
||||
This was some time ago a standalone dct class,
|
||||
but to get more speed I made it an inline dct
|
||||
int the filter classes
|
||||
*/
|
||||
|
||||
static int dct36_12Init=false;
|
||||
|
||||
void initialize_dct12_dct36() {
|
||||
if (dct36_12Init) {
|
||||
return;
|
||||
}
|
||||
dct36_12Init=true;
|
||||
|
||||
|
||||
int i;
|
||||
|
||||
for(i=0;i<3;i++)
|
||||
hsec_12[i]=(REAL)(0.5/cos(double(i*2+1)* PI_12));
|
||||
|
||||
for(i=0;i<9;i++)
|
||||
hsec_36[i]=(REAL)(0.5/cos(double(i*2+1)* PI_36));
|
||||
|
||||
for(i=0;i<9;i++)
|
||||
cos_18[i]=(REAL)(cos(PI_18*double(i)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
void dct36(REAL *inbuf,REAL *prevblk1,
|
||||
REAL *prevblk2,REAL *wi,REAL *out){
|
||||
|
||||
#define MACRO0(v) { \
|
||||
REAL tmp; \
|
||||
out2[9+(v)]=(tmp=sum0+sum1)*wi[27+(v)]; \
|
||||
out2[8-(v)]=tmp * wi[26-(v)]; } \
|
||||
sum0-=sum1; \
|
||||
ts[SBLIMIT*(8-(v))]=out1[8-(v)]+sum0*wi[8-(v)]; \
|
||||
ts[SBLIMIT*(9+(v))]=out1[9+(v)]+sum0*wi[9+(v)];
|
||||
#define MACRO1(v) { \
|
||||
REAL sum0,sum1; \
|
||||
sum0=tmp1a+tmp2a; \
|
||||
sum1=(tmp1b+tmp2b)*hsec_36[(v)]; \
|
||||
MACRO0(v); }
|
||||
#define MACRO2(v) { \
|
||||
REAL sum0,sum1; \
|
||||
sum0=tmp2a-tmp1a; \
|
||||
sum1=(tmp2b-tmp1b) * hsec_36[(v)]; \
|
||||
MACRO0(v); }
|
||||
|
||||
{
|
||||
REAL *in = inbuf;
|
||||
|
||||
in[17]+=in[16];in[16]+=in[15];in[15]+=in[14];in[14]+=in[13];
|
||||
in[13]+=in[12];in[12]+=in[11];in[11]+=in[10];in[10]+=in[ 9];
|
||||
in[ 9]+=in[ 8];in[ 8]+=in[ 7];in[ 7]+=in[ 6];in[ 6]+=in[ 5];
|
||||
in[ 5]+=in[ 4];in[ 4]+=in[ 3];in[ 3]+=in[ 2];in[ 2]+=in[ 1];
|
||||
in[ 1]+=in[ 0];
|
||||
|
||||
|
||||
in[17]+=in[15];in[15]+=in[13];in[13]+=in[11];in[11]+=in[ 9];
|
||||
in[ 9]+=in[ 7];in[7] +=in[ 5];in[ 5]+=in[ 3];in[ 3]+=in[ 1];
|
||||
|
||||
{
|
||||
REAL *c = cos_18;
|
||||
REAL *out2 = prevblk2;
|
||||
REAL *out1 = prevblk1;
|
||||
REAL *ts = out;
|
||||
|
||||
REAL ta33,ta66,tb33,tb66;
|
||||
|
||||
ta33=in[2*3+0]*c[3];
|
||||
ta66=in[2*6+0]*c[6];
|
||||
tb33=in[2*3+1]*c[3];
|
||||
tb66=in[2*6+1]*c[6];
|
||||
|
||||
{
|
||||
REAL tmp1a,tmp2a,tmp1b,tmp2b;
|
||||
tmp1a= in[2*1+0]*c[1]+ta33 +in[2*5+0]*c[5]+in[2*7+0]*c[7];
|
||||
tmp1b= in[2*1+1]*c[1]+tb33 +in[2*5+1]*c[5]+in[2*7+1]*c[7];
|
||||
tmp2a=in[2*0+0]+in[2*2+0]*c[2]+in[2*4+0]*c[4]+ta66 +in[2*8+0]*c[8];
|
||||
tmp2b=in[2*0+1]+in[2*2+1]*c[2]+in[2*4+1]*c[4]+tb66 +in[2*8+1]*c[8];
|
||||
MACRO1(0);
|
||||
MACRO2(8);
|
||||
}
|
||||
|
||||
{
|
||||
REAL tmp1a,tmp2a,tmp1b,tmp2b;
|
||||
tmp1a=(in[2*1+0]-in[2*5+0]-in[2*7+0])*c[3];
|
||||
tmp1b=(in[2*1+1]-in[2*5+1]-in[2*7+1])*c[3];
|
||||
tmp2a=(in[2*2+0]-in[2*4+0]-in[2*8+0])*c[6]-in[2*6+0]+in[2*0+0];
|
||||
tmp2b=(in[2*2+1]-in[2*4+1]-in[2*8+1])*c[6]-in[2*6+1]+in[2*0+1];
|
||||
MACRO1(1);
|
||||
MACRO2(7);
|
||||
}
|
||||
|
||||
{
|
||||
REAL tmp1a,tmp2a,tmp1b,tmp2b;
|
||||
tmp1a= in[2*1+0]*c[5]-ta33 -in[2*5+0]*c[7]+in[2*7+0]*c[1];
|
||||
tmp1b= in[2*1+1]*c[5]-tb33 -in[2*5+1]*c[7]+in[2*7+1]*c[1];
|
||||
tmp2a=in[2*0+0]-in[2*2+0]*c[8]-in[2*4+0]*c[2]+ta66 +in[2*8+0]*c[4];
|
||||
tmp2b=in[2*0+1]-in[2*2+1]*c[8]-in[2*4+1]*c[2]+tb66 +in[2*8+1]*c[4];
|
||||
MACRO1(2);
|
||||
MACRO2(6);
|
||||
}
|
||||
|
||||
{
|
||||
REAL tmp1a,tmp2a,tmp1b,tmp2b;
|
||||
tmp1a= in[2*1+0]*c[7]-ta33 +in[2*5+0]*c[1]-in[2*7+0]*c[5];
|
||||
tmp1b= in[2*1+1]*c[7]-tb33 +in[2*5+1]*c[1]-in[2*7+1]*c[5];
|
||||
tmp2a=in[2*0+0]-in[2*2+0]*c[4]+in[2*4+0]*c[8]+ta66 -in[2*8+0]*c[2];
|
||||
tmp2b=in[2*0+1]-in[2*2+1]*c[4]+in[2*4+1]*c[8]+tb66 -in[2*8+1]*c[2];
|
||||
MACRO1(3);
|
||||
MACRO2(5);
|
||||
}
|
||||
|
||||
{
|
||||
REAL sum0,sum1;
|
||||
sum0= in[2*0+0]-in[2*2+0]+in[2*4+0]-in[2*6+0]+in[2*8+0];
|
||||
sum1=(in[2*0+1]-in[2*2+1]+in[2*4+1]-in[2*6+1]+in[2*8+1])*hsec_36[4];
|
||||
MACRO0(4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void dct12(REAL *in,REAL *prevblk1,REAL *prevblk2,REAL *wi,REAL *out) {
|
||||
|
||||
#define DCT12_PART1 \
|
||||
in5=in[5*3]; \
|
||||
in5+=(in4=in[4*3]); \
|
||||
in4+=(in3=in[3*3]); \
|
||||
in3+=(in2=in[2*3]); \
|
||||
in2+=(in1=in[1*3]); \
|
||||
in1+=(in0=in[0*3]); \
|
||||
\
|
||||
in5+=in3;in3+=in1; \
|
||||
\
|
||||
in2*=cos1_6; \
|
||||
in3*=cos1_6;
|
||||
|
||||
#define DCT12_PART2 \
|
||||
in0+=in4*cos2_6; \
|
||||
\
|
||||
in4=in0+in2; \
|
||||
in0-=in2; \
|
||||
\
|
||||
in1+=in5*cos2_6; \
|
||||
\
|
||||
in5=(in1+in3)*hsec_12[0]; \
|
||||
in1=(in1-in3)*hsec_12[2]; \
|
||||
\
|
||||
in3=in4+in5; \
|
||||
in4-=in5; \
|
||||
\
|
||||
in2=in0+in1; \
|
||||
in0-=in1;
|
||||
|
||||
{
|
||||
REAL in0,in1,in2,in3,in4,in5;
|
||||
register REAL *pb1=prevblk1;
|
||||
out[SBLIMIT*0]=pb1[0];out[SBLIMIT*1]=pb1[1];out[SBLIMIT*2]=pb1[2];
|
||||
out[SBLIMIT*3]=pb1[3];out[SBLIMIT*4]=pb1[4];out[SBLIMIT*5]=pb1[5];
|
||||
|
||||
DCT12_PART1;
|
||||
|
||||
{
|
||||
REAL tmp0,tmp1=(in0-in4);
|
||||
{
|
||||
register REAL tmp2=(in1-in5)*hsec_12[1];
|
||||
tmp0=tmp1+tmp2;
|
||||
tmp1-=tmp2;
|
||||
}
|
||||
out[(17-1)*SBLIMIT]=pb1[17-1]+tmp0*wi[11-1];
|
||||
out[(12+1)*SBLIMIT]=pb1[12+1]+tmp0*wi[ 6+1];
|
||||
out[(6 +1)*SBLIMIT]=pb1[6 +1]+tmp1*wi[ 1 ];
|
||||
out[(11-1)*SBLIMIT]=pb1[11-1]+tmp1*wi[ 5-1];
|
||||
}
|
||||
|
||||
DCT12_PART2;
|
||||
out[(17-0)*SBLIMIT]=pb1[17-0]+in2*wi[11-0];
|
||||
out[(12+0)*SBLIMIT]=pb1[12+0]+in2*wi[ 6+0];
|
||||
out[(12+2)*SBLIMIT]=pb1[12+2]+in3*wi[ 6+2];
|
||||
out[(17-2)*SBLIMIT]=pb1[17-2]+in3*wi[11-2];
|
||||
|
||||
out[( 6+0)*SBLIMIT]=pb1[ 6+0]+in0*wi[0];
|
||||
out[(11-0)*SBLIMIT]=pb1[11-0]+in0*wi[5-0];
|
||||
out[( 6+2)*SBLIMIT]=pb1[ 6+2]+in4*wi[2];
|
||||
out[(11-2)*SBLIMIT]=pb1[11-2]+in4*wi[5-2];
|
||||
}
|
||||
|
||||
in++;
|
||||
{
|
||||
REAL in0,in1,in2,in3,in4,in5;
|
||||
register REAL *pb2 = prevblk2;
|
||||
|
||||
DCT12_PART1;
|
||||
|
||||
{
|
||||
REAL tmp0,tmp1=(in0-in4);
|
||||
{
|
||||
REAL tmp2=(in1-in5)*hsec_12[1];
|
||||
tmp0=tmp1+tmp2;
|
||||
tmp1-=tmp2;
|
||||
}
|
||||
pb2[5-1]=tmp0*wi[11-1];
|
||||
pb2[0+1]=tmp0*wi[6+1];
|
||||
out[(12+1)*SBLIMIT]+=tmp1*wi[1];
|
||||
out[(17-1)*SBLIMIT]+=tmp1*wi[5-1];
|
||||
}
|
||||
|
||||
DCT12_PART2;
|
||||
|
||||
pb2[5-0]=in2*wi[11-0];
|
||||
pb2[0+0]=in2*wi[6+0];
|
||||
pb2[0+2]=in3*wi[6+2];
|
||||
pb2[5-2]=in3*wi[11-2];
|
||||
|
||||
out[(12+0)*SBLIMIT]+=in0*wi[0];
|
||||
out[(17-0)*SBLIMIT]+=in0*wi[5-0];
|
||||
out[(12+2)*SBLIMIT]+=in4*wi[2];
|
||||
out[(17-2)*SBLIMIT]+=in4*wi[5-2];
|
||||
}
|
||||
|
||||
in++;
|
||||
{
|
||||
REAL in0,in1,in2,in3,in4,in5;
|
||||
register REAL *pb2 = prevblk2;
|
||||
pb2[12]=pb2[13]=pb2[14]=pb2[15]=pb2[16]=pb2[17]=0.0;
|
||||
|
||||
DCT12_PART1;
|
||||
|
||||
{
|
||||
REAL tmp0,tmp1=(in0-in4);
|
||||
{
|
||||
REAL tmp2=(in1-in5)*hsec_12[1];
|
||||
tmp0=tmp1+tmp2;
|
||||
tmp1-=tmp2;
|
||||
}
|
||||
pb2[11-1]=tmp0*wi[11-1];
|
||||
pb2[ 6+1]=tmp0*wi[6+1];
|
||||
pb2[ 0+1]+=tmp1*wi[1];
|
||||
pb2[ 5-1]+=tmp1*wi[5-1];
|
||||
}
|
||||
|
||||
DCT12_PART2;
|
||||
pb2[11-0]=in2*wi[11-0];
|
||||
pb2[ 6+0]=in2*wi[ 6+0];
|
||||
pb2[ 6+2]=in3*wi[ 6+2];
|
||||
pb2[11-2]=in3*wi[11-2];
|
||||
|
||||
pb2[ 0+0]+=in0*wi[0 ];
|
||||
pb2[ 5-0]+=in0*wi[5-0];
|
||||
pb2[ 0+2]+=in4*wi[2 ];
|
||||
pb2[ 5-2]+=in4*wi[5-2];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,205 +0,0 @@
|
|||
/*
|
||||
wrapper for dcts
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - added some explicit casts to remove compilation warnings
|
||||
|
||||
#include "common.h"
|
||||
#include "dct.h"
|
||||
|
||||
ATTR_ALIGN(64) static REAL hcos_64[16];
|
||||
ATTR_ALIGN(64) static REAL hcos_32[8];
|
||||
ATTR_ALIGN(64) static REAL hcos_16[4];
|
||||
ATTR_ALIGN(64) static REAL hcos_8[2];
|
||||
ATTR_ALIGN(64) static REAL hcos_4;
|
||||
|
||||
/**
|
||||
This was some time ago a standalone dct class,
|
||||
but to get more speed I made it an inline dct
|
||||
int the filter classes
|
||||
*/
|
||||
|
||||
static int dct64Init=false;
|
||||
|
||||
void initialize_dct64() {
|
||||
if (dct64Init) {
|
||||
return;
|
||||
}
|
||||
dct64Init=true;
|
||||
|
||||
int i;
|
||||
|
||||
for(i=0;i<16;i++) {
|
||||
hcos_64[i]=(REAL)(1.0/(2.0*cos(MY_PI*double(i*2+1)/64.0)));
|
||||
}
|
||||
for(i=0;i< 8;i++) {
|
||||
hcos_32[i]=(REAL)(1.0/(2.0*cos(MY_PI*double(i*2+1)/32.0)));
|
||||
}
|
||||
for(i=0;i< 4;i++) {
|
||||
hcos_16[i]=(REAL)(1.0/(2.0*cos(MY_PI*double(i*2+1)/16.0)));
|
||||
}
|
||||
for(i=0;i< 2;i++) {
|
||||
hcos_8[i]=(REAL)(1.0/(2.0*cos(MY_PI*double(i*2+1)/ 8.0)));
|
||||
}
|
||||
hcos_4=(REAL)(1.0/(2.0*cos(MY_PI*1.0/4.0)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// splay dct64 , faster than mpeg123 dct. (from decode.c)
|
||||
//
|
||||
void dct64(REAL* out1,REAL* out2,REAL *fraction) {
|
||||
ATTR_ALIGN(64) REAL p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,pa,pb,pc,pd,pe,pf;
|
||||
ATTR_ALIGN(64) REAL q0,q1,q2,q3,q4,q5,q6,q7,q8,q9,qa,qb,qc,qd,qe,qf;
|
||||
|
||||
#define OUT1(v,t) out1[(32-(v))*16] =(-(out1[(v)*16]=t))
|
||||
#define OUT2(v) out2[(96-(v)-32)*16]=out2[((v)-32)*16]
|
||||
|
||||
// compute new values via a fast cosine transform:
|
||||
{
|
||||
// put to buffer 0..15
|
||||
register REAL* x=fraction;
|
||||
|
||||
p0=x[ 0]+x[31];p1=x[ 1]+x[30];p2=x[ 2]+x[29];p3=x[ 3]+x[28];
|
||||
p4=x[ 4]+x[27];p5=x[ 5]+x[26];p6=x[ 6]+x[25];p7=x[ 7]+x[24];
|
||||
p8=x[ 8]+x[23];p9=x[ 9]+x[22];pa=x[10]+x[21];pb=x[11]+x[20];
|
||||
pc=x[12]+x[19];pd=x[13]+x[18];pe=x[14]+x[17];pf=x[15]+x[16];
|
||||
}
|
||||
|
||||
// put to buffer 32..39
|
||||
q0=p0+pf;q1=p1+pe;q2=p2+pd;q3=p3+pc;
|
||||
q4=p4+pb;q5=p5+pa;q6=p6+p9;q7=p7+p8;
|
||||
// put to buffer 40..47
|
||||
q8=hcos_32[0]*(p0-pf);q9=hcos_32[1]*(p1-pe);
|
||||
qa=hcos_32[2]*(p2-pd);qb=hcos_32[3]*(p3-pc);
|
||||
qc=hcos_32[4]*(p4-pb);qd=hcos_32[5]*(p5-pa);
|
||||
qe=hcos_32[6]*(p6-p9);qf=hcos_32[7]*(p7-p8);
|
||||
|
||||
p0=q0+q7;p1=q1+q6;p2=q2+q5;p3=q3+q4;
|
||||
p4=hcos_16[0]*(q0-q7);p5=hcos_16[1]*(q1-q6);
|
||||
p6=hcos_16[2]*(q2-q5);p7=hcos_16[3]*(q3-q4);
|
||||
p8=q8+qf;p9=q9+qe;pa=qa+qd;pb=qb+qc;
|
||||
pc=hcos_16[0]*(q8-qf);pd=hcos_16[1]*(q9-qe);
|
||||
pe=hcos_16[2]*(qa-qd);pf=hcos_16[3]*(qb-qc);
|
||||
|
||||
q0=p0+p3;q1=p1+p2;q2=hcos_8[0]*(p0-p3);q3=hcos_8[1]*(p1-p2);
|
||||
q4=p4+p7;q5=p5+p6;q6=hcos_8[0]*(p4-p7);q7=hcos_8[1]*(p5-p6);
|
||||
q8=p8+pb;q9=p9+pa;qa=hcos_8[0]*(p8-pb);qb=hcos_8[1]*(p9-pa);
|
||||
qc=pc+pf;qd=pd+pe;qe=hcos_8[0]*(pc-pf);qf=hcos_8[1]*(pd-pe);
|
||||
|
||||
p0=q0+q1;p1=hcos_4*(q0-q1);p2=q2+q3;p3=hcos_4*(q2-q3);
|
||||
p4=q4+q5;p5=hcos_4*(q4-q5);p6=q6+q7;p7=hcos_4*(q6-q7);
|
||||
p8=q8+q9;p9=hcos_4*(q8-q9);pa=qa+qb;pb=hcos_4*(qa-qb);
|
||||
pc=qc+qd;pd=hcos_4*(qc-qd);pe=qe+qf;pf=hcos_4*(qe-qf);
|
||||
|
||||
{
|
||||
register REAL tmp;
|
||||
|
||||
tmp=p6+p7;
|
||||
OUT2(36)=-(p5+tmp);
|
||||
OUT2(44)=-(p4+tmp);
|
||||
tmp=pb+pf;
|
||||
OUT1(10,tmp);
|
||||
OUT1(6,pd+tmp);
|
||||
tmp=pe+pf;
|
||||
OUT2(46)=-(p8+pc+tmp);
|
||||
OUT2(34)=-(p9+pd+tmp);
|
||||
tmp+=pa+pb;
|
||||
OUT2(38)=-(pd+tmp);
|
||||
OUT2(42)=-(pc+tmp);
|
||||
OUT1(2,p9+pd+pf);
|
||||
OUT1(4,p5+p7);
|
||||
OUT2(48)=-p0;
|
||||
out2[0]=-(out1[0]=p1);
|
||||
OUT1( 8,p3);
|
||||
OUT1(12,p7);
|
||||
OUT1(14,pf);
|
||||
OUT2(40)=-(p2+p3);
|
||||
}
|
||||
|
||||
{
|
||||
// put to buffer 16..31
|
||||
register REAL *x=fraction;
|
||||
|
||||
p0=hcos_64[ 0]*(x[ 0]-x[31]);p1=hcos_64[ 1]*(x[ 1]-x[30]);
|
||||
p2=hcos_64[ 2]*(x[ 2]-x[29]);p3=hcos_64[ 3]*(x[ 3]-x[28]);
|
||||
p4=hcos_64[ 4]*(x[ 4]-x[27]);p5=hcos_64[ 5]*(x[ 5]-x[26]);
|
||||
p6=hcos_64[ 6]*(x[ 6]-x[25]);p7=hcos_64[ 7]*(x[ 7]-x[24]);
|
||||
p8=hcos_64[ 8]*(x[ 8]-x[23]);p9=hcos_64[ 9]*(x[ 9]-x[22]);
|
||||
pa=hcos_64[10]*(x[10]-x[21]);pb=hcos_64[11]*(x[11]-x[20]);
|
||||
pc=hcos_64[12]*(x[12]-x[19]);pd=hcos_64[13]*(x[13]-x[18]);
|
||||
pe=hcos_64[14]*(x[14]-x[17]);pf=hcos_64[15]*(x[15]-x[16]);
|
||||
}
|
||||
|
||||
// put to 48..63
|
||||
q0=p0+pf;q1=p1+pe;q2=p2+pd;q3=p3+pc;
|
||||
q4=p4+pb;q5=p5+pa;q6=p6+p9;q7=p7+p8;
|
||||
q8=hcos_32[0]*(p0-pf);q9=hcos_32[1]*(p1-pe);
|
||||
qa=hcos_32[2]*(p2-pd);qb=hcos_32[3]*(p3-pc);
|
||||
qc=hcos_32[4]*(p4-pb);qd=hcos_32[5]*(p5-pa);
|
||||
qe=hcos_32[6]*(p6-p9);qf=hcos_32[7]*(p7-p8);
|
||||
|
||||
p0=q0+q7;p1=q1+q6;p2=q2+q5;p3=q3+q4;
|
||||
p4=hcos_16[0]*(q0-q7);p5=hcos_16[1]*(q1-q6);
|
||||
p6=hcos_16[2]*(q2-q5);p7=hcos_16[3]*(q3-q4);
|
||||
p8=q8+qf;p9=q9+qe;pa=qa+qd;pb=qb+qc;
|
||||
pc=hcos_16[0]*(q8-qf);pd=hcos_16[1]*(q9-qe);
|
||||
pe=hcos_16[2]*(qa-qd);pf=hcos_16[3]*(qb-qc);
|
||||
|
||||
q0=p0+p3;q1=p1+p2;q2=hcos_8[0]*(p0-p3);q3=hcos_8[1]*(p1-p2);
|
||||
q4=p4+p7;q5=p5+p6;q6=hcos_8[0]*(p4-p7);q7=hcos_8[1]*(p5-p6);
|
||||
q8=p8+pb;q9=p9+pa;qa=hcos_8[0]*(p8-pb);qb=hcos_8[1]*(p9-pa);
|
||||
qc=pc+pf;qd=pd+pe;qe=hcos_8[0]*(pc-pf);qf=hcos_8[1]*(pd-pe);
|
||||
|
||||
p0=q0+q1;p1=hcos_4*(q0-q1);
|
||||
p2=q2+q3;p3=hcos_4*(q2-q3);
|
||||
p4=q4+q5;p5=hcos_4*(q4-q5);
|
||||
p6=q6+q7;p7=hcos_4*(q6-q7);
|
||||
p8=q8+q9;p9=hcos_4*(q8-q9);
|
||||
pa=qa+qb;pb=hcos_4*(qa-qb);
|
||||
pc=qc+qd;pd=hcos_4*(qc-qd);
|
||||
pe=qe+qf;pf=hcos_4*(qe-qf);
|
||||
|
||||
{
|
||||
REAL tmp;
|
||||
|
||||
tmp=pd+pf;
|
||||
OUT1(5,p5+p7+pb+tmp);
|
||||
tmp+=p9;
|
||||
OUT1(1,p1+tmp);
|
||||
OUT2(33)=-(p1+pe+tmp);
|
||||
tmp+=p5+p7;
|
||||
OUT1(3,tmp);
|
||||
OUT2(35)=-(p6+pe+tmp);
|
||||
tmp=pa+pb+pc+pd+pe+pf;
|
||||
OUT2(39)=-(p2+p3+tmp-pc);
|
||||
OUT2(43)=-(p4+p6+p7+tmp-pd);
|
||||
OUT2(37)=-(p5+p6+p7+tmp-pc);
|
||||
OUT2(41)=-(p2+p3+tmp-pd);
|
||||
tmp=p8+pc+pe+pf;
|
||||
OUT2(47)=-(p0+tmp);
|
||||
OUT2(45)=-(p4+p6+p7+tmp);
|
||||
tmp=pb+pf;
|
||||
OUT1(11,p7+tmp);
|
||||
tmp+=p3;
|
||||
OUT1( 9,tmp);
|
||||
OUT1( 7,pd+tmp);
|
||||
OUT1(13,p7+pf);
|
||||
OUT1(15,pf);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,215 +0,0 @@
|
|||
/*
|
||||
wrapper for dcts
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - added some explicit casts to remove compilation warnings
|
||||
|
||||
#include "common.h"
|
||||
#include "dct.h"
|
||||
|
||||
|
||||
ATTR_ALIGN(64) static REAL hcos_64_down[16];
|
||||
ATTR_ALIGN(64) static REAL hcos_32_down[8];
|
||||
ATTR_ALIGN(64) static REAL hcos_16_down[4];
|
||||
ATTR_ALIGN(64) static REAL hcos_8_down[2];
|
||||
ATTR_ALIGN(64) static REAL hcos_4_down;
|
||||
|
||||
/**
|
||||
This was some time ago a standalone dct class,
|
||||
but to get more speed I made it an inline dct
|
||||
int the filter classes
|
||||
*/
|
||||
|
||||
static int dctInit=false;
|
||||
|
||||
void initialize_dct64_downsample() {
|
||||
if (dctInit) {
|
||||
return;
|
||||
}
|
||||
dctInit=true;
|
||||
|
||||
int i;
|
||||
|
||||
for(i=0;i<16;i++) {
|
||||
hcos_64_down[i]=(REAL)(1.0/(2.0*cos(MY_PI*double(i*2+1)/64.0)));
|
||||
}
|
||||
for(i=0;i< 8;i++) {
|
||||
hcos_32_down[i]=(REAL)(1.0/(2.0*cos(MY_PI*double(i*2+1)/32.0)));
|
||||
}
|
||||
for(i=0;i< 4;i++) {
|
||||
hcos_16_down[i]=(REAL)(1.0/(2.0*cos(MY_PI*double(i*2+1)/16.0)));
|
||||
}
|
||||
for(i=0;i< 2;i++) {
|
||||
hcos_8_down[i]=(REAL)(1.0/(2.0*cos(MY_PI*double(i*2+1)/ 8.0)));
|
||||
}
|
||||
hcos_4_down=(REAL)(1.0/(2.0*cos(MY_PI*1.0/4.0)));
|
||||
|
||||
}
|
||||
|
||||
void dct64_downsample(REAL* out1,REAL* out2,REAL *fraction) {
|
||||
REAL p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,pa,pb,pc,pd,pe,pf;
|
||||
REAL q0,q1,q2,q3,q4,q5,q6,q7,q8,q9,qa,qb,qc,qd,qe,qf;
|
||||
|
||||
#define OUT1(v,t) out1[(32-(v))*16] =(-(out1[(v)*16]=t))
|
||||
#define OUT2(v) out2[(96-(v)-32)*16]=out2[((v)-32)*16]
|
||||
|
||||
// compute new values via a fast cosine transform:
|
||||
/* {
|
||||
register REAL *x=fraction;
|
||||
|
||||
p0=x[ 0]+x[31];p1=x[ 1]+x[30];p2=x[ 2]+x[29];p3=x[ 3]+x[28];
|
||||
p4=x[ 4]+x[27];p5=x[ 5]+x[26];p6=x[ 6]+x[25];p7=x[ 7]+x[24];
|
||||
p8=x[ 8]+x[23];p9=x[ 9]+x[22];pa=x[10]+x[21];pb=x[11]+x[20];
|
||||
pc=x[12]+x[19];pd=x[13]+x[18];pe=x[14]+x[17];pf=x[15]+x[16];
|
||||
}
|
||||
|
||||
q0=p0+pf;q1=p1+pe;q2=p2+pd;q3=p3+pc;
|
||||
q4=p4+pb;q5=p5+pa;q6=p6+p9;q7=p7+p8;
|
||||
q8=hcos_32_down[0]*(p0-pf);q9=hcos_32_down[1]*(p1-pe);
|
||||
qa=hcos_32_down[2]*(p2-pd);qb=hcos_32_down[3]*(p3-pc);
|
||||
qc=hcos_32_down[4]*(p4-pb);qd=hcos_32_down[5]*(p5-pa);
|
||||
qe=hcos_32_down[6]*(p6-p9);qf=hcos_32_down[7]*(p7-p8); */
|
||||
|
||||
{
|
||||
|
||||
register REAL *x=fraction;
|
||||
|
||||
q0=x[ 0]+x[15];q1=x[ 1]+x[14];q2=x[ 2]+x[13];q3=x[ 3]+x[12];
|
||||
q4=x[ 4]+x[11];q5=x[ 5]+x[10];q6=x[ 6]+x[ 9];q7=x[ 7]+x[ 8];
|
||||
|
||||
q8=hcos_32_down[0]*(x[ 0]-x[15]);q9=hcos_32_down[1]*(x[ 1]-x[14]);
|
||||
qa=hcos_32_down[2]*(x[ 2]-x[13]);qb=hcos_32_down[3]*(x[ 3]-x[12]);
|
||||
qc=hcos_32_down[4]*(x[ 4]-x[11]);qd=hcos_32_down[5]*(x[ 5]-x[10]);
|
||||
qe=hcos_32_down[6]*(x[ 6]-x[ 9]);qf=hcos_32_down[7]*(x[ 7]-x[ 8]);
|
||||
}
|
||||
|
||||
p0=q0+q7;p1=q1+q6;p2=q2+q5;p3=q3+q4;
|
||||
p4=hcos_16_down[0]*(q0-q7);p5=hcos_16_down[1]*(q1-q6);
|
||||
p6=hcos_16_down[2]*(q2-q5);p7=hcos_16_down[3]*(q3-q4);
|
||||
p8=q8+qf;p9=q9+qe;pa=qa+qd;pb=qb+qc;
|
||||
pc=hcos_16_down[0]*(q8-qf);pd=hcos_16_down[1]*(q9-qe);
|
||||
pe=hcos_16_down[2]*(qa-qd);pf=hcos_16_down[3]*(qb-qc);
|
||||
|
||||
q0=p0+p3;q1=p1+p2;q2=hcos_8_down[0]*(p0-p3);q3=hcos_8_down[1]*(p1-p2);
|
||||
q4=p4+p7;q5=p5+p6;q6=hcos_8_down[0]*(p4-p7);q7=hcos_8_down[1]*(p5-p6);
|
||||
q8=p8+pb;q9=p9+pa;qa=hcos_8_down[0]*(p8-pb);qb=hcos_8_down[1]*(p9-pa);
|
||||
qc=pc+pf;qd=pd+pe;qe=hcos_8_down[0]*(pc-pf);qf=hcos_8_down[1]*(pd-pe);
|
||||
|
||||
p0=q0+q1;p1=hcos_4_down*(q0-q1);p2=q2+q3;p3=hcos_4_down*(q2-q3);
|
||||
p4=q4+q5;p5=hcos_4_down*(q4-q5);p6=q6+q7;p7=hcos_4_down*(q6-q7);
|
||||
p8=q8+q9;p9=hcos_4_down*(q8-q9);pa=qa+qb;pb=hcos_4_down*(qa-qb);
|
||||
pc=qc+qd;pd=hcos_4_down*(qc-qd);pe=qe+qf;pf=hcos_4_down*(qe-qf);
|
||||
|
||||
{
|
||||
register REAL tmp;
|
||||
|
||||
tmp=p6+p7;
|
||||
OUT2(36)=-(p5+tmp);
|
||||
OUT2(44)=-(p4+tmp);
|
||||
tmp=pb+pf;
|
||||
OUT1(10,tmp);
|
||||
OUT1(6,pd+tmp);
|
||||
tmp=pe+pf;
|
||||
OUT2(46)=-(p8+pc+tmp);
|
||||
OUT2(34)=-(p9+pd+tmp);
|
||||
tmp+=pa+pb;
|
||||
OUT2(38)=-(pd+tmp);
|
||||
OUT2(42)=-(pc+tmp);
|
||||
OUT1(2,p9+pd+pf);
|
||||
OUT1(4,p5+p7);
|
||||
OUT2(48)=-p0;
|
||||
out2[0]=-(out1[0]=p1);
|
||||
OUT1( 8,p3);
|
||||
OUT1(12,p7);
|
||||
OUT1(14,pf);
|
||||
OUT2(40)=-(p2+p3);
|
||||
}
|
||||
|
||||
{
|
||||
register REAL *x=fraction;
|
||||
|
||||
/* p0=hcos_64_down[ 0]*(x[ 0]-x[31]);p1=hcos_64_down[ 1]*(x[ 1]-x[30]);
|
||||
p2=hcos_64_down[ 2]*(x[ 2]-x[29]);p3=hcos_64_down[ 3]*(x[ 3]-x[28]);
|
||||
p4=hcos_64_down[ 4]*(x[ 4]-x[27]);p5=hcos_64_down[ 5]*(x[ 5]-x[26]);
|
||||
p6=hcos_64_down[ 6]*(x[ 6]-x[25]);p7=hcos_64_down[ 7]*(x[ 7]-x[24]);
|
||||
p8=hcos_64_down[ 8]*(x[ 8]-x[23]);p9=hcos_64_down[ 9]*(x[ 9]-x[22]);
|
||||
pa=hcos_64_down[10]*(x[10]-x[21]);pb=hcos_64_down[11]*(x[11]-x[20]);
|
||||
pc=hcos_64_down[12]*(x[12]-x[19]);pd=hcos_64_down[13]*(x[13]-x[18]);
|
||||
pe=hcos_64_down[14]*(x[14]-x[17]);pf=hcos_64_down[15]*(x[15]-x[16]); */
|
||||
|
||||
p0=hcos_64_down[ 0]*x[ 0];p1=hcos_64_down[ 1]*x[ 1];
|
||||
p2=hcos_64_down[ 2]*x[ 2];p3=hcos_64_down[ 3]*x[ 3];
|
||||
p4=hcos_64_down[ 4]*x[ 4];p5=hcos_64_down[ 5]*x[ 5];
|
||||
p6=hcos_64_down[ 6]*x[ 6];p7=hcos_64_down[ 7]*x[ 7];
|
||||
p8=hcos_64_down[ 8]*x[ 8];p9=hcos_64_down[ 9]*x[ 9];
|
||||
pa=hcos_64_down[10]*x[10];pb=hcos_64_down[11]*x[11];
|
||||
pc=hcos_64_down[12]*x[12];pd=hcos_64_down[13]*x[13];
|
||||
pe=hcos_64_down[14]*x[14];pf=hcos_64_down[15]*x[15];
|
||||
}
|
||||
|
||||
q0=p0+pf;q1=p1+pe;q2=p2+pd;q3=p3+pc;
|
||||
q4=p4+pb;q5=p5+pa;q6=p6+p9;q7=p7+p8;
|
||||
q8=hcos_32_down[0]*(p0-pf);q9=hcos_32_down[1]*(p1-pe);
|
||||
qa=hcos_32_down[2]*(p2-pd);qb=hcos_32_down[3]*(p3-pc);
|
||||
qc=hcos_32_down[4]*(p4-pb);qd=hcos_32_down[5]*(p5-pa);
|
||||
qe=hcos_32_down[6]*(p6-p9);qf=hcos_32_down[7]*(p7-p8);
|
||||
|
||||
p0=q0+q7;p1=q1+q6;p2=q2+q5;p3=q3+q4;
|
||||
p4=hcos_16_down[0]*(q0-q7);p5=hcos_16_down[1]*(q1-q6);
|
||||
p6=hcos_16_down[2]*(q2-q5);p7=hcos_16_down[3]*(q3-q4);
|
||||
p8=q8+qf;p9=q9+qe;pa=qa+qd;pb=qb+qc;
|
||||
pc=hcos_16_down[0]*(q8-qf);pd=hcos_16_down[1]*(q9-qe);
|
||||
pe=hcos_16_down[2]*(qa-qd);pf=hcos_16_down[3]*(qb-qc);
|
||||
|
||||
q0=p0+p3;q1=p1+p2;q2=hcos_8_down[0]*(p0-p3);q3=hcos_8_down[1]*(p1-p2);
|
||||
q4=p4+p7;q5=p5+p6;q6=hcos_8_down[0]*(p4-p7);q7=hcos_8_down[1]*(p5-p6);
|
||||
q8=p8+pb;q9=p9+pa;qa=hcos_8_down[0]*(p8-pb);qb=hcos_8_down[1]*(p9-pa);
|
||||
qc=pc+pf;qd=pd+pe;qe=hcos_8_down[0]*(pc-pf);qf=hcos_8_down[1]*(pd-pe);
|
||||
|
||||
p0=q0+q1;p1=hcos_4_down*(q0-q1);
|
||||
p2=q2+q3;p3=hcos_4_down*(q2-q3);
|
||||
p4=q4+q5;p5=hcos_4_down*(q4-q5);
|
||||
p6=q6+q7;p7=hcos_4_down*(q6-q7);
|
||||
p8=q8+q9;p9=hcos_4_down*(q8-q9);
|
||||
pa=qa+qb;pb=hcos_4_down*(qa-qb);
|
||||
pc=qc+qd;pd=hcos_4_down*(qc-qd);
|
||||
pe=qe+qf;pf=hcos_4_down*(qe-qf);
|
||||
|
||||
{
|
||||
REAL tmp;
|
||||
|
||||
tmp=pd+pf;
|
||||
OUT1(5,p5+p7+pb+tmp);
|
||||
tmp+=p9;
|
||||
OUT1(1,p1+tmp);
|
||||
OUT2(33)=-(p1+pe+tmp);
|
||||
tmp+=p5+p7;
|
||||
OUT1(3,tmp);
|
||||
OUT2(35)=-(p6+pe+tmp);
|
||||
tmp=pa+pb+pc+pd+pe+pf;
|
||||
OUT2(39)=-(p2+p3+tmp-pc);
|
||||
OUT2(43)=-(p4+p6+p7+tmp-pd);
|
||||
OUT2(37)=-(p5+p6+p7+tmp-pc);
|
||||
OUT2(41)=-(p2+p3+tmp-pd);
|
||||
tmp=p8+pc+pe+pf;
|
||||
OUT2(47)=-(p0+tmp);
|
||||
OUT2(45)=-(p4+p6+p7+tmp);
|
||||
tmp=pb+pf;
|
||||
OUT1(11,p7+tmp);
|
||||
tmp+=p3;
|
||||
OUT1( 9,tmp);
|
||||
OUT1( 7,pd+tmp);
|
||||
OUT1(13,p7+pf);
|
||||
OUT1(15,pf);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
/*
|
||||
|
||||
Copyright (C) 2000 Stefan Westerfeld
|
||||
stefan@space.twc.de
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/11/2002 (by Hauke Duden):
|
||||
// - removed unnecessary includes
|
||||
|
||||
#include "huffmanlookup.h"
|
||||
|
||||
//#include <assert.h>
|
||||
|
||||
|
||||
|
||||
|
||||
struct HuffmanLookup::decodeData HuffmanLookup::qdecode[32][256];
|
||||
/* for initialization */
|
||||
static HuffmanLookup l;
|
||||
|
||||
HuffmanLookup::HuffmanLookup()
|
||||
{
|
||||
int table,p,x,y;
|
||||
|
||||
for(table = 0; table < 32; table++)
|
||||
{
|
||||
// 8 bits pattern
|
||||
for(p = 0; p < 256; p++)
|
||||
{
|
||||
bits = 24;
|
||||
pattern = (p << 16);
|
||||
|
||||
huffmandecoder_1(&Mpegtoraw::ht[table], &x,&y);
|
||||
|
||||
int used = 24 - bits;
|
||||
qdecode[table][p].skip = (used <= 8)?used:0;
|
||||
qdecode[table][p].x = x;
|
||||
qdecode[table][p].y = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int HuffmanLookup::wgetbit()
|
||||
{
|
||||
return (pattern >> --bits) & 1;
|
||||
}
|
||||
|
||||
int HuffmanLookup::wgetbits (int b)
|
||||
{
|
||||
bits -= b;
|
||||
return (pattern >> bits) & ((1 << b) - 1);
|
||||
}
|
||||
|
||||
void HuffmanLookup::huffmandecoder_1(const HUFFMANCODETABLE *h, int *x, int *y)
|
||||
{
|
||||
typedef unsigned int HUFFBITS;
|
||||
|
||||
HUFFBITS level=(1<<(sizeof(HUFFBITS)*8-1));
|
||||
int point=0;
|
||||
/* Lookup in Huffman table. */
|
||||
for(;;)
|
||||
{
|
||||
if(h->val[point][0]==0)
|
||||
{ /*end of tree*/
|
||||
int xx,yy;
|
||||
|
||||
xx=h->val[point][1]>>4;
|
||||
yy=h->val[point][1]&0xf;
|
||||
|
||||
if(h->linbits)
|
||||
{
|
||||
if((h->xlen)==(unsigned)xx)xx+=wgetbits(h->linbits);
|
||||
if(xx)if(wgetbit())xx=-xx;
|
||||
if((h->ylen)==(unsigned)yy)yy+=wgetbits(h->linbits);
|
||||
if(yy)if(wgetbit())yy=-yy;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(xx)if(wgetbit())xx=-xx;
|
||||
if(yy)if(wgetbit())yy=-yy;
|
||||
}
|
||||
*x=xx;*y=yy;
|
||||
break;
|
||||
}
|
||||
|
||||
point+=h->val[point][wgetbit()];
|
||||
|
||||
level>>=1;
|
||||
if(!(level || ((unsigned)point<Mpegtoraw::ht->treelen)))
|
||||
{
|
||||
register int xx,yy;
|
||||
|
||||
xx=(h->xlen<<1);// set x and y to a medium value as a simple concealment
|
||||
yy=(h->ylen<<1);
|
||||
|
||||
// h->xlen and h->ylen can't be 1 under tablename 32
|
||||
// if(xx)
|
||||
if(wgetbit())xx=-xx;
|
||||
// if(yy)
|
||||
if(wgetbit())yy=-yy;
|
||||
|
||||
*x=xx;*y=yy;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
|
||||
Copyright (C) 2000 Stefan Westerfeld
|
||||
stefan@space.twc.de
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __HUFFMANLOOKUP_H
|
||||
#define __HUFFMANLOOKUP_H
|
||||
#include "mpegsound.h"
|
||||
|
||||
/*
|
||||
* This class speeds up the huffman table decoding by largely replacing it
|
||||
* by a table lookup. It uses the fact that the huffman tables don't change,
|
||||
* and that given a byte of the bitstream, we can predict what the result
|
||||
* will be (without reading it bit by bit).
|
||||
*/
|
||||
|
||||
class HuffmanLookup {
|
||||
private:
|
||||
long pattern, bits;
|
||||
int wgetbit();
|
||||
int wgetbits (int b);
|
||||
void huffmandecoder_1(const HUFFMANCODETABLE *h,int *x, int *y);
|
||||
|
||||
ATTR_ALIGN(64) static struct decodeData {
|
||||
int x : 8;
|
||||
int y : 8;
|
||||
int skip : 16;
|
||||
} qdecode[32][256];
|
||||
public:
|
||||
HuffmanLookup();
|
||||
|
||||
static int decode(int table, int pattern, int* x, int* y)
|
||||
{
|
||||
*x = qdecode[table][pattern].x;
|
||||
*y = qdecode[table][pattern].y;
|
||||
return qdecode[table][pattern].skip;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,584 +0,0 @@
|
|||
/* MPEG/WAVE Sound library
|
||||
|
||||
(C) 1997 by Jung woo-jae */
|
||||
|
||||
// Huffmantable.cc
|
||||
// It contains initialized huffman table for MPEG layer 3
|
||||
|
||||
|
||||
#include "mpegsound.h"
|
||||
|
||||
static const unsigned int
|
||||
htd01[ 7][2]={{ 2, 1},{ 0, 0},{ 2, 1},{ 0, 16},{ 2, 1},{ 0, 1},
|
||||
{ 0, 17}},
|
||||
|
||||
htd02[ 17][2]={{ 2, 1},{ 0, 0},{ 4, 1},{ 2, 1},{ 0, 16},{ 0, 1},
|
||||
{ 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 32},{ 0, 33},
|
||||
{ 2, 1},{ 0, 18},{ 2, 1},{ 0, 2},{ 0, 34}},
|
||||
|
||||
htd03[ 17][2]={{ 4, 1},{ 2, 1},{ 0, 0},{ 0, 1},{ 2, 1},{ 0, 17},
|
||||
{ 2, 1},{ 0, 16},{ 4, 1},{ 2, 1},{ 0, 32},{ 0, 33},
|
||||
{ 2, 1},{ 0, 18},{ 2, 1},{ 0, 2},{ 0, 34}},
|
||||
|
||||
htd05[ 31][2]={{ 2, 1},{ 0, 0},{ 4, 1},{ 2, 1},{ 0, 16},{ 0, 1},
|
||||
{ 2, 1},{ 0, 17},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 32},
|
||||
{ 0, 2},{ 2, 1},{ 0, 33},{ 0, 18},{ 8, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0, 34},{ 0, 48},{ 2, 1},{ 0, 3},{ 0, 19},
|
||||
{ 2, 1},{ 0, 49},{ 2, 1},{ 0, 50},{ 2, 1},{ 0, 35},
|
||||
{ 0, 51}},
|
||||
|
||||
htd06[ 31][2]={{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 0},{ 0, 16},{ 0, 17},
|
||||
{ 6, 1},{ 2, 1},{ 0, 1},{ 2, 1},{ 0, 32},{ 0, 33},
|
||||
{ 6, 1},{ 2, 1},{ 0, 18},{ 2, 1},{ 0, 2},{ 0, 34},
|
||||
{ 4, 1},{ 2, 1},{ 0, 49},{ 0, 19},{ 4, 1},{ 2, 1},
|
||||
{ 0, 48},{ 0, 50},{ 2, 1},{ 0, 35},{ 2, 1},{ 0, 3},
|
||||
{ 0, 51}},
|
||||
|
||||
htd07[ 71][2]={{ 2, 1},{ 0, 0},{ 4, 1},{ 2, 1},{ 0, 16},{ 0, 1},
|
||||
{ 8, 1},{ 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 32},
|
||||
{ 0, 2},{ 0, 33},{ 18, 1},{ 6, 1},{ 2, 1},{ 0, 18},
|
||||
{ 2, 1},{ 0, 34},{ 0, 48},{ 4, 1},{ 2, 1},{ 0, 49},
|
||||
{ 0, 19},{ 4, 1},{ 2, 1},{ 0, 3},{ 0, 50},{ 2, 1},
|
||||
{ 0, 35},{ 0, 4},{ 10, 1},{ 4, 1},{ 2, 1},{ 0, 64},
|
||||
{ 0, 65},{ 2, 1},{ 0, 20},{ 2, 1},{ 0, 66},{ 0, 36},
|
||||
{ 12, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 51},{ 0, 67},
|
||||
{ 0, 80},{ 4, 1},{ 2, 1},{ 0, 52},{ 0, 5},{ 0, 81},
|
||||
{ 6, 1},{ 2, 1},{ 0, 21},{ 2, 1},{ 0, 82},{ 0, 37},
|
||||
|
||||
{ 4, 1},{ 2, 1},{ 0, 68},{ 0, 53},{ 4, 1},{ 2, 1},
|
||||
{ 0, 83},{ 0, 84},{ 2, 1},{ 0, 69},{ 0, 85}},
|
||||
|
||||
htd08[ 71][2]={{ 6, 1},{ 2, 1},{ 0, 0},{ 2, 1},{ 0, 16},{ 0, 1},
|
||||
{ 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 33},{ 0, 18},
|
||||
{ 14, 1},{ 4, 1},{ 2, 1},{ 0, 32},{ 0, 2},{ 2, 1},
|
||||
{ 0, 34},{ 4, 1},{ 2, 1},{ 0, 48},{ 0, 3},{ 2, 1},
|
||||
{ 0, 49},{ 0, 19},{ 14, 1},{ 8, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0, 50},{ 0, 35},{ 2, 1},{ 0, 64},{ 0, 4},{ 2, 1},
|
||||
{ 0, 65},{ 2, 1},{ 0, 20},{ 0, 66},{ 12, 1},{ 6, 1},
|
||||
{ 2, 1},{ 0, 36},{ 2, 1},{ 0, 51},{ 0, 80},{ 4, 1},
|
||||
{ 2, 1},{ 0, 67},{ 0, 52},{ 0, 81},{ 6, 1},{ 2, 1},
|
||||
{ 0, 21},{ 2, 1},{ 0, 5},{ 0, 82},{ 6, 1},{ 2, 1},
|
||||
|
||||
{ 0, 37},{ 2, 1},{ 0, 68},{ 0, 53},{ 2, 1},{ 0, 83},
|
||||
{ 2, 1},{ 0, 69},{ 2, 1},{ 0, 84},{ 0, 85}},
|
||||
|
||||
htd09[ 71][2]={{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 0},{ 0, 16},{ 2, 1},
|
||||
{ 0, 1},{ 0, 17},{ 10, 1},{ 4, 1},{ 2, 1},{ 0, 32},
|
||||
{ 0, 33},{ 2, 1},{ 0, 18},{ 2, 1},{ 0, 2},{ 0, 34},
|
||||
{ 12, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 48},{ 0, 3},
|
||||
{ 0, 49},{ 2, 1},{ 0, 19},{ 2, 1},{ 0, 50},{ 0, 35},
|
||||
{ 12, 1},{ 4, 1},{ 2, 1},{ 0, 65},{ 0, 20},{ 4, 1},
|
||||
{ 2, 1},{ 0, 64},{ 0, 51},{ 2, 1},{ 0, 66},{ 0, 36},
|
||||
{ 10, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 4},{ 0, 80},
|
||||
{ 0, 67},{ 2, 1},{ 0, 52},{ 0, 81},{ 8, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0, 21},{ 0, 82},{ 2, 1},{ 0, 37},{ 0, 68},
|
||||
|
||||
{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 5},{ 0, 84},{ 0, 83},
|
||||
{ 2, 1},{ 0, 53},{ 2, 1},{ 0, 69},{ 0, 85}},
|
||||
|
||||
htd10[127][2]={{ 2, 1},{ 0, 0},{ 4, 1},{ 2, 1},{ 0, 16},{ 0, 1},
|
||||
{ 10, 1},{ 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 32},
|
||||
{ 0, 2},{ 2, 1},{ 0, 33},{ 0, 18},{ 28, 1},{ 8, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0, 34},{ 0, 48},{ 2, 1},{ 0, 49},
|
||||
{ 0, 19},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 3},{ 0, 50},
|
||||
{ 2, 1},{ 0, 35},{ 0, 64},{ 4, 1},{ 2, 1},{ 0, 65},
|
||||
{ 0, 20},{ 4, 1},{ 2, 1},{ 0, 4},{ 0, 51},{ 2, 1},
|
||||
{ 0, 66},{ 0, 36},{ 28, 1},{ 10, 1},{ 6, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0, 80},{ 0, 5},{ 0, 96},{ 2, 1},{ 0, 97},
|
||||
{ 0, 22},{ 12, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 67},
|
||||
|
||||
{ 0, 52},{ 0, 81},{ 2, 1},{ 0, 21},{ 2, 1},{ 0, 82},
|
||||
{ 0, 37},{ 4, 1},{ 2, 1},{ 0, 38},{ 0, 54},{ 0,113},
|
||||
{ 20, 1},{ 8, 1},{ 2, 1},{ 0, 23},{ 4, 1},{ 2, 1},
|
||||
{ 0, 68},{ 0, 83},{ 0, 6},{ 6, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0, 53},{ 0, 69},{ 0, 98},{ 2, 1},{ 0,112},{ 2, 1},
|
||||
{ 0, 7},{ 0,100},{ 14, 1},{ 4, 1},{ 2, 1},{ 0,114},
|
||||
{ 0, 39},{ 6, 1},{ 2, 1},{ 0, 99},{ 2, 1},{ 0, 84},
|
||||
{ 0, 85},{ 2, 1},{ 0, 70},{ 0,115},{ 8, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0, 55},{ 0,101},{ 2, 1},{ 0, 86},{ 0,116},
|
||||
{ 6, 1},{ 2, 1},{ 0, 71},{ 2, 1},{ 0,102},{ 0,117},
|
||||
|
||||
{ 4, 1},{ 2, 1},{ 0, 87},{ 0,118},{ 2, 1},{ 0,103},
|
||||
{ 0,119}},
|
||||
|
||||
htd11[127][2]={{ 6, 1},{ 2, 1},{ 0, 0},{ 2, 1},{ 0, 16},{ 0, 1},
|
||||
{ 8, 1},{ 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 32},
|
||||
{ 0, 2},{ 0, 18},{ 24, 1},{ 8, 1},{ 2, 1},{ 0, 33},
|
||||
{ 2, 1},{ 0, 34},{ 2, 1},{ 0, 48},{ 0, 3},{ 4, 1},
|
||||
{ 2, 1},{ 0, 49},{ 0, 19},{ 4, 1},{ 2, 1},{ 0, 50},
|
||||
{ 0, 35},{ 4, 1},{ 2, 1},{ 0, 64},{ 0, 4},{ 2, 1},
|
||||
{ 0, 65},{ 0, 20},{ 30, 1},{ 16, 1},{ 10, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0, 66},{ 0, 36},{ 4, 1},{ 2, 1},{ 0, 51},
|
||||
{ 0, 67},{ 0, 80},{ 4, 1},{ 2, 1},{ 0, 52},{ 0, 81},
|
||||
{ 0, 97},{ 6, 1},{ 2, 1},{ 0, 22},{ 2, 1},{ 0, 6},
|
||||
|
||||
{ 0, 38},{ 2, 1},{ 0, 98},{ 2, 1},{ 0, 21},{ 2, 1},
|
||||
{ 0, 5},{ 0, 82},{ 16, 1},{ 10, 1},{ 6, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0, 37},{ 0, 68},{ 0, 96},{ 2, 1},{ 0, 99},
|
||||
{ 0, 54},{ 4, 1},{ 2, 1},{ 0,112},{ 0, 23},{ 0,113},
|
||||
{ 16, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 7},{ 0,100},
|
||||
{ 0,114},{ 2, 1},{ 0, 39},{ 4, 1},{ 2, 1},{ 0, 83},
|
||||
{ 0, 53},{ 2, 1},{ 0, 84},{ 0, 69},{ 10, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0, 70},{ 0,115},{ 2, 1},{ 0, 55},{ 2, 1},
|
||||
{ 0,101},{ 0, 86},{ 10, 1},{ 6, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0, 85},{ 0, 87},{ 0,116},{ 2, 1},{ 0, 71},{ 0,102},
|
||||
|
||||
{ 4, 1},{ 2, 1},{ 0,117},{ 0,118},{ 2, 1},{ 0,103},
|
||||
{ 0,119}},
|
||||
|
||||
htd12[127][2]={{ 12, 1},{ 4, 1},{ 2, 1},{ 0, 16},{ 0, 1},{ 2, 1},
|
||||
{ 0, 17},{ 2, 1},{ 0, 0},{ 2, 1},{ 0, 32},{ 0, 2},
|
||||
{ 16, 1},{ 4, 1},{ 2, 1},{ 0, 33},{ 0, 18},{ 4, 1},
|
||||
{ 2, 1},{ 0, 34},{ 0, 49},{ 2, 1},{ 0, 19},{ 2, 1},
|
||||
{ 0, 48},{ 2, 1},{ 0, 3},{ 0, 64},{ 26, 1},{ 8, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0, 50},{ 0, 35},{ 2, 1},{ 0, 65},
|
||||
{ 0, 51},{ 10, 1},{ 4, 1},{ 2, 1},{ 0, 20},{ 0, 66},
|
||||
{ 2, 1},{ 0, 36},{ 2, 1},{ 0, 4},{ 0, 80},{ 4, 1},
|
||||
{ 2, 1},{ 0, 67},{ 0, 52},{ 2, 1},{ 0, 81},{ 0, 21},
|
||||
{ 28, 1},{ 14, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 82},
|
||||
|
||||
{ 0, 37},{ 2, 1},{ 0, 83},{ 0, 53},{ 4, 1},{ 2, 1},
|
||||
{ 0, 96},{ 0, 22},{ 0, 97},{ 4, 1},{ 2, 1},{ 0, 98},
|
||||
{ 0, 38},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 5},{ 0, 6},
|
||||
{ 0, 68},{ 2, 1},{ 0, 84},{ 0, 69},{ 18, 1},{ 10, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0, 99},{ 0, 54},{ 4, 1},{ 2, 1},
|
||||
{ 0,112},{ 0, 7},{ 0,113},{ 4, 1},{ 2, 1},{ 0, 23},
|
||||
{ 0,100},{ 2, 1},{ 0, 70},{ 0,114},{ 10, 1},{ 6, 1},
|
||||
{ 2, 1},{ 0, 39},{ 2, 1},{ 0, 85},{ 0,115},{ 2, 1},
|
||||
{ 0, 55},{ 0, 86},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,101},
|
||||
{ 0,116},{ 2, 1},{ 0, 71},{ 0,102},{ 4, 1},{ 2, 1},
|
||||
|
||||
{ 0,117},{ 0, 87},{ 2, 1},{ 0,118},{ 2, 1},{ 0,103},
|
||||
{ 0,119}},
|
||||
|
||||
htd13[511][2]={{ 2, 1},{ 0, 0},{ 6, 1},{ 2, 1},{ 0, 16},{ 2, 1},
|
||||
{ 0, 1},{ 0, 17},{ 28, 1},{ 8, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0, 32},{ 0, 2},{ 2, 1},{ 0, 33},{ 0, 18},{ 8, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0, 34},{ 0, 48},{ 2, 1},{ 0, 3},
|
||||
{ 0, 49},{ 6, 1},{ 2, 1},{ 0, 19},{ 2, 1},{ 0, 50},
|
||||
{ 0, 35},{ 4, 1},{ 2, 1},{ 0, 64},{ 0, 4},{ 0, 65},
|
||||
{ 70, 1},{ 28, 1},{ 14, 1},{ 6, 1},{ 2, 1},{ 0, 20},
|
||||
{ 2, 1},{ 0, 51},{ 0, 66},{ 4, 1},{ 2, 1},{ 0, 36},
|
||||
{ 0, 80},{ 2, 1},{ 0, 67},{ 0, 52},{ 4, 1},{ 2, 1},
|
||||
{ 0, 81},{ 0, 21},{ 4, 1},{ 2, 1},{ 0, 5},{ 0, 82}, // 60
|
||||
|
||||
{ 2, 1},{ 0, 37},{ 2, 1},{ 0, 68},{ 0, 83},{ 14, 1},
|
||||
{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 96},{ 0, 6},{ 2, 1},
|
||||
{ 0, 97},{ 0, 22},{ 4, 1},{ 2, 1},{ 0,128},{ 0, 8},
|
||||
{ 0,129},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 53},
|
||||
{ 0, 98},{ 2, 1},{ 0, 38},{ 0, 84},{ 4, 1},{ 2, 1},
|
||||
{ 0, 69},{ 0, 99},{ 2, 1},{ 0, 54},{ 0,112},{ 6, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0, 7},{ 0, 85},{ 0,113},{ 2, 1},
|
||||
{ 0, 23},{ 2, 1},{ 0, 39},{ 0, 55},{ 72, 1},{ 24, 1},
|
||||
{ 12, 1},{ 4, 1},{ 2, 1},{ 0, 24},{ 0,130},{ 2, 1},
|
||||
{ 0, 40},{ 4, 1},{ 2, 1},{ 0,100},{ 0, 70},{ 0,114}, // 120
|
||||
|
||||
{ 8, 1},{ 4, 1},{ 2, 1},{ 0,132},{ 0, 72},{ 2, 1},
|
||||
{ 0,144},{ 0, 9},{ 2, 1},{ 0,145},{ 0, 25},{ 24, 1},
|
||||
{ 14, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,115},{ 0,101},
|
||||
{ 2, 1},{ 0, 86},{ 0,116},{ 4, 1},{ 2, 1},{ 0, 71},
|
||||
{ 0,102},{ 0,131},{ 6, 1},{ 2, 1},{ 0, 56},{ 2, 1},
|
||||
{ 0,117},{ 0, 87},{ 2, 1},{ 0,146},{ 0, 41},{ 14, 1},
|
||||
{ 8, 1},{ 4, 1},{ 2, 1},{ 0,103},{ 0,133},{ 2, 1},
|
||||
{ 0, 88},{ 0, 57},{ 2, 1},{ 0,147},{ 2, 1},{ 0, 73},
|
||||
{ 0,134},{ 6, 1},{ 2, 1},{ 0,160},{ 2, 1},{ 0,104},
|
||||
{ 0, 10},{ 2, 1},{ 0,161},{ 0, 26},{ 68, 1},{ 24, 1}, // 180
|
||||
|
||||
{ 12, 1},{ 4, 1},{ 2, 1},{ 0,162},{ 0, 42},{ 4, 1},
|
||||
{ 2, 1},{ 0,149},{ 0, 89},{ 2, 1},{ 0,163},{ 0, 58},
|
||||
{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 74},{ 0,150},{ 2, 1},
|
||||
{ 0,176},{ 0, 11},{ 2, 1},{ 0,177},{ 0, 27},{ 20, 1},
|
||||
{ 8, 1},{ 2, 1},{ 0,178},{ 4, 1},{ 2, 1},{ 0,118},
|
||||
{ 0,119},{ 0,148},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,135},
|
||||
{ 0,120},{ 0,164},{ 4, 1},{ 2, 1},{ 0,105},{ 0,165},
|
||||
{ 0, 43},{ 12, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 90},
|
||||
{ 0,136},{ 0,179},{ 2, 1},{ 0, 59},{ 2, 1},{ 0,121},
|
||||
{ 0,166},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,106},{ 0,180}, // 240
|
||||
|
||||
{ 0,192},{ 4, 1},{ 2, 1},{ 0, 12},{ 0,152},{ 0,193},
|
||||
{ 60, 1},{ 22, 1},{ 10, 1},{ 6, 1},{ 2, 1},{ 0, 28},
|
||||
{ 2, 1},{ 0,137},{ 0,181},{ 2, 1},{ 0, 91},{ 0,194},
|
||||
{ 4, 1},{ 2, 1},{ 0, 44},{ 0, 60},{ 4, 1},{ 2, 1},
|
||||
{ 0,182},{ 0,107},{ 2, 1},{ 0,196},{ 0, 76},{ 16, 1},
|
||||
{ 8, 1},{ 4, 1},{ 2, 1},{ 0,168},{ 0,138},{ 2, 1},
|
||||
{ 0,208},{ 0, 13},{ 2, 1},{ 0,209},{ 2, 1},{ 0, 75},
|
||||
{ 2, 1},{ 0,151},{ 0,167},{ 12, 1},{ 6, 1},{ 2, 1},
|
||||
{ 0,195},{ 2, 1},{ 0,122},{ 0,153},{ 4, 1},{ 2, 1},
|
||||
{ 0,197},{ 0, 92},{ 0,183},{ 4, 1},{ 2, 1},{ 0, 29}, // 300
|
||||
|
||||
{ 0,210},{ 2, 1},{ 0, 45},{ 2, 1},{ 0,123},{ 0,211},
|
||||
{ 52, 1},{ 28, 1},{ 12, 1},{ 4, 1},{ 2, 1},{ 0, 61},
|
||||
{ 0,198},{ 4, 1},{ 2, 1},{ 0,108},{ 0,169},{ 2, 1},
|
||||
{ 0,154},{ 0,212},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,184},
|
||||
{ 0,139},{ 2, 1},{ 0, 77},{ 0,199},{ 4, 1},{ 2, 1},
|
||||
{ 0,124},{ 0,213},{ 2, 1},{ 0, 93},{ 0,224},{ 10, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0,225},{ 0, 30},{ 4, 1},{ 2, 1},
|
||||
{ 0, 14},{ 0, 46},{ 0,226},{ 8, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0,227},{ 0,109},{ 2, 1},{ 0,140},{ 0,228},{ 4, 1},
|
||||
{ 2, 1},{ 0,229},{ 0,186},{ 0,240},{ 38, 1},{ 16, 1}, // 360
|
||||
|
||||
{ 4, 1},{ 2, 1},{ 0,241},{ 0, 31},{ 6, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0,170},{ 0,155},{ 0,185},{ 2, 1},{ 0, 62},
|
||||
{ 2, 1},{ 0,214},{ 0,200},{ 12, 1},{ 6, 1},{ 2, 1},
|
||||
{ 0, 78},{ 2, 1},{ 0,215},{ 0,125},{ 2, 1},{ 0,171},
|
||||
{ 2, 1},{ 0, 94},{ 0,201},{ 6, 1},{ 2, 1},{ 0, 15},
|
||||
{ 2, 1},{ 0,156},{ 0,110},{ 2, 1},{ 0,242},{ 0, 47},
|
||||
{ 32, 1},{ 16, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,216},
|
||||
{ 0,141},{ 0, 63},{ 6, 1},{ 2, 1},{ 0,243},{ 2, 1},
|
||||
{ 0,230},{ 0,202},{ 2, 1},{ 0,244},{ 0, 79},{ 8, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0,187},{ 0,172},{ 2, 1},{ 0,231}, // 420
|
||||
|
||||
{ 0,245},{ 4, 1},{ 2, 1},{ 0,217},{ 0,157},{ 2, 1},
|
||||
{ 0, 95},{ 0,232},{ 30, 1},{ 12, 1},{ 6, 1},{ 2, 1},
|
||||
{ 0,111},{ 2, 1},{ 0,246},{ 0,203},{ 4, 1},{ 2, 1},
|
||||
{ 0,188},{ 0,173},{ 0,218},{ 8, 1},{ 2, 1},{ 0,247},
|
||||
{ 4, 1},{ 2, 1},{ 0,126},{ 0,127},{ 0,142},{ 6, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0,158},{ 0,174},{ 0,204},{ 2, 1},
|
||||
{ 0,248},{ 0,143},{ 18, 1},{ 8, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0,219},{ 0,189},{ 2, 1},{ 0,234},{ 0,249},{ 4, 1},
|
||||
{ 2, 1},{ 0,159},{ 0,235},{ 2, 1},{ 0,190},{ 2, 1},
|
||||
{ 0,205},{ 0,250},{ 14, 1},{ 4, 1},{ 2, 1},{ 0,221}, // 480
|
||||
|
||||
{ 0,236},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,233},{ 0,175},
|
||||
{ 0,220},{ 2, 1},{ 0,206},{ 0,251},{ 8, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0,191},{ 0,222},{ 2, 1},{ 0,207},{ 0,238},
|
||||
{ 4, 1},{ 2, 1},{ 0,223},{ 0,239},{ 2, 1},{ 0,255},
|
||||
{ 2, 1},{ 0,237},{ 2, 1},{ 0,253},{ 2, 1},{ 0,252},
|
||||
{ 0,254}},
|
||||
|
||||
htd15[511][2]={{ 16, 1},{ 6, 1},{ 2, 1},{ 0, 0},{ 2, 1},{ 0, 16},
|
||||
{ 0, 1},{ 2, 1},{ 0, 17},{ 4, 1},{ 2, 1},{ 0, 32},
|
||||
{ 0, 2},{ 2, 1},{ 0, 33},{ 0, 18},{ 50, 1},{ 16, 1},
|
||||
{ 6, 1},{ 2, 1},{ 0, 34},{ 2, 1},{ 0, 48},{ 0, 49},
|
||||
{ 6, 1},{ 2, 1},{ 0, 19},{ 2, 1},{ 0, 3},{ 0, 64},
|
||||
{ 2, 1},{ 0, 50},{ 0, 35},{ 14, 1},{ 6, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0, 4},{ 0, 20},{ 0, 65},{ 4, 1},{ 2, 1},
|
||||
{ 0, 51},{ 0, 66},{ 2, 1},{ 0, 36},{ 0, 67},{ 10, 1},
|
||||
{ 6, 1},{ 2, 1},{ 0, 52},{ 2, 1},{ 0, 80},{ 0, 5},
|
||||
{ 2, 1},{ 0, 81},{ 0, 21},{ 4, 1},{ 2, 1},{ 0, 82}, // 60
|
||||
|
||||
{ 0, 37},{ 4, 1},{ 2, 1},{ 0, 68},{ 0, 83},{ 0, 97},
|
||||
{ 90, 1},{ 36, 1},{ 18, 1},{ 10, 1},{ 6, 1},{ 2, 1},
|
||||
{ 0, 53},{ 2, 1},{ 0, 96},{ 0, 6},{ 2, 1},{ 0, 22},
|
||||
{ 0, 98},{ 4, 1},{ 2, 1},{ 0, 38},{ 0, 84},{ 2, 1},
|
||||
{ 0, 69},{ 0, 99},{ 10, 1},{ 6, 1},{ 2, 1},{ 0, 54},
|
||||
{ 2, 1},{ 0,112},{ 0, 7},{ 2, 1},{ 0,113},{ 0, 85},
|
||||
{ 4, 1},{ 2, 1},{ 0, 23},{ 0,100},{ 2, 1},{ 0,114},
|
||||
{ 0, 39},{ 24, 1},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0, 70},{ 0,115},{ 2, 1},{ 0, 55},{ 0,101},{ 4, 1},
|
||||
{ 2, 1},{ 0, 86},{ 0,128},{ 2, 1},{ 0, 8},{ 0,116}, // 120
|
||||
|
||||
{ 4, 1},{ 2, 1},{ 0,129},{ 0, 24},{ 2, 1},{ 0,130},
|
||||
{ 0, 40},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 71},
|
||||
{ 0,102},{ 2, 1},{ 0,131},{ 0, 56},{ 4, 1},{ 2, 1},
|
||||
{ 0,117},{ 0, 87},{ 2, 1},{ 0,132},{ 0, 72},{ 6, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0,144},{ 0, 25},{ 0,145},{ 4, 1},
|
||||
{ 2, 1},{ 0,146},{ 0,118},{ 2, 1},{ 0,103},{ 0, 41},
|
||||
{ 92, 1},{ 36, 1},{ 18, 1},{ 10, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0,133},{ 0, 88},{ 4, 1},{ 2, 1},{ 0, 9},{ 0,119},
|
||||
{ 0,147},{ 4, 1},{ 2, 1},{ 0, 57},{ 0,148},{ 2, 1},
|
||||
{ 0, 73},{ 0,134},{ 10, 1},{ 6, 1},{ 2, 1},{ 0,104}, // 180
|
||||
|
||||
{ 2, 1},{ 0,160},{ 0, 10},{ 2, 1},{ 0,161},{ 0, 26},
|
||||
{ 4, 1},{ 2, 1},{ 0,162},{ 0, 42},{ 2, 1},{ 0,149},
|
||||
{ 0, 89},{ 26, 1},{ 14, 1},{ 6, 1},{ 2, 1},{ 0,163},
|
||||
{ 2, 1},{ 0, 58},{ 0,135},{ 4, 1},{ 2, 1},{ 0,120},
|
||||
{ 0,164},{ 2, 1},{ 0, 74},{ 0,150},{ 6, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0,105},{ 0,176},{ 0,177},{ 4, 1},{ 2, 1},
|
||||
{ 0, 27},{ 0,165},{ 0,178},{ 14, 1},{ 8, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0, 90},{ 0, 43},{ 2, 1},{ 0,136},{ 0,151},
|
||||
{ 2, 1},{ 0,179},{ 2, 1},{ 0,121},{ 0, 59},{ 8, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0,106},{ 0,180},{ 2, 1},{ 0, 75}, // 240
|
||||
|
||||
{ 0,193},{ 4, 1},{ 2, 1},{ 0,152},{ 0,137},{ 2, 1},
|
||||
{ 0, 28},{ 0,181},{ 80, 1},{ 34, 1},{ 16, 1},{ 6, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0, 91},{ 0, 44},{ 0,194},{ 6, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0, 11},{ 0,192},{ 0,166},{ 2, 1},
|
||||
{ 0,167},{ 0,122},{ 10, 1},{ 4, 1},{ 2, 1},{ 0,195},
|
||||
{ 0, 60},{ 4, 1},{ 2, 1},{ 0, 12},{ 0,153},{ 0,182},
|
||||
{ 4, 1},{ 2, 1},{ 0,107},{ 0,196},{ 2, 1},{ 0, 76},
|
||||
{ 0,168},{ 20, 1},{ 10, 1},{ 4, 1},{ 2, 1},{ 0,138},
|
||||
{ 0,197},{ 4, 1},{ 2, 1},{ 0,208},{ 0, 92},{ 0,209},
|
||||
{ 4, 1},{ 2, 1},{ 0,183},{ 0,123},{ 2, 1},{ 0, 29}, // 300
|
||||
|
||||
{ 2, 1},{ 0, 13},{ 0, 45},{ 12, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0,210},{ 0,211},{ 4, 1},{ 2, 1},{ 0, 61},{ 0,198},
|
||||
{ 2, 1},{ 0,108},{ 0,169},{ 6, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0,154},{ 0,184},{ 0,212},{ 4, 1},{ 2, 1},{ 0,139},
|
||||
{ 0, 77},{ 2, 1},{ 0,199},{ 0,124},{ 68, 1},{ 34, 1},
|
||||
{ 18, 1},{ 10, 1},{ 4, 1},{ 2, 1},{ 0,213},{ 0, 93},
|
||||
{ 4, 1},{ 2, 1},{ 0,224},{ 0, 14},{ 0,225},{ 4, 1},
|
||||
{ 2, 1},{ 0, 30},{ 0,226},{ 2, 1},{ 0,170},{ 0, 46},
|
||||
{ 8, 1},{ 4, 1},{ 2, 1},{ 0,185},{ 0,155},{ 2, 1},
|
||||
{ 0,227},{ 0,214},{ 4, 1},{ 2, 1},{ 0,109},{ 0, 62}, // 360
|
||||
|
||||
{ 2, 1},{ 0,200},{ 0,140},{ 16, 1},{ 8, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0,228},{ 0, 78},{ 2, 1},{ 0,215},{ 0,125},
|
||||
{ 4, 1},{ 2, 1},{ 0,229},{ 0,186},{ 2, 1},{ 0,171},
|
||||
{ 0, 94},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,201},{ 0,156},
|
||||
{ 2, 1},{ 0,241},{ 0, 31},{ 6, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0,240},{ 0,110},{ 0,242},{ 2, 1},{ 0, 47},{ 0,230},
|
||||
{ 38, 1},{ 18, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,216},
|
||||
{ 0,243},{ 2, 1},{ 0, 63},{ 0,244},{ 6, 1},{ 2, 1},
|
||||
{ 0, 79},{ 2, 1},{ 0,141},{ 0,217},{ 2, 1},{ 0,187},
|
||||
{ 0,202},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,172},{ 0,231}, // 420
|
||||
|
||||
{ 2, 1},{ 0,126},{ 0,245},{ 8, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0,157},{ 0, 95},{ 2, 1},{ 0,232},{ 0,142},{ 2, 1},
|
||||
{ 0,246},{ 0,203},{ 34, 1},{ 18, 1},{ 10, 1},{ 6, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0, 15},{ 0,174},{ 0,111},{ 2, 1},
|
||||
{ 0,188},{ 0,218},{ 4, 1},{ 2, 1},{ 0,173},{ 0,247},
|
||||
{ 2, 1},{ 0,127},{ 0,233},{ 8, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0,158},{ 0,204},{ 2, 1},{ 0,248},{ 0,143},{ 4, 1},
|
||||
{ 2, 1},{ 0,219},{ 0,189},{ 2, 1},{ 0,234},{ 0,249},
|
||||
{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,159},{ 0,220},
|
||||
{ 2, 1},{ 0,205},{ 0,235},{ 4, 1},{ 2, 1},{ 0,190}, // 480
|
||||
|
||||
{ 0,250},{ 2, 1},{ 0,175},{ 0,221},{ 14, 1},{ 6, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0,236},{ 0,206},{ 0,251},{ 4, 1},
|
||||
{ 2, 1},{ 0,191},{ 0,237},{ 2, 1},{ 0,222},{ 0,252},
|
||||
{ 6, 1},{ 4, 1},{ 2, 1},{ 0,207},{ 0,253},{ 0,238},
|
||||
{ 4, 1},{ 2, 1},{ 0,223},{ 0,254},{ 2, 1},{ 0,239},
|
||||
{ 0,255}},
|
||||
|
||||
htd16[511][2]={{ 2, 1},{ 0, 0},{ 6, 1},{ 2, 1},{ 0, 16},{ 2, 1},
|
||||
{ 0, 1},{ 0, 17},{ 42, 1},{ 8, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0, 32},{ 0, 2},{ 2, 1},{ 0, 33},{ 0, 18},{ 10, 1},
|
||||
{ 6, 1},{ 2, 1},{ 0, 34},{ 2, 1},{ 0, 48},{ 0, 3},
|
||||
{ 2, 1},{ 0, 49},{ 0, 19},{ 10, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0, 50},{ 0, 35},{ 4, 1},{ 2, 1},{ 0, 64},{ 0, 4},
|
||||
{ 0, 65},{ 6, 1},{ 2, 1},{ 0, 20},{ 2, 1},{ 0, 51},
|
||||
{ 0, 66},{ 4, 1},{ 2, 1},{ 0, 36},{ 0, 80},{ 2, 1},
|
||||
{ 0, 67},{ 0, 52},{138, 1},{ 40, 1},{ 16, 1},{ 6, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0, 5},{ 0, 21},{ 0, 81},{ 4, 1}, // 60
|
||||
|
||||
{ 2, 1},{ 0, 82},{ 0, 37},{ 4, 1},{ 2, 1},{ 0, 68},
|
||||
{ 0, 53},{ 0, 83},{ 10, 1},{ 6, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0, 96},{ 0, 6},{ 0, 97},{ 2, 1},{ 0, 22},{ 0, 98},
|
||||
{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 38},{ 0, 84},{ 2, 1},
|
||||
{ 0, 69},{ 0, 99},{ 4, 1},{ 2, 1},{ 0, 54},{ 0,112},
|
||||
{ 0,113},{ 40, 1},{ 18, 1},{ 8, 1},{ 2, 1},{ 0, 23},
|
||||
{ 2, 1},{ 0, 7},{ 2, 1},{ 0, 85},{ 0,100},{ 4, 1},
|
||||
{ 2, 1},{ 0,114},{ 0, 39},{ 4, 1},{ 2, 1},{ 0, 70},
|
||||
{ 0,101},{ 0,115},{ 10, 1},{ 6, 1},{ 2, 1},{ 0, 55},
|
||||
{ 2, 1},{ 0, 86},{ 0, 8},{ 2, 1},{ 0,128},{ 0,129}, // 120
|
||||
|
||||
{ 6, 1},{ 2, 1},{ 0, 24},{ 2, 1},{ 0,116},{ 0, 71},
|
||||
{ 2, 1},{ 0,130},{ 2, 1},{ 0, 40},{ 0,102},{ 24, 1},
|
||||
{ 14, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,131},{ 0, 56},
|
||||
{ 2, 1},{ 0,117},{ 0,132},{ 4, 1},{ 2, 1},{ 0, 72},
|
||||
{ 0,144},{ 0,145},{ 6, 1},{ 2, 1},{ 0, 25},{ 2, 1},
|
||||
{ 0, 9},{ 0,118},{ 2, 1},{ 0,146},{ 0, 41},{ 14, 1},
|
||||
{ 8, 1},{ 4, 1},{ 2, 1},{ 0,133},{ 0, 88},{ 2, 1},
|
||||
{ 0,147},{ 0, 57},{ 4, 1},{ 2, 1},{ 0,160},{ 0, 10},
|
||||
{ 0, 26},{ 8, 1},{ 2, 1},{ 0,162},{ 2, 1},{ 0,103},
|
||||
{ 2, 1},{ 0, 87},{ 0, 73},{ 6, 1},{ 2, 1},{ 0,148}, // 180
|
||||
|
||||
{ 2, 1},{ 0,119},{ 0,134},{ 2, 1},{ 0,161},{ 2, 1},
|
||||
{ 0,104},{ 0,149},{220, 1},{126, 1},{ 50, 1},{ 26, 1},
|
||||
{ 12, 1},{ 6, 1},{ 2, 1},{ 0, 42},{ 2, 1},{ 0, 89},
|
||||
{ 0, 58},{ 2, 1},{ 0,163},{ 2, 1},{ 0,135},{ 0,120},
|
||||
{ 8, 1},{ 4, 1},{ 2, 1},{ 0,164},{ 0, 74},{ 2, 1},
|
||||
{ 0,150},{ 0,105},{ 4, 1},{ 2, 1},{ 0,176},{ 0, 11},
|
||||
{ 0,177},{ 10, 1},{ 4, 1},{ 2, 1},{ 0, 27},{ 0,178},
|
||||
{ 2, 1},{ 0, 43},{ 2, 1},{ 0,165},{ 0, 90},{ 6, 1},
|
||||
{ 2, 1},{ 0,179},{ 2, 1},{ 0,166},{ 0,106},{ 4, 1},
|
||||
{ 2, 1},{ 0,180},{ 0, 75},{ 2, 1},{ 0, 12},{ 0,193}, // 240
|
||||
|
||||
{ 30, 1},{ 14, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,181},
|
||||
{ 0,194},{ 0, 44},{ 4, 1},{ 2, 1},{ 0,167},{ 0,195},
|
||||
{ 2, 1},{ 0,107},{ 0,196},{ 8, 1},{ 2, 1},{ 0, 29},
|
||||
{ 4, 1},{ 2, 1},{ 0,136},{ 0,151},{ 0, 59},{ 4, 1},
|
||||
{ 2, 1},{ 0,209},{ 0,210},{ 2, 1},{ 0, 45},{ 0,211},
|
||||
{ 18, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0, 30},{ 0, 46},
|
||||
{ 0,226},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,121},{ 0,152},
|
||||
{ 0,192},{ 2, 1},{ 0, 28},{ 2, 1},{ 0,137},{ 0, 91},
|
||||
{ 14, 1},{ 6, 1},{ 2, 1},{ 0, 60},{ 2, 1},{ 0,122},
|
||||
{ 0,182},{ 4, 1},{ 2, 1},{ 0, 76},{ 0,153},{ 2, 1}, // 300
|
||||
|
||||
{ 0,168},{ 0,138},{ 6, 1},{ 2, 1},{ 0, 13},{ 2, 1},
|
||||
{ 0,197},{ 0, 92},{ 4, 1},{ 2, 1},{ 0, 61},{ 0,198},
|
||||
{ 2, 1},{ 0,108},{ 0,154},{ 88, 1},{ 86, 1},{ 36, 1},
|
||||
{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,139},{ 0, 77},
|
||||
{ 2, 1},{ 0,199},{ 0,124},{ 4, 1},{ 2, 1},{ 0,213},
|
||||
{ 0, 93},{ 2, 1},{ 0,224},{ 0, 14},{ 8, 1},{ 2, 1},
|
||||
{ 0,227},{ 4, 1},{ 2, 1},{ 0,208},{ 0,183},{ 0,123},
|
||||
{ 6, 1},{ 4, 1},{ 2, 1},{ 0,169},{ 0,184},{ 0,212},
|
||||
{ 2, 1},{ 0,225},{ 2, 1},{ 0,170},{ 0,185},{ 24, 1},
|
||||
{ 10, 1},{ 6, 1},{ 4, 1},{ 2, 1},{ 0,155},{ 0,214}, // 360
|
||||
|
||||
{ 0,109},{ 2, 1},{ 0, 62},{ 0,200},{ 6, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0,140},{ 0,228},{ 0, 78},{ 4, 1},{ 2, 1},
|
||||
{ 0,215},{ 0,229},{ 2, 1},{ 0,186},{ 0,171},{ 12, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0,156},{ 0,230},{ 4, 1},{ 2, 1},
|
||||
{ 0,110},{ 0,216},{ 2, 1},{ 0,141},{ 0,187},{ 8, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0,231},{ 0,157},{ 2, 1},{ 0,232},
|
||||
{ 0,142},{ 4, 1},{ 2, 1},{ 0,203},{ 0,188},{ 0,158},
|
||||
{ 0,241},{ 2, 1},{ 0, 31},{ 2, 1},{ 0, 15},{ 0, 47},
|
||||
{ 66, 1},{ 56, 1},{ 2, 1},{ 0,242},{ 52, 1},{ 50, 1},
|
||||
{ 20, 1},{ 8, 1},{ 2, 1},{ 0,189},{ 2, 1},{ 0, 94}, // 420
|
||||
|
||||
{ 2, 1},{ 0,125},{ 0,201},{ 6, 1},{ 2, 1},{ 0,202},
|
||||
{ 2, 1},{ 0,172},{ 0,126},{ 4, 1},{ 2, 1},{ 0,218},
|
||||
{ 0,173},{ 0,204},{ 10, 1},{ 6, 1},{ 2, 1},{ 0,174},
|
||||
{ 2, 1},{ 0,219},{ 0,220},{ 2, 1},{ 0,205},{ 0,190},
|
||||
{ 6, 1},{ 4, 1},{ 2, 1},{ 0,235},{ 0,237},{ 0,238},
|
||||
{ 6, 1},{ 4, 1},{ 2, 1},{ 0,217},{ 0,234},{ 0,233},
|
||||
{ 2, 1},{ 0,222},{ 4, 1},{ 2, 1},{ 0,221},{ 0,236},
|
||||
{ 0,206},{ 0, 63},{ 0,240},{ 4, 1},{ 2, 1},{ 0,243},
|
||||
{ 0,244},{ 2, 1},{ 0, 79},{ 2, 1},{ 0,245},{ 0, 95},
|
||||
{ 10, 1},{ 2, 1},{ 0,255},{ 4, 1},{ 2, 1},{ 0,246}, // 480
|
||||
|
||||
{ 0,111},{ 2, 1},{ 0,247},{ 0,127},{ 12, 1},{ 6, 1},
|
||||
{ 2, 1},{ 0,143},{ 2, 1},{ 0,248},{ 0,249},{ 4, 1},
|
||||
{ 2, 1},{ 0,159},{ 0,250},{ 0,175},{ 8, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0,251},{ 0,191},{ 2, 1},{ 0,252},{ 0,207},
|
||||
{ 4, 1},{ 2, 1},{ 0,253},{ 0,223},{ 2, 1},{ 0,254},
|
||||
{ 0,239}},
|
||||
|
||||
htd24[512][2]={{ 60, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 0},{ 0, 16},
|
||||
{ 2, 1},{ 0, 1},{ 0, 17},{ 14, 1},{ 6, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0, 32},{ 0, 2},{ 0, 33},{ 2, 1},{ 0, 18},
|
||||
{ 2, 1},{ 0, 34},{ 2, 1},{ 0, 48},{ 0, 3},{ 14, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0, 49},{ 0, 19},{ 4, 1},{ 2, 1},
|
||||
{ 0, 50},{ 0, 35},{ 4, 1},{ 2, 1},{ 0, 64},{ 0, 4},
|
||||
{ 0, 65},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 20},{ 0, 51},
|
||||
{ 2, 1},{ 0, 66},{ 0, 36},{ 6, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0, 67},{ 0, 52},{ 0, 81},{ 6, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0, 80},{ 0, 5},{ 0, 21},{ 2, 1},{ 0, 82},{ 0, 37}, // 60
|
||||
|
||||
{250+85, 1},{ 98, 1},{ 34, 1},{ 18, 1},{ 10, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0, 68},{ 0, 83},{ 2, 1},{ 0, 53},{ 2, 1},
|
||||
{ 0, 96},{ 0, 6},{ 4, 1},{ 2, 1},{ 0, 97},{ 0, 22},
|
||||
{ 2, 1},{ 0, 98},{ 0, 38},{ 8, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0, 84},{ 0, 69},{ 2, 1},{ 0, 99},{ 0, 54},{ 4, 1},
|
||||
{ 2, 1},{ 0,113},{ 0, 85},{ 2, 1},{ 0,100},{ 0, 70},
|
||||
{ 32, 1},{ 14, 1},{ 6, 1},{ 2, 1},{ 0,114},{ 2, 1},
|
||||
{ 0, 39},{ 0, 55},{ 2, 1},{ 0,115},{ 4, 1},{ 2, 1},
|
||||
{ 0,112},{ 0, 7},{ 0, 23},{ 10, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0,101},{ 0, 86},{ 4, 1},{ 2, 1},{ 0,128},{ 0, 8}, // 120
|
||||
|
||||
{ 0,129},{ 4, 1},{ 2, 1},{ 0,116},{ 0, 71},{ 2, 1},
|
||||
{ 0, 24},{ 0,130},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0, 40},{ 0,102},{ 2, 1},{ 0,131},{ 0, 56},{ 4, 1},
|
||||
{ 2, 1},{ 0,117},{ 0, 87},{ 2, 1},{ 0,132},{ 0, 72},
|
||||
{ 8, 1},{ 4, 1},{ 2, 1},{ 0,145},{ 0, 25},{ 2, 1},
|
||||
{ 0,146},{ 0,118},{ 4, 1},{ 2, 1},{ 0,103},{ 0, 41},
|
||||
{ 2, 1},{ 0,133},{ 0, 88},{ 92, 1},{ 34, 1},{ 16, 1},
|
||||
{ 8, 1},{ 4, 1},{ 2, 1},{ 0,147},{ 0, 57},{ 2, 1},
|
||||
{ 0,148},{ 0, 73},{ 4, 1},{ 2, 1},{ 0,119},{ 0,134},
|
||||
{ 2, 1},{ 0,104},{ 0,161},{ 8, 1},{ 4, 1},{ 2, 1}, // 180
|
||||
|
||||
{ 0,162},{ 0, 42},{ 2, 1},{ 0,149},{ 0, 89},{ 4, 1},
|
||||
{ 2, 1},{ 0,163},{ 0, 58},{ 2, 1},{ 0,135},{ 2, 1},
|
||||
{ 0,120},{ 0, 74},{ 22, 1},{ 12, 1},{ 4, 1},{ 2, 1},
|
||||
{ 0,164},{ 0,150},{ 4, 1},{ 2, 1},{ 0,105},{ 0,177},
|
||||
{ 2, 1},{ 0, 27},{ 0,165},{ 6, 1},{ 2, 1},{ 0,178},
|
||||
{ 2, 1},{ 0, 90},{ 0, 43},{ 2, 1},{ 0,136},{ 0,179},
|
||||
{ 16, 1},{ 10, 1},{ 6, 1},{ 2, 1},{ 0,144},{ 2, 1},
|
||||
{ 0, 9},{ 0,160},{ 2, 1},{ 0,151},{ 0,121},{ 4, 1},
|
||||
{ 2, 1},{ 0,166},{ 0,106},{ 0,180},{ 12, 1},{ 6, 1},
|
||||
{ 2, 1},{ 0, 26},{ 2, 1},{ 0, 10},{ 0,176},{ 2, 1}, // 240
|
||||
|
||||
{ 0, 59},{ 2, 1},{ 0, 11},{ 0,192},{ 4, 1},{ 2, 1},
|
||||
{ 0, 75},{ 0,193},{ 2, 1},{ 0,152},{ 0,137},{ 67, 1},
|
||||
{ 34, 1},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 28},
|
||||
{ 0,181},{ 2, 1},{ 0, 91},{ 0,194},{ 4, 1},{ 2, 1},
|
||||
{ 0, 44},{ 0,167},{ 2, 1},{ 0,122},{ 0,195},{ 10, 1},
|
||||
{ 6, 1},{ 2, 1},{ 0, 60},{ 2, 1},{ 0, 12},{ 0,208},
|
||||
{ 2, 1},{ 0,182},{ 0,107},{ 4, 1},{ 2, 1},{ 0,196},
|
||||
{ 0, 76},{ 2, 1},{ 0,153},{ 0,168},{ 16, 1},{ 8, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0,138},{ 0,197},{ 2, 1},{ 0, 92},
|
||||
{ 0,209},{ 4, 1},{ 2, 1},{ 0,183},{ 0,123},{ 2, 1}, // 300
|
||||
|
||||
{ 0, 29},{ 0,210},{ 9, 1},{ 4, 1},{ 2, 1},{ 0, 45},
|
||||
{ 0,211},{ 2, 1},{ 0, 61},{ 0,198},{ 85,250},{ 4, 1}, // 306 -
|
||||
{ 2, 1},{ 0,108},{ 0,169},{ 2, 1},{ 0,154},{ 0,212},
|
||||
{ 32, 1},{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,184},
|
||||
{ 0,139},{ 2, 1},{ 0, 77},{ 0,199},{ 4, 1},{ 2, 1},
|
||||
{ 0,124},{ 0,213},{ 2, 1},{ 0, 93},{ 0,225},{ 8, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0, 30},{ 0,226},{ 2, 1},{ 0,170},
|
||||
{ 0,185},{ 4, 1},{ 2, 1},{ 0,155},{ 0,227},{ 2, 1},
|
||||
{ 0,214},{ 0,109},{ 20, 1},{ 10, 1},{ 6, 1},{ 2, 1},
|
||||
{ 0, 62},{ 2, 1},{ 0, 46},{ 0, 78},{ 2, 1},{ 0,200}, // 360
|
||||
|
||||
{ 0,140},{ 4, 1},{ 2, 1},{ 0,228},{ 0,215},{ 4, 1},
|
||||
{ 2, 1},{ 0,125},{ 0,171},{ 0,229},{ 10, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0,186},{ 0, 94},{ 2, 1},{ 0,201},{ 2, 1},
|
||||
{ 0,156},{ 0,110},{ 8, 1},{ 2, 1},{ 0,230},{ 2, 1},
|
||||
{ 0, 13},{ 2, 1},{ 0,224},{ 0, 14},{ 4, 1},{ 2, 1},
|
||||
{ 0,216},{ 0,141},{ 2, 1},{ 0,187},{ 0,202},{ 74, 1},
|
||||
{ 2, 1},{ 0,255},{ 64, 1},{ 58, 1},{ 32, 1},{ 16, 1},
|
||||
{ 8, 1},{ 4, 1},{ 2, 1},{ 0,172},{ 0,231},{ 2, 1},
|
||||
{ 0,126},{ 0,217},{ 4, 1},{ 2, 1},{ 0,157},{ 0,232},
|
||||
{ 2, 1},{ 0,142},{ 0,203},{ 8, 1},{ 4, 1},{ 2, 1}, // 420
|
||||
|
||||
{ 0,188},{ 0,218},{ 2, 1},{ 0,173},{ 0,233},{ 4, 1},
|
||||
{ 2, 1},{ 0,158},{ 0,204},{ 2, 1},{ 0,219},{ 0,189},
|
||||
{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,234},{ 0,174},
|
||||
{ 2, 1},{ 0,220},{ 0,205},{ 4, 1},{ 2, 1},{ 0,235},
|
||||
{ 0,190},{ 2, 1},{ 0,221},{ 0,236},{ 8, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0,206},{ 0,237},{ 2, 1},{ 0,222},{ 0,238},
|
||||
{ 0, 15},{ 4, 1},{ 2, 1},{ 0,240},{ 0, 31},{ 0,241},
|
||||
{ 4, 1},{ 2, 1},{ 0,242},{ 0, 47},{ 2, 1},{ 0,243},
|
||||
{ 0, 63},{ 18, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0,244},
|
||||
{ 0, 79},{ 2, 1},{ 0,245},{ 0, 95},{ 4, 1},{ 2, 1}, // 480
|
||||
|
||||
{ 0,246},{ 0,111},{ 2, 1},{ 0,247},{ 2, 1},{ 0,127},
|
||||
{ 0,143},{ 10, 1},{ 4, 1},{ 2, 1},{ 0,248},{ 0,249},
|
||||
{ 4, 1},{ 2, 1},{ 0,159},{ 0,175},{ 0,250},{ 8, 1},
|
||||
{ 4, 1},{ 2, 1},{ 0,251},{ 0,191},{ 2, 1},{ 0,252},
|
||||
{ 0,207},{ 4, 1},{ 2, 1},{ 0,253},{ 0,223},{ 2, 1},
|
||||
{ 0,254},{ 0,239}},
|
||||
|
||||
htd32[ 31][2]={{ 2, 1},{ 0, 0},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 8},
|
||||
{ 0, 4},{ 2, 1},{ 0, 1},{ 0, 2},{ 8, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0, 12},{ 0, 10},{ 2, 1},{ 0, 3},{ 0, 6},
|
||||
{ 6, 1},{ 2, 1},{ 0, 9},{ 2, 1},{ 0, 5},{ 0, 7},
|
||||
{ 4, 1},{ 2, 1},{ 0, 14},{ 0, 13},{ 2, 1},{ 0, 15},
|
||||
{ 0, 11}},
|
||||
|
||||
htd33[ 31][2]={{ 16, 1},{ 8, 1},{ 4, 1},{ 2, 1},{ 0, 0},{ 0, 1},
|
||||
{ 2, 1},{ 0, 2},{ 0, 3},{ 4, 1},{ 2, 1},{ 0, 4},
|
||||
{ 0, 5},{ 2, 1},{ 0, 6},{ 0, 7},{ 8, 1},{ 4, 1},
|
||||
{ 2, 1},{ 0, 8},{ 0, 9},{ 2, 1},{ 0, 10},{ 0, 11},
|
||||
{ 4, 1},{ 2, 1},{ 0, 12},{ 0, 13},{ 2, 1},{ 0, 14},
|
||||
{ 0, 15}};
|
||||
|
||||
const HUFFMANCODETABLE Mpegtoraw::ht[HTN]=
|
||||
{
|
||||
{ 0, 0-1, 0-1, 0, 0, htd33},
|
||||
{ 1, 2-1, 2-1, 0, 7,htd01},
|
||||
{ 2, 3-1, 3-1, 0, 17,htd02},
|
||||
{ 3, 3-1, 3-1, 0, 17,htd03},
|
||||
{ 4, 0-1, 0-1, 0, 0, htd33},
|
||||
{ 5, 4-1, 4-1, 0, 31,htd05},
|
||||
{ 6, 4-1, 4-1, 0, 31,htd06},
|
||||
{ 7, 6-1, 6-1, 0, 71,htd07},
|
||||
{ 8, 6-1, 6-1, 0, 71,htd08},
|
||||
{ 9, 6-1, 6-1, 0, 71,htd09},
|
||||
{10, 8-1, 8-1, 0,127,htd10},
|
||||
{11, 8-1, 8-1, 0,127,htd11},
|
||||
{12, 8-1, 8-1, 0,127,htd12},
|
||||
{13,16-1,16-1, 0,511,htd13},
|
||||
{14, 0-1, 0-1, 0, 0, htd33},
|
||||
{15,16-1,16-1, 0,511,htd15},
|
||||
{16,16-1,16-1, 1,511,htd16},
|
||||
{17,16-1,16-1, 2,511,htd16},
|
||||
{18,16-1,16-1, 3,511,htd16},
|
||||
{19,16-1,16-1, 4,511,htd16},
|
||||
{20,16-1,16-1, 6,511,htd16},
|
||||
{21,16-1,16-1, 8,511,htd16},
|
||||
{22,16-1,16-1,10,511,htd16},
|
||||
{23,16-1,16-1,13,511,htd16},
|
||||
{24,16-1,16-1, 4,512,htd24},
|
||||
{25,16-1,16-1, 5,512,htd24},
|
||||
{26,16-1,16-1, 6,512,htd24},
|
||||
{27,16-1,16-1, 7,512,htd24},
|
||||
{28,16-1,16-1, 8,512,htd24},
|
||||
{29,16-1,16-1, 9,512,htd24},
|
||||
{30,16-1,16-1,11,512,htd24},
|
||||
{31,16-1,16-1,13,512,htd24},
|
||||
{32, 1-1,16-1, 0, 31,htd32},
|
||||
{33, 1-1,16-1, 0, 31,htd33}
|
||||
};
|
|
@ -1,441 +0,0 @@
|
|||
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - added VC6 pragma to prevent some warnings from being reported
|
||||
|
||||
#ifndef __MPEG2TABLES_H
|
||||
#define __MPEG2TABLES_H
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4305)
|
||||
#endif
|
||||
|
||||
|
||||
#define MAXTABLE 3
|
||||
|
||||
|
||||
// Tables for layer 2.
|
||||
|
||||
// bitalloclengthtable :0,1 supported 2. 2 ot tested & disabled
|
||||
// this table merges the subbands to the longer one.
|
||||
// 8 < 12 , 27 < 30 but the "length" is the same
|
||||
|
||||
static const int bitalloclengthtable[MAXTABLE][MAXSUBBAND]=
|
||||
{ {4,4,3,3,3,3,3,3,3,3,3,3,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||||
{4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3, 3,3,3,3,3,3,3,2,2,2,2,2,2,2,0,0},
|
||||
{4,4,4,4,3,3,3,3,3,3,3,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0} };
|
||||
|
||||
|
||||
/*
|
||||
Orignal is:
|
||||
{ {4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3, 3,3,3,3,3,3,3,2,2,2,2,0,0,0,0,0},
|
||||
{4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3, 3,3,3,3,3,3,3,2,2,2,2,2,2,2,0,0},
|
||||
{4,4,3,3,3,3,3,3,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||||
{4,4,3,3,3,3,3,3,3,3,3,3,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
|
||||
{4,4,4,4,3,3,3,3,3,3,3,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0} };
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static const REAL group5bits[27*3]=
|
||||
{
|
||||
-2.0/3.0, -2.0/3.0, -2.0/3.0,
|
||||
0.0, -2.0/3.0, -2.0/3.0,
|
||||
2.0/3.0, -2.0/3.0, -2.0/3.0,
|
||||
-2.0/3.0, 0.0, -2.0/3.0,
|
||||
0.0, 0.0, -2.0/3.0,
|
||||
2.0/3.0, 0.0, -2.0/3.0,
|
||||
-2.0/3.0, 2.0/3.0, -2.0/3.0,
|
||||
0.0, 2.0/3.0, -2.0/3.0,
|
||||
2.0/3.0, 2.0/3.0, -2.0/3.0,
|
||||
-2.0/3.0, -2.0/3.0, 0.0,
|
||||
0.0, -2.0/3.0, 0.0,
|
||||
2.0/3.0, -2.0/3.0, 0.0,
|
||||
-2.0/3.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0,
|
||||
2.0/3.0, 0.0, 0.0,
|
||||
-2.0/3.0, 2.0/3.0, 0.0,
|
||||
0.0, 2.0/3.0, 0.0,
|
||||
2.0/3.0, 2.0/3.0, 0.0,
|
||||
-2.0/3.0, -2.0/3.0, 2.0/3.0,
|
||||
0.0, -2.0/3.0, 2.0/3.0,
|
||||
2.0/3.0, -2.0/3.0, 2.0/3.0,
|
||||
-2.0/3.0, 0.0, 2.0/3.0,
|
||||
0.0, 0.0, 2.0/3.0,
|
||||
2.0/3.0, 0.0, 2.0/3.0,
|
||||
-2.0/3.0, 2.0/3.0, 2.0/3.0,
|
||||
0.0, 2.0/3.0, 2.0/3.0,
|
||||
2.0/3.0, 2.0/3.0, 2.0/3.0
|
||||
};
|
||||
|
||||
static const REAL group7bits[125*3]=
|
||||
{
|
||||
-0.8,-0.8,-0.8, -0.4,-0.8,-0.8, 0.0,-0.8,-0.8, 0.4,-0.8,-0.8, 0.8,-0.8,-0.8,
|
||||
-0.8,-0.4,-0.8, -0.4,-0.4,-0.8, 0.0,-0.4,-0.8, 0.4,-0.4,-0.8, 0.8,-0.4,-0.8,
|
||||
-0.8, 0.0,-0.8, -0.4, 0.0,-0.8, 0.0, 0.0,-0.8, 0.4, 0.0,-0.8, 0.8, 0.0,-0.8,
|
||||
-0.8, 0.4,-0.8, -0.4, 0.4,-0.8, 0.0, 0.4,-0.8, 0.4, 0.4,-0.8, 0.8, 0.4,-0.8,
|
||||
-0.8, 0.8,-0.8, -0.4, 0.8,-0.8, 0.0, 0.8,-0.8, 0.4, 0.8,-0.8, 0.8, 0.8,-0.8,
|
||||
-0.8,-0.8,-0.4, -0.4,-0.8,-0.4, 0.0,-0.8,-0.4, 0.4,-0.8,-0.4, 0.8,-0.8,-0.4,
|
||||
-0.8,-0.4,-0.4, -0.4,-0.4,-0.4, 0.0,-0.4,-0.4, 0.4,-0.4,-0.4, 0.8,-0.4,-0.4,
|
||||
-0.8, 0.0,-0.4, -0.4, 0.0,-0.4, 0.0, 0.0,-0.4, 0.4, 0.0,-0.4, 0.8, 0.0,-0.4,
|
||||
-0.8, 0.4,-0.4, -0.4, 0.4,-0.4, 0.0, 0.4,-0.4, 0.4, 0.4,-0.4, 0.8, 0.4,-0.4,
|
||||
-0.8, 0.8,-0.4, -0.4, 0.8,-0.4, 0.0, 0.8,-0.4, 0.4, 0.8,-0.4, 0.8, 0.8,-0.4,
|
||||
-0.8,-0.8, 0.0, -0.4,-0.8, 0.0, 0.0,-0.8, 0.0, 0.4,-0.8, 0.0, 0.8,-0.8, 0.0,
|
||||
-0.8,-0.4, 0.0, -0.4,-0.4, 0.0, 0.0,-0.4, 0.0, 0.4,-0.4, 0.0, 0.8,-0.4, 0.0,
|
||||
-0.8, 0.0, 0.0, -0.4, 0.0, 0.0, 0.0, 0.0, 0.0, 0.4, 0.0, 0.0, 0.8, 0.0, 0.0,
|
||||
-0.8, 0.4, 0.0, -0.4, 0.4, 0.0, 0.0, 0.4, 0.0, 0.4, 0.4, 0.0, 0.8, 0.4, 0.0,
|
||||
-0.8, 0.8, 0.0, -0.4, 0.8, 0.0, 0.0, 0.8, 0.0, 0.4, 0.8, 0.0, 0.8, 0.8, 0.0,
|
||||
-0.8,-0.8, 0.4, -0.4,-0.8, 0.4, 0.0,-0.8, 0.4, 0.4,-0.8, 0.4, 0.8,-0.8, 0.4,
|
||||
-0.8,-0.4, 0.4, -0.4,-0.4, 0.4, 0.0,-0.4, 0.4, 0.4,-0.4, 0.4, 0.8,-0.4, 0.4,
|
||||
-0.8, 0.0, 0.4, -0.4, 0.0, 0.4, 0.0, 0.0, 0.4, 0.4, 0.0, 0.4, 0.8, 0.0, 0.4,
|
||||
-0.8, 0.4, 0.4, -0.4, 0.4, 0.4, 0.0, 0.4, 0.4, 0.4, 0.4, 0.4, 0.8, 0.4, 0.4,
|
||||
-0.8, 0.8, 0.4, -0.4, 0.8, 0.4, 0.0, 0.8, 0.4, 0.4, 0.8, 0.4, 0.8, 0.8, 0.4,
|
||||
-0.8,-0.8, 0.8, -0.4,-0.8, 0.8, 0.0,-0.8, 0.8, 0.4,-0.8, 0.8, 0.8,-0.8, 0.8,
|
||||
-0.8,-0.4, 0.8, -0.4,-0.4, 0.8, 0.0,-0.4, 0.8, 0.4,-0.4, 0.8, 0.8,-0.4, 0.8,
|
||||
-0.8, 0.0, 0.8, -0.4, 0.0, 0.8, 0.0, 0.0, 0.8, 0.4, 0.0, 0.8, 0.8, 0.0, 0.8,
|
||||
-0.8, 0.4, 0.8, -0.4, 0.4, 0.8, 0.0, 0.4, 0.8, 0.4, 0.4, 0.8, 0.8, 0.4, 0.8,
|
||||
-0.8, 0.8, 0.8, -0.4, 0.8, 0.8, 0.0, 0.8, 0.8, 0.4, 0.8, 0.8, 0.8, 0.8, 0.8
|
||||
};
|
||||
|
||||
static const REAL group10bits[729*3]=
|
||||
{
|
||||
-8.0/9.0,-8.0/9.0,-8.0/9.0, -6.0/9.0,-8.0/9.0,-8.0/9.0, -4.0/9.0,-8.0/9.0,-8.0/9.0,
|
||||
-2.0/9.0,-8.0/9.0,-8.0/9.0, 0.0,-8.0/9.0,-8.0/9.0, 2.0/9.0,-8.0/9.0,-8.0/9.0,
|
||||
4.0/9.0,-8.0/9.0,-8.0/9.0, 6.0/9.0,-8.0/9.0,-8.0/9.0, 8.0/9.0,-8.0/9.0,-8.0/9.0,
|
||||
-8.0/9.0,-6.0/9.0,-8.0/9.0, -6.0/9.0,-6.0/9.0,-8.0/9.0, -4.0/9.0,-6.0/9.0,-8.0/9.0,
|
||||
-2.0/9.0,-6.0/9.0,-8.0/9.0, 0.0,-6.0/9.0,-8.0/9.0, 2.0/9.0,-6.0/9.0,-8.0/9.0,
|
||||
4.0/9.0,-6.0/9.0,-8.0/9.0, 6.0/9.0,-6.0/9.0,-8.0/9.0, 8.0/9.0,-6.0/9.0,-8.0/9.0,
|
||||
-8.0/9.0,-4.0/9.0,-8.0/9.0, -6.0/9.0,-4.0/9.0,-8.0/9.0, -4.0/9.0,-4.0/9.0,-8.0/9.0,
|
||||
-2.0/9.0,-4.0/9.0,-8.0/9.0, 0.0,-4.0/9.0,-8.0/9.0, 2.0/9.0,-4.0/9.0,-8.0/9.0,
|
||||
4.0/9.0,-4.0/9.0,-8.0/9.0, 6.0/9.0,-4.0/9.0,-8.0/9.0, 8.0/9.0,-4.0/9.0,-8.0/9.0,
|
||||
-8.0/9.0,-2.0/9.0,-8.0/9.0, -6.0/9.0,-2.0/9.0,-8.0/9.0, -4.0/9.0,-2.0/9.0,-8.0/9.0,
|
||||
-2.0/9.0,-2.0/9.0,-8.0/9.0, 0.0,-2.0/9.0,-8.0/9.0, 2.0/9.0,-2.0/9.0,-8.0/9.0,
|
||||
4.0/9.0,-2.0/9.0,-8.0/9.0, 6.0/9.0,-2.0/9.0,-8.0/9.0, 8.0/9.0,-2.0/9.0,-8.0/9.0,
|
||||
-8.0/9.0, 0.0,-8.0/9.0, -6.0/9.0, 0.0,-8.0/9.0, -4.0/9.0, 0.0,-8.0/9.0,
|
||||
-2.0/9.0, 0.0,-8.0/9.0, 0.0, 0.0,-8.0/9.0, 2.0/9.0, 0.0,-8.0/9.0,
|
||||
4.0/9.0, 0.0,-8.0/9.0, 6.0/9.0, 0.0,-8.0/9.0, 8.0/9.0, 0.0,-8.0/9.0,
|
||||
-8.0/9.0, 2.0/9.0,-8.0/9.0, -6.0/9.0, 2.0/9.0,-8.0/9.0, -4.0/9.0, 2.0/9.0,-8.0/9.0,
|
||||
-2.0/9.0, 2.0/9.0,-8.0/9.0, 0.0, 2.0/9.0,-8.0/9.0, 2.0/9.0, 2.0/9.0,-8.0/9.0,
|
||||
4.0/9.0, 2.0/9.0,-8.0/9.0, 6.0/9.0, 2.0/9.0,-8.0/9.0, 8.0/9.0, 2.0/9.0,-8.0/9.0,
|
||||
-8.0/9.0, 4.0/9.0,-8.0/9.0, -6.0/9.0, 4.0/9.0,-8.0/9.0, -4.0/9.0, 4.0/9.0,-8.0/9.0,
|
||||
-2.0/9.0, 4.0/9.0,-8.0/9.0, 0.0, 4.0/9.0,-8.0/9.0, 2.0/9.0, 4.0/9.0,-8.0/9.0,
|
||||
4.0/9.0, 4.0/9.0,-8.0/9.0, 6.0/9.0, 4.0/9.0,-8.0/9.0, 8.0/9.0, 4.0/9.0,-8.0/9.0,
|
||||
-8.0/9.0, 6.0/9.0,-8.0/9.0, -6.0/9.0, 6.0/9.0,-8.0/9.0, -4.0/9.0, 6.0/9.0,-8.0/9.0,
|
||||
-2.0/9.0, 6.0/9.0,-8.0/9.0, 0.0, 6.0/9.0,-8.0/9.0, 2.0/9.0, 6.0/9.0,-8.0/9.0,
|
||||
4.0/9.0, 6.0/9.0,-8.0/9.0, 6.0/9.0, 6.0/9.0,-8.0/9.0, 8.0/9.0, 6.0/9.0,-8.0/9.0,
|
||||
-8.0/9.0, 8.0/9.0,-8.0/9.0, -6.0/9.0, 8.0/9.0,-8.0/9.0, -4.0/9.0, 8.0/9.0,-8.0/9.0,
|
||||
-2.0/9.0, 8.0/9.0,-8.0/9.0, 0.0, 8.0/9.0,-8.0/9.0, 2.0/9.0, 8.0/9.0,-8.0/9.0,
|
||||
4.0/9.0, 8.0/9.0,-8.0/9.0, 6.0/9.0, 8.0/9.0,-8.0/9.0, 8.0/9.0, 8.0/9.0,-8.0/9.0,
|
||||
-8.0/9.0,-8.0/9.0,-6.0/9.0, -6.0/9.0,-8.0/9.0,-6.0/9.0, -4.0/9.0,-8.0/9.0,-6.0/9.0,
|
||||
-2.0/9.0,-8.0/9.0,-6.0/9.0, 0.0,-8.0/9.0,-6.0/9.0, 2.0/9.0,-8.0/9.0,-6.0/9.0,
|
||||
4.0/9.0,-8.0/9.0,-6.0/9.0, 6.0/9.0,-8.0/9.0,-6.0/9.0, 8.0/9.0,-8.0/9.0,-6.0/9.0,
|
||||
-8.0/9.0,-6.0/9.0,-6.0/9.0, -6.0/9.0,-6.0/9.0,-6.0/9.0, -4.0/9.0,-6.0/9.0,-6.0/9.0,
|
||||
-2.0/9.0,-6.0/9.0,-6.0/9.0, 0.0,-6.0/9.0,-6.0/9.0, 2.0/9.0,-6.0/9.0,-6.0/9.0,
|
||||
4.0/9.0,-6.0/9.0,-6.0/9.0, 6.0/9.0,-6.0/9.0,-6.0/9.0, 8.0/9.0,-6.0/9.0,-6.0/9.0,
|
||||
-8.0/9.0,-4.0/9.0,-6.0/9.0, -6.0/9.0,-4.0/9.0,-6.0/9.0, -4.0/9.0,-4.0/9.0,-6.0/9.0,
|
||||
-2.0/9.0,-4.0/9.0,-6.0/9.0, 0.0,-4.0/9.0,-6.0/9.0, 2.0/9.0,-4.0/9.0,-6.0/9.0,
|
||||
4.0/9.0,-4.0/9.0,-6.0/9.0, 6.0/9.0,-4.0/9.0,-6.0/9.0, 8.0/9.0,-4.0/9.0,-6.0/9.0,
|
||||
-8.0/9.0,-2.0/9.0,-6.0/9.0, -6.0/9.0,-2.0/9.0,-6.0/9.0, -4.0/9.0,-2.0/9.0,-6.0/9.0,
|
||||
-2.0/9.0,-2.0/9.0,-6.0/9.0, 0.0,-2.0/9.0,-6.0/9.0, 2.0/9.0,-2.0/9.0,-6.0/9.0,
|
||||
4.0/9.0,-2.0/9.0,-6.0/9.0, 6.0/9.0,-2.0/9.0,-6.0/9.0, 8.0/9.0,-2.0/9.0,-6.0/9.0,
|
||||
-8.0/9.0, 0.0,-6.0/9.0, -6.0/9.0, 0.0,-6.0/9.0, -4.0/9.0, 0.0,-6.0/9.0,
|
||||
-2.0/9.0, 0.0,-6.0/9.0, 0.0, 0.0,-6.0/9.0, 2.0/9.0, 0.0,-6.0/9.0,
|
||||
4.0/9.0, 0.0,-6.0/9.0, 6.0/9.0, 0.0,-6.0/9.0, 8.0/9.0, 0.0,-6.0/9.0,
|
||||
-8.0/9.0, 2.0/9.0,-6.0/9.0, -6.0/9.0, 2.0/9.0,-6.0/9.0, -4.0/9.0, 2.0/9.0,-6.0/9.0,
|
||||
-2.0/9.0, 2.0/9.0,-6.0/9.0, 0.0, 2.0/9.0,-6.0/9.0, 2.0/9.0, 2.0/9.0,-6.0/9.0,
|
||||
4.0/9.0, 2.0/9.0,-6.0/9.0, 6.0/9.0, 2.0/9.0,-6.0/9.0, 8.0/9.0, 2.0/9.0,-6.0/9.0,
|
||||
-8.0/9.0, 4.0/9.0,-6.0/9.0, -6.0/9.0, 4.0/9.0,-6.0/9.0, -4.0/9.0, 4.0/9.0,-6.0/9.0,
|
||||
-2.0/9.0, 4.0/9.0,-6.0/9.0, 0.0, 4.0/9.0,-6.0/9.0, 2.0/9.0, 4.0/9.0,-6.0/9.0,
|
||||
4.0/9.0, 4.0/9.0,-6.0/9.0, 6.0/9.0, 4.0/9.0,-6.0/9.0, 8.0/9.0, 4.0/9.0,-6.0/9.0,
|
||||
-8.0/9.0, 6.0/9.0,-6.0/9.0, -6.0/9.0, 6.0/9.0,-6.0/9.0, -4.0/9.0, 6.0/9.0,-6.0/9.0,
|
||||
-2.0/9.0, 6.0/9.0,-6.0/9.0, 0.0, 6.0/9.0,-6.0/9.0, 2.0/9.0, 6.0/9.0,-6.0/9.0,
|
||||
4.0/9.0, 6.0/9.0,-6.0/9.0, 6.0/9.0, 6.0/9.0,-6.0/9.0, 8.0/9.0, 6.0/9.0,-6.0/9.0,
|
||||
-8.0/9.0, 8.0/9.0,-6.0/9.0, -6.0/9.0, 8.0/9.0,-6.0/9.0, -4.0/9.0, 8.0/9.0,-6.0/9.0,
|
||||
-2.0/9.0, 8.0/9.0,-6.0/9.0, 0.0, 8.0/9.0,-6.0/9.0, 2.0/9.0, 8.0/9.0,-6.0/9.0,
|
||||
4.0/9.0, 8.0/9.0,-6.0/9.0, 6.0/9.0, 8.0/9.0,-6.0/9.0, 8.0/9.0, 8.0/9.0,-6.0/9.0,
|
||||
-8.0/9.0,-8.0/9.0,-4.0/9.0, -6.0/9.0,-8.0/9.0,-4.0/9.0, -4.0/9.0,-8.0/9.0,-4.0/9.0,
|
||||
-2.0/9.0,-8.0/9.0,-4.0/9.0, 0.0,-8.0/9.0,-4.0/9.0, 2.0/9.0,-8.0/9.0,-4.0/9.0,
|
||||
4.0/9.0,-8.0/9.0,-4.0/9.0, 6.0/9.0,-8.0/9.0,-4.0/9.0, 8.0/9.0,-8.0/9.0,-4.0/9.0,
|
||||
-8.0/9.0,-6.0/9.0,-4.0/9.0, -6.0/9.0,-6.0/9.0,-4.0/9.0, -4.0/9.0,-6.0/9.0,-4.0/9.0,
|
||||
-2.0/9.0,-6.0/9.0,-4.0/9.0, 0.0,-6.0/9.0,-4.0/9.0, 2.0/9.0,-6.0/9.0,-4.0/9.0,
|
||||
4.0/9.0,-6.0/9.0,-4.0/9.0, 6.0/9.0,-6.0/9.0,-4.0/9.0, 8.0/9.0,-6.0/9.0,-4.0/9.0,
|
||||
-8.0/9.0,-4.0/9.0,-4.0/9.0, -6.0/9.0,-4.0/9.0,-4.0/9.0, -4.0/9.0,-4.0/9.0,-4.0/9.0,
|
||||
-2.0/9.0,-4.0/9.0,-4.0/9.0, 0.0,-4.0/9.0,-4.0/9.0, 2.0/9.0,-4.0/9.0,-4.0/9.0,
|
||||
4.0/9.0,-4.0/9.0,-4.0/9.0, 6.0/9.0,-4.0/9.0,-4.0/9.0, 8.0/9.0,-4.0/9.0,-4.0/9.0,
|
||||
-8.0/9.0,-2.0/9.0,-4.0/9.0, -6.0/9.0,-2.0/9.0,-4.0/9.0, -4.0/9.0,-2.0/9.0,-4.0/9.0,
|
||||
-2.0/9.0,-2.0/9.0,-4.0/9.0, 0.0,-2.0/9.0,-4.0/9.0, 2.0/9.0,-2.0/9.0,-4.0/9.0,
|
||||
4.0/9.0,-2.0/9.0,-4.0/9.0, 6.0/9.0,-2.0/9.0,-4.0/9.0, 8.0/9.0,-2.0/9.0,-4.0/9.0,
|
||||
-8.0/9.0, 0.0,-4.0/9.0, -6.0/9.0, 0.0,-4.0/9.0, -4.0/9.0, 0.0,-4.0/9.0,
|
||||
-2.0/9.0, 0.0,-4.0/9.0, 0.0, 0.0,-4.0/9.0, 2.0/9.0, 0.0,-4.0/9.0,
|
||||
4.0/9.0, 0.0,-4.0/9.0, 6.0/9.0, 0.0,-4.0/9.0, 8.0/9.0, 0.0,-4.0/9.0,
|
||||
-8.0/9.0, 2.0/9.0,-4.0/9.0, -6.0/9.0, 2.0/9.0,-4.0/9.0, -4.0/9.0, 2.0/9.0,-4.0/9.0,
|
||||
-2.0/9.0, 2.0/9.0,-4.0/9.0, 0.0, 2.0/9.0,-4.0/9.0, 2.0/9.0, 2.0/9.0,-4.0/9.0,
|
||||
4.0/9.0, 2.0/9.0,-4.0/9.0, 6.0/9.0, 2.0/9.0,-4.0/9.0, 8.0/9.0, 2.0/9.0,-4.0/9.0,
|
||||
-8.0/9.0, 4.0/9.0,-4.0/9.0, -6.0/9.0, 4.0/9.0,-4.0/9.0, -4.0/9.0, 4.0/9.0,-4.0/9.0,
|
||||
-2.0/9.0, 4.0/9.0,-4.0/9.0, 0.0, 4.0/9.0,-4.0/9.0, 2.0/9.0, 4.0/9.0,-4.0/9.0,
|
||||
4.0/9.0, 4.0/9.0,-4.0/9.0, 6.0/9.0, 4.0/9.0,-4.0/9.0, 8.0/9.0, 4.0/9.0,-4.0/9.0,
|
||||
-8.0/9.0, 6.0/9.0,-4.0/9.0, -6.0/9.0, 6.0/9.0,-4.0/9.0, -4.0/9.0, 6.0/9.0,-4.0/9.0,
|
||||
-2.0/9.0, 6.0/9.0,-4.0/9.0, 0.0, 6.0/9.0,-4.0/9.0, 2.0/9.0, 6.0/9.0,-4.0/9.0,
|
||||
4.0/9.0, 6.0/9.0,-4.0/9.0, 6.0/9.0, 6.0/9.0,-4.0/9.0, 8.0/9.0, 6.0/9.0,-4.0/9.0,
|
||||
-8.0/9.0, 8.0/9.0,-4.0/9.0, -6.0/9.0, 8.0/9.0,-4.0/9.0, -4.0/9.0, 8.0/9.0,-4.0/9.0,
|
||||
-2.0/9.0, 8.0/9.0,-4.0/9.0, 0.0, 8.0/9.0,-4.0/9.0, 2.0/9.0, 8.0/9.0,-4.0/9.0,
|
||||
4.0/9.0, 8.0/9.0,-4.0/9.0, 6.0/9.0, 8.0/9.0,-4.0/9.0, 8.0/9.0, 8.0/9.0,-4.0/9.0,
|
||||
-8.0/9.0,-8.0/9.0,-2.0/9.0, -6.0/9.0,-8.0/9.0,-2.0/9.0, -4.0/9.0,-8.0/9.0,-2.0/9.0,
|
||||
-2.0/9.0,-8.0/9.0,-2.0/9.0, 0.0,-8.0/9.0,-2.0/9.0, 2.0/9.0,-8.0/9.0,-2.0/9.0,
|
||||
4.0/9.0,-8.0/9.0,-2.0/9.0, 6.0/9.0,-8.0/9.0,-2.0/9.0, 8.0/9.0,-8.0/9.0,-2.0/9.0,
|
||||
-8.0/9.0,-6.0/9.0,-2.0/9.0, -6.0/9.0,-6.0/9.0,-2.0/9.0, -4.0/9.0,-6.0/9.0,-2.0/9.0,
|
||||
-2.0/9.0,-6.0/9.0,-2.0/9.0, 0.0,-6.0/9.0,-2.0/9.0, 2.0/9.0,-6.0/9.0,-2.0/9.0,
|
||||
4.0/9.0,-6.0/9.0,-2.0/9.0, 6.0/9.0,-6.0/9.0,-2.0/9.0, 8.0/9.0,-6.0/9.0,-2.0/9.0,
|
||||
-8.0/9.0,-4.0/9.0,-2.0/9.0, -6.0/9.0,-4.0/9.0,-2.0/9.0, -4.0/9.0,-4.0/9.0,-2.0/9.0,
|
||||
-2.0/9.0,-4.0/9.0,-2.0/9.0, 0.0,-4.0/9.0,-2.0/9.0, 2.0/9.0,-4.0/9.0,-2.0/9.0,
|
||||
4.0/9.0,-4.0/9.0,-2.0/9.0, 6.0/9.0,-4.0/9.0,-2.0/9.0, 8.0/9.0,-4.0/9.0,-2.0/9.0,
|
||||
-8.0/9.0,-2.0/9.0,-2.0/9.0, -6.0/9.0,-2.0/9.0,-2.0/9.0, -4.0/9.0,-2.0/9.0,-2.0/9.0,
|
||||
-2.0/9.0,-2.0/9.0,-2.0/9.0, 0.0,-2.0/9.0,-2.0/9.0, 2.0/9.0,-2.0/9.0,-2.0/9.0,
|
||||
4.0/9.0,-2.0/9.0,-2.0/9.0, 6.0/9.0,-2.0/9.0,-2.0/9.0, 8.0/9.0,-2.0/9.0,-2.0/9.0,
|
||||
-8.0/9.0, 0.0,-2.0/9.0, -6.0/9.0, 0.0,-2.0/9.0, -4.0/9.0, 0.0,-2.0/9.0,
|
||||
-2.0/9.0, 0.0,-2.0/9.0, 0.0, 0.0,-2.0/9.0, 2.0/9.0, 0.0,-2.0/9.0,
|
||||
4.0/9.0, 0.0,-2.0/9.0, 6.0/9.0, 0.0,-2.0/9.0, 8.0/9.0, 0.0,-2.0/9.0,
|
||||
-8.0/9.0, 2.0/9.0,-2.0/9.0, -6.0/9.0, 2.0/9.0,-2.0/9.0, -4.0/9.0, 2.0/9.0,-2.0/9.0,
|
||||
-2.0/9.0, 2.0/9.0,-2.0/9.0, 0.0, 2.0/9.0,-2.0/9.0, 2.0/9.0, 2.0/9.0,-2.0/9.0,
|
||||
4.0/9.0, 2.0/9.0,-2.0/9.0, 6.0/9.0, 2.0/9.0,-2.0/9.0, 8.0/9.0, 2.0/9.0,-2.0/9.0,
|
||||
-8.0/9.0, 4.0/9.0,-2.0/9.0, -6.0/9.0, 4.0/9.0,-2.0/9.0, -4.0/9.0, 4.0/9.0,-2.0/9.0,
|
||||
-2.0/9.0, 4.0/9.0,-2.0/9.0, 0.0, 4.0/9.0,-2.0/9.0, 2.0/9.0, 4.0/9.0,-2.0/9.0,
|
||||
4.0/9.0, 4.0/9.0,-2.0/9.0, 6.0/9.0, 4.0/9.0,-2.0/9.0, 8.0/9.0, 4.0/9.0,-2.0/9.0,
|
||||
-8.0/9.0, 6.0/9.0,-2.0/9.0, -6.0/9.0, 6.0/9.0,-2.0/9.0, -4.0/9.0, 6.0/9.0,-2.0/9.0,
|
||||
-2.0/9.0, 6.0/9.0,-2.0/9.0, 0.0, 6.0/9.0,-2.0/9.0, 2.0/9.0, 6.0/9.0,-2.0/9.0,
|
||||
4.0/9.0, 6.0/9.0,-2.0/9.0, 6.0/9.0, 6.0/9.0,-2.0/9.0, 8.0/9.0, 6.0/9.0,-2.0/9.0,
|
||||
-8.0/9.0, 8.0/9.0,-2.0/9.0, -6.0/9.0, 8.0/9.0,-2.0/9.0, -4.0/9.0, 8.0/9.0,-2.0/9.0,
|
||||
-2.0/9.0, 8.0/9.0,-2.0/9.0, 0.0, 8.0/9.0,-2.0/9.0, 2.0/9.0, 8.0/9.0,-2.0/9.0,
|
||||
4.0/9.0, 8.0/9.0,-2.0/9.0, 6.0/9.0, 8.0/9.0,-2.0/9.0, 8.0/9.0, 8.0/9.0,-2.0/9.0,
|
||||
-8.0/9.0,-8.0/9.0, 0.0, -6.0/9.0,-8.0/9.0, 0.0, -4.0/9.0,-8.0/9.0, 0.0,
|
||||
-2.0/9.0,-8.0/9.0, 0.0, 0.0,-8.0/9.0, 0.0, 2.0/9.0,-8.0/9.0, 0.0,
|
||||
4.0/9.0,-8.0/9.0, 0.0, 6.0/9.0,-8.0/9.0, 0.0, 8.0/9.0,-8.0/9.0, 0.0,
|
||||
-8.0/9.0,-6.0/9.0, 0.0, -6.0/9.0,-6.0/9.0, 0.0, -4.0/9.0,-6.0/9.0, 0.0,
|
||||
-2.0/9.0,-6.0/9.0, 0.0, 0.0,-6.0/9.0, 0.0, 2.0/9.0,-6.0/9.0, 0.0,
|
||||
4.0/9.0,-6.0/9.0, 0.0, 6.0/9.0,-6.0/9.0, 0.0, 8.0/9.0,-6.0/9.0, 0.0,
|
||||
-8.0/9.0,-4.0/9.0, 0.0, -6.0/9.0,-4.0/9.0, 0.0, -4.0/9.0,-4.0/9.0, 0.0,
|
||||
-2.0/9.0,-4.0/9.0, 0.0, 0.0,-4.0/9.0, 0.0, 2.0/9.0,-4.0/9.0, 0.0,
|
||||
4.0/9.0,-4.0/9.0, 0.0, 6.0/9.0,-4.0/9.0, 0.0, 8.0/9.0,-4.0/9.0, 0.0,
|
||||
-8.0/9.0,-2.0/9.0, 0.0, -6.0/9.0,-2.0/9.0, 0.0, -4.0/9.0,-2.0/9.0, 0.0,
|
||||
-2.0/9.0,-2.0/9.0, 0.0, 0.0,-2.0/9.0, 0.0, 2.0/9.0,-2.0/9.0, 0.0,
|
||||
4.0/9.0,-2.0/9.0, 0.0, 6.0/9.0,-2.0/9.0, 0.0, 8.0/9.0,-2.0/9.0, 0.0,
|
||||
-8.0/9.0, 0.0, 0.0, -6.0/9.0, 0.0, 0.0, -4.0/9.0, 0.0, 0.0,
|
||||
-2.0/9.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0/9.0, 0.0, 0.0,
|
||||
4.0/9.0, 0.0, 0.0, 6.0/9.0, 0.0, 0.0, 8.0/9.0, 0.0, 0.0,
|
||||
-8.0/9.0, 2.0/9.0, 0.0, -6.0/9.0, 2.0/9.0, 0.0, -4.0/9.0, 2.0/9.0, 0.0,
|
||||
-2.0/9.0, 2.0/9.0, 0.0, 0.0, 2.0/9.0, 0.0, 2.0/9.0, 2.0/9.0, 0.0,
|
||||
4.0/9.0, 2.0/9.0, 0.0, 6.0/9.0, 2.0/9.0, 0.0, 8.0/9.0, 2.0/9.0, 0.0,
|
||||
-8.0/9.0, 4.0/9.0, 0.0, -6.0/9.0, 4.0/9.0, 0.0, -4.0/9.0, 4.0/9.0, 0.0,
|
||||
-2.0/9.0, 4.0/9.0, 0.0, 0.0, 4.0/9.0, 0.0, 2.0/9.0, 4.0/9.0, 0.0,
|
||||
4.0/9.0, 4.0/9.0, 0.0, 6.0/9.0, 4.0/9.0, 0.0, 8.0/9.0, 4.0/9.0, 0.0,
|
||||
-8.0/9.0, 6.0/9.0, 0.0, -6.0/9.0, 6.0/9.0, 0.0, -4.0/9.0, 6.0/9.0, 0.0,
|
||||
-2.0/9.0, 6.0/9.0, 0.0, 0.0, 6.0/9.0, 0.0, 2.0/9.0, 6.0/9.0, 0.0,
|
||||
4.0/9.0, 6.0/9.0, 0.0, 6.0/9.0, 6.0/9.0, 0.0, 8.0/9.0, 6.0/9.0, 0.0,
|
||||
-8.0/9.0, 8.0/9.0, 0.0, -6.0/9.0, 8.0/9.0, 0.0, -4.0/9.0, 8.0/9.0, 0.0,
|
||||
-2.0/9.0, 8.0/9.0, 0.0, 0.0, 8.0/9.0, 0.0, 2.0/9.0, 8.0/9.0, 0.0,
|
||||
4.0/9.0, 8.0/9.0, 0.0, 6.0/9.0, 8.0/9.0, 0.0, 8.0/9.0, 8.0/9.0, 0.0,
|
||||
-8.0/9.0,-8.0/9.0, 2.0/9.0, -6.0/9.0,-8.0/9.0, 2.0/9.0, -4.0/9.0,-8.0/9.0, 2.0/9.0,
|
||||
-2.0/9.0,-8.0/9.0, 2.0/9.0, 0.0,-8.0/9.0, 2.0/9.0, 2.0/9.0,-8.0/9.0, 2.0/9.0,
|
||||
4.0/9.0,-8.0/9.0, 2.0/9.0, 6.0/9.0,-8.0/9.0, 2.0/9.0, 8.0/9.0,-8.0/9.0, 2.0/9.0,
|
||||
-8.0/9.0,-6.0/9.0, 2.0/9.0, -6.0/9.0,-6.0/9.0, 2.0/9.0, -4.0/9.0,-6.0/9.0, 2.0/9.0,
|
||||
-2.0/9.0,-6.0/9.0, 2.0/9.0, 0.0,-6.0/9.0, 2.0/9.0, 2.0/9.0,-6.0/9.0, 2.0/9.0,
|
||||
4.0/9.0,-6.0/9.0, 2.0/9.0, 6.0/9.0,-6.0/9.0, 2.0/9.0, 8.0/9.0,-6.0/9.0, 2.0/9.0,
|
||||
-8.0/9.0,-4.0/9.0, 2.0/9.0, -6.0/9.0,-4.0/9.0, 2.0/9.0, -4.0/9.0,-4.0/9.0, 2.0/9.0,
|
||||
-2.0/9.0,-4.0/9.0, 2.0/9.0, 0.0,-4.0/9.0, 2.0/9.0, 2.0/9.0,-4.0/9.0, 2.0/9.0,
|
||||
4.0/9.0,-4.0/9.0, 2.0/9.0, 6.0/9.0,-4.0/9.0, 2.0/9.0, 8.0/9.0,-4.0/9.0, 2.0/9.0,
|
||||
-8.0/9.0,-2.0/9.0, 2.0/9.0, -6.0/9.0,-2.0/9.0, 2.0/9.0, -4.0/9.0,-2.0/9.0, 2.0/9.0,
|
||||
-2.0/9.0,-2.0/9.0, 2.0/9.0, 0.0,-2.0/9.0, 2.0/9.0, 2.0/9.0,-2.0/9.0, 2.0/9.0,
|
||||
4.0/9.0,-2.0/9.0, 2.0/9.0, 6.0/9.0,-2.0/9.0, 2.0/9.0, 8.0/9.0,-2.0/9.0, 2.0/9.0,
|
||||
-8.0/9.0, 0.0, 2.0/9.0, -6.0/9.0, 0.0, 2.0/9.0, -4.0/9.0, 0.0, 2.0/9.0,
|
||||
-2.0/9.0, 0.0, 2.0/9.0, 0.0, 0.0, 2.0/9.0, 2.0/9.0, 0.0, 2.0/9.0,
|
||||
4.0/9.0, 0.0, 2.0/9.0, 6.0/9.0, 0.0, 2.0/9.0, 8.0/9.0, 0.0, 2.0/9.0,
|
||||
-8.0/9.0, 2.0/9.0, 2.0/9.0, -6.0/9.0, 2.0/9.0, 2.0/9.0, -4.0/9.0, 2.0/9.0, 2.0/9.0,
|
||||
-2.0/9.0, 2.0/9.0, 2.0/9.0, 0.0, 2.0/9.0, 2.0/9.0, 2.0/9.0, 2.0/9.0, 2.0/9.0,
|
||||
4.0/9.0, 2.0/9.0, 2.0/9.0, 6.0/9.0, 2.0/9.0, 2.0/9.0, 8.0/9.0, 2.0/9.0, 2.0/9.0,
|
||||
-8.0/9.0, 4.0/9.0, 2.0/9.0, -6.0/9.0, 4.0/9.0, 2.0/9.0, -4.0/9.0, 4.0/9.0, 2.0/9.0,
|
||||
-2.0/9.0, 4.0/9.0, 2.0/9.0, 0.0, 4.0/9.0, 2.0/9.0, 2.0/9.0, 4.0/9.0, 2.0/9.0,
|
||||
4.0/9.0, 4.0/9.0, 2.0/9.0, 6.0/9.0, 4.0/9.0, 2.0/9.0, 8.0/9.0, 4.0/9.0, 2.0/9.0,
|
||||
-8.0/9.0, 6.0/9.0, 2.0/9.0, -6.0/9.0, 6.0/9.0, 2.0/9.0, -4.0/9.0, 6.0/9.0, 2.0/9.0,
|
||||
-2.0/9.0, 6.0/9.0, 2.0/9.0, 0.0, 6.0/9.0, 2.0/9.0, 2.0/9.0, 6.0/9.0, 2.0/9.0,
|
||||
4.0/9.0, 6.0/9.0, 2.0/9.0, 6.0/9.0, 6.0/9.0, 2.0/9.0, 8.0/9.0, 6.0/9.0, 2.0/9.0,
|
||||
-8.0/9.0, 8.0/9.0, 2.0/9.0, -6.0/9.0, 8.0/9.0, 2.0/9.0, -4.0/9.0, 8.0/9.0, 2.0/9.0,
|
||||
-2.0/9.0, 8.0/9.0, 2.0/9.0, 0.0, 8.0/9.0, 2.0/9.0, 2.0/9.0, 8.0/9.0, 2.0/9.0,
|
||||
4.0/9.0, 8.0/9.0, 2.0/9.0, 6.0/9.0, 8.0/9.0, 2.0/9.0, 8.0/9.0, 8.0/9.0, 2.0/9.0,
|
||||
-8.0/9.0,-8.0/9.0, 4.0/9.0, -6.0/9.0,-8.0/9.0, 4.0/9.0, -4.0/9.0,-8.0/9.0, 4.0/9.0,
|
||||
-2.0/9.0,-8.0/9.0, 4.0/9.0, 0.0,-8.0/9.0, 4.0/9.0, 2.0/9.0,-8.0/9.0, 4.0/9.0,
|
||||
4.0/9.0,-8.0/9.0, 4.0/9.0, 6.0/9.0,-8.0/9.0, 4.0/9.0, 8.0/9.0,-8.0/9.0, 4.0/9.0,
|
||||
-8.0/9.0,-6.0/9.0, 4.0/9.0, -6.0/9.0,-6.0/9.0, 4.0/9.0, -4.0/9.0,-6.0/9.0, 4.0/9.0,
|
||||
-2.0/9.0,-6.0/9.0, 4.0/9.0, 0.0,-6.0/9.0, 4.0/9.0, 2.0/9.0,-6.0/9.0, 4.0/9.0,
|
||||
4.0/9.0,-6.0/9.0, 4.0/9.0, 6.0/9.0,-6.0/9.0, 4.0/9.0, 8.0/9.0,-6.0/9.0, 4.0/9.0,
|
||||
-8.0/9.0,-4.0/9.0, 4.0/9.0, -6.0/9.0,-4.0/9.0, 4.0/9.0, -4.0/9.0,-4.0/9.0, 4.0/9.0,
|
||||
-2.0/9.0,-4.0/9.0, 4.0/9.0, 0.0,-4.0/9.0, 4.0/9.0, 2.0/9.0,-4.0/9.0, 4.0/9.0,
|
||||
4.0/9.0,-4.0/9.0, 4.0/9.0, 6.0/9.0,-4.0/9.0, 4.0/9.0, 8.0/9.0,-4.0/9.0, 4.0/9.0,
|
||||
-8.0/9.0,-2.0/9.0, 4.0/9.0, -6.0/9.0,-2.0/9.0, 4.0/9.0, -4.0/9.0,-2.0/9.0, 4.0/9.0,
|
||||
-2.0/9.0,-2.0/9.0, 4.0/9.0, 0.0,-2.0/9.0, 4.0/9.0, 2.0/9.0,-2.0/9.0, 4.0/9.0,
|
||||
4.0/9.0,-2.0/9.0, 4.0/9.0, 6.0/9.0,-2.0/9.0, 4.0/9.0, 8.0/9.0,-2.0/9.0, 4.0/9.0,
|
||||
-8.0/9.0, 0.0, 4.0/9.0, -6.0/9.0, 0.0, 4.0/9.0, -4.0/9.0, 0.0, 4.0/9.0,
|
||||
-2.0/9.0, 0.0, 4.0/9.0, 0.0, 0.0, 4.0/9.0, 2.0/9.0, 0.0, 4.0/9.0,
|
||||
4.0/9.0, 0.0, 4.0/9.0, 6.0/9.0, 0.0, 4.0/9.0, 8.0/9.0, 0.0, 4.0/9.0,
|
||||
-8.0/9.0, 2.0/9.0, 4.0/9.0, -6.0/9.0, 2.0/9.0, 4.0/9.0, -4.0/9.0, 2.0/9.0, 4.0/9.0,
|
||||
-2.0/9.0, 2.0/9.0, 4.0/9.0, 0.0, 2.0/9.0, 4.0/9.0, 2.0/9.0, 2.0/9.0, 4.0/9.0,
|
||||
4.0/9.0, 2.0/9.0, 4.0/9.0, 6.0/9.0, 2.0/9.0, 4.0/9.0, 8.0/9.0, 2.0/9.0, 4.0/9.0,
|
||||
-8.0/9.0, 4.0/9.0, 4.0/9.0, -6.0/9.0, 4.0/9.0, 4.0/9.0, -4.0/9.0, 4.0/9.0, 4.0/9.0,
|
||||
-2.0/9.0, 4.0/9.0, 4.0/9.0, 0.0, 4.0/9.0, 4.0/9.0, 2.0/9.0, 4.0/9.0, 4.0/9.0,
|
||||
4.0/9.0, 4.0/9.0, 4.0/9.0, 6.0/9.0, 4.0/9.0, 4.0/9.0, 8.0/9.0, 4.0/9.0, 4.0/9.0,
|
||||
-8.0/9.0, 6.0/9.0, 4.0/9.0, -6.0/9.0, 6.0/9.0, 4.0/9.0, -4.0/9.0, 6.0/9.0, 4.0/9.0,
|
||||
-2.0/9.0, 6.0/9.0, 4.0/9.0, 0.0, 6.0/9.0, 4.0/9.0, 2.0/9.0, 6.0/9.0, 4.0/9.0,
|
||||
4.0/9.0, 6.0/9.0, 4.0/9.0, 6.0/9.0, 6.0/9.0, 4.0/9.0, 8.0/9.0, 6.0/9.0, 4.0/9.0,
|
||||
-8.0/9.0, 8.0/9.0, 4.0/9.0, -6.0/9.0, 8.0/9.0, 4.0/9.0, -4.0/9.0, 8.0/9.0, 4.0/9.0,
|
||||
-2.0/9.0, 8.0/9.0, 4.0/9.0, 0.0, 8.0/9.0, 4.0/9.0, 2.0/9.0, 8.0/9.0, 4.0/9.0,
|
||||
4.0/9.0, 8.0/9.0, 4.0/9.0, 6.0/9.0, 8.0/9.0, 4.0/9.0, 8.0/9.0, 8.0/9.0, 4.0/9.0,
|
||||
-8.0/9.0,-8.0/9.0, 6.0/9.0, -6.0/9.0,-8.0/9.0, 6.0/9.0, -4.0/9.0,-8.0/9.0, 6.0/9.0,
|
||||
-2.0/9.0,-8.0/9.0, 6.0/9.0, 0.0,-8.0/9.0, 6.0/9.0, 2.0/9.0,-8.0/9.0, 6.0/9.0,
|
||||
4.0/9.0,-8.0/9.0, 6.0/9.0, 6.0/9.0,-8.0/9.0, 6.0/9.0, 8.0/9.0,-8.0/9.0, 6.0/9.0,
|
||||
-8.0/9.0,-6.0/9.0, 6.0/9.0, -6.0/9.0,-6.0/9.0, 6.0/9.0, -4.0/9.0,-6.0/9.0, 6.0/9.0,
|
||||
-2.0/9.0,-6.0/9.0, 6.0/9.0, 0.0,-6.0/9.0, 6.0/9.0, 2.0/9.0,-6.0/9.0, 6.0/9.0,
|
||||
4.0/9.0,-6.0/9.0, 6.0/9.0, 6.0/9.0,-6.0/9.0, 6.0/9.0, 8.0/9.0,-6.0/9.0, 6.0/9.0,
|
||||
-8.0/9.0,-4.0/9.0, 6.0/9.0, -6.0/9.0,-4.0/9.0, 6.0/9.0, -4.0/9.0,-4.0/9.0, 6.0/9.0,
|
||||
-2.0/9.0,-4.0/9.0, 6.0/9.0, 0.0,-4.0/9.0, 6.0/9.0, 2.0/9.0,-4.0/9.0, 6.0/9.0,
|
||||
4.0/9.0,-4.0/9.0, 6.0/9.0, 6.0/9.0,-4.0/9.0, 6.0/9.0, 8.0/9.0,-4.0/9.0, 6.0/9.0,
|
||||
-8.0/9.0,-2.0/9.0, 6.0/9.0, -6.0/9.0,-2.0/9.0, 6.0/9.0, -4.0/9.0,-2.0/9.0, 6.0/9.0,
|
||||
-2.0/9.0,-2.0/9.0, 6.0/9.0, 0.0,-2.0/9.0, 6.0/9.0, 2.0/9.0,-2.0/9.0, 6.0/9.0,
|
||||
4.0/9.0,-2.0/9.0, 6.0/9.0, 6.0/9.0,-2.0/9.0, 6.0/9.0, 8.0/9.0,-2.0/9.0, 6.0/9.0,
|
||||
-8.0/9.0, 0.0, 6.0/9.0, -6.0/9.0, 0.0, 6.0/9.0, -4.0/9.0, 0.0, 6.0/9.0,
|
||||
-2.0/9.0, 0.0, 6.0/9.0, 0.0, 0.0, 6.0/9.0, 2.0/9.0, 0.0, 6.0/9.0,
|
||||
4.0/9.0, 0.0, 6.0/9.0, 6.0/9.0, 0.0, 6.0/9.0, 8.0/9.0, 0.0, 6.0/9.0,
|
||||
-8.0/9.0, 2.0/9.0, 6.0/9.0, -6.0/9.0, 2.0/9.0, 6.0/9.0, -4.0/9.0, 2.0/9.0, 6.0/9.0,
|
||||
-2.0/9.0, 2.0/9.0, 6.0/9.0, 0.0, 2.0/9.0, 6.0/9.0, 2.0/9.0, 2.0/9.0, 6.0/9.0,
|
||||
4.0/9.0, 2.0/9.0, 6.0/9.0, 6.0/9.0, 2.0/9.0, 6.0/9.0, 8.0/9.0, 2.0/9.0, 6.0/9.0,
|
||||
-8.0/9.0, 4.0/9.0, 6.0/9.0, -6.0/9.0, 4.0/9.0, 6.0/9.0, -4.0/9.0, 4.0/9.0, 6.0/9.0,
|
||||
-2.0/9.0, 4.0/9.0, 6.0/9.0, 0.0, 4.0/9.0, 6.0/9.0, 2.0/9.0, 4.0/9.0, 6.0/9.0,
|
||||
4.0/9.0, 4.0/9.0, 6.0/9.0, 6.0/9.0, 4.0/9.0, 6.0/9.0, 8.0/9.0, 4.0/9.0, 6.0/9.0,
|
||||
-8.0/9.0, 6.0/9.0, 6.0/9.0, -6.0/9.0, 6.0/9.0, 6.0/9.0, -4.0/9.0, 6.0/9.0, 6.0/9.0,
|
||||
-2.0/9.0, 6.0/9.0, 6.0/9.0, 0.0, 6.0/9.0, 6.0/9.0, 2.0/9.0, 6.0/9.0, 6.0/9.0,
|
||||
4.0/9.0, 6.0/9.0, 6.0/9.0, 6.0/9.0, 6.0/9.0, 6.0/9.0, 8.0/9.0, 6.0/9.0, 6.0/9.0,
|
||||
-8.0/9.0, 8.0/9.0, 6.0/9.0, -6.0/9.0, 8.0/9.0, 6.0/9.0, -4.0/9.0, 8.0/9.0, 6.0/9.0,
|
||||
-2.0/9.0, 8.0/9.0, 6.0/9.0, 0.0, 8.0/9.0, 6.0/9.0, 2.0/9.0, 8.0/9.0, 6.0/9.0,
|
||||
4.0/9.0, 8.0/9.0, 6.0/9.0, 6.0/9.0, 8.0/9.0, 6.0/9.0, 8.0/9.0, 8.0/9.0, 6.0/9.0,
|
||||
-8.0/9.0,-8.0/9.0, 8.0/9.0, -6.0/9.0,-8.0/9.0, 8.0/9.0, -4.0/9.0,-8.0/9.0, 8.0/9.0,
|
||||
-2.0/9.0,-8.0/9.0, 8.0/9.0, 0.0,-8.0/9.0, 8.0/9.0, 2.0/9.0,-8.0/9.0, 8.0/9.0,
|
||||
4.0/9.0,-8.0/9.0, 8.0/9.0, 6.0/9.0,-8.0/9.0, 8.0/9.0, 8.0/9.0,-8.0/9.0, 8.0/9.0,
|
||||
-8.0/9.0,-6.0/9.0, 8.0/9.0, -6.0/9.0,-6.0/9.0, 8.0/9.0, -4.0/9.0,-6.0/9.0, 8.0/9.0,
|
||||
-2.0/9.0,-6.0/9.0, 8.0/9.0, 0.0,-6.0/9.0, 8.0/9.0, 2.0/9.0,-6.0/9.0, 8.0/9.0,
|
||||
4.0/9.0,-6.0/9.0, 8.0/9.0, 6.0/9.0,-6.0/9.0, 8.0/9.0, 8.0/9.0,-6.0/9.0, 8.0/9.0,
|
||||
-8.0/9.0,-4.0/9.0, 8.0/9.0, -6.0/9.0,-4.0/9.0, 8.0/9.0, -4.0/9.0,-4.0/9.0, 8.0/9.0,
|
||||
-2.0/9.0,-4.0/9.0, 8.0/9.0, 0.0,-4.0/9.0, 8.0/9.0, 2.0/9.0,-4.0/9.0, 8.0/9.0,
|
||||
4.0/9.0,-4.0/9.0, 8.0/9.0, 6.0/9.0,-4.0/9.0, 8.0/9.0, 8.0/9.0,-4.0/9.0, 8.0/9.0,
|
||||
-8.0/9.0,-2.0/9.0, 8.0/9.0, -6.0/9.0,-2.0/9.0, 8.0/9.0, -4.0/9.0,-2.0/9.0, 8.0/9.0,
|
||||
-2.0/9.0,-2.0/9.0, 8.0/9.0, 0.0,-2.0/9.0, 8.0/9.0, 2.0/9.0,-2.0/9.0, 8.0/9.0,
|
||||
4.0/9.0,-2.0/9.0, 8.0/9.0, 6.0/9.0,-2.0/9.0, 8.0/9.0, 8.0/9.0,-2.0/9.0, 8.0/9.0,
|
||||
-8.0/9.0, 0.0, 8.0/9.0, -6.0/9.0, 0.0, 8.0/9.0, -4.0/9.0, 0.0, 8.0/9.0,
|
||||
-2.0/9.0, 0.0, 8.0/9.0, 0.0, 0.0, 8.0/9.0, 2.0/9.0, 0.0, 8.0/9.0,
|
||||
4.0/9.0, 0.0, 8.0/9.0, 6.0/9.0, 0.0, 8.0/9.0, 8.0/9.0, 0.0, 8.0/9.0,
|
||||
-8.0/9.0, 2.0/9.0, 8.0/9.0, -6.0/9.0, 2.0/9.0, 8.0/9.0, -4.0/9.0, 2.0/9.0, 8.0/9.0,
|
||||
-2.0/9.0, 2.0/9.0, 8.0/9.0, 0.0, 2.0/9.0, 8.0/9.0, 2.0/9.0, 2.0/9.0, 8.0/9.0,
|
||||
4.0/9.0, 2.0/9.0, 8.0/9.0, 6.0/9.0, 2.0/9.0, 8.0/9.0, 8.0/9.0, 2.0/9.0, 8.0/9.0,
|
||||
-8.0/9.0, 4.0/9.0, 8.0/9.0, -6.0/9.0, 4.0/9.0, 8.0/9.0, -4.0/9.0, 4.0/9.0, 8.0/9.0,
|
||||
-2.0/9.0, 4.0/9.0, 8.0/9.0, 0.0, 4.0/9.0, 8.0/9.0, 2.0/9.0, 4.0/9.0, 8.0/9.0,
|
||||
4.0/9.0, 4.0/9.0, 8.0/9.0, 6.0/9.0, 4.0/9.0, 8.0/9.0, 8.0/9.0, 4.0/9.0, 8.0/9.0,
|
||||
-8.0/9.0, 6.0/9.0, 8.0/9.0, -6.0/9.0, 6.0/9.0, 8.0/9.0, -4.0/9.0, 6.0/9.0, 8.0/9.0,
|
||||
-2.0/9.0, 6.0/9.0, 8.0/9.0, 0.0, 6.0/9.0, 8.0/9.0, 2.0/9.0, 6.0/9.0, 8.0/9.0,
|
||||
4.0/9.0, 6.0/9.0, 8.0/9.0, 6.0/9.0, 6.0/9.0, 8.0/9.0, 8.0/9.0, 6.0/9.0, 8.0/9.0,
|
||||
-8.0/9.0, 8.0/9.0, 8.0/9.0, -6.0/9.0, 8.0/9.0, 8.0/9.0, -4.0/9.0, 8.0/9.0, 8.0/9.0,
|
||||
-2.0/9.0, 8.0/9.0, 8.0/9.0, 0.0, 8.0/9.0, 8.0/9.0, 2.0/9.0, 8.0/9.0, 8.0/9.0,
|
||||
4.0/9.0, 8.0/9.0, 8.0/9.0, 6.0/9.0, 8.0/9.0, 8.0/9.0, 8.0/9.0, 8.0/9.0, 8.0/9.0
|
||||
};
|
||||
|
||||
|
||||
static const REAL *grouptableA[16] =
|
||||
{ 0,group5bits,group7bits,group10bits,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
static const REAL *grouptableB1[16] =
|
||||
{ 0,group5bits,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
|
||||
static const REAL *grouptableB234[16] =
|
||||
{ 0,group5bits,group7bits,0,group10bits,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
static const int codelengthtableA[16] =
|
||||
{ 0, 5, 7, 10, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
|
||||
static const int codelengthtableB1[16] =
|
||||
{ 0, 5, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
|
||||
static const int codelengthtableB2[16] =
|
||||
{ 0, 5, 7, 3, 10, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16 };
|
||||
static const int codelengthtableB3[8] = { 0, 5, 7, 3, 10, 4, 5, 16 };
|
||||
static const int codelengthtableB4[4] = { 0, 5, 7, 16 };
|
||||
|
||||
|
||||
static const REAL factortableA[16] =
|
||||
{ 0.0, 1.0/2.0, 1.0/4.0, 1.0/8.0,
|
||||
1.0/8.0, 1.0/16.0, 1.0/32.0, 1.0/64.0,
|
||||
1.0/128.0, 1.0/256.0, 1.0/512.0, 1.0/1024.0,
|
||||
1.0/2048.0, 1.0/4096.0, 1.0/8192.0, 1.0/16384.0 };
|
||||
static const REAL factortableB1[16] =
|
||||
{ 0.0, 1.0/2.0, 1.0/4.0, 1.0/8.0,
|
||||
1.0/16.0, 1.0/32.0, 1.0/64.0, 1.0/128.0,
|
||||
1.0/256.0, 1.0/512.0, 1.0/1024.0, 1.0/2048.0,
|
||||
1.0/4096.0, 1.0/8192.0, 1.0/16384.0, 1.0/32768.0 };
|
||||
static const REAL factortableB2[16] =
|
||||
{ 0.0, 1.0/2.0, 1.0/4.0, 1.0/4.0,
|
||||
1.0/8.0, 1.0/8.0, 1.0/16.0, 1.0/32.0,
|
||||
1.0/64.0, 1.0/128.0, 1.0/256.0, 1.0/512.0,
|
||||
1.0/1024.0, 1.0/2048.0, 1.0/4096.0, 1.0/32768.0 };
|
||||
static const REAL factortableB3[8] =
|
||||
{ 0.0, 1.0/2.0, 1.0/4.0, 1.0/4.0, 1.0/8.0, 1.0/8.0, 1.0/16.0, 1.0/32768.0 };
|
||||
static const REAL factortableB4[4] = { 0.0, 1.0/2.0, 1.0/4.0, 1.0/32768.0 };
|
||||
|
||||
|
||||
static const REAL ctableA[16]=
|
||||
{ 0.0, 1.33333333333, 1.60000000000, 1.77777777777,
|
||||
1.06666666666, 1.03225806452, 1.01587301587, 1.00787401575,
|
||||
1.00392156863, 1.00195694716, 1.00097751711, 1.00048851979,
|
||||
1.00024420024, 1.00012208522, 1.00006103888, 1.00003051851};
|
||||
static const REAL ctableB1[16]=
|
||||
{ 0.0, 1.33333333333, 1.14285714286, 1.06666666666,
|
||||
1.03225806452, 1.01587301587, 1.00787401575, 1.00392156863,
|
||||
1.00195694716, 1.00097751711, 1.00048851979, 1.00024420024,
|
||||
1.00012208522, 1.00006103888, 1.00003051851, 1.00001525902};
|
||||
static const REAL ctableB2[16] =
|
||||
{ 0.0, 1.33333333333, 1.60000000000, 1.14285714286,
|
||||
1.77777777777, 1.06666666666, 1.03225806452, 1.01587301587,
|
||||
1.00787401575, 1.00392156863, 1.00195694716, 1.00097751711,
|
||||
1.00048851979, 1.00024420024, 1.00012208522, 1.00001525902};
|
||||
static const REAL ctableB3[8] =
|
||||
{ 0.0, 1.33333333333, 1.60000000000, 1.14285714286,
|
||||
1.77777777777, 1.06666666666, 1.03225806452, 1.00001525902 };
|
||||
static const REAL ctableB4[4] =
|
||||
{ 0.0, 1.33333333333, 1.60000000000, 1.00001525902 };
|
||||
|
||||
|
||||
static const REAL dtableA[16]=
|
||||
{ 0.0, 0.50000000000, 0.50000000000, 0.50000000000,
|
||||
0.12500000000, 0.06250000000, 0.03125000000, 0.01562500000,
|
||||
0.00781250000, 0.00390625000, 0.00195312500, 0.00097656250,
|
||||
0.00048828125, 0.00024414063, 0.00012207031, 0.00006103516};
|
||||
|
||||
static const REAL dtableB1[16]=
|
||||
{ 0.0, 0.50000000000, 0.25000000000, 0.12500000000,
|
||||
0.06250000000, 0.03125000000, 0.01562500000, 0.00781250000,
|
||||
0.00390625000, 0.00195312500, 0.00097656250, 0.00048828125,
|
||||
0.00024414063, 0.00012207031, 0.00006103516, 0.00003051758};
|
||||
|
||||
static const REAL dtableB2[16]=
|
||||
{ 0.0, 0.50000000000, 0.50000000000, 0.25000000000,
|
||||
0.50000000000, 0.12500000000, 0.06250000000, 0.03125000000,
|
||||
0.01562500000, 0.00781250000, 0.00390625000, 0.00195312500,
|
||||
0.00097656250, 0.00048828125, 0.00024414063, 0.00003051758};
|
||||
|
||||
static const REAL dtableB3[8]=
|
||||
{ 0.0, 0.50000000000, 0.50000000000, 0.25000000000,
|
||||
0.50000000000, 0.12500000000, 0.06250000000, 0.00003051758};
|
||||
|
||||
static const REAL dtableB4[4]=
|
||||
{0.0, 0.50000000000, 0.50000000000, 0.00003051758};
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(default : 4305)
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
bitwindow class
|
||||
Copyright (C) 2000 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - removed cout and exit stuff
|
||||
|
||||
|
||||
#include "mpegAudioBitWindow.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int MpegAudioBitWindow::getCanReadBits() {
|
||||
int p=bitindex>>3;
|
||||
int bytes=point - p;
|
||||
int bits=bytes*8+(bitindex&7);
|
||||
/*cout << "point:"<<point
|
||||
<< " p:"<<p
|
||||
<< " bytes:"<<bytes
|
||||
<<" bitindex:"<<bitindex<<" can read:"<<bits<<endl;*/
|
||||
return bits;
|
||||
}
|
||||
|
||||
void MpegAudioBitWindow::wrap(void) {
|
||||
int p=bitindex>>3;
|
||||
point&=(WINDOWSIZE-1);
|
||||
|
||||
if(p>=point) {
|
||||
for(register int i=4;i<point;i++)
|
||||
buffer[WINDOWSIZE+i]=buffer[i];
|
||||
}
|
||||
*((int *)(buffer+WINDOWSIZE))=*((int *)buffer);
|
||||
}
|
|
@ -1,144 +0,0 @@
|
|||
/*
|
||||
bitwindow class
|
||||
Copyright (C) 2000 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/11/2002 (by Hauke Duden):
|
||||
// - removed unnecessary includes
|
||||
|
||||
|
||||
#ifndef __MPEGBITWINDOW_H
|
||||
#define __MPEGBITWINDOW_H
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
//#include <iostream.h>
|
||||
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
#define _KEY 0
|
||||
#else
|
||||
#define _KEY 3
|
||||
#endif
|
||||
|
||||
#define WINDOWSIZE 4096
|
||||
#define BITWINDOWSIZE (WINDOWSIZE*8)
|
||||
|
||||
|
||||
class MpegAudioBitWindow {
|
||||
|
||||
int point,bitindex;
|
||||
char buffer[2*WINDOWSIZE];
|
||||
|
||||
public:
|
||||
MpegAudioBitWindow(){bitindex=point=0;}
|
||||
|
||||
inline void initialize(void) {bitindex=point=0;}
|
||||
inline int gettotalbit(void) const {return bitindex;}
|
||||
|
||||
inline void putbyte(int c) {buffer[point&(WINDOWSIZE-1)]=c;point++;}
|
||||
void wrap(void);
|
||||
inline void rewind(int bits) {bitindex-=bits;}
|
||||
inline void forward(int bits) {bitindex+=bits;}
|
||||
|
||||
// returns number of bits which can safley read
|
||||
int getCanReadBits();
|
||||
|
||||
|
||||
//
|
||||
// Ugly bitgetting inline functions for higher speed
|
||||
//
|
||||
|
||||
|
||||
inline int getbits(int bits) {
|
||||
union
|
||||
{
|
||||
char store[4];
|
||||
int current;
|
||||
}u;
|
||||
int bi;
|
||||
|
||||
if(!bits)return 0;
|
||||
|
||||
u.current=0;
|
||||
bi=(bitindex&7);
|
||||
u.store[_KEY]=buffer[(bitindex>>3)&(WINDOWSIZE-1)]<<bi;
|
||||
//u.store[_KEY]=buffer[bitindex>>3]<<bi;
|
||||
bi=8-bi;
|
||||
bitindex+=bi;
|
||||
|
||||
while(bits) {
|
||||
if(!bi) {
|
||||
u.store[_KEY]=buffer[(bitindex>>3)&(WINDOWSIZE-1)];
|
||||
//u.store[_KEY]=buffer[bitindex>>3];
|
||||
bitindex+=8;
|
||||
bi=8;
|
||||
}
|
||||
|
||||
if(bits>=bi) {
|
||||
u.current<<=bi;
|
||||
bits-=bi;
|
||||
bi=0;
|
||||
}
|
||||
else {
|
||||
u.current<<=bits;
|
||||
bi-=bits;
|
||||
bits=0;
|
||||
}
|
||||
}
|
||||
bitindex-=bi;
|
||||
|
||||
return (u.current>>8);
|
||||
}
|
||||
|
||||
|
||||
int getbit(void) {
|
||||
register int r=(buffer[(bitindex>>3)&(WINDOWSIZE-1)]>>(7-(bitindex&7)))&1;
|
||||
//register int r=(buffer[bitindex>>3]>>(7-(bitindex&7)))&1;
|
||||
bitindex++;
|
||||
return r;
|
||||
}
|
||||
|
||||
// no range check version
|
||||
inline int getbits9_f(int bits) {
|
||||
register unsigned short a;
|
||||
{
|
||||
int offset=bitindex>>3;
|
||||
a=(((unsigned char)buffer[offset])<<8)|((unsigned char)buffer[offset+1]);
|
||||
}
|
||||
a<<=(bitindex&7);
|
||||
bitindex+=bits;
|
||||
return (int)((unsigned int)(a>>(16-bits)));
|
||||
}
|
||||
|
||||
// range check version
|
||||
int getbits9(int bits) {
|
||||
register unsigned short a;
|
||||
{
|
||||
int offset=(bitindex>>3)&(WINDOWSIZE-1);
|
||||
a=(((unsigned char)buffer[offset])<<8)|((unsigned char)buffer[offset+1]);
|
||||
}
|
||||
|
||||
a<<=(bitindex&7);
|
||||
bitindex+=bits;
|
||||
return (int)((unsigned int)(a>>(16-bits)));
|
||||
}
|
||||
|
||||
int peek8() {
|
||||
int offset = (bitindex>>3)&(WINDOWSIZE-1), a;
|
||||
a=(((unsigned char)buffer[offset])<<8) | ((unsigned char)buffer[offset+1]);
|
||||
return (a >> (8-(bitindex&7))) & 0xff;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
#endif
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
initializer/resyncer/frame detection etc.. for mpeg audio
|
||||
Copyright (C) 2000 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "mpegAudioStream.h"
|
||||
|
||||
|
||||
MpegAudioStream::MpegAudioStream() {
|
||||
buffer=(char*)0;
|
||||
}
|
||||
|
||||
|
||||
MpegAudioStream::~MpegAudioStream() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MpegAudioStream::setFrame(unsigned char* ptr,int len) {
|
||||
this->buffer=(char*)ptr;
|
||||
this->len=len;
|
||||
bitindex=0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,146 +0,0 @@
|
|||
/*
|
||||
initializer/resyncer/frame detection etc.. for mpeg audio
|
||||
Copyright (C) 2000 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef __MPEGAUDIOSTREAM_H
|
||||
#define __MPEGAUDIOSTREAM_H
|
||||
|
||||
// we include this for the big_endian define
|
||||
//#include "mpegAudioBitWindow.h"
|
||||
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
#define _KEY 0
|
||||
#else
|
||||
#define _KEY 3
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define _MAX_MPEG_BUFFERSIZE 4096
|
||||
|
||||
|
||||
/**
|
||||
Here we go from the frame to the bitlevel.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
class MpegAudioStream {
|
||||
|
||||
char* buffer;
|
||||
int len;
|
||||
int bitindex;
|
||||
|
||||
public:
|
||||
MpegAudioStream();
|
||||
~MpegAudioStream();
|
||||
|
||||
void setFrame(unsigned char* prt,int len);
|
||||
|
||||
// Bit functions
|
||||
|
||||
inline char* getBuffer() { return buffer; }
|
||||
inline int getBufferSize() { return _MAX_MPEG_BUFFERSIZE ;}
|
||||
inline void sync() { bitindex=(bitindex+7)&0xFFFFFFF8; }
|
||||
inline int issync() { return (bitindex&7);};
|
||||
|
||||
/**
|
||||
Now follow ugly inline function. The performance gain is 1.5 %
|
||||
on a 400 MHz AMD
|
||||
*/
|
||||
|
||||
inline int getbyte() {
|
||||
int r=(unsigned char)buffer[bitindex>>3];
|
||||
bitindex+=8;
|
||||
return r;
|
||||
}
|
||||
|
||||
inline int getbits9(int bits) {
|
||||
register unsigned short a;
|
||||
{
|
||||
int offset=bitindex>>3;
|
||||
|
||||
a=(((unsigned char)buffer[offset])<<8) |
|
||||
((unsigned char)buffer[offset+1]);
|
||||
}
|
||||
|
||||
a<<=(bitindex&7);
|
||||
bitindex+=bits;
|
||||
return (int)((unsigned int)(a>>(16-bits)));
|
||||
}
|
||||
|
||||
inline int getbits8() {
|
||||
register unsigned short a;
|
||||
|
||||
{
|
||||
int offset=bitindex>>3;
|
||||
|
||||
a=(((unsigned char)buffer[offset])<<8) |
|
||||
((unsigned char)buffer[offset+1]);
|
||||
}
|
||||
|
||||
a<<=(bitindex&7);
|
||||
bitindex+=8;
|
||||
return (int)((unsigned int)(a>>8));
|
||||
}
|
||||
|
||||
inline int getbit() {
|
||||
register int r=(buffer[bitindex>>3]>>(7-(bitindex&7)))&1;
|
||||
|
||||
bitindex++;
|
||||
return r;
|
||||
}
|
||||
|
||||
inline int getbits(int bits) {
|
||||
union
|
||||
{
|
||||
char store[4];
|
||||
int current;
|
||||
}u;
|
||||
int bi;
|
||||
|
||||
if(!bits)return 0;
|
||||
|
||||
u.current=0;
|
||||
bi=(bitindex&7);
|
||||
u.store[_KEY]=buffer[bitindex>>3]<<bi;
|
||||
bi=8-bi;
|
||||
bitindex+=bi;
|
||||
|
||||
while(bits) {
|
||||
if(!bi) {
|
||||
u.store[_KEY]=buffer[bitindex>>3];
|
||||
bitindex+=8;
|
||||
bi=8;
|
||||
}
|
||||
if(bits>=bi) {
|
||||
u.current<<=bi;
|
||||
bits-=bi;
|
||||
bi=0;
|
||||
} else {
|
||||
u.current<<=bits;
|
||||
bi-=bits;
|
||||
bits=0;
|
||||
}
|
||||
}
|
||||
bitindex-=bi;
|
||||
return (u.current>>8);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
|
@ -1,118 +0,0 @@
|
|||
/* MPEG/WAVE Sound library
|
||||
|
||||
(C) 1997 by Jung woo-jae */
|
||||
|
||||
// Mpeglayer1.cc
|
||||
// It's for MPEG Layer 1
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - added VC6 pragma to prevent some warnings from being reported
|
||||
|
||||
#include "mpegsound.h"
|
||||
#include "synthesis.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4305)
|
||||
#endif
|
||||
|
||||
// Tables for layer 1
|
||||
static const REAL factortable[15] =
|
||||
{
|
||||
0.0,
|
||||
(1.0/2.0) * (4.0/3.0), (1.0/4.0) * (8.0/7.0),
|
||||
(1.0/8.0) * (16.0/15.0), (1.0/16.0) * (32.0/31.0),
|
||||
(1.0/32.0) * (64.0/63.0), (1.0/64.0) * (128.0/127.0),
|
||||
(1.0/128.0) * (256.0/255.0), (1.0/256.0) * (512.0/511.0),
|
||||
(1.0/512.0) * (1024.0/1023.0), (1.0/1024.0) * (2048.0/2047.0),
|
||||
(1.0/2048.0) * (4096.0/4095.0), (1.0/4096.0) * (8192.0/8191.0),
|
||||
(1.0/8192.0) * (16384.0/16383.0), (1.0/16384.0) * (32768.0/32767.0)
|
||||
};
|
||||
|
||||
static const REAL offsettable[15] =
|
||||
{
|
||||
0.0,
|
||||
((1.0/2.0)-1.0) * (4.0/3.0), ((1.0/4.0)-1.0) * (8.0/7.0),
|
||||
((1.0/8.0)-1.0) * (16.0/15.0), ((1.0/16.0)-1.0) * (32.0/31.0),
|
||||
((1.0/32.0)-1.0) * (64.0/63.0), ((1.0/64.0)-1.0) * (128.0/127.0),
|
||||
((1.0/128.0)-1.0) * (256.0/255.0), ((1.0/256.0)-1.0) * (512.0/511.0),
|
||||
((1.0/512.0)-1.0) * (1024.0/1023.0), ((1.0/1024.0)-1.0) * (2048.0/2047.0),
|
||||
((1.0/2048.0)-1.0) * (4096.0/4095.0), ((1.0/4096.0)-1.0) * (8192.0/8191.0),
|
||||
((1.0/8192.0)-1.0) * (16384.0/16383.0), ((1.0/16384.0)-1.0) * (32768.0/32767.0)
|
||||
};
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(default : 4305)
|
||||
#endif
|
||||
|
||||
// Mpeg layer 1
|
||||
void Mpegtoraw::extractlayer1(void)
|
||||
{
|
||||
int inputstereo=mpegAudioHeader->getInputstereo();
|
||||
int stereobound=mpegAudioHeader->getStereobound();
|
||||
REAL fraction[MAXCHANNEL][MAXSUBBAND];
|
||||
REAL scalefactor[MAXCHANNEL][MAXSUBBAND];
|
||||
|
||||
int bitalloc[MAXCHANNEL][MAXSUBBAND],
|
||||
sample[MAXCHANNEL][MAXSUBBAND];
|
||||
|
||||
register int i,j;
|
||||
int s=stereobound,l;
|
||||
|
||||
|
||||
// Bitalloc
|
||||
for(i=0;i<s;i++)
|
||||
{
|
||||
bitalloc[LS][i]=getbits(4);
|
||||
bitalloc[RS][i]=getbits(4);
|
||||
}
|
||||
for(;i<MAXSUBBAND;i++)
|
||||
bitalloc[LS][i]=
|
||||
bitalloc[RS][i]=getbits(4);
|
||||
|
||||
// Scale index
|
||||
if(inputstereo)
|
||||
for(i=0;i<MAXSUBBAND;i++)
|
||||
{
|
||||
if(bitalloc[LS][i])scalefactor[LS][i]=scalefactorstable[getbits(6)];
|
||||
if(bitalloc[RS][i])scalefactor[RS][i]=scalefactorstable[getbits(6)];
|
||||
}
|
||||
else
|
||||
for(i=0;i<MAXSUBBAND;i++)
|
||||
if(bitalloc[LS][i])scalefactor[LS][i]=scalefactorstable[getbits(6)];
|
||||
|
||||
for(l=0;l<SCALEBLOCK;l++)
|
||||
{
|
||||
// Sample
|
||||
for(i=0;i<s;i++)
|
||||
{
|
||||
if((j=bitalloc[LS][i]))sample[LS][i]=getbits(j+1);
|
||||
if((j=bitalloc[RS][i]))sample[RS][i]=getbits(j+1);
|
||||
}
|
||||
for(;i<MAXSUBBAND;i++)
|
||||
if((j=bitalloc[LS][i]))sample[LS][i]=sample[RS][i]=getbits(j+1);
|
||||
|
||||
|
||||
// Fraction
|
||||
if(lOutputStereo)
|
||||
for(i=0;i<MAXSUBBAND;i++)
|
||||
{
|
||||
if((j=bitalloc[LS][i]))
|
||||
fraction[LS][i]=(REAL(sample[LS][i])*factortable[j]+offsettable[j])
|
||||
*scalefactor[LS][i];
|
||||
else fraction[LS][i]=0.0;
|
||||
if((j=bitalloc[RS][i]))
|
||||
fraction[RS][i]=(REAL(sample[RS][i])*factortable[j]+offsettable[j])
|
||||
*scalefactor[RS][i];
|
||||
else fraction[RS][i]=0.0;
|
||||
}
|
||||
else
|
||||
for(i=0;i<MAXSUBBAND;i++)
|
||||
if((j=bitalloc[LS][i]))
|
||||
fraction[LS][i]=(REAL(sample[LS][i])*factortable[j]+offsettable[j])
|
||||
*scalefactor[LS][i];
|
||||
else fraction[LS][i]=0.0;
|
||||
|
||||
synthesis->doSynth(lDownSample,lOutputStereo,
|
||||
fraction[LS],fraction[RS]);
|
||||
}
|
||||
}
|
|
@ -1,449 +0,0 @@
|
|||
/* MPEG/WAVE Sound library
|
||||
|
||||
(C) 1997 by Jung woo-jae */
|
||||
|
||||
// Mpeglayer2.cc
|
||||
// It's for MPEG Layer 2
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - added some explicit casts to remove compilation warnings
|
||||
// - added VC6 pragma to prevent some warnings from being reported
|
||||
|
||||
#include "mpegsound.h"
|
||||
#include "synthesis.h"
|
||||
|
||||
|
||||
#define BUGFIX
|
||||
#include "mpeg2tables.h"
|
||||
|
||||
|
||||
// workaround for buggy mpeg2 streams.
|
||||
// tested with 12 monkey cdi, worgked fine.
|
||||
// problem was: the stream produced ints
|
||||
// with access out of the tables
|
||||
// if we have such an access we set it to a zero entry
|
||||
#ifdef BUGFIX
|
||||
static int checkCodeRange(int code,const REAL* group) {
|
||||
int back=0;
|
||||
if (group == NULL) {
|
||||
//cout << "group null"<<endl;
|
||||
return 0;
|
||||
}
|
||||
back=code;
|
||||
|
||||
if (group == group5bits) {
|
||||
if (back > 27*3) {
|
||||
// redirect to zero value
|
||||
back=3;
|
||||
}
|
||||
return back;
|
||||
}
|
||||
if (group == group7bits) {
|
||||
if (back > 125*3) {
|
||||
back=6;
|
||||
}
|
||||
return back;
|
||||
}
|
||||
if (group == group10bits) {
|
||||
if (back > 729*3) {
|
||||
back=12;
|
||||
}
|
||||
return back;
|
||||
}
|
||||
//DEBUG_LAYER(cout << "unknown group found!"<<endl;)
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Mpeg layer 2
|
||||
void Mpegtoraw::extractlayer2(void) {
|
||||
int inputstereo=mpegAudioHeader->getInputstereo();
|
||||
int tableindex=mpegAudioHeader->getTableindex();
|
||||
int subbandnumber=mpegAudioHeader->getSubbandnumber();
|
||||
int stereobound=mpegAudioHeader->getStereobound();
|
||||
|
||||
REAL fraction[MAXCHANNEL][3][MAXSUBBAND];
|
||||
unsigned int bitalloc[MAXCHANNEL][MAXSUBBAND],
|
||||
scaleselector[MAXCHANNEL][MAXSUBBAND];
|
||||
REAL scalefactor[2][3][MAXSUBBAND];
|
||||
|
||||
const REAL *group[MAXCHANNEL][MAXSUBBAND];
|
||||
unsigned int codelength[MAXCHANNEL][MAXSUBBAND];
|
||||
REAL factor[MAXCHANNEL][MAXSUBBAND];
|
||||
REAL c[MAXCHANNEL][MAXSUBBAND],d[MAXCHANNEL][MAXSUBBAND];
|
||||
|
||||
int s=stereobound,n=subbandnumber;
|
||||
|
||||
|
||||
// Bitalloc
|
||||
{
|
||||
register int i;
|
||||
register const int *t=bitalloclengthtable[tableindex];
|
||||
for(i=0;i<s;i++,t++)
|
||||
{
|
||||
bitalloc[LS][i]=getbits(*t);
|
||||
bitalloc[RS][i]=getbits(*t);
|
||||
}
|
||||
for(;i<n;i++,t++) {
|
||||
bitalloc[LS][i]=bitalloc[RS][i]=getbits(*t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Scale selector
|
||||
if(inputstereo)
|
||||
for(register int i=0;i<n;i++)
|
||||
{
|
||||
if(bitalloc[LS][i])scaleselector[LS][i]=getbits(2);
|
||||
if(bitalloc[RS][i])scaleselector[RS][i]=getbits(2);
|
||||
}
|
||||
else
|
||||
for(register int i=0;i<n;i++)
|
||||
if(bitalloc[LS][i])scaleselector[LS][i]=getbits(2);
|
||||
|
||||
// Scale index
|
||||
{
|
||||
register int i,j;
|
||||
|
||||
|
||||
for(i=0;i<n;i++)
|
||||
{
|
||||
if((j=bitalloc[LS][i]))
|
||||
{
|
||||
if(!tableindex)
|
||||
{
|
||||
group[LS][i]=grouptableA[j];
|
||||
codelength[LS][i]=codelengthtableA[j];
|
||||
factor[LS][i]=factortableA[j];
|
||||
c[LS][i]=ctableA[j];
|
||||
d[LS][i]=dtableA[j];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(i<=2)
|
||||
{
|
||||
group[LS][i]=grouptableB1[j];
|
||||
codelength[LS][i]=codelengthtableB1[j];
|
||||
factor[LS][i]=factortableB1[j];
|
||||
c[LS][i]=ctableB1[j];
|
||||
d[LS][i]=dtableB1[j];
|
||||
}
|
||||
else
|
||||
{
|
||||
group[LS][i]=grouptableB234[j];
|
||||
if(i<=10)
|
||||
{
|
||||
codelength[LS][i]=codelengthtableB2[j];
|
||||
factor[LS][i]=factortableB2[j];
|
||||
c[LS][i]=ctableB2[j];
|
||||
d[LS][i]=dtableB2[j];
|
||||
}
|
||||
else if(i<=22)
|
||||
{
|
||||
codelength[LS][i]=codelengthtableB3[j];
|
||||
factor[LS][i]=factortableB3[j];
|
||||
c[LS][i]=ctableB3[j];
|
||||
d[LS][i]=dtableB3[j];
|
||||
}
|
||||
else
|
||||
{
|
||||
codelength[LS][i]=codelengthtableB4[j];
|
||||
factor[LS][i]=factortableB4[j];
|
||||
c[LS][i]=ctableB4[j];
|
||||
d[LS][i]=dtableB4[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
switch(scaleselector[LS][i])
|
||||
{
|
||||
case 0:scalefactor[LS][0][i]=scalefactorstable[getbits(6)];
|
||||
scalefactor[LS][1][i]=scalefactorstable[getbits(6)];
|
||||
scalefactor[LS][2][i]=scalefactorstable[getbits(6)];
|
||||
break;
|
||||
case 1:scalefactor[LS][0][i]=
|
||||
scalefactor[LS][1][i]=scalefactorstable[getbits(6)];
|
||||
scalefactor[LS][2][i]=scalefactorstable[getbits(6)];
|
||||
break;
|
||||
case 2:scalefactor[LS][0][i]=
|
||||
scalefactor[LS][1][i]=
|
||||
scalefactor[LS][2][i]=scalefactorstable[getbits(6)];
|
||||
break;
|
||||
case 3:scalefactor[LS][0][i]=scalefactorstable[getbits(6)];
|
||||
scalefactor[LS][1][i]=
|
||||
scalefactor[LS][2][i]=scalefactorstable[getbits(6)];
|
||||
break;
|
||||
default:
|
||||
//cout << "scaleselector left default never happens"<<endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(inputstereo && (j=bitalloc[RS][i]))
|
||||
{
|
||||
if(!tableindex)
|
||||
{
|
||||
group[RS][i]=grouptableA[j];
|
||||
codelength[RS][i]=codelengthtableA[j];
|
||||
factor[RS][i]=factortableA[j];
|
||||
c[RS][i]=ctableA[j];
|
||||
d[RS][i]=dtableA[j];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(i<=2)
|
||||
{
|
||||
group[RS][i]=grouptableB1[j];
|
||||
codelength[RS][i]=codelengthtableB1[j];
|
||||
factor[RS][i]=factortableB1[j];
|
||||
c[RS][i]=ctableB1[j];
|
||||
d[RS][i]=dtableB1[j];
|
||||
}
|
||||
else
|
||||
{
|
||||
group[RS][i]=grouptableB234[j];
|
||||
if(i<=10)
|
||||
{
|
||||
codelength[RS][i]=codelengthtableB2[j];
|
||||
factor[RS][i]=factortableB2[j];
|
||||
c[RS][i]=ctableB2[j];
|
||||
d[RS][i]=dtableB2[j];
|
||||
}
|
||||
else if(i<=22)
|
||||
{
|
||||
codelength[RS][i]=codelengthtableB3[j];
|
||||
factor[RS][i]=factortableB3[j];
|
||||
c[RS][i]=ctableB3[j];
|
||||
d[RS][i]=dtableB3[j];
|
||||
}
|
||||
else
|
||||
{
|
||||
codelength[RS][i]=codelengthtableB4[j];
|
||||
factor[RS][i]=factortableB4[j];
|
||||
c[RS][i]=ctableB4[j];
|
||||
d[RS][i]=dtableB4[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
switch(scaleselector[RS][i])
|
||||
{
|
||||
case 0 : scalefactor[RS][0][i]=scalefactorstable[getbits(6)];
|
||||
scalefactor[RS][1][i]=scalefactorstable[getbits(6)];
|
||||
scalefactor[RS][2][i]=scalefactorstable[getbits(6)];
|
||||
break;
|
||||
case 1 : scalefactor[RS][0][i]=
|
||||
scalefactor[RS][1][i]=scalefactorstable[getbits(6)];
|
||||
scalefactor[RS][2][i]=scalefactorstable[getbits(6)];
|
||||
break;
|
||||
case 2 : scalefactor[RS][0][i]=
|
||||
scalefactor[RS][1][i]=
|
||||
scalefactor[RS][2][i]=scalefactorstable[getbits(6)];
|
||||
break;
|
||||
case 3 : scalefactor[RS][0][i]=scalefactorstable[getbits(6)];
|
||||
scalefactor[RS][1][i]=
|
||||
scalefactor[RS][2][i]=scalefactorstable[getbits(6)];
|
||||
break;
|
||||
default:
|
||||
//cout << "scaleselector right default never happens"<<endl;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Read Sample
|
||||
{
|
||||
register int i;
|
||||
|
||||
for(int l=0;l<SCALEBLOCK;l++)
|
||||
{
|
||||
// Read Sample
|
||||
for(i=0;i<s;i++)
|
||||
{
|
||||
if(bitalloc[LS][i])
|
||||
{
|
||||
if(group[LS][i])
|
||||
{
|
||||
register const REAL *s;
|
||||
int code=getbits(codelength[LS][i]);
|
||||
|
||||
|
||||
|
||||
code+=code<<1;
|
||||
#ifdef BUGFIX
|
||||
// bugfix for bad streams
|
||||
code=checkCodeRange(code,group[LS][i]);
|
||||
if (code == -1) return;
|
||||
#endif
|
||||
s=group[LS][i]+code;
|
||||
|
||||
fraction[LS][0][i]=s[0];
|
||||
fraction[LS][1][i]=s[1];
|
||||
fraction[LS][2][i]=s[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
fraction[LS][0][i]=(REAL)
|
||||
(REAL(getbits(codelength[LS][i]))*factor[LS][i]-1.0);
|
||||
fraction[LS][1][i]=(REAL)
|
||||
(REAL(getbits(codelength[LS][i]))*factor[LS][i]-1.0);
|
||||
fraction[LS][2][i]=(REAL)
|
||||
(REAL(getbits(codelength[LS][i]))*factor[LS][i]-1.0);
|
||||
}
|
||||
}
|
||||
else fraction[LS][0][i]=fraction[LS][1][i]=fraction[LS][2][i]=0.0;
|
||||
|
||||
|
||||
if(inputstereo && bitalloc[RS][i])
|
||||
{
|
||||
if(group[RS][i])
|
||||
{
|
||||
const REAL *s;
|
||||
int code=getbits(codelength[RS][i]);
|
||||
|
||||
code+=code<<1;
|
||||
#ifdef BUGFIX
|
||||
// bugfix for bad streams
|
||||
code=checkCodeRange(code,group[RS][i]);
|
||||
if (code == -1) return;
|
||||
#endif
|
||||
s=group[RS][i]+code;
|
||||
|
||||
fraction[RS][0][i]=s[0];
|
||||
fraction[RS][1][i]=s[1];
|
||||
fraction[RS][2][i]=s[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
fraction[RS][0][i]=(REAL)
|
||||
(REAL(getbits(codelength[RS][i]))*factor[RS][i]-1.0);
|
||||
fraction[RS][1][i]=(REAL)
|
||||
(REAL(getbits(codelength[RS][i]))*factor[RS][i]-1.0);
|
||||
fraction[RS][2][i]=(REAL)
|
||||
(REAL(getbits(codelength[RS][i]))*factor[RS][i]-1.0);
|
||||
}
|
||||
}
|
||||
else fraction[RS][0][i]=fraction[RS][1][i]=fraction[RS][2][i]=0.0;
|
||||
}
|
||||
|
||||
|
||||
for(;i<n;i++)
|
||||
{
|
||||
if(bitalloc[LS][i])
|
||||
{
|
||||
if(group[LS][i])
|
||||
{
|
||||
register const REAL *s;
|
||||
int code=getbits(codelength[LS][i]);
|
||||
|
||||
code+=code<<1;
|
||||
#ifdef BUGFIX
|
||||
// bugfix for bad streams
|
||||
code=checkCodeRange(code,group[LS][i]);
|
||||
if (code == -1) return;
|
||||
#endif
|
||||
s=group[LS][i]+code;
|
||||
|
||||
fraction[LS][0][i]=fraction[RS][0][i]=s[0];
|
||||
fraction[LS][1][i]=fraction[RS][1][i]=s[1];
|
||||
fraction[LS][2][i]=fraction[RS][2][i]=s[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
fraction[LS][0][i]=fraction[RS][0][i]=(REAL)
|
||||
(REAL(getbits(codelength[LS][i]))*factor[LS][i]-1.0);
|
||||
fraction[LS][1][i]=fraction[RS][1][i]=(REAL)
|
||||
(REAL(getbits(codelength[LS][i]))*factor[LS][i]-1.0);
|
||||
fraction[LS][2][i]=fraction[RS][2][i]=(REAL)
|
||||
(REAL(getbits(codelength[LS][i]))*factor[LS][i]-1.0);
|
||||
}
|
||||
}
|
||||
else fraction[LS][0][i]=fraction[LS][1][i]=fraction[LS][2][i]=
|
||||
fraction[RS][0][i]=fraction[RS][1][i]=fraction[RS][2][i]=0.0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//Fraction
|
||||
if(lOutputStereo)
|
||||
for(i=0;i<n;i++)
|
||||
{
|
||||
if(bitalloc[LS][i])
|
||||
{
|
||||
if(!group[LS][i])
|
||||
{
|
||||
fraction[LS][0][i]=(fraction[LS][0][i]+d[LS][i])*c[LS][i];
|
||||
fraction[LS][1][i]=(fraction[LS][1][i]+d[LS][i])*c[LS][i];
|
||||
fraction[LS][2][i]=(fraction[LS][2][i]+d[LS][i])*c[LS][i];
|
||||
}
|
||||
|
||||
register REAL t=scalefactor[LS][l>>2][i];
|
||||
fraction[LS][0][i]*=t;
|
||||
fraction[LS][1][i]*=t;
|
||||
fraction[LS][2][i]*=t;
|
||||
}
|
||||
|
||||
if(bitalloc[RS][i])
|
||||
{
|
||||
if(!group[RS][i])
|
||||
{
|
||||
fraction[RS][0][i]=(fraction[RS][0][i]+d[RS][i])*c[LS][i];
|
||||
fraction[RS][1][i]=(fraction[RS][1][i]+d[RS][i])*c[LS][i];
|
||||
fraction[RS][2][i]=(fraction[RS][2][i]+d[RS][i])*c[LS][i];
|
||||
}
|
||||
|
||||
register REAL t=scalefactor[RS][l>>2][i];
|
||||
fraction[RS][0][i]*=t;
|
||||
fraction[RS][1][i]*=t;
|
||||
fraction[RS][2][i]*=t;
|
||||
}
|
||||
}
|
||||
else
|
||||
for(i=0;i<n;i++)
|
||||
if(bitalloc[LS][i])
|
||||
{
|
||||
if(!group[LS][i])
|
||||
{
|
||||
fraction[LS][0][i]=(fraction[LS][0][i]+d[LS][i])*c[LS][i];
|
||||
fraction[LS][1][i]=(fraction[LS][1][i]+d[LS][i])*c[LS][i];
|
||||
fraction[LS][2][i]=(fraction[LS][2][i]+d[LS][i])*c[LS][i];
|
||||
}
|
||||
|
||||
register REAL t=scalefactor[LS][l>>2][i];
|
||||
fraction[LS][0][i]*=t;
|
||||
fraction[LS][1][i]*=t;
|
||||
fraction[LS][2][i]*=t;
|
||||
}
|
||||
|
||||
|
||||
for(;i<MAXSUBBAND;i++)
|
||||
fraction[LS][0][i]=fraction[LS][1][i]=fraction[LS][2][i]=
|
||||
fraction[RS][0][i]=fraction[RS][1][i]=fraction[RS][2][i]=0.0;
|
||||
|
||||
for(i=0;i<3;i++) {
|
||||
synthesis->doSynth(lDownSample,lOutputStereo,
|
||||
fraction[LS][i],fraction[RS][i]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,252 +0,0 @@
|
|||
// MPEG/WAVE Sound library
|
||||
|
||||
// (C) 1997 by Woo-jae Jung
|
||||
|
||||
// Mpegsound.h
|
||||
// This is typeset for functions in MPEG/WAVE Sound library.
|
||||
// Now, it's for only linux-pc-?86
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - removed dump stuff
|
||||
|
||||
|
||||
/************************************/
|
||||
/* Include default library packages */
|
||||
/************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#include "mpegAudioStream.h"
|
||||
#include "common.h"
|
||||
|
||||
class Synthesis;
|
||||
class AudioFrame;
|
||||
|
||||
|
||||
#ifndef _L__SOUND__
|
||||
#define _L__SOUND__
|
||||
|
||||
#include "../mpegAudioFrame/mpegAudioHeader.h"
|
||||
#include "mpegAudioBitWindow.h"
|
||||
|
||||
|
||||
//#define DEBUG_LAYER(x) x
|
||||
#define DEBUG_LAYER(x)
|
||||
|
||||
|
||||
/**************************/
|
||||
/* Define values for MPEG */
|
||||
/**************************/
|
||||
#define SCALEBLOCK 12
|
||||
#define MAXSUBBAND 32
|
||||
#define MAXCHANNEL 2
|
||||
#define RAWDATASIZE (2*2*2*32*SSLIMIT)
|
||||
|
||||
|
||||
|
||||
// Huffmancode
|
||||
#define HTN 34
|
||||
|
||||
|
||||
|
||||
#define MODE_MONO 0
|
||||
#define MODE_STEREO 1
|
||||
|
||||
/********************/
|
||||
/* Type definitions */
|
||||
/********************/
|
||||
|
||||
typedef struct {
|
||||
bool generalflag;
|
||||
unsigned int part2_3_length;
|
||||
unsigned int big_values;
|
||||
unsigned int global_gain;
|
||||
unsigned int scalefac_compress;
|
||||
unsigned int window_switching_flag;
|
||||
unsigned int block_type;
|
||||
unsigned int mixed_block_flag;
|
||||
unsigned int table_select[3];
|
||||
unsigned int subblock_gain[3];
|
||||
unsigned int region0_count;
|
||||
unsigned int region1_count;
|
||||
unsigned int preflag;
|
||||
unsigned int scalefac_scale;
|
||||
unsigned int count1table_select;
|
||||
}layer3grinfo;
|
||||
|
||||
typedef struct {
|
||||
unsigned main_data_begin;
|
||||
unsigned private_bits;
|
||||
struct {
|
||||
unsigned scfsi[4];
|
||||
layer3grinfo gr[2];
|
||||
}ch[2];
|
||||
}layer3sideinfo;
|
||||
|
||||
typedef struct {
|
||||
int l[23]; /* [cb] */
|
||||
int s[3][13]; /* [window][cb] */
|
||||
}layer3scalefactor; /* [ch] */
|
||||
|
||||
typedef struct {
|
||||
int tablename;
|
||||
unsigned int xlen,ylen;
|
||||
unsigned int linbits;
|
||||
unsigned int treelen;
|
||||
const unsigned int (*val)[2];
|
||||
}HUFFMANCODETABLE;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class DCT;
|
||||
//class Dump;
|
||||
|
||||
// Class for converting mpeg format to raw format
|
||||
class Mpegtoraw {
|
||||
/*****************************/
|
||||
/* Constant tables for layer */
|
||||
/*****************************/
|
||||
private:
|
||||
static const int bitrate[2][3][15];
|
||||
static const int frequencies[2][3];
|
||||
static const REAL scalefactorstable[64];
|
||||
ATTR_ALIGN(64) static const HUFFMANCODETABLE ht[HTN];
|
||||
|
||||
|
||||
friend class HuffmanLookup;
|
||||
|
||||
/*************************/
|
||||
/* MPEG header variables */
|
||||
/*************************/
|
||||
|
||||
// comes from constructor, decoder works on them
|
||||
MpegAudioStream* mpegAudioStream;
|
||||
MpegAudioHeader* mpegAudioHeader;
|
||||
AudioFrame* audioFrame;
|
||||
//Dump* dump;
|
||||
Synthesis* synthesis;
|
||||
|
||||
/***************************************/
|
||||
/* Interface for setting music quality */
|
||||
/***************************************/
|
||||
|
||||
int lWantStereo;
|
||||
int lOutputStereo;
|
||||
int lDownSample;
|
||||
|
||||
public:
|
||||
Mpegtoraw(MpegAudioStream* mpegAudioStream,
|
||||
MpegAudioHeader* mpegAudioHeader);
|
||||
|
||||
|
||||
~Mpegtoraw();
|
||||
int decode(AudioFrame* audioFrame);
|
||||
|
||||
|
||||
void setStereo(int lStereo);
|
||||
int getStereo();
|
||||
|
||||
void setDownSample(int lDownSample);
|
||||
int getDownSample();
|
||||
|
||||
|
||||
|
||||
private:
|
||||
void initialize();
|
||||
|
||||
|
||||
|
||||
/*****************************/
|
||||
/* Loading MPEG-Audio stream */
|
||||
/*****************************/
|
||||
|
||||
union
|
||||
{
|
||||
unsigned char store[4];
|
||||
unsigned int current;
|
||||
}u;
|
||||
|
||||
|
||||
int getbyte() { return mpegAudioStream->getbyte(); }
|
||||
int getbits(int bits) { return mpegAudioStream->getbits(bits); }
|
||||
int getbits9(int bits) { return mpegAudioStream->getbits9(bits); }
|
||||
int getbits8() { return mpegAudioStream->getbits8(); }
|
||||
int getbit() { return mpegAudioStream->getbit(); }
|
||||
|
||||
|
||||
void sync() { mpegAudioStream->sync(); }
|
||||
bool issync() { return mpegAudioStream->issync()!=0; }
|
||||
|
||||
|
||||
/********************/
|
||||
/* Global variables */
|
||||
/********************/
|
||||
|
||||
// optimisation from maplay12+
|
||||
// 0/1: nonzero for channel 0/1 2: max position for both
|
||||
int nonzero[3];
|
||||
|
||||
// for Layer3
|
||||
|
||||
int layer3framestart;
|
||||
int layer3part2start;
|
||||
|
||||
ATTR_ALIGN(64) REAL prevblck[2][2][SBLIMIT][SSLIMIT];
|
||||
int currentprevblock;
|
||||
ATTR_ALIGN(64) layer3sideinfo sideinfo;
|
||||
ATTR_ALIGN(64) layer3scalefactor scalefactors[2];
|
||||
|
||||
ATTR_ALIGN(64) MpegAudioBitWindow bitwindow;
|
||||
MpegAudioBitWindow lastValidBitwindow;
|
||||
|
||||
int wgetbit(void);
|
||||
int wgetbits9(int bits);
|
||||
int wgetbits(int bits);
|
||||
int wgetCanReadBits();
|
||||
|
||||
/*************************************/
|
||||
/* Decoding functions for each layer */
|
||||
/*************************************/
|
||||
|
||||
// Extractor
|
||||
void extractlayer1(void); // MPEG-1
|
||||
void extractlayer2(void);
|
||||
void extractlayer3(void);
|
||||
void extractlayer3_2(void); // MPEG-2
|
||||
|
||||
|
||||
// Functions for layer 3
|
||||
void layer3initialize(void);
|
||||
bool layer3getsideinfo(void);
|
||||
bool layer3getsideinfo_2(void);
|
||||
void layer3getscalefactors(int ch,int gr);
|
||||
void layer3getscalefactors_2(int ch);
|
||||
void layer3huffmandecode(int ch,int gr,int out[SBLIMIT][SSLIMIT]);
|
||||
REAL layer3twopow2(int scale,int preflag,int pretab_offset,int l);
|
||||
REAL layer3twopow2_1(int a,int b,int c);
|
||||
void layer3dequantizesample(int ch,int gr,int in[SBLIMIT][SSLIMIT],
|
||||
REAL out[SBLIMIT][SSLIMIT]);
|
||||
void adjustNonZero(REAL in[2][SBLIMIT][SSLIMIT]);
|
||||
void layer3fixtostereo(int gr,REAL in[2][SBLIMIT][SSLIMIT]);
|
||||
void layer3reorderandantialias(int ch,int gr,REAL in[SBLIMIT][SSLIMIT],
|
||||
REAL out[SBLIMIT][SSLIMIT]);
|
||||
|
||||
void layer3hybrid(int ch,int gr,REAL in[SBLIMIT][SSLIMIT],
|
||||
REAL out[SSLIMIT][SBLIMIT]);
|
||||
|
||||
void huffmandecoder_1(const HUFFMANCODETABLE *h,int *x,int *y);
|
||||
void huffmandecoder_2(const HUFFMANCODETABLE *h,int *x,int *y,int *v,int *w);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -1,43 +0,0 @@
|
|||
/* MPEG/WAVE Sound library
|
||||
|
||||
(C) 1997 by Jung woo-jae */
|
||||
|
||||
// Mpegtable.cc
|
||||
// It has tables for MPEG layer 1, 2 and a part of layer 3
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - added VC6 pragma to prevent some warnings from being reported
|
||||
|
||||
|
||||
#include "mpegsound.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4305)
|
||||
#endif
|
||||
|
||||
|
||||
// Mpeg general table
|
||||
const REAL Mpegtoraw::scalefactorstable[64] =
|
||||
{
|
||||
2.00000000000000, 1.58740105196820, 1.25992104989487, 1.00000000000000,
|
||||
0.79370052598410, 0.62996052494744, 0.50000000000000, 0.39685026299205,
|
||||
0.31498026247372, 0.25000000000000, 0.19842513149602, 0.15749013123686,
|
||||
0.12500000000000, 0.09921256574801, 0.07874506561843, 0.06250000000000,
|
||||
0.04960628287401, 0.03937253280921, 0.03125000000000, 0.02480314143700,
|
||||
0.01968626640461, 0.01562500000000, 0.01240157071850, 0.00984313320230,
|
||||
0.00781250000000, 0.00620078535925, 0.00492156660115, 0.00390625000000,
|
||||
0.00310039267963, 0.00246078330058, 0.00195312500000, 0.00155019633981,
|
||||
0.00123039165029, 0.00097656250000, 0.00077509816991, 0.00061519582514,
|
||||
0.00048828125000, 0.00038754908495, 0.00030759791257, 0.00024414062500,
|
||||
0.00019377454248, 0.00015379895629, 0.00012207031250, 0.00009688727124,
|
||||
0.00007689947814, 0.00006103515625, 0.00004844363562, 0.00003844973907,
|
||||
0.00003051757813, 0.00002422181781, 0.00001922486954, 0.00001525878906,
|
||||
0.00001211090890, 0.00000961243477, 0.00000762939453, 0.00000605545445,
|
||||
0.00000480621738, 0.00000381469727, 0.00000302772723, 0.00000240310869,
|
||||
0.00000190734863, 0.00000151386361, 0.00000120155435, 0.00000000000000
|
||||
};
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(default : 4305)
|
||||
#endif
|
||||
|
|
@ -1,137 +0,0 @@
|
|||
/* MPEG/WAVE Sound library
|
||||
|
||||
(C) 1997 by Jung woo-jae */
|
||||
|
||||
// Mpegtoraw.cc
|
||||
// Server which get mpeg format and put raw format.
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - added #include <new> to ensure that bad_alloc will be thrown on mem error
|
||||
// - removed dump stuff
|
||||
|
||||
//changes 8/15/2002 (by Hauke Duden):
|
||||
// - set downsample to true, by default
|
||||
|
||||
//changes 8/17/2002 (by Hauke Duden):
|
||||
// - set downsample to false again - it only reduced the frequency by half instead
|
||||
// of synthesizing with twice the frequency and THEN reducing it by half
|
||||
|
||||
|
||||
#include "mpegsound.h"
|
||||
#include "synthesis.h"
|
||||
//#include "dump.h"
|
||||
#include "../frame/audioFrame.h"
|
||||
|
||||
#include <new>
|
||||
|
||||
|
||||
Mpegtoraw::Mpegtoraw(MpegAudioStream* mpegAudioStream,
|
||||
MpegAudioHeader* mpegAudioHeader) {
|
||||
|
||||
this->mpegAudioStream=mpegAudioStream;
|
||||
this->mpegAudioHeader=mpegAudioHeader;
|
||||
|
||||
this->lOutputStereo=true;
|
||||
setStereo(true);
|
||||
setDownSample(false);
|
||||
|
||||
//dump=new Dump();
|
||||
synthesis=new Synthesis();
|
||||
initialize();
|
||||
|
||||
}
|
||||
|
||||
Mpegtoraw::~Mpegtoraw() {
|
||||
|
||||
delete synthesis;
|
||||
//delete dump;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void Mpegtoraw::setStereo(int flag) {
|
||||
lWantStereo=flag;
|
||||
}
|
||||
|
||||
void Mpegtoraw::setDownSample(int flag) {
|
||||
lDownSample=flag;
|
||||
}
|
||||
|
||||
int Mpegtoraw::getStereo() {
|
||||
return lWantStereo;
|
||||
}
|
||||
|
||||
int Mpegtoraw::getDownSample() {
|
||||
return lDownSample;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Convert mpeg to raw
|
||||
// Mpeg headder class
|
||||
void Mpegtoraw::initialize() {
|
||||
|
||||
|
||||
|
||||
layer3initialize();
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Convert mpeg to raw
|
||||
int Mpegtoraw::decode(AudioFrame* audioFrame) {
|
||||
int back=true;
|
||||
|
||||
this->audioFrame=audioFrame;
|
||||
/*if (audioFrame->getSize() < RAWDATASIZE) {
|
||||
cout << "audioFrame needs at least:"<<RAWDATASIZE<<" size"<<endl;
|
||||
exit(0);
|
||||
}*/
|
||||
|
||||
audioFrame->clearrawdata();
|
||||
synthesis->clearrawdata();
|
||||
|
||||
int layer=mpegAudioHeader->getLayer();
|
||||
this->lOutputStereo=lWantStereo & mpegAudioHeader->getInputstereo();
|
||||
|
||||
if (mpegAudioHeader->getProtection()==false) {
|
||||
mpegAudioStream->getbyte();
|
||||
mpegAudioStream->getbyte();
|
||||
}
|
||||
switch(layer) {
|
||||
case 3:
|
||||
extractlayer3();
|
||||
break;
|
||||
case 2:
|
||||
extractlayer2();
|
||||
break;
|
||||
case 1:
|
||||
extractlayer1();
|
||||
break;
|
||||
default:
|
||||
//cout << "unknown layer:"<<layer<<endl;
|
||||
back=false;
|
||||
}
|
||||
|
||||
//
|
||||
// Now put the frequencies/output etc.. in the frame
|
||||
//
|
||||
audioFrame->setFrameFormat(lOutputStereo,
|
||||
mpegAudioHeader->getFrequencyHz()>>lDownSample);
|
||||
|
||||
audioFrame->putFloatData(synthesis->getOutputData(),synthesis->getLen());
|
||||
return back;
|
||||
|
||||
}
|
|
@ -1,96 +0,0 @@
|
|||
/*
|
||||
unrolled operations, for better Pentium FPU scheduling
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef __OP_H
|
||||
#define __OP_H
|
||||
|
||||
/**
|
||||
The Pentium has two pipelined FPUs which makes it possible
|
||||
to do two operations in one cycle.
|
||||
(If you are lucky)
|
||||
|
||||
*/
|
||||
|
||||
#define PTR_DIST (1024)
|
||||
|
||||
#define OS r1=vp1[0] * dp[0]; \
|
||||
r2=vp1[PTR_DIST-0] * dp[0]; \
|
||||
dp++;
|
||||
|
||||
#define XX1 vp1+=15;dp++;
|
||||
|
||||
#define XX2 r1+=vp1[0] * dp[-1]; \
|
||||
r2+=vp1[PTR_DIST-0] * dp[-1];
|
||||
|
||||
#define OP_END(val) vp1-=val;dp+=val;
|
||||
|
||||
#define OP_END_1(vVal,dVal) vp1+=(vVal-dVal),dp+=dVal
|
||||
|
||||
|
||||
// this is OP_END(x);XX1; together:
|
||||
#define OP_END_2(vVal) vp1+=(15-vVal),dp+=vVal+1
|
||||
|
||||
|
||||
// check this to test pipelining
|
||||
|
||||
#define SCHEDULE1(op,r1,r2) r1;op;r2;
|
||||
#define SCHEDULE2(op,r1,r2) op;r1;r2;
|
||||
|
||||
#define SCHEDULE(a,b,c) SCHEDULE2(a,b,c);
|
||||
|
||||
|
||||
#define OP r1+=vp1[-1] * dp[0]; \
|
||||
r2+=vp1[PTR_DIST-1] * dp[0];
|
||||
|
||||
|
||||
|
||||
#define OP2 SCHEDULE(OP ,r1+=vp1[-2] * dp[1] ,r2+=vp1[PTR_DIST-2] *dp[1]);
|
||||
#define OP3 SCHEDULE(OP2 ,r1+=vp1[-3] * dp[2] ,r2+=vp1[PTR_DIST-3] *dp[2]);
|
||||
#define OP4 SCHEDULE(OP3 ,r1+=vp1[-4] * dp[3] ,r2+=vp1[PTR_DIST-4] *dp[3]);
|
||||
#define OP5 SCHEDULE(OP4 ,r1+=vp1[-5] * dp[4] ,r2+=vp1[PTR_DIST-5] *dp[4]);
|
||||
#define OP6 SCHEDULE(OP5 ,r1+=vp1[-6] * dp[5] ,r2+=vp1[PTR_DIST-6] *dp[5]);
|
||||
#define OP7 SCHEDULE(OP6 ,r1+=vp1[-7] * dp[6] ,r2+=vp1[PTR_DIST-7] *dp[6]);
|
||||
#define OP8 SCHEDULE(OP7 ,r1+=vp1[-8] * dp[7] ,r2+=vp1[PTR_DIST-8] *dp[7]);
|
||||
#define OP9 SCHEDULE(OP8 ,r1+=vp1[-9] * dp[8] ,r2+=vp1[PTR_DIST-9] *dp[8]);
|
||||
#define OP10 SCHEDULE(OP9 ,r1+=vp1[-10] * dp[9] ,r2+=vp1[PTR_DIST-10] *dp[9]);
|
||||
#define OP11 SCHEDULE(OP10,r1+=vp1[-11] * dp[10],r2+=vp1[PTR_DIST-11] *dp[10]);
|
||||
#define OP12 SCHEDULE(OP11,r1+=vp1[-12] * dp[11],r2+=vp1[PTR_DIST-12] *dp[11]);
|
||||
#define OP13 SCHEDULE(OP12,r1+=vp1[-13] * dp[12],r2+=vp1[PTR_DIST-13] *dp[12]);
|
||||
#define OP14 SCHEDULE(OP13,r1+=vp1[-14] * dp[13],r2+=vp1[PTR_DIST-14] *dp[13]);
|
||||
#define OP15 SCHEDULE(OP14,r1+=vp1[-15] * dp[14],r2+=vp1[PTR_DIST-15] *dp[14]);
|
||||
|
||||
|
||||
/*
|
||||
#define OP r1+=vp1[-1] * dp[0]; \
|
||||
r2+=vp2[-1] * dp[0];
|
||||
|
||||
|
||||
|
||||
#define OP2 SCHEDULE(OP ,r1+=vp1[-2] * dp[1] ,r2+=vp2[-2] * dp[1]);
|
||||
#define OP3 SCHEDULE(OP2 ,r1+=vp1[-3] * dp[2] ,r2+=vp2[-3] * dp[2]);
|
||||
#define OP4 SCHEDULE(OP3 ,r1+=vp1[-4] * dp[3] ,r2+=vp2[-4] * dp[3]);
|
||||
#define OP5 SCHEDULE(OP4 ,r1+=vp1[-5] * dp[4] ,r2+=vp2[-5] * dp[4]);
|
||||
#define OP6 SCHEDULE(OP5 ,r1+=vp1[-6] * dp[5] ,r2+=vp2[-6] * dp[5]);
|
||||
#define OP7 SCHEDULE(OP6 ,r1+=vp1[-7] * dp[6] ,r2+=vp2[-7] * dp[6]);
|
||||
#define OP8 SCHEDULE(OP7 ,r1+=vp1[-8] * dp[7] ,r2+=vp2[-8] * dp[7]);
|
||||
#define OP9 SCHEDULE(OP8 ,r1+=vp1[-9] * dp[8] ,r2+=vp2[-9] * dp[8]);
|
||||
#define OP10 SCHEDULE(OP9 ,r1+=vp1[-10] * dp[9] ,r2+=vp2[-10] * dp[9]);
|
||||
#define OP11 SCHEDULE(OP10,r1+=vp1[-11] * dp[10],r2+=vp2[-11] * dp[10]);
|
||||
#define OP12 SCHEDULE(OP11,r1+=vp1[-12] * dp[11],r2+=vp2[-12] * dp[11]);
|
||||
#define OP13 SCHEDULE(OP12,r1+=vp1[-13] * dp[12],r2+=vp2[-13] * dp[12]);
|
||||
#define OP14 SCHEDULE(OP13,r1+=vp1[-14] * dp[13],r2+=vp2[-14] * dp[13]);
|
||||
#define OP15 SCHEDULE(OP14,r1+=vp1[-15] * dp[14],r2+=vp2[-15] * dp[14]);
|
||||
*/
|
||||
|
||||
#endif
|
|
@ -1,85 +0,0 @@
|
|||
/*
|
||||
decoder interface for the splay mp3 decoder.
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - added #include <new> to ensure that bad_alloc will be thrown on mem error
|
||||
// - removed dump stuff
|
||||
// - added function to access header from outside
|
||||
|
||||
#define _FROM_SOURCE
|
||||
#include "../mpegAudioFrame/dxHead.h"
|
||||
#include "splayDecoder.h"
|
||||
#include "mpegsound.h"
|
||||
|
||||
#include <new>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
SplayDecoder::SplayDecoder() {
|
||||
header = new MpegAudioHeader();
|
||||
stream = new MpegAudioStream();
|
||||
server = new Mpegtoraw(stream,header);
|
||||
|
||||
xHeadData=new XHEADDATA();
|
||||
xHeadData->toc=new unsigned char[101];
|
||||
//dump=new Dump();
|
||||
}
|
||||
|
||||
|
||||
SplayDecoder::~SplayDecoder() {
|
||||
delete (xHeadData->toc);
|
||||
delete xHeadData;
|
||||
|
||||
delete server;
|
||||
delete header;
|
||||
delete stream;
|
||||
//delete dump;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int SplayDecoder::decode(unsigned char* ptr, int len,AudioFrame* dest) {
|
||||
int back;
|
||||
// fist setup the stream and the 4 bytes header info;
|
||||
//dump->dump((char*)ptr,len);
|
||||
if (header->parseHeader(ptr) == false) {
|
||||
return false;
|
||||
}
|
||||
// maybe a Xing Header?
|
||||
if (len >= 152+4) {
|
||||
int lXing=GetXingHeader(xHeadData,(unsigned char*)ptr);
|
||||
if (lXing) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
stream->setFrame(ptr+4,len-4);
|
||||
back=server->decode(dest);
|
||||
|
||||
return back;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void SplayDecoder::config(const char* key,const char* val,void* ) {
|
||||
if (strcmp(key,"2")==0) {
|
||||
server->setDownSample(atoi(val));
|
||||
}
|
||||
if (strcmp(key,"m")==0) {
|
||||
server->setStereo(atoi(val));
|
||||
}
|
||||
}
|
||||
|
||||
MpegAudioHeader* SplayDecoder::GetMPEGAudioHeader()
|
||||
{
|
||||
return header;
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
decoder interface for the splay mp3 decoder.
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - removed dump stuff
|
||||
// - added function to access header from outside
|
||||
|
||||
//changes 8/11/2002 (by Hauke Duden):
|
||||
// - removed unnecessary includes
|
||||
|
||||
#ifndef __SPLAYDECODER_H
|
||||
#define __SPLAYDECODER_H
|
||||
|
||||
// state definitions for splay decoder
|
||||
|
||||
#define _SPLAY_RESET 0
|
||||
#define _SPLAY_EOF 1
|
||||
#define _SPLAY_FIRSTINIT 2
|
||||
#define _SPLAY_REINIT 3
|
||||
#define _SPLAY_DECODE 4
|
||||
#define _SPLAY_FRAME 5
|
||||
|
||||
|
||||
#include "../frame/audioFrame.h"
|
||||
//#include "dump.h"
|
||||
//#include <string.h>
|
||||
|
||||
class Mpegtoraw;
|
||||
class MpegAudioStream;
|
||||
class MpegAudioHeader;
|
||||
|
||||
|
||||
/**
|
||||
The decoder interface.
|
||||
The decoder expects an mpeg audio frame.
|
||||
The call to decode is "atomic", after that you have
|
||||
a PCMFrame to play.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
class SplayDecoder {
|
||||
|
||||
MpegAudioStream* stream;
|
||||
MpegAudioHeader* header;
|
||||
Mpegtoraw* server;
|
||||
//Dump* dump;
|
||||
#ifdef _FROM_SOURCE
|
||||
XHEADDATA* xHeadData;
|
||||
#else
|
||||
void* xHeadData;
|
||||
#endif
|
||||
|
||||
|
||||
public:
|
||||
SplayDecoder();
|
||||
~SplayDecoder();
|
||||
|
||||
int decode(unsigned char* ptr, int len,AudioFrame* dest);
|
||||
void config(const char* key,const char* val,void* ret);
|
||||
|
||||
MpegAudioHeader* GetMPEGAudioHeader();
|
||||
|
||||
};
|
||||
#endif
|
|
@ -1,231 +0,0 @@
|
|||
/*
|
||||
downsample implementation
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - removed cout and exit stuff
|
||||
|
||||
#include "synthesis.h"
|
||||
#include "dct.h"
|
||||
|
||||
void Synthesis::computebuffer_Down(REAL *fraction,
|
||||
REAL buffer[2][CALCBUFFERSIZE]){
|
||||
REAL *out1,*out2;
|
||||
|
||||
out1=buffer[currentcalcbuffer]+calcbufferoffset;
|
||||
out2=buffer[currentcalcbuffer^1]+calcbufferoffset;
|
||||
dct64_downsample(out1,out2,fraction);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define SAVE putraw(r); \
|
||||
dp+=16;vp+=15+(15-14)
|
||||
#define OS r=*vp * *dp++
|
||||
#define XX vp+=15;r+=*vp * *dp++
|
||||
#define OP r+=*--vp * *dp++
|
||||
|
||||
inline void Synthesis::generatesingle_Down(void)
|
||||
{
|
||||
int i;
|
||||
register REAL r, *vp;
|
||||
register const REAL *dp;
|
||||
|
||||
i=32/2;
|
||||
dp=filter;
|
||||
vp=calcbuffer[LS][currentcalcbuffer]+calcbufferoffset;
|
||||
// actual_v+actual_write_pos;
|
||||
|
||||
switch (calcbufferoffset)
|
||||
{
|
||||
case 0:for(;i;i--,vp+=15){
|
||||
OS;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 1:for(;i;i--,vp+=15){
|
||||
OS;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 2:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 3:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 4:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 5:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 6:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 7:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 8:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 9:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 10:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 11:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 12:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;
|
||||
SAVE;}break;
|
||||
case 13:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;
|
||||
SAVE;}break;
|
||||
case 14:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;
|
||||
SAVE;}break;
|
||||
case 15:for(;i;i--,vp+=31){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
}
|
||||
}
|
||||
|
||||
#undef OS
|
||||
#undef XX
|
||||
#undef OP
|
||||
#undef SAVE
|
||||
|
||||
#define SAVE \
|
||||
putraw(r1); \
|
||||
putraw(r2); \
|
||||
dp+=16;vp1+=15+(15-14);vp2+=15+(15-14)
|
||||
#define OS r1=*vp1 * *dp; \
|
||||
r2=*vp2 * *dp++
|
||||
#define XX vp1+=15;r1+=*vp1 * *dp; \
|
||||
vp2+=15;r2+=*vp2 * *dp++
|
||||
#define OP r1+=*--vp1 * *dp; \
|
||||
r2+=*--vp2 * *dp++
|
||||
|
||||
|
||||
inline void Synthesis::generate_Down(void)
|
||||
{
|
||||
int i;
|
||||
REAL r1,r2;
|
||||
register REAL *vp1,*vp2;
|
||||
register const REAL *dp;
|
||||
|
||||
dp=filter;
|
||||
vp1=calcbuffer[LS][currentcalcbuffer]+calcbufferoffset;
|
||||
vp2=calcbuffer[RS][currentcalcbuffer]+calcbufferoffset;
|
||||
// actual_v+actual_write_pos;
|
||||
|
||||
i=32/2;
|
||||
switch (calcbufferoffset)
|
||||
{
|
||||
case 0:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 1:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 2:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 3:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 4:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 5:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 6:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 7:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 8:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 9:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 10:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 11:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 12:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;
|
||||
SAVE;}break;
|
||||
case 13:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;
|
||||
SAVE;}break;
|
||||
case 14:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;
|
||||
SAVE;}break;
|
||||
case 15:for(;i;i--,vp1+=31,vp2+=31){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Synthesis::synth_Down(int lOutputStereo,REAL *fractionL,REAL *fractionR) {
|
||||
switch(lOutputStereo) {
|
||||
case true:
|
||||
computebuffer_Down(fractionL,calcbuffer[LS]);
|
||||
computebuffer_Down(fractionR,calcbuffer[RS]);
|
||||
generate_Down();
|
||||
nextOffset();
|
||||
break;
|
||||
case false:
|
||||
computebuffer_Down(fractionL,calcbuffer[LS]);
|
||||
generatesingle_Down();
|
||||
nextOffset();
|
||||
break;
|
||||
default:
|
||||
/*cout << "unknown lOutputStereo in Synthesis::synth_Std"<<endl;
|
||||
exit(0);*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Synthesis::synthMP3_Down(int lOutputStereo,
|
||||
REAL hout [2][SSLIMIT][SBLIMIT]) {
|
||||
int ss;
|
||||
switch(lOutputStereo) {
|
||||
case true:
|
||||
for(ss=0;ss<SSLIMIT;ss++) {
|
||||
computebuffer_Down(hout[LS][ss],calcbuffer[LS]);
|
||||
computebuffer_Down(hout[RS][ss],calcbuffer[RS]);
|
||||
generate_Down();
|
||||
nextOffset();
|
||||
}
|
||||
break;
|
||||
case false:
|
||||
for(ss=0;ss<SSLIMIT;ss++) {
|
||||
computebuffer_Down(hout[LS][ss],calcbuffer[LS]);
|
||||
generatesingle_Down();
|
||||
nextOffset();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/*cout << "unknown lOutputStereo in Synthesis::synth_Std"<<endl;
|
||||
exit(0);*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,329 +0,0 @@
|
|||
/*
|
||||
std synth implementation
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - removed cout and exit stuff
|
||||
|
||||
#include "synthesis.h"
|
||||
#include "dct.h"
|
||||
|
||||
|
||||
//#include "dct64.cpp"
|
||||
|
||||
inline void Synthesis::computebuffer_Std(REAL *fraction,
|
||||
REAL buffer[2][CALCBUFFERSIZE]) {
|
||||
REAL *out1,*out2;
|
||||
out1=buffer[currentcalcbuffer]+calcbufferoffset;
|
||||
out2=buffer[currentcalcbuffer^1]+calcbufferoffset;
|
||||
dct64(out1,out2,fraction);
|
||||
}
|
||||
|
||||
|
||||
#define SAVE putraw(r);
|
||||
#define OS r=*vp * *dp++
|
||||
#define XX vp+=15;r+=*vp * *dp++
|
||||
#define OP r+=*--vp * *dp++
|
||||
|
||||
|
||||
inline void Synthesis::generatesingle_Std(void) {
|
||||
int i;
|
||||
register REAL r, *vp;
|
||||
register const REAL *dp;
|
||||
|
||||
i=32;
|
||||
dp=filter;
|
||||
vp=calcbuffer[LS][currentcalcbuffer]+calcbufferoffset;
|
||||
// actual_v+actual_write_pos;
|
||||
|
||||
switch (calcbufferoffset)
|
||||
{
|
||||
case 0:for(;i;i--,vp+=15){
|
||||
OS;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 1:for(;i;i--,vp+=15){
|
||||
OS;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 2:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 3:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 4:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 5:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 6:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 7:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 8:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 9:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 10:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 11:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 12:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;
|
||||
SAVE;}break;
|
||||
case 13:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;
|
||||
SAVE;}break;
|
||||
case 14:for(;i;i--,vp+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;
|
||||
SAVE;}break;
|
||||
case 15:for(;i;i--,vp+=31){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
}
|
||||
}
|
||||
|
||||
#undef OS
|
||||
#undef XX
|
||||
#undef OP
|
||||
#undef SAVE
|
||||
|
||||
|
||||
#define SAVE putraw(r1); putraw(r2);
|
||||
|
||||
#define OS r1=*vp1 * *dp; \
|
||||
r2=*vp2 * *dp++
|
||||
#define XX vp1+=15;r1+=*vp1 * *dp; \
|
||||
vp2+=15;r2+=*vp2 * *dp++
|
||||
#define OP r1+=*--vp1 * *dp; \
|
||||
r2+=*--vp2 * *dp++
|
||||
|
||||
/*
|
||||
inline void Synthesis::generate_old(void)
|
||||
{
|
||||
int i;
|
||||
REAL r1,r2;
|
||||
register REAL *vp1,*vp2;
|
||||
register const REAL *dp;
|
||||
|
||||
dp=filter;
|
||||
vp1=calcbuffer[LS][currentcalcbuffer]+calcbufferoffset;
|
||||
vp2=calcbuffer[RS][currentcalcbuffer]+calcbufferoffset;
|
||||
// actual_v+actual_write_pos;
|
||||
|
||||
i=32;
|
||||
switch (calcbufferoffset)
|
||||
{
|
||||
case 0:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 1:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 2:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 3:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 4:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 5:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 6:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 7:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 8:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 9:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 10:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 11:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
case 12:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;OP;
|
||||
SAVE;}break;
|
||||
case 13:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;OP;
|
||||
SAVE;}break;
|
||||
case 14:for(;i;i--,vp1+=15,vp2+=15){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;XX;
|
||||
SAVE;}break;
|
||||
case 15:for(;i;i--,vp1+=31,vp2+=31){
|
||||
OS;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;OP;
|
||||
SAVE;}break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
#undef OS
|
||||
#undef XX
|
||||
#undef OP
|
||||
#undef SAVE
|
||||
|
||||
#include "op.h"
|
||||
#define SAVE putraw(r1); putraw(r2);
|
||||
|
||||
inline void Synthesis::generate_Std(void)
|
||||
{
|
||||
int i;
|
||||
REAL r1,r2;
|
||||
|
||||
register REAL *vp1;
|
||||
register const REAL *dp;
|
||||
|
||||
dp=filter;
|
||||
vp1=calcbuffer[LS][currentcalcbuffer]+calcbufferoffset;
|
||||
// we calculate cp2 from vp1 because they are both
|
||||
// in the same array. code was:
|
||||
// register REAL* vp2
|
||||
//vp2=calcbuffer[RS][currentcalcbuffer]+calcbufferoffset;
|
||||
|
||||
i=32;
|
||||
switch (calcbufferoffset)
|
||||
{
|
||||
case 0:for(;i;i--,OP_END_1(15,14)){
|
||||
OS;XX1;XX2;OP14;
|
||||
SAVE;}break;
|
||||
case 1:for(;i;i--,OP_END_1(15,13)){
|
||||
OS;OP;OP_END_2(1);XX2;OP13;
|
||||
SAVE;}break;
|
||||
case 2:for(;i;i--,OP_END_1(15,12)){
|
||||
OS;OP2;OP_END_2(2);XX2;OP12;
|
||||
SAVE;}break;
|
||||
case 3:for(;i;i--,OP_END_1(15,11)){
|
||||
OS;OP3;OP_END_2(3);XX2;OP11;
|
||||
SAVE;}break;
|
||||
case 4:for(;i;i--,OP_END_1(15,10)){
|
||||
OS;OP4;OP_END_2(4);XX2;OP10;
|
||||
SAVE;}break;
|
||||
case 5:for(;i;i--,OP_END_1(15,9)){
|
||||
OS;OP5;OP_END_2(5);XX2;OP9;
|
||||
SAVE;}break;
|
||||
case 6:for(;i;i--,OP_END_1(15,8)){
|
||||
OS;OP6;OP_END_2(6);XX2;OP8;
|
||||
SAVE;}break;
|
||||
case 7:for(;i;i--,OP_END_1(15,7)){
|
||||
OS;OP7;OP_END_2(7);XX2;OP7;
|
||||
SAVE;}break;
|
||||
case 8:for(;i;i--,OP_END_1(15,6)){
|
||||
OS;OP8;OP_END_2(8);XX2;OP6;
|
||||
SAVE;}break;
|
||||
case 9:for(;i;i--,OP_END_1(15,5)){
|
||||
OS;OP9;OP_END_2(9);XX2;OP5;
|
||||
SAVE;}break;
|
||||
case 10:for(;i;i--,OP_END_1(15,4)){
|
||||
OS;OP10;OP_END_2(10);XX2;OP4;
|
||||
SAVE;}break;
|
||||
case 11:for(;i;i--,OP_END_1(15,3)){
|
||||
OS;OP11;OP_END_2(11);XX2;OP3;
|
||||
SAVE;}break;
|
||||
case 12:for(;i;i--,OP_END_1(15,2)){
|
||||
OS;OP12;OP_END_2(12);XX2;OP2;
|
||||
SAVE;}break;
|
||||
case 13:for(;i;i--,OP_END_1(15,1)){
|
||||
OS;OP13;OP_END_2(13);XX2;OP;
|
||||
SAVE;}break;
|
||||
case 14:for(;i;i--,vp1+=15){
|
||||
OS;OP14;OP_END_2(14);XX2;
|
||||
SAVE;}break;
|
||||
case 15:for(;i;i--,OP_END_1(31,15)){
|
||||
OS;OP15;
|
||||
SAVE;}break;
|
||||
}
|
||||
}
|
||||
#undef OP_END_1
|
||||
#undef OP_END_2
|
||||
#undef OP
|
||||
#undef OP1
|
||||
#undef OP2
|
||||
#undef OP3
|
||||
#undef OP4
|
||||
#undef OP5
|
||||
#undef OP6
|
||||
#undef OP7
|
||||
#undef OP8
|
||||
#undef OP9
|
||||
#undef OP10
|
||||
#undef OP11
|
||||
#undef OP12
|
||||
#undef OP13
|
||||
#undef OP14
|
||||
#undef OP15
|
||||
#undef OS
|
||||
#undef XX1
|
||||
#undef XX2
|
||||
#undef SCHEDULE
|
||||
#undef SCHEDULE1
|
||||
#undef SCHEDULE2
|
||||
#undef SAVE
|
||||
|
||||
void Synthesis::synth_Std(int lOutputStereo,REAL *fractionL,REAL *fractionR) {
|
||||
switch(lOutputStereo) {
|
||||
case true:
|
||||
computebuffer_Std(fractionL,calcbuffer[LS]);
|
||||
computebuffer_Std(fractionR,calcbuffer[RS]);
|
||||
generate_Std();
|
||||
nextOffset();
|
||||
break;
|
||||
case false:
|
||||
computebuffer_Std(fractionL,calcbuffer[LS]);
|
||||
generatesingle_Std();
|
||||
nextOffset();
|
||||
break;
|
||||
default:
|
||||
/*cout << "unknown lOutputStereo in Synthesis::synth_Std"<<endl;
|
||||
exit(0);*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Synthesis::synthMP3_Std(int lOutputStereo,
|
||||
REAL hout [2][SSLIMIT][SBLIMIT]) {
|
||||
int ss;
|
||||
switch(lOutputStereo) {
|
||||
case true:
|
||||
for(ss=0;ss<SSLIMIT;ss++) {
|
||||
computebuffer_Std(hout[LS][ss],calcbuffer[LS]);
|
||||
computebuffer_Std(hout[RS][ss],calcbuffer[RS]);
|
||||
generate_Std();
|
||||
nextOffset();
|
||||
}
|
||||
break;
|
||||
case false:
|
||||
for(ss=0;ss<SSLIMIT;ss++) {
|
||||
computebuffer_Std(hout[LS][ss],calcbuffer[LS]);
|
||||
generatesingle_Std();
|
||||
nextOffset();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/*cout << "unknown lOutputStereo in Synthesis::synth_Std"<<endl;
|
||||
exit(0);*/
|
||||
break;
|
||||
}
|
||||
}
|
|
@ -1,159 +0,0 @@
|
|||
/*
|
||||
filer definition
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - added VC6 pragma to prevent some warnings from being reported
|
||||
|
||||
|
||||
#include "synthesis.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4305)
|
||||
#endif
|
||||
|
||||
const REAL Synthesis::filter[512]=
|
||||
{
|
||||
0.000000000, -0.000442505, 0.003250122, -0.007003784,
|
||||
0.031082153, -0.078628540, 0.100311279, -0.572036743,
|
||||
1.144989014, 0.572036743, 0.100311279, 0.078628540,
|
||||
0.031082153, 0.007003784, 0.003250122, 0.000442505,
|
||||
-0.000015259, -0.000473022, 0.003326416, -0.007919312,
|
||||
0.030517578, -0.084182739, 0.090927124, -0.600219727,
|
||||
1.144287109, 0.543823242, 0.108856201, 0.073059082,
|
||||
0.031478882, 0.006118774, 0.003173828, 0.000396729,
|
||||
-0.000015259, -0.000534058, 0.003387451, -0.008865356,
|
||||
0.029785156, -0.089706421, 0.080688477, -0.628295898,
|
||||
1.142211914, 0.515609741, 0.116577148, 0.067520142,
|
||||
0.031738281, 0.005294800, 0.003082275, 0.000366211,
|
||||
-0.000015259, -0.000579834, 0.003433228, -0.009841919,
|
||||
0.028884888, -0.095169067, 0.069595337, -0.656219482,
|
||||
1.138763428, 0.487472534, 0.123474121, 0.061996460,
|
||||
0.031845093, 0.004486084, 0.002990723, 0.000320435,
|
||||
-0.000015259, -0.000625610, 0.003463745, -0.010848999,
|
||||
0.027801514, -0.100540161, 0.057617188, -0.683914185,
|
||||
1.133926392, 0.459472656, 0.129577637, 0.056533813,
|
||||
0.031814575, 0.003723145, 0.002899170, 0.000289917,
|
||||
-0.000015259, -0.000686646, 0.003479004, -0.011886597,
|
||||
0.026535034, -0.105819702, 0.044784546, -0.711318970,
|
||||
1.127746582, 0.431655884, 0.134887695, 0.051132202,
|
||||
0.031661987, 0.003005981, 0.002792358, 0.000259399,
|
||||
-0.000015259, -0.000747681, 0.003479004, -0.012939453,
|
||||
0.025085449, -0.110946655, 0.031082153, -0.738372803,
|
||||
1.120223999, 0.404083252, 0.139450073, 0.045837402,
|
||||
0.031387329, 0.002334595, 0.002685547, 0.000244141,
|
||||
-0.000030518, -0.000808716, 0.003463745, -0.014022827,
|
||||
0.023422241, -0.115921021, 0.016510010, -0.765029907,
|
||||
1.111373901, 0.376800537, 0.143264771, 0.040634155,
|
||||
0.031005859, 0.001693726, 0.002578735, 0.000213623,
|
||||
-0.000030518, -0.000885010, 0.003417969, -0.015121460,
|
||||
0.021575928, -0.120697021, 0.001068115, -0.791213989,
|
||||
1.101211548, 0.349868774, 0.146362305, 0.035552979,
|
||||
0.030532837, 0.001098633, 0.002456665, 0.000198364,
|
||||
-0.000030518, -0.000961304, 0.003372192, -0.016235352,
|
||||
0.019531250, -0.125259399, -0.015228271, -0.816864014,
|
||||
1.089782715, 0.323318481, 0.148773193, 0.030609131,
|
||||
0.029937744, 0.000549316, 0.002349854, 0.000167847,
|
||||
-0.000030518, -0.001037598, 0.003280640, -0.017349243,
|
||||
0.017257690, -0.129562378, -0.032379150, -0.841949463,
|
||||
1.077117920, 0.297210693, 0.150497437, 0.025817871,
|
||||
0.029281616, 0.000030518, 0.002243042, 0.000152588,
|
||||
-0.000045776, -0.001113892, 0.003173828, -0.018463135,
|
||||
0.014801025, -0.133590698, -0.050354004, -0.866363525,
|
||||
1.063217163, 0.271591187, 0.151596069, 0.021179199,
|
||||
0.028533936, -0.000442505, 0.002120972, 0.000137329,
|
||||
-0.000045776, -0.001205444, 0.003051758, -0.019577026,
|
||||
0.012115479, -0.137298584, -0.069168091, -0.890090942,
|
||||
1.048156738, 0.246505737, 0.152069092, 0.016708374,
|
||||
0.027725220, -0.000869751, 0.002014160, 0.000122070,
|
||||
-0.000061035, -0.001296997, 0.002883911, -0.020690918,
|
||||
0.009231567, -0.140670776, -0.088775635, -0.913055420,
|
||||
1.031936646, 0.221984863, 0.151962280, 0.012420654,
|
||||
0.026840210, -0.001266479, 0.001907349, 0.000106812,
|
||||
-0.000061035, -0.001388550, 0.002700806, -0.021789551,
|
||||
0.006134033, -0.143676758, -0.109161377, -0.935195923,
|
||||
1.014617920, 0.198059082, 0.151306152, 0.008316040,
|
||||
0.025909424, -0.001617432, 0.001785278, 0.000106812,
|
||||
-0.000076294, -0.001480103, 0.002487183, -0.022857666,
|
||||
0.002822876, -0.146255493, -0.130310059, -0.956481934,
|
||||
0.996246338, 0.174789429, 0.150115967, 0.004394531,
|
||||
0.024932861, -0.001937866, 0.001693726, 0.000091553,
|
||||
-0.000076294, -0.001586914, 0.002227783, -0.023910522,
|
||||
-0.000686646, -0.148422241, -0.152206421, -0.976852417,
|
||||
0.976852417, 0.152206421, 0.148422241, 0.000686646,
|
||||
0.023910522, -0.002227783, 0.001586914, 0.000076294,
|
||||
-0.000091553, -0.001693726, 0.001937866, -0.024932861,
|
||||
-0.004394531, -0.150115967, -0.174789429, -0.996246338,
|
||||
0.956481934, 0.130310059, 0.146255493, -0.002822876,
|
||||
0.022857666, -0.002487183, 0.001480103, 0.000076294,
|
||||
-0.000106812, -0.001785278, 0.001617432, -0.025909424,
|
||||
-0.008316040, -0.151306152, -0.198059082, -1.014617920,
|
||||
0.935195923, 0.109161377, 0.143676758, -0.006134033,
|
||||
0.021789551, -0.002700806, 0.001388550, 0.000061035,
|
||||
-0.000106812, -0.001907349, 0.001266479, -0.026840210,
|
||||
-0.012420654, -0.151962280, -0.221984863, -1.031936646,
|
||||
0.913055420, 0.088775635, 0.140670776, -0.009231567,
|
||||
0.020690918, -0.002883911, 0.001296997, 0.000061035,
|
||||
-0.000122070, -0.002014160, 0.000869751, -0.027725220,
|
||||
-0.016708374, -0.152069092, -0.246505737, -1.048156738,
|
||||
0.890090942, 0.069168091, 0.137298584, -0.012115479,
|
||||
0.019577026, -0.003051758, 0.001205444, 0.000045776,
|
||||
-0.000137329, -0.002120972, 0.000442505, -0.028533936,
|
||||
-0.021179199, -0.151596069, -0.271591187, -1.063217163,
|
||||
0.866363525, 0.050354004, 0.133590698, -0.014801025,
|
||||
0.018463135, -0.003173828, 0.001113892, 0.000045776,
|
||||
-0.000152588, -0.002243042, -0.000030518, -0.029281616,
|
||||
-0.025817871, -0.150497437, -0.297210693, -1.077117920,
|
||||
0.841949463, 0.032379150, 0.129562378, -0.017257690,
|
||||
0.017349243, -0.003280640, 0.001037598, 0.000030518,
|
||||
-0.000167847, -0.002349854, -0.000549316, -0.029937744,
|
||||
-0.030609131, -0.148773193, -0.323318481, -1.089782715,
|
||||
0.816864014, 0.015228271, 0.125259399, -0.019531250,
|
||||
0.016235352, -0.003372192, 0.000961304, 0.000030518,
|
||||
-0.000198364, -0.002456665, -0.001098633, -0.030532837,
|
||||
-0.035552979, -0.146362305, -0.349868774, -1.101211548,
|
||||
0.791213989, -0.001068115, 0.120697021, -0.021575928,
|
||||
0.015121460, -0.003417969, 0.000885010, 0.000030518,
|
||||
-0.000213623, -0.002578735, -0.001693726, -0.031005859,
|
||||
-0.040634155, -0.143264771, -0.376800537, -1.111373901,
|
||||
0.765029907, -0.016510010, 0.115921021, -0.023422241,
|
||||
0.014022827, -0.003463745, 0.000808716, 0.000030518,
|
||||
-0.000244141, -0.002685547, -0.002334595, -0.031387329,
|
||||
-0.045837402, -0.139450073, -0.404083252, -1.120223999,
|
||||
0.738372803, -0.031082153, 0.110946655, -0.025085449,
|
||||
0.012939453, -0.003479004, 0.000747681, 0.000015259,
|
||||
-0.000259399, -0.002792358, -0.003005981, -0.031661987,
|
||||
-0.051132202, -0.134887695, -0.431655884, -1.127746582,
|
||||
0.711318970, -0.044784546, 0.105819702, -0.026535034,
|
||||
0.011886597, -0.003479004, 0.000686646, 0.000015259,
|
||||
-0.000289917, -0.002899170, -0.003723145, -0.031814575,
|
||||
-0.056533813, -0.129577637, -0.459472656, -1.133926392,
|
||||
0.683914185, -0.057617188, 0.100540161, -0.027801514,
|
||||
0.010848999, -0.003463745, 0.000625610, 0.000015259,
|
||||
-0.000320435, -0.002990723, -0.004486084, -0.031845093,
|
||||
-0.061996460, -0.123474121, -0.487472534, -1.138763428,
|
||||
0.656219482, -0.069595337, 0.095169067, -0.028884888,
|
||||
0.009841919, -0.003433228, 0.000579834, 0.000015259,
|
||||
-0.000366211, -0.003082275, -0.005294800, -0.031738281,
|
||||
-0.067520142, -0.116577148, -0.515609741, -1.142211914,
|
||||
0.628295898, -0.080688477, 0.089706421, -0.029785156,
|
||||
0.008865356, -0.003387451, 0.000534058, 0.000015259,
|
||||
-0.000396729, -0.003173828, -0.006118774, -0.031478882,
|
||||
-0.073059082, -0.108856201, -0.543823242, -1.144287109,
|
||||
0.600219727, -0.090927124, 0.084182739, -0.030517578,
|
||||
0.007919312, -0.003326416, 0.000473022, 0.000015259
|
||||
};
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(default : 4305)
|
||||
#endif
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
header for synthesis
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - removed cout and exit stuff
|
||||
|
||||
|
||||
#include "synthesis.h"
|
||||
|
||||
Synthesis::Synthesis() {
|
||||
|
||||
int i;
|
||||
outpos=0;
|
||||
calcbufferoffset=15;
|
||||
currentcalcbuffer=0;
|
||||
|
||||
for(i=CALCBUFFERSIZE-1;i>=0;i--)
|
||||
calcbuffer[LS][0][i]=calcbuffer[LS][1][i]=
|
||||
calcbuffer[RS][0][i]=calcbuffer[RS][1][i]=0.0;
|
||||
|
||||
initialize_dct64();
|
||||
initialize_dct64_downsample();
|
||||
}
|
||||
|
||||
|
||||
Synthesis::~Synthesis() {
|
||||
}
|
||||
|
||||
|
||||
void Synthesis::doSynth(int lDownSample,int lOutputStereo,
|
||||
REAL *fractionL,REAL *fractionR) {
|
||||
switch(lDownSample) {
|
||||
case false:
|
||||
synth_Std(lOutputStereo,fractionL,fractionR);
|
||||
break;
|
||||
case true:
|
||||
synth_Down(lOutputStereo,fractionL,fractionR);
|
||||
break;
|
||||
default:
|
||||
/*cout << "unknown downsample parameter"<<lDownSample<<endl;
|
||||
exit(0);*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Synthesis::doMP3Synth(int lDownSample,int lOutputStereo,
|
||||
REAL in[2][SSLIMIT][SBLIMIT]) {
|
||||
|
||||
switch(lDownSample) {
|
||||
case false:
|
||||
synthMP3_Std(lOutputStereo,in);
|
||||
break;
|
||||
case true:
|
||||
synthMP3_Down(lOutputStereo,in);
|
||||
break;
|
||||
default:
|
||||
/*cout << "unknown downsample parameter:"<<lDownSample<<endl;
|
||||
exit(0);*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
header for synthesis
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef __SYNTHESIS_H
|
||||
#define __SYNTHESIS_H
|
||||
|
||||
#include "common.h"
|
||||
#include "dct.h"
|
||||
|
||||
#define CALCBUFFERSIZE 512
|
||||
#define FRAMESIZE (2*2*2*32*18)
|
||||
|
||||
|
||||
class Synthesis {
|
||||
|
||||
//
|
||||
// Subbandsynthesis two calcbuffers for every channel, and two channels.
|
||||
// calcbufferL[0]=calcbuffer[0]
|
||||
// calcbufferL[1]=calcbuffer[1]
|
||||
// calcbufferR[0]=calcbuffer[2]
|
||||
// calcbufferR[1]=calcbuffer[3]
|
||||
ATTR_ALIGN(64) REAL calcbuffer[2][2][CALCBUFFERSIZE];
|
||||
ATTR_ALIGN(64) int currentcalcbuffer,calcbufferoffset;
|
||||
ATTR_ALIGN(64) static const REAL filter[512];
|
||||
ATTR_ALIGN(64) REAL out[FRAMESIZE];
|
||||
int outpos;
|
||||
|
||||
public:
|
||||
Synthesis();
|
||||
~Synthesis();
|
||||
|
||||
// mpeg1,2
|
||||
void doSynth(int lDownSample,int lOutputStereo,
|
||||
REAL *fractionL,REAL *fractionR);
|
||||
|
||||
void doMP3Synth(int lDownSample,int lOutputStereo,
|
||||
REAL in[2][SSLIMIT][SBLIMIT]);
|
||||
|
||||
// put mpeg to raw
|
||||
inline void putraw(REAL val) {
|
||||
out[outpos++]=val;
|
||||
}
|
||||
|
||||
inline REAL* getOutputData() { return out; }
|
||||
inline void clearrawdata() { outpos=0; }
|
||||
inline int getLen() { return outpos; }
|
||||
|
||||
|
||||
private:
|
||||
void synth_Down(int lOutputStereo,REAL *fractionL,REAL *fractionR);
|
||||
void synth_Std(int lOutputStereo,REAL *fractionL,REAL *fractionR);
|
||||
|
||||
void synthMP3_Down(int lOutputStereo,REAL hout [2][SSLIMIT][SBLIMIT]);
|
||||
void synthMP3_Std(int lOutputStereo,REAL hout [2][SSLIMIT][SBLIMIT]);
|
||||
|
||||
inline void nextOffset() {
|
||||
calcbufferoffset++;
|
||||
calcbufferoffset&=0xf;
|
||||
/*
|
||||
if (calcbufferoffset<15) {
|
||||
calcbufferoffset++;
|
||||
} else {
|
||||
calcbufferoffset=0;
|
||||
}
|
||||
*/
|
||||
currentcalcbuffer^=1;
|
||||
}
|
||||
|
||||
|
||||
void computebuffer_Std(REAL *fraction,REAL buffer[2][CALCBUFFERSIZE]);
|
||||
void generate_Std(void);
|
||||
void generatesingle_Std(void);
|
||||
|
||||
void computebuffer_Down(REAL *fraction,REAL buffer[2][CALCBUFFERSIZE]);
|
||||
void generate_Down(void);
|
||||
void generatesingle_Down(void);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,78 +0,0 @@
|
|||
/*
|
||||
wrapper for window functions
|
||||
Copyright (C) 2001 Martin Vogt
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Library General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
For more information look at the file License.txt in this package
|
||||
|
||||
*/
|
||||
|
||||
//changes 8/4/2002 (by Hauke Duden):
|
||||
// - added VC6 pragma to prevent some warnings from being reported
|
||||
|
||||
#include "mpegsound.h"
|
||||
|
||||
|
||||
static int windowInit=0;
|
||||
|
||||
ATTR_ALIGN(64) REAL win[4][36];
|
||||
ATTR_ALIGN(64) REAL winINV[4][36];
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable: 4244)
|
||||
#endif
|
||||
|
||||
void initialize_win() {
|
||||
if (windowInit) {
|
||||
return;
|
||||
}
|
||||
windowInit=true;
|
||||
|
||||
int i;
|
||||
|
||||
for(i=0;i<18;i++) {
|
||||
/*
|
||||
win[0][i]=win[1][i]=0.5*sin(PI_72*(double)(2*i+1))/
|
||||
cos(PI_72*(double)(2*i+19));
|
||||
*/
|
||||
win[0][i]=win[1][i]=0.5*sin(PI_72*(double)(2*(i+0)+1))/cos(MY_PI * (double) (2*(i+0) +19) / 72.0 );
|
||||
win[0][i+18] = win[3][i+18] = 0.5 * sin( MY_PI / 72.0 * (double) (2*(i+18)+1) ) / cos ( MY_PI * (double) (2*(i+18)+19) / 72.0 );
|
||||
}
|
||||
/*
|
||||
for(;i<36;i++) {
|
||||
win[0][i]=win[3][i]=0.5*sin(PI_72*(double)(2*i+1))/cos(PI_72*(double)(2*i+19));
|
||||
|
||||
}
|
||||
*/
|
||||
for(i=0;i<6;i++) {
|
||||
win[1][i+18]=0.5/cos(MY_PI*(double)(2*(i+18)+19)/72.0);
|
||||
win[3][i+12]=0.5/cos(MY_PI*(double)(2*(i+12)+19)/72.0);
|
||||
win[1][i+24]=0.5*sin(PI_24*(double)(2*i+13))/cos(MY_PI*(double)(2*(i+24)+19)/72.0);
|
||||
win[1][i+30]=win[3][i]=0.0;
|
||||
win[3][i+6 ]=0.5*sin(PI_24*(double)(2*i+1))/cos(MY_PI*(double)(2*(i+6)+19)/72.0);
|
||||
}
|
||||
for(i=0;i<12;i++)
|
||||
win[2][i]=0.5*sin(PI_24*(double)(2*i+1))/cos(MY_PI*(double)(2*i+7)/24.0);
|
||||
|
||||
int j;
|
||||
|
||||
for(j=0;j<4;j++) {
|
||||
int len[4] = { 36,36,12,36 };
|
||||
for(i=0;i<len[j];i+=2)
|
||||
winINV[j][i] = + win[j][i];
|
||||
for(i=1;i<len[j];i+=2)
|
||||
winINV[j][i] = - win[j][i];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(default: 4244)
|
||||
#endif
|
||||
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
#ifndef _SPLAY_WINDOW_H_
|
||||
#define _SPLAY_WINDOW_H_
|
||||
|
||||
extern ATTR_ALIGN(64) REAL win[4][36];
|
||||
extern ATTR_ALIGN(64) REAL winINV[4][36];
|
||||
|
||||
inline REAL* getSplayWindow(int nr) { return win[nr]; }
|
||||
inline REAL* getSplayWindowINV(int nr) { return winINV[nr]; }
|
||||
|
||||
#endif
|
|
@ -1,26 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.yourcompany.yourcocoaframework</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
Binary file not shown.
|
@ -1,794 +0,0 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 42;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
|
||||
8EBDF3EA09F28B08004F2528 /* aacinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF3D509F28B08004F2528 /* aacinfo.c */; };
|
||||
8EBDF3EB09F28B08004F2528 /* aacinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF3D609F28B08004F2528 /* aacinfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
8EBDF3EE09F28B08004F2528 /* getopt.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF3D909F28B08004F2528 /* getopt.c */; };
|
||||
8EBDF3EF09F28B08004F2528 /* getopt.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF3DA09F28B08004F2528 /* getopt.h */; };
|
||||
8EBDF3F209F28B08004F2528 /* drms.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF3DE09F28B08004F2528 /* drms.c */; };
|
||||
8EBDF3F309F28B08004F2528 /* drms.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF3DF09F28B08004F2528 /* drms.h */; };
|
||||
8EBDF3F409F28B08004F2528 /* drmstables.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF3E009F28B08004F2528 /* drmstables.h */; };
|
||||
8EBDF3F509F28B08004F2528 /* mp4atom.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF3E109F28B08004F2528 /* mp4atom.c */; };
|
||||
8EBDF3F709F28B08004F2528 /* mp4ff.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF3E309F28B08004F2528 /* mp4ff.h */; };
|
||||
8EBDF3F809F28B08004F2528 /* mp4ff_int_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF3E409F28B08004F2528 /* mp4ff_int_types.h */; };
|
||||
8EBDF3F909F28B08004F2528 /* mp4ffint.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF3E509F28B08004F2528 /* mp4ffint.h */; };
|
||||
8EBDF3FA09F28B08004F2528 /* mp4meta.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF3E609F28B08004F2528 /* mp4meta.c */; };
|
||||
8EBDF3FB09F28B08004F2528 /* mp4sample.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF3E709F28B08004F2528 /* mp4sample.c */; };
|
||||
8EBDF3FC09F28B08004F2528 /* mp4tagupdate.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF3E809F28B08004F2528 /* mp4tagupdate.c */; };
|
||||
8EBDF3FD09F28B08004F2528 /* mp4util.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF3E909F28B08004F2528 /* mp4util.c */; };
|
||||
8EBDF40009F28B1F004F2528 /* faad.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF3FE09F28B1F004F2528 /* faad.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
8EBDF40109F28B1F004F2528 /* neaacdec.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF3FF09F28B1F004F2528 /* neaacdec.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
8EBDF47209F28B2C004F2528 /* analysis.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF40209F28B2C004F2528 /* analysis.h */; };
|
||||
8EBDF47309F28B2C004F2528 /* bits.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF40309F28B2C004F2528 /* bits.c */; };
|
||||
8EBDF47409F28B2C004F2528 /* bits.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF40409F28B2C004F2528 /* bits.h */; };
|
||||
8EBDF47509F28B2C004F2528 /* cfft_tab.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF40509F28B2C004F2528 /* cfft_tab.h */; };
|
||||
8EBDF47609F28B2C004F2528 /* cfft.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF40609F28B2C004F2528 /* cfft.c */; };
|
||||
8EBDF47709F28B2C004F2528 /* cfft.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF40709F28B2C004F2528 /* cfft.h */; };
|
||||
8EBDF47809F28B2C004F2528 /* hcb.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF40909F28B2C004F2528 /* hcb.h */; };
|
||||
8EBDF47909F28B2C004F2528 /* hcb_1.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF40A09F28B2C004F2528 /* hcb_1.h */; };
|
||||
8EBDF47A09F28B2C004F2528 /* hcb_10.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF40B09F28B2C004F2528 /* hcb_10.h */; };
|
||||
8EBDF47B09F28B2C004F2528 /* hcb_11.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF40C09F28B2C004F2528 /* hcb_11.h */; };
|
||||
8EBDF47C09F28B2C004F2528 /* hcb_2.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF40D09F28B2C004F2528 /* hcb_2.h */; };
|
||||
8EBDF47D09F28B2C004F2528 /* hcb_3.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF40E09F28B2C004F2528 /* hcb_3.h */; };
|
||||
8EBDF47E09F28B2C004F2528 /* hcb_4.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF40F09F28B2C004F2528 /* hcb_4.h */; };
|
||||
8EBDF47F09F28B2C004F2528 /* hcb_5.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF41009F28B2C004F2528 /* hcb_5.h */; };
|
||||
8EBDF48009F28B2C004F2528 /* hcb_6.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF41109F28B2C004F2528 /* hcb_6.h */; };
|
||||
8EBDF48109F28B2C004F2528 /* hcb_7.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF41209F28B2C004F2528 /* hcb_7.h */; };
|
||||
8EBDF48209F28B2C004F2528 /* hcb_8.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF41309F28B2C004F2528 /* hcb_8.h */; };
|
||||
8EBDF48309F28B2C004F2528 /* hcb_9.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF41409F28B2C004F2528 /* hcb_9.h */; };
|
||||
8EBDF48409F28B2C004F2528 /* hcb_sf.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF41509F28B2C004F2528 /* hcb_sf.h */; };
|
||||
8EBDF48509F28B2C004F2528 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF41609F28B2C004F2528 /* common.c */; };
|
||||
8EBDF48609F28B2C004F2528 /* common.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF41709F28B2C004F2528 /* common.h */; };
|
||||
8EBDF48709F28B2C004F2528 /* decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF41809F28B2C004F2528 /* decoder.c */; };
|
||||
8EBDF48809F28B2C004F2528 /* decoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF41909F28B2C004F2528 /* decoder.h */; };
|
||||
8EBDF48909F28B2C004F2528 /* drc.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF41A09F28B2C004F2528 /* drc.c */; };
|
||||
8EBDF48A09F28B2C004F2528 /* drc.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF41B09F28B2C004F2528 /* drc.h */; };
|
||||
8EBDF48B09F28B2C004F2528 /* drm_dec.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF41C09F28B2C004F2528 /* drm_dec.c */; };
|
||||
8EBDF48C09F28B2C004F2528 /* drm_dec.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF41D09F28B2C004F2528 /* drm_dec.h */; };
|
||||
8EBDF48D09F28B2C004F2528 /* error.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF41E09F28B2C004F2528 /* error.c */; };
|
||||
8EBDF48E09F28B2C004F2528 /* error.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF41F09F28B2C004F2528 /* error.h */; };
|
||||
8EBDF48F09F28B2C004F2528 /* filtbank.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF42009F28B2C004F2528 /* filtbank.c */; };
|
||||
8EBDF49009F28B2C004F2528 /* filtbank.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF42109F28B2C004F2528 /* filtbank.h */; };
|
||||
8EBDF49109F28B2C004F2528 /* fixed.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF42209F28B2C004F2528 /* fixed.h */; };
|
||||
8EBDF49209F28B2C004F2528 /* hcr.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF42309F28B2C004F2528 /* hcr.c */; };
|
||||
8EBDF49309F28B2C004F2528 /* huffman.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF42409F28B2C004F2528 /* huffman.c */; };
|
||||
8EBDF49409F28B2C004F2528 /* huffman.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF42509F28B2C004F2528 /* huffman.h */; };
|
||||
8EBDF49509F28B2C004F2528 /* ic_predict.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF42609F28B2C004F2528 /* ic_predict.c */; };
|
||||
8EBDF49609F28B2C004F2528 /* ic_predict.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF42709F28B2C004F2528 /* ic_predict.h */; };
|
||||
8EBDF49709F28B2C004F2528 /* iq_table.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF42809F28B2C004F2528 /* iq_table.h */; };
|
||||
8EBDF49809F28B2C004F2528 /* is.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF42909F28B2C004F2528 /* is.c */; };
|
||||
8EBDF49909F28B2C004F2528 /* is.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF42A09F28B2C004F2528 /* is.h */; };
|
||||
8EBDF49A09F28B2C004F2528 /* kbd_win.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF42B09F28B2C004F2528 /* kbd_win.h */; };
|
||||
8EBDF4A609F28B2C004F2528 /* lt_predict.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF43709F28B2C004F2528 /* lt_predict.c */; };
|
||||
8EBDF4A709F28B2C004F2528 /* lt_predict.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF43809F28B2C004F2528 /* lt_predict.h */; };
|
||||
8EBDF4A909F28B2C004F2528 /* mdct_tab.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF43A09F28B2C004F2528 /* mdct_tab.h */; };
|
||||
8EBDF4AA09F28B2C004F2528 /* mdct.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF43B09F28B2C004F2528 /* mdct.c */; };
|
||||
8EBDF4AB09F28B2C004F2528 /* mdct.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF43C09F28B2C004F2528 /* mdct.h */; };
|
||||
8EBDF4AC09F28B2C004F2528 /* mp4.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF43D09F28B2C004F2528 /* mp4.c */; };
|
||||
8EBDF4AD09F28B2C004F2528 /* mp4.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF43E09F28B2C004F2528 /* mp4.h */; };
|
||||
8EBDF4AE09F28B2C004F2528 /* ms.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF43F09F28B2C004F2528 /* ms.c */; };
|
||||
8EBDF4AF09F28B2C004F2528 /* ms.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF44009F28B2C004F2528 /* ms.h */; };
|
||||
8EBDF4B009F28B2C004F2528 /* output.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF44109F28B2C004F2528 /* output.c */; };
|
||||
8EBDF4B109F28B2C004F2528 /* output.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF44209F28B2C004F2528 /* output.h */; };
|
||||
8EBDF4B209F28B2C004F2528 /* pns.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF44309F28B2C004F2528 /* pns.c */; };
|
||||
8EBDF4B309F28B2C004F2528 /* pns.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF44409F28B2C004F2528 /* pns.h */; };
|
||||
8EBDF4B409F28B2C004F2528 /* ps_dec.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF44509F28B2C004F2528 /* ps_dec.c */; };
|
||||
8EBDF4B509F28B2C004F2528 /* ps_dec.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF44609F28B2C004F2528 /* ps_dec.h */; };
|
||||
8EBDF4B609F28B2C004F2528 /* ps_syntax.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF44709F28B2C004F2528 /* ps_syntax.c */; };
|
||||
8EBDF4B709F28B2C004F2528 /* ps_tables.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF44809F28B2C004F2528 /* ps_tables.h */; };
|
||||
8EBDF4B809F28B2C004F2528 /* pulse.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF44909F28B2C004F2528 /* pulse.c */; };
|
||||
8EBDF4B909F28B2C004F2528 /* pulse.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF44A09F28B2C004F2528 /* pulse.h */; };
|
||||
8EBDF4BA09F28B2C004F2528 /* rvlc.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF44B09F28B2C004F2528 /* rvlc.c */; };
|
||||
8EBDF4BB09F28B2C004F2528 /* rvlc.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF44C09F28B2C004F2528 /* rvlc.h */; };
|
||||
8EBDF4BC09F28B2C004F2528 /* sbr_dct.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF44D09F28B2C004F2528 /* sbr_dct.c */; };
|
||||
8EBDF4BD09F28B2C004F2528 /* sbr_dct.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF44E09F28B2C004F2528 /* sbr_dct.h */; };
|
||||
8EBDF4BE09F28B2C004F2528 /* sbr_dec.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF44F09F28B2C004F2528 /* sbr_dec.c */; };
|
||||
8EBDF4BF09F28B2C004F2528 /* sbr_dec.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF45009F28B2C004F2528 /* sbr_dec.h */; };
|
||||
8EBDF4C009F28B2C004F2528 /* sbr_e_nf.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF45109F28B2C004F2528 /* sbr_e_nf.c */; };
|
||||
8EBDF4C109F28B2C004F2528 /* sbr_e_nf.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF45209F28B2C004F2528 /* sbr_e_nf.h */; };
|
||||
8EBDF4C209F28B2C004F2528 /* sbr_fbt.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF45309F28B2C004F2528 /* sbr_fbt.c */; };
|
||||
8EBDF4C309F28B2C004F2528 /* sbr_fbt.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF45409F28B2C004F2528 /* sbr_fbt.h */; };
|
||||
8EBDF4C409F28B2C004F2528 /* sbr_hfadj.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF45509F28B2C004F2528 /* sbr_hfadj.c */; };
|
||||
8EBDF4C509F28B2C004F2528 /* sbr_hfadj.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF45609F28B2C004F2528 /* sbr_hfadj.h */; };
|
||||
8EBDF4C609F28B2C004F2528 /* sbr_hfgen.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF45709F28B2C004F2528 /* sbr_hfgen.c */; };
|
||||
8EBDF4C709F28B2C004F2528 /* sbr_hfgen.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF45809F28B2C004F2528 /* sbr_hfgen.h */; };
|
||||
8EBDF4C809F28B2C004F2528 /* sbr_huff.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF45909F28B2C004F2528 /* sbr_huff.c */; };
|
||||
8EBDF4C909F28B2C004F2528 /* sbr_huff.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF45A09F28B2C004F2528 /* sbr_huff.h */; };
|
||||
8EBDF4CA09F28B2C004F2528 /* sbr_noise.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF45B09F28B2C004F2528 /* sbr_noise.h */; };
|
||||
8EBDF4CB09F28B2C004F2528 /* sbr_qmf_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF45C09F28B2C004F2528 /* sbr_qmf_c.h */; };
|
||||
8EBDF4CC09F28B2C004F2528 /* sbr_qmf.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF45D09F28B2C004F2528 /* sbr_qmf.c */; };
|
||||
8EBDF4CD09F28B2C004F2528 /* sbr_qmf.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF45E09F28B2C004F2528 /* sbr_qmf.h */; };
|
||||
8EBDF4CE09F28B2C004F2528 /* sbr_syntax.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF45F09F28B2C004F2528 /* sbr_syntax.c */; };
|
||||
8EBDF4CF09F28B2C004F2528 /* sbr_syntax.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF46009F28B2C004F2528 /* sbr_syntax.h */; };
|
||||
8EBDF4D009F28B2C004F2528 /* sbr_tf_grid.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF46109F28B2C004F2528 /* sbr_tf_grid.c */; };
|
||||
8EBDF4D109F28B2C004F2528 /* sbr_tf_grid.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF46209F28B2C004F2528 /* sbr_tf_grid.h */; };
|
||||
8EBDF4D209F28B2C004F2528 /* sine_win.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF46309F28B2C004F2528 /* sine_win.h */; };
|
||||
8EBDF4D309F28B2C004F2528 /* specrec.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF46409F28B2C004F2528 /* specrec.c */; };
|
||||
8EBDF4D409F28B2C004F2528 /* specrec.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF46509F28B2C004F2528 /* specrec.h */; };
|
||||
8EBDF4D509F28B2C004F2528 /* ssr_fb.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF46609F28B2C004F2528 /* ssr_fb.c */; };
|
||||
8EBDF4D609F28B2C004F2528 /* ssr_fb.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF46709F28B2C004F2528 /* ssr_fb.h */; };
|
||||
8EBDF4D709F28B2C004F2528 /* ssr_ipqf.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF46809F28B2C004F2528 /* ssr_ipqf.c */; };
|
||||
8EBDF4D809F28B2C004F2528 /* ssr_ipqf.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF46909F28B2C004F2528 /* ssr_ipqf.h */; };
|
||||
8EBDF4D909F28B2C004F2528 /* ssr_win.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF46A09F28B2C004F2528 /* ssr_win.h */; };
|
||||
8EBDF4DA09F28B2C004F2528 /* ssr.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF46B09F28B2C004F2528 /* ssr.c */; };
|
||||
8EBDF4DB09F28B2C004F2528 /* ssr.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF46C09F28B2C004F2528 /* ssr.h */; };
|
||||
8EBDF4DC09F28B2C004F2528 /* structs.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF46D09F28B2C004F2528 /* structs.h */; };
|
||||
8EBDF4DD09F28B2C004F2528 /* syntax.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF46E09F28B2C004F2528 /* syntax.c */; };
|
||||
8EBDF4DE09F28B2C004F2528 /* syntax.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF46F09F28B2C004F2528 /* syntax.h */; };
|
||||
8EBDF4DF09F28B2C004F2528 /* tns.c in Sources */ = {isa = PBXBuildFile; fileRef = 8EBDF47009F28B2C004F2528 /* tns.c */; };
|
||||
8EBDF4E009F28B2C004F2528 /* tns.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF47109F28B2C004F2528 /* tns.h */; };
|
||||
8EBDF4E409F28B3F004F2528 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 8EBDF4E309F28B3F004F2528 /* config.h */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXBuildStyle section */
|
||||
014CEA440018CDF011CA2923 /* Debug */ = {
|
||||
isa = PBXBuildStyle;
|
||||
buildSettings = {
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
014CEA450018CDF011CA2923 /* Release */ = {
|
||||
isa = PBXBuildStyle;
|
||||
buildSettings = {
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End PBXBuildStyle section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
8DC2EF5B0486A6940098B216 /* FAAD2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FAAD2.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
8EBDF3D509F28B08004F2528 /* aacinfo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = aacinfo.c; sourceTree = "<group>"; };
|
||||
8EBDF3D609F28B08004F2528 /* aacinfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = aacinfo.h; sourceTree = "<group>"; };
|
||||
8EBDF3D909F28B08004F2528 /* getopt.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = getopt.c; sourceTree = "<group>"; };
|
||||
8EBDF3DA09F28B08004F2528 /* getopt.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = getopt.h; sourceTree = "<group>"; };
|
||||
8EBDF3DE09F28B08004F2528 /* drms.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = drms.c; sourceTree = "<group>"; };
|
||||
8EBDF3DF09F28B08004F2528 /* drms.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = drms.h; sourceTree = "<group>"; };
|
||||
8EBDF3E009F28B08004F2528 /* drmstables.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = drmstables.h; sourceTree = "<group>"; };
|
||||
8EBDF3E109F28B08004F2528 /* mp4atom.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = mp4atom.c; sourceTree = "<group>"; };
|
||||
8EBDF3E309F28B08004F2528 /* mp4ff.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mp4ff.h; sourceTree = "<group>"; };
|
||||
8EBDF3E409F28B08004F2528 /* mp4ff_int_types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mp4ff_int_types.h; sourceTree = "<group>"; };
|
||||
8EBDF3E509F28B08004F2528 /* mp4ffint.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = mp4ffint.h; sourceTree = "<group>"; };
|
||||
8EBDF3E609F28B08004F2528 /* mp4meta.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = mp4meta.c; sourceTree = "<group>"; };
|
||||
8EBDF3E709F28B08004F2528 /* mp4sample.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = mp4sample.c; sourceTree = "<group>"; };
|
||||
8EBDF3E809F28B08004F2528 /* mp4tagupdate.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = mp4tagupdate.c; sourceTree = "<group>"; };
|
||||
8EBDF3E909F28B08004F2528 /* mp4util.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = mp4util.c; sourceTree = "<group>"; };
|
||||
8EBDF3FE09F28B1F004F2528 /* faad.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = faad.h; path = Files/include/faad.h; sourceTree = "<group>"; };
|
||||
8EBDF3FF09F28B1F004F2528 /* neaacdec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = neaacdec.h; path = Files/include/neaacdec.h; sourceTree = "<group>"; };
|
||||
8EBDF40209F28B2C004F2528 /* analysis.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = analysis.h; path = Files/libfaad/analysis.h; sourceTree = "<group>"; };
|
||||
8EBDF40309F28B2C004F2528 /* bits.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = bits.c; path = Files/libfaad/bits.c; sourceTree = "<group>"; };
|
||||
8EBDF40409F28B2C004F2528 /* bits.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = bits.h; path = Files/libfaad/bits.h; sourceTree = "<group>"; };
|
||||
8EBDF40509F28B2C004F2528 /* cfft_tab.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = cfft_tab.h; path = Files/libfaad/cfft_tab.h; sourceTree = "<group>"; };
|
||||
8EBDF40609F28B2C004F2528 /* cfft.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = cfft.c; path = Files/libfaad/cfft.c; sourceTree = "<group>"; };
|
||||
8EBDF40709F28B2C004F2528 /* cfft.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = cfft.h; path = Files/libfaad/cfft.h; sourceTree = "<group>"; };
|
||||
8EBDF40909F28B2C004F2528 /* hcb.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hcb.h; sourceTree = "<group>"; };
|
||||
8EBDF40A09F28B2C004F2528 /* hcb_1.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hcb_1.h; sourceTree = "<group>"; };
|
||||
8EBDF40B09F28B2C004F2528 /* hcb_10.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hcb_10.h; sourceTree = "<group>"; };
|
||||
8EBDF40C09F28B2C004F2528 /* hcb_11.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hcb_11.h; sourceTree = "<group>"; };
|
||||
8EBDF40D09F28B2C004F2528 /* hcb_2.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hcb_2.h; sourceTree = "<group>"; };
|
||||
8EBDF40E09F28B2C004F2528 /* hcb_3.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hcb_3.h; sourceTree = "<group>"; };
|
||||
8EBDF40F09F28B2C004F2528 /* hcb_4.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hcb_4.h; sourceTree = "<group>"; };
|
||||
8EBDF41009F28B2C004F2528 /* hcb_5.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hcb_5.h; sourceTree = "<group>"; };
|
||||
8EBDF41109F28B2C004F2528 /* hcb_6.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hcb_6.h; sourceTree = "<group>"; };
|
||||
8EBDF41209F28B2C004F2528 /* hcb_7.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hcb_7.h; sourceTree = "<group>"; };
|
||||
8EBDF41309F28B2C004F2528 /* hcb_8.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hcb_8.h; sourceTree = "<group>"; };
|
||||
8EBDF41409F28B2C004F2528 /* hcb_9.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hcb_9.h; sourceTree = "<group>"; };
|
||||
8EBDF41509F28B2C004F2528 /* hcb_sf.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = hcb_sf.h; sourceTree = "<group>"; };
|
||||
8EBDF41609F28B2C004F2528 /* common.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = common.c; path = Files/libfaad/common.c; sourceTree = "<group>"; };
|
||||
8EBDF41709F28B2C004F2528 /* common.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = common.h; path = Files/libfaad/common.h; sourceTree = "<group>"; };
|
||||
8EBDF41809F28B2C004F2528 /* decoder.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = decoder.c; path = Files/libfaad/decoder.c; sourceTree = "<group>"; };
|
||||
8EBDF41909F28B2C004F2528 /* decoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = decoder.h; path = Files/libfaad/decoder.h; sourceTree = "<group>"; };
|
||||
8EBDF41A09F28B2C004F2528 /* drc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = drc.c; path = Files/libfaad/drc.c; sourceTree = "<group>"; };
|
||||
8EBDF41B09F28B2C004F2528 /* drc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = drc.h; path = Files/libfaad/drc.h; sourceTree = "<group>"; };
|
||||
8EBDF41C09F28B2C004F2528 /* drm_dec.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = drm_dec.c; path = Files/libfaad/drm_dec.c; sourceTree = "<group>"; };
|
||||
8EBDF41D09F28B2C004F2528 /* drm_dec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = drm_dec.h; path = Files/libfaad/drm_dec.h; sourceTree = "<group>"; };
|
||||
8EBDF41E09F28B2C004F2528 /* error.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = error.c; path = Files/libfaad/error.c; sourceTree = "<group>"; };
|
||||
8EBDF41F09F28B2C004F2528 /* error.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = error.h; path = Files/libfaad/error.h; sourceTree = "<group>"; };
|
||||
8EBDF42009F28B2C004F2528 /* filtbank.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = filtbank.c; path = Files/libfaad/filtbank.c; sourceTree = "<group>"; };
|
||||
8EBDF42109F28B2C004F2528 /* filtbank.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = filtbank.h; path = Files/libfaad/filtbank.h; sourceTree = "<group>"; };
|
||||
8EBDF42209F28B2C004F2528 /* fixed.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = fixed.h; path = Files/libfaad/fixed.h; sourceTree = "<group>"; };
|
||||
8EBDF42309F28B2C004F2528 /* hcr.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hcr.c; path = Files/libfaad/hcr.c; sourceTree = "<group>"; };
|
||||
8EBDF42409F28B2C004F2528 /* huffman.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = huffman.c; path = Files/libfaad/huffman.c; sourceTree = "<group>"; };
|
||||
8EBDF42509F28B2C004F2528 /* huffman.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = huffman.h; path = Files/libfaad/huffman.h; sourceTree = "<group>"; };
|
||||
8EBDF42609F28B2C004F2528 /* ic_predict.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ic_predict.c; path = Files/libfaad/ic_predict.c; sourceTree = "<group>"; };
|
||||
8EBDF42709F28B2C004F2528 /* ic_predict.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ic_predict.h; path = Files/libfaad/ic_predict.h; sourceTree = "<group>"; };
|
||||
8EBDF42809F28B2C004F2528 /* iq_table.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = iq_table.h; path = Files/libfaad/iq_table.h; sourceTree = "<group>"; };
|
||||
8EBDF42909F28B2C004F2528 /* is.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = is.c; path = Files/libfaad/is.c; sourceTree = "<group>"; };
|
||||
8EBDF42A09F28B2C004F2528 /* is.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = is.h; path = Files/libfaad/is.h; sourceTree = "<group>"; };
|
||||
8EBDF42B09F28B2C004F2528 /* kbd_win.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = kbd_win.h; path = Files/libfaad/kbd_win.h; sourceTree = "<group>"; };
|
||||
8EBDF43709F28B2C004F2528 /* lt_predict.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lt_predict.c; path = Files/libfaad/lt_predict.c; sourceTree = "<group>"; };
|
||||
8EBDF43809F28B2C004F2528 /* lt_predict.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = lt_predict.h; path = Files/libfaad/lt_predict.h; sourceTree = "<group>"; };
|
||||
8EBDF43A09F28B2C004F2528 /* mdct_tab.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = mdct_tab.h; path = Files/libfaad/mdct_tab.h; sourceTree = "<group>"; };
|
||||
8EBDF43B09F28B2C004F2528 /* mdct.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = mdct.c; path = Files/libfaad/mdct.c; sourceTree = "<group>"; };
|
||||
8EBDF43C09F28B2C004F2528 /* mdct.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = mdct.h; path = Files/libfaad/mdct.h; sourceTree = "<group>"; };
|
||||
8EBDF43D09F28B2C004F2528 /* mp4.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = mp4.c; path = Files/libfaad/mp4.c; sourceTree = "<group>"; };
|
||||
8EBDF43E09F28B2C004F2528 /* mp4.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = mp4.h; path = Files/libfaad/mp4.h; sourceTree = "<group>"; };
|
||||
8EBDF43F09F28B2C004F2528 /* ms.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ms.c; path = Files/libfaad/ms.c; sourceTree = "<group>"; };
|
||||
8EBDF44009F28B2C004F2528 /* ms.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ms.h; path = Files/libfaad/ms.h; sourceTree = "<group>"; };
|
||||
8EBDF44109F28B2C004F2528 /* output.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = output.c; path = Files/libfaad/output.c; sourceTree = "<group>"; };
|
||||
8EBDF44209F28B2C004F2528 /* output.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = output.h; path = Files/libfaad/output.h; sourceTree = "<group>"; };
|
||||
8EBDF44309F28B2C004F2528 /* pns.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pns.c; path = Files/libfaad/pns.c; sourceTree = "<group>"; };
|
||||
8EBDF44409F28B2C004F2528 /* pns.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pns.h; path = Files/libfaad/pns.h; sourceTree = "<group>"; };
|
||||
8EBDF44509F28B2C004F2528 /* ps_dec.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ps_dec.c; path = Files/libfaad/ps_dec.c; sourceTree = "<group>"; };
|
||||
8EBDF44609F28B2C004F2528 /* ps_dec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ps_dec.h; path = Files/libfaad/ps_dec.h; sourceTree = "<group>"; };
|
||||
8EBDF44709F28B2C004F2528 /* ps_syntax.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ps_syntax.c; path = Files/libfaad/ps_syntax.c; sourceTree = "<group>"; };
|
||||
8EBDF44809F28B2C004F2528 /* ps_tables.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ps_tables.h; path = Files/libfaad/ps_tables.h; sourceTree = "<group>"; };
|
||||
8EBDF44909F28B2C004F2528 /* pulse.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pulse.c; path = Files/libfaad/pulse.c; sourceTree = "<group>"; };
|
||||
8EBDF44A09F28B2C004F2528 /* pulse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pulse.h; path = Files/libfaad/pulse.h; sourceTree = "<group>"; };
|
||||
8EBDF44B09F28B2C004F2528 /* rvlc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = rvlc.c; path = Files/libfaad/rvlc.c; sourceTree = "<group>"; };
|
||||
8EBDF44C09F28B2C004F2528 /* rvlc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = rvlc.h; path = Files/libfaad/rvlc.h; sourceTree = "<group>"; };
|
||||
8EBDF44D09F28B2C004F2528 /* sbr_dct.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sbr_dct.c; path = Files/libfaad/sbr_dct.c; sourceTree = "<group>"; };
|
||||
8EBDF44E09F28B2C004F2528 /* sbr_dct.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sbr_dct.h; path = Files/libfaad/sbr_dct.h; sourceTree = "<group>"; };
|
||||
8EBDF44F09F28B2C004F2528 /* sbr_dec.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sbr_dec.c; path = Files/libfaad/sbr_dec.c; sourceTree = "<group>"; };
|
||||
8EBDF45009F28B2C004F2528 /* sbr_dec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sbr_dec.h; path = Files/libfaad/sbr_dec.h; sourceTree = "<group>"; };
|
||||
8EBDF45109F28B2C004F2528 /* sbr_e_nf.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sbr_e_nf.c; path = Files/libfaad/sbr_e_nf.c; sourceTree = "<group>"; };
|
||||
8EBDF45209F28B2C004F2528 /* sbr_e_nf.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sbr_e_nf.h; path = Files/libfaad/sbr_e_nf.h; sourceTree = "<group>"; };
|
||||
8EBDF45309F28B2C004F2528 /* sbr_fbt.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sbr_fbt.c; path = Files/libfaad/sbr_fbt.c; sourceTree = "<group>"; };
|
||||
8EBDF45409F28B2C004F2528 /* sbr_fbt.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sbr_fbt.h; path = Files/libfaad/sbr_fbt.h; sourceTree = "<group>"; };
|
||||
8EBDF45509F28B2C004F2528 /* sbr_hfadj.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sbr_hfadj.c; path = Files/libfaad/sbr_hfadj.c; sourceTree = "<group>"; };
|
||||
8EBDF45609F28B2C004F2528 /* sbr_hfadj.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sbr_hfadj.h; path = Files/libfaad/sbr_hfadj.h; sourceTree = "<group>"; };
|
||||
8EBDF45709F28B2C004F2528 /* sbr_hfgen.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sbr_hfgen.c; path = Files/libfaad/sbr_hfgen.c; sourceTree = "<group>"; };
|
||||
8EBDF45809F28B2C004F2528 /* sbr_hfgen.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sbr_hfgen.h; path = Files/libfaad/sbr_hfgen.h; sourceTree = "<group>"; };
|
||||
8EBDF45909F28B2C004F2528 /* sbr_huff.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sbr_huff.c; path = Files/libfaad/sbr_huff.c; sourceTree = "<group>"; };
|
||||
8EBDF45A09F28B2C004F2528 /* sbr_huff.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sbr_huff.h; path = Files/libfaad/sbr_huff.h; sourceTree = "<group>"; };
|
||||
8EBDF45B09F28B2C004F2528 /* sbr_noise.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sbr_noise.h; path = Files/libfaad/sbr_noise.h; sourceTree = "<group>"; };
|
||||
8EBDF45C09F28B2C004F2528 /* sbr_qmf_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sbr_qmf_c.h; path = Files/libfaad/sbr_qmf_c.h; sourceTree = "<group>"; };
|
||||
8EBDF45D09F28B2C004F2528 /* sbr_qmf.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sbr_qmf.c; path = Files/libfaad/sbr_qmf.c; sourceTree = "<group>"; };
|
||||
8EBDF45E09F28B2C004F2528 /* sbr_qmf.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sbr_qmf.h; path = Files/libfaad/sbr_qmf.h; sourceTree = "<group>"; };
|
||||
8EBDF45F09F28B2C004F2528 /* sbr_syntax.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sbr_syntax.c; path = Files/libfaad/sbr_syntax.c; sourceTree = "<group>"; };
|
||||
8EBDF46009F28B2C004F2528 /* sbr_syntax.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sbr_syntax.h; path = Files/libfaad/sbr_syntax.h; sourceTree = "<group>"; };
|
||||
8EBDF46109F28B2C004F2528 /* sbr_tf_grid.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sbr_tf_grid.c; path = Files/libfaad/sbr_tf_grid.c; sourceTree = "<group>"; };
|
||||
8EBDF46209F28B2C004F2528 /* sbr_tf_grid.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sbr_tf_grid.h; path = Files/libfaad/sbr_tf_grid.h; sourceTree = "<group>"; };
|
||||
8EBDF46309F28B2C004F2528 /* sine_win.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sine_win.h; path = Files/libfaad/sine_win.h; sourceTree = "<group>"; };
|
||||
8EBDF46409F28B2C004F2528 /* specrec.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = specrec.c; path = Files/libfaad/specrec.c; sourceTree = "<group>"; };
|
||||
8EBDF46509F28B2C004F2528 /* specrec.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = specrec.h; path = Files/libfaad/specrec.h; sourceTree = "<group>"; };
|
||||
8EBDF46609F28B2C004F2528 /* ssr_fb.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ssr_fb.c; path = Files/libfaad/ssr_fb.c; sourceTree = "<group>"; };
|
||||
8EBDF46709F28B2C004F2528 /* ssr_fb.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ssr_fb.h; path = Files/libfaad/ssr_fb.h; sourceTree = "<group>"; };
|
||||
8EBDF46809F28B2C004F2528 /* ssr_ipqf.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ssr_ipqf.c; path = Files/libfaad/ssr_ipqf.c; sourceTree = "<group>"; };
|
||||
8EBDF46909F28B2C004F2528 /* ssr_ipqf.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ssr_ipqf.h; path = Files/libfaad/ssr_ipqf.h; sourceTree = "<group>"; };
|
||||
8EBDF46A09F28B2C004F2528 /* ssr_win.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ssr_win.h; path = Files/libfaad/ssr_win.h; sourceTree = "<group>"; };
|
||||
8EBDF46B09F28B2C004F2528 /* ssr.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ssr.c; path = Files/libfaad/ssr.c; sourceTree = "<group>"; };
|
||||
8EBDF46C09F28B2C004F2528 /* ssr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ssr.h; path = Files/libfaad/ssr.h; sourceTree = "<group>"; };
|
||||
8EBDF46D09F28B2C004F2528 /* structs.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = structs.h; path = Files/libfaad/structs.h; sourceTree = "<group>"; };
|
||||
8EBDF46E09F28B2C004F2528 /* syntax.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = syntax.c; path = Files/libfaad/syntax.c; sourceTree = "<group>"; };
|
||||
8EBDF46F09F28B2C004F2528 /* syntax.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = syntax.h; path = Files/libfaad/syntax.h; sourceTree = "<group>"; };
|
||||
8EBDF47009F28B2C004F2528 /* tns.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = tns.c; path = Files/libfaad/tns.c; sourceTree = "<group>"; };
|
||||
8EBDF47109F28B2C004F2528 /* tns.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = tns.h; path = Files/libfaad/tns.h; sourceTree = "<group>"; };
|
||||
8EBDF4E309F28B3F004F2528 /* config.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = config.h; path = Files/config.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
8DC2EF560486A6940098B216 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
034768DFFF38A50411DB9C8B /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8DC2EF5B0486A6940098B216 /* FAAD2.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0867D691FE84028FC02AAC07 /* FAAD2 */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EBDF3CF09F28ACA004F2528 /* Common */,
|
||||
8EBDF3C609F28ABA004F2528 /* Headers */,
|
||||
8EBDF3C509F28AB4004F2528 /* Source */,
|
||||
089C1665FE841158C02AAC07 /* Resources */,
|
||||
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
|
||||
034768DFFF38A50411DB9C8B /* Products */,
|
||||
);
|
||||
name = FAAD2;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */,
|
||||
1058C7B2FEA5585E11CA2CBB /* Other Frameworks */,
|
||||
);
|
||||
name = "External Frameworks and Libraries";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
089C1665FE841158C02AAC07 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8DC2EF5A0486A6940098B216 /* Info.plist */,
|
||||
089C1666FE841158C02AAC07 /* InfoPlist.strings */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = "Linked Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7B2FEA5585E11CA2CBB /* Other Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EBDF3C509F28AB4004F2528 /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EBDF40209F28B2C004F2528 /* analysis.h */,
|
||||
8EBDF40309F28B2C004F2528 /* bits.c */,
|
||||
8EBDF40409F28B2C004F2528 /* bits.h */,
|
||||
8EBDF40509F28B2C004F2528 /* cfft_tab.h */,
|
||||
8EBDF40609F28B2C004F2528 /* cfft.c */,
|
||||
8EBDF40709F28B2C004F2528 /* cfft.h */,
|
||||
8EBDF40809F28B2C004F2528 /* codebook */,
|
||||
8EBDF41609F28B2C004F2528 /* common.c */,
|
||||
8EBDF41709F28B2C004F2528 /* common.h */,
|
||||
8EBDF41809F28B2C004F2528 /* decoder.c */,
|
||||
8EBDF41909F28B2C004F2528 /* decoder.h */,
|
||||
8EBDF41A09F28B2C004F2528 /* drc.c */,
|
||||
8EBDF41B09F28B2C004F2528 /* drc.h */,
|
||||
8EBDF41C09F28B2C004F2528 /* drm_dec.c */,
|
||||
8EBDF41D09F28B2C004F2528 /* drm_dec.h */,
|
||||
8EBDF41E09F28B2C004F2528 /* error.c */,
|
||||
8EBDF41F09F28B2C004F2528 /* error.h */,
|
||||
8EBDF42009F28B2C004F2528 /* filtbank.c */,
|
||||
8EBDF42109F28B2C004F2528 /* filtbank.h */,
|
||||
8EBDF42209F28B2C004F2528 /* fixed.h */,
|
||||
8EBDF42309F28B2C004F2528 /* hcr.c */,
|
||||
8EBDF42409F28B2C004F2528 /* huffman.c */,
|
||||
8EBDF42509F28B2C004F2528 /* huffman.h */,
|
||||
8EBDF42609F28B2C004F2528 /* ic_predict.c */,
|
||||
8EBDF42709F28B2C004F2528 /* ic_predict.h */,
|
||||
8EBDF42809F28B2C004F2528 /* iq_table.h */,
|
||||
8EBDF42909F28B2C004F2528 /* is.c */,
|
||||
8EBDF42A09F28B2C004F2528 /* is.h */,
|
||||
8EBDF42B09F28B2C004F2528 /* kbd_win.h */,
|
||||
8EBDF43709F28B2C004F2528 /* lt_predict.c */,
|
||||
8EBDF43809F28B2C004F2528 /* lt_predict.h */,
|
||||
8EBDF43A09F28B2C004F2528 /* mdct_tab.h */,
|
||||
8EBDF43B09F28B2C004F2528 /* mdct.c */,
|
||||
8EBDF43C09F28B2C004F2528 /* mdct.h */,
|
||||
8EBDF43D09F28B2C004F2528 /* mp4.c */,
|
||||
8EBDF43E09F28B2C004F2528 /* mp4.h */,
|
||||
8EBDF43F09F28B2C004F2528 /* ms.c */,
|
||||
8EBDF44009F28B2C004F2528 /* ms.h */,
|
||||
8EBDF44109F28B2C004F2528 /* output.c */,
|
||||
8EBDF44209F28B2C004F2528 /* output.h */,
|
||||
8EBDF44309F28B2C004F2528 /* pns.c */,
|
||||
8EBDF44409F28B2C004F2528 /* pns.h */,
|
||||
8EBDF44509F28B2C004F2528 /* ps_dec.c */,
|
||||
8EBDF44609F28B2C004F2528 /* ps_dec.h */,
|
||||
8EBDF44709F28B2C004F2528 /* ps_syntax.c */,
|
||||
8EBDF44809F28B2C004F2528 /* ps_tables.h */,
|
||||
8EBDF44909F28B2C004F2528 /* pulse.c */,
|
||||
8EBDF44A09F28B2C004F2528 /* pulse.h */,
|
||||
8EBDF44B09F28B2C004F2528 /* rvlc.c */,
|
||||
8EBDF44C09F28B2C004F2528 /* rvlc.h */,
|
||||
8EBDF44D09F28B2C004F2528 /* sbr_dct.c */,
|
||||
8EBDF44E09F28B2C004F2528 /* sbr_dct.h */,
|
||||
8EBDF44F09F28B2C004F2528 /* sbr_dec.c */,
|
||||
8EBDF45009F28B2C004F2528 /* sbr_dec.h */,
|
||||
8EBDF45109F28B2C004F2528 /* sbr_e_nf.c */,
|
||||
8EBDF45209F28B2C004F2528 /* sbr_e_nf.h */,
|
||||
8EBDF45309F28B2C004F2528 /* sbr_fbt.c */,
|
||||
8EBDF45409F28B2C004F2528 /* sbr_fbt.h */,
|
||||
8EBDF45509F28B2C004F2528 /* sbr_hfadj.c */,
|
||||
8EBDF45609F28B2C004F2528 /* sbr_hfadj.h */,
|
||||
8EBDF45709F28B2C004F2528 /* sbr_hfgen.c */,
|
||||
8EBDF45809F28B2C004F2528 /* sbr_hfgen.h */,
|
||||
8EBDF45909F28B2C004F2528 /* sbr_huff.c */,
|
||||
8EBDF45A09F28B2C004F2528 /* sbr_huff.h */,
|
||||
8EBDF45B09F28B2C004F2528 /* sbr_noise.h */,
|
||||
8EBDF45C09F28B2C004F2528 /* sbr_qmf_c.h */,
|
||||
8EBDF45D09F28B2C004F2528 /* sbr_qmf.c */,
|
||||
8EBDF45E09F28B2C004F2528 /* sbr_qmf.h */,
|
||||
8EBDF45F09F28B2C004F2528 /* sbr_syntax.c */,
|
||||
8EBDF46009F28B2C004F2528 /* sbr_syntax.h */,
|
||||
8EBDF46109F28B2C004F2528 /* sbr_tf_grid.c */,
|
||||
8EBDF46209F28B2C004F2528 /* sbr_tf_grid.h */,
|
||||
8EBDF46309F28B2C004F2528 /* sine_win.h */,
|
||||
8EBDF46409F28B2C004F2528 /* specrec.c */,
|
||||
8EBDF46509F28B2C004F2528 /* specrec.h */,
|
||||
8EBDF46609F28B2C004F2528 /* ssr_fb.c */,
|
||||
8EBDF46709F28B2C004F2528 /* ssr_fb.h */,
|
||||
8EBDF46809F28B2C004F2528 /* ssr_ipqf.c */,
|
||||
8EBDF46909F28B2C004F2528 /* ssr_ipqf.h */,
|
||||
8EBDF46A09F28B2C004F2528 /* ssr_win.h */,
|
||||
8EBDF46B09F28B2C004F2528 /* ssr.c */,
|
||||
8EBDF46C09F28B2C004F2528 /* ssr.h */,
|
||||
8EBDF46D09F28B2C004F2528 /* structs.h */,
|
||||
8EBDF46E09F28B2C004F2528 /* syntax.c */,
|
||||
8EBDF46F09F28B2C004F2528 /* syntax.h */,
|
||||
8EBDF47009F28B2C004F2528 /* tns.c */,
|
||||
8EBDF47109F28B2C004F2528 /* tns.h */,
|
||||
);
|
||||
name = Source;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EBDF3C609F28ABA004F2528 /* Headers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EBDF4E309F28B3F004F2528 /* config.h */,
|
||||
8EBDF3FE09F28B1F004F2528 /* faad.h */,
|
||||
8EBDF3FF09F28B1F004F2528 /* neaacdec.h */,
|
||||
);
|
||||
name = Headers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EBDF3CF09F28ACA004F2528 /* Common */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EBDF3D409F28B08004F2528 /* faad */,
|
||||
8EBDF3DD09F28B08004F2528 /* mp4ff */,
|
||||
);
|
||||
name = Common;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EBDF3D409F28B08004F2528 /* faad */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EBDF3D509F28B08004F2528 /* aacinfo.c */,
|
||||
8EBDF3D609F28B08004F2528 /* aacinfo.h */,
|
||||
8EBDF3D909F28B08004F2528 /* getopt.c */,
|
||||
8EBDF3DA09F28B08004F2528 /* getopt.h */,
|
||||
);
|
||||
name = faad;
|
||||
path = Files/common/faad;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EBDF3DD09F28B08004F2528 /* mp4ff */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EBDF3DE09F28B08004F2528 /* drms.c */,
|
||||
8EBDF3DF09F28B08004F2528 /* drms.h */,
|
||||
8EBDF3E009F28B08004F2528 /* drmstables.h */,
|
||||
8EBDF3E109F28B08004F2528 /* mp4atom.c */,
|
||||
8EBDF3E309F28B08004F2528 /* mp4ff.h */,
|
||||
8EBDF3E409F28B08004F2528 /* mp4ff_int_types.h */,
|
||||
8EBDF3E509F28B08004F2528 /* mp4ffint.h */,
|
||||
8EBDF3E609F28B08004F2528 /* mp4meta.c */,
|
||||
8EBDF3E709F28B08004F2528 /* mp4sample.c */,
|
||||
8EBDF3E809F28B08004F2528 /* mp4tagupdate.c */,
|
||||
8EBDF3E909F28B08004F2528 /* mp4util.c */,
|
||||
);
|
||||
name = mp4ff;
|
||||
path = Files/common/mp4ff;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8EBDF40809F28B2C004F2528 /* codebook */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8EBDF40909F28B2C004F2528 /* hcb.h */,
|
||||
8EBDF40A09F28B2C004F2528 /* hcb_1.h */,
|
||||
8EBDF40B09F28B2C004F2528 /* hcb_10.h */,
|
||||
8EBDF40C09F28B2C004F2528 /* hcb_11.h */,
|
||||
8EBDF40D09F28B2C004F2528 /* hcb_2.h */,
|
||||
8EBDF40E09F28B2C004F2528 /* hcb_3.h */,
|
||||
8EBDF40F09F28B2C004F2528 /* hcb_4.h */,
|
||||
8EBDF41009F28B2C004F2528 /* hcb_5.h */,
|
||||
8EBDF41109F28B2C004F2528 /* hcb_6.h */,
|
||||
8EBDF41209F28B2C004F2528 /* hcb_7.h */,
|
||||
8EBDF41309F28B2C004F2528 /* hcb_8.h */,
|
||||
8EBDF41409F28B2C004F2528 /* hcb_9.h */,
|
||||
8EBDF41509F28B2C004F2528 /* hcb_sf.h */,
|
||||
);
|
||||
name = codebook;
|
||||
path = Files/libfaad/codebook;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
8DC2EF500486A6940098B216 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8EBDF3EB09F28B08004F2528 /* aacinfo.h in Headers */,
|
||||
8EBDF3EF09F28B08004F2528 /* getopt.h in Headers */,
|
||||
8EBDF3F309F28B08004F2528 /* drms.h in Headers */,
|
||||
8EBDF3F409F28B08004F2528 /* drmstables.h in Headers */,
|
||||
8EBDF3F709F28B08004F2528 /* mp4ff.h in Headers */,
|
||||
8EBDF3F809F28B08004F2528 /* mp4ff_int_types.h in Headers */,
|
||||
8EBDF3F909F28B08004F2528 /* mp4ffint.h in Headers */,
|
||||
8EBDF40009F28B1F004F2528 /* faad.h in Headers */,
|
||||
8EBDF40109F28B1F004F2528 /* neaacdec.h in Headers */,
|
||||
8EBDF47209F28B2C004F2528 /* analysis.h in Headers */,
|
||||
8EBDF47409F28B2C004F2528 /* bits.h in Headers */,
|
||||
8EBDF47509F28B2C004F2528 /* cfft_tab.h in Headers */,
|
||||
8EBDF47709F28B2C004F2528 /* cfft.h in Headers */,
|
||||
8EBDF47809F28B2C004F2528 /* hcb.h in Headers */,
|
||||
8EBDF47909F28B2C004F2528 /* hcb_1.h in Headers */,
|
||||
8EBDF47A09F28B2C004F2528 /* hcb_10.h in Headers */,
|
||||
8EBDF47B09F28B2C004F2528 /* hcb_11.h in Headers */,
|
||||
8EBDF47C09F28B2C004F2528 /* hcb_2.h in Headers */,
|
||||
8EBDF47D09F28B2C004F2528 /* hcb_3.h in Headers */,
|
||||
8EBDF47E09F28B2C004F2528 /* hcb_4.h in Headers */,
|
||||
8EBDF47F09F28B2C004F2528 /* hcb_5.h in Headers */,
|
||||
8EBDF48009F28B2C004F2528 /* hcb_6.h in Headers */,
|
||||
8EBDF48109F28B2C004F2528 /* hcb_7.h in Headers */,
|
||||
8EBDF48209F28B2C004F2528 /* hcb_8.h in Headers */,
|
||||
8EBDF48309F28B2C004F2528 /* hcb_9.h in Headers */,
|
||||
8EBDF48409F28B2C004F2528 /* hcb_sf.h in Headers */,
|
||||
8EBDF48609F28B2C004F2528 /* common.h in Headers */,
|
||||
8EBDF48809F28B2C004F2528 /* decoder.h in Headers */,
|
||||
8EBDF48A09F28B2C004F2528 /* drc.h in Headers */,
|
||||
8EBDF48C09F28B2C004F2528 /* drm_dec.h in Headers */,
|
||||
8EBDF48E09F28B2C004F2528 /* error.h in Headers */,
|
||||
8EBDF49009F28B2C004F2528 /* filtbank.h in Headers */,
|
||||
8EBDF49109F28B2C004F2528 /* fixed.h in Headers */,
|
||||
8EBDF49409F28B2C004F2528 /* huffman.h in Headers */,
|
||||
8EBDF49609F28B2C004F2528 /* ic_predict.h in Headers */,
|
||||
8EBDF49709F28B2C004F2528 /* iq_table.h in Headers */,
|
||||
8EBDF49909F28B2C004F2528 /* is.h in Headers */,
|
||||
8EBDF49A09F28B2C004F2528 /* kbd_win.h in Headers */,
|
||||
8EBDF4A709F28B2C004F2528 /* lt_predict.h in Headers */,
|
||||
8EBDF4A909F28B2C004F2528 /* mdct_tab.h in Headers */,
|
||||
8EBDF4AB09F28B2C004F2528 /* mdct.h in Headers */,
|
||||
8EBDF4AD09F28B2C004F2528 /* mp4.h in Headers */,
|
||||
8EBDF4AF09F28B2C004F2528 /* ms.h in Headers */,
|
||||
8EBDF4B109F28B2C004F2528 /* output.h in Headers */,
|
||||
8EBDF4B309F28B2C004F2528 /* pns.h in Headers */,
|
||||
8EBDF4B509F28B2C004F2528 /* ps_dec.h in Headers */,
|
||||
8EBDF4B709F28B2C004F2528 /* ps_tables.h in Headers */,
|
||||
8EBDF4B909F28B2C004F2528 /* pulse.h in Headers */,
|
||||
8EBDF4BB09F28B2C004F2528 /* rvlc.h in Headers */,
|
||||
8EBDF4BD09F28B2C004F2528 /* sbr_dct.h in Headers */,
|
||||
8EBDF4BF09F28B2C004F2528 /* sbr_dec.h in Headers */,
|
||||
8EBDF4C109F28B2C004F2528 /* sbr_e_nf.h in Headers */,
|
||||
8EBDF4C309F28B2C004F2528 /* sbr_fbt.h in Headers */,
|
||||
8EBDF4C509F28B2C004F2528 /* sbr_hfadj.h in Headers */,
|
||||
8EBDF4C709F28B2C004F2528 /* sbr_hfgen.h in Headers */,
|
||||
8EBDF4C909F28B2C004F2528 /* sbr_huff.h in Headers */,
|
||||
8EBDF4CA09F28B2C004F2528 /* sbr_noise.h in Headers */,
|
||||
8EBDF4CB09F28B2C004F2528 /* sbr_qmf_c.h in Headers */,
|
||||
8EBDF4CD09F28B2C004F2528 /* sbr_qmf.h in Headers */,
|
||||
8EBDF4CF09F28B2C004F2528 /* sbr_syntax.h in Headers */,
|
||||
8EBDF4D109F28B2C004F2528 /* sbr_tf_grid.h in Headers */,
|
||||
8EBDF4D209F28B2C004F2528 /* sine_win.h in Headers */,
|
||||
8EBDF4D409F28B2C004F2528 /* specrec.h in Headers */,
|
||||
8EBDF4D609F28B2C004F2528 /* ssr_fb.h in Headers */,
|
||||
8EBDF4D809F28B2C004F2528 /* ssr_ipqf.h in Headers */,
|
||||
8EBDF4D909F28B2C004F2528 /* ssr_win.h in Headers */,
|
||||
8EBDF4DB09F28B2C004F2528 /* ssr.h in Headers */,
|
||||
8EBDF4DC09F28B2C004F2528 /* structs.h in Headers */,
|
||||
8EBDF4DE09F28B2C004F2528 /* syntax.h in Headers */,
|
||||
8EBDF4E009F28B2C004F2528 /* tns.h in Headers */,
|
||||
8EBDF4E409F28B3F004F2528 /* config.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
8DC2EF4F0486A6940098B216 /* FAAD2 */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "FAAD2" */;
|
||||
buildPhases = (
|
||||
8DC2EF500486A6940098B216 /* Headers */,
|
||||
8DC2EF520486A6940098B216 /* Resources */,
|
||||
8DC2EF540486A6940098B216 /* Sources */,
|
||||
8DC2EF560486A6940098B216 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
buildSettings = {
|
||||
};
|
||||
dependencies = (
|
||||
);
|
||||
name = FAAD2;
|
||||
productInstallPath = "$(HOME)/Library/Frameworks";
|
||||
productName = FAAD2;
|
||||
productReference = 8DC2EF5B0486A6940098B216 /* FAAD2.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
0867D690FE84028FC02AAC07 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "FAAD2" */;
|
||||
buildSettings = {
|
||||
};
|
||||
buildStyles = (
|
||||
014CEA440018CDF011CA2923 /* Debug */,
|
||||
014CEA450018CDF011CA2923 /* Release */,
|
||||
);
|
||||
hasScannedForEncodings = 1;
|
||||
mainGroup = 0867D691FE84028FC02AAC07 /* FAAD2 */;
|
||||
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
|
||||
projectDirPath = "";
|
||||
targets = (
|
||||
8DC2EF4F0486A6940098B216 /* FAAD2 */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
8DC2EF520486A6940098B216 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
8DC2EF540486A6940098B216 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8EBDF3EA09F28B08004F2528 /* aacinfo.c in Sources */,
|
||||
8EBDF3EE09F28B08004F2528 /* getopt.c in Sources */,
|
||||
8EBDF3F209F28B08004F2528 /* drms.c in Sources */,
|
||||
8EBDF3F509F28B08004F2528 /* mp4atom.c in Sources */,
|
||||
8EBDF3FA09F28B08004F2528 /* mp4meta.c in Sources */,
|
||||
8EBDF3FB09F28B08004F2528 /* mp4sample.c in Sources */,
|
||||
8EBDF3FC09F28B08004F2528 /* mp4tagupdate.c in Sources */,
|
||||
8EBDF3FD09F28B08004F2528 /* mp4util.c in Sources */,
|
||||
8EBDF47309F28B2C004F2528 /* bits.c in Sources */,
|
||||
8EBDF47609F28B2C004F2528 /* cfft.c in Sources */,
|
||||
8EBDF48509F28B2C004F2528 /* common.c in Sources */,
|
||||
8EBDF48709F28B2C004F2528 /* decoder.c in Sources */,
|
||||
8EBDF48909F28B2C004F2528 /* drc.c in Sources */,
|
||||
8EBDF48B09F28B2C004F2528 /* drm_dec.c in Sources */,
|
||||
8EBDF48D09F28B2C004F2528 /* error.c in Sources */,
|
||||
8EBDF48F09F28B2C004F2528 /* filtbank.c in Sources */,
|
||||
8EBDF49209F28B2C004F2528 /* hcr.c in Sources */,
|
||||
8EBDF49309F28B2C004F2528 /* huffman.c in Sources */,
|
||||
8EBDF49509F28B2C004F2528 /* ic_predict.c in Sources */,
|
||||
8EBDF49809F28B2C004F2528 /* is.c in Sources */,
|
||||
8EBDF4A609F28B2C004F2528 /* lt_predict.c in Sources */,
|
||||
8EBDF4AA09F28B2C004F2528 /* mdct.c in Sources */,
|
||||
8EBDF4AC09F28B2C004F2528 /* mp4.c in Sources */,
|
||||
8EBDF4AE09F28B2C004F2528 /* ms.c in Sources */,
|
||||
8EBDF4B009F28B2C004F2528 /* output.c in Sources */,
|
||||
8EBDF4B209F28B2C004F2528 /* pns.c in Sources */,
|
||||
8EBDF4B409F28B2C004F2528 /* ps_dec.c in Sources */,
|
||||
8EBDF4B609F28B2C004F2528 /* ps_syntax.c in Sources */,
|
||||
8EBDF4B809F28B2C004F2528 /* pulse.c in Sources */,
|
||||
8EBDF4BA09F28B2C004F2528 /* rvlc.c in Sources */,
|
||||
8EBDF4BC09F28B2C004F2528 /* sbr_dct.c in Sources */,
|
||||
8EBDF4BE09F28B2C004F2528 /* sbr_dec.c in Sources */,
|
||||
8EBDF4C009F28B2C004F2528 /* sbr_e_nf.c in Sources */,
|
||||
8EBDF4C209F28B2C004F2528 /* sbr_fbt.c in Sources */,
|
||||
8EBDF4C409F28B2C004F2528 /* sbr_hfadj.c in Sources */,
|
||||
8EBDF4C609F28B2C004F2528 /* sbr_hfgen.c in Sources */,
|
||||
8EBDF4C809F28B2C004F2528 /* sbr_huff.c in Sources */,
|
||||
8EBDF4CC09F28B2C004F2528 /* sbr_qmf.c in Sources */,
|
||||
8EBDF4CE09F28B2C004F2528 /* sbr_syntax.c in Sources */,
|
||||
8EBDF4D009F28B2C004F2528 /* sbr_tf_grid.c in Sources */,
|
||||
8EBDF4D309F28B2C004F2528 /* specrec.c in Sources */,
|
||||
8EBDF4D509F28B2C004F2528 /* ssr_fb.c in Sources */,
|
||||
8EBDF4D709F28B2C004F2528 /* ssr_ipqf.c in Sources */,
|
||||
8EBDF4DA09F28B2C004F2528 /* ssr.c in Sources */,
|
||||
8EBDF4DD09F28B2C004F2528 /* syntax.c in Sources */,
|
||||
8EBDF4DF09F28B2C004F2528 /* tns.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
089C1666FE841158C02AAC07 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
089C1667FE841158C02AAC07 /* English */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
1DEB91AE08733DA50010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
FRAMEWORK_VERSION = A;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
HEADER_SEARCH_PATHS = Files/libfaad/;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "$(HOME)/Library/Frameworks";
|
||||
OTHER_CFLAGS = "-DHAVE_CONFIG_H";
|
||||
PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = YES;
|
||||
PRODUCT_NAME = FAAD2;
|
||||
WRAPPER_EXTENSION = framework;
|
||||
ZERO_LINK = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1DEB91AF08733DA50010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = (
|
||||
ppc,
|
||||
i386,
|
||||
);
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
FRAMEWORK_VERSION = A;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
HEADER_SEARCH_PATHS = Files/libfaad/;
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
INSTALL_PATH = "@executable_path/../Frameworks";
|
||||
OTHER_CFLAGS = "-DHAVE_CONFIG_H";
|
||||
PRODUCT_NAME = FAAD2;
|
||||
WRAPPER_EXTENSION = framework;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
1DEB91B208733DA50010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1DEB91B308733DA50010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
PREBINDING = NO;
|
||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "FAAD2" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1DEB91AE08733DA50010E9CD /* Debug */,
|
||||
1DEB91AF08733DA50010E9CD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "FAAD2" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1DEB91B208733DA50010E9CD /* Debug */,
|
||||
1DEB91B308733DA50010E9CD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
|
||||
M. Bakker (mbakker(at)nero.com)
|
||||
- complete library
|
||||
|
||||
Alexander Kurpiers (a.kurpiers(at)nt.tu-darmstadt.de)
|
||||
- HCR code
|
||||
- DRM stuff
|
||||
- lot's of bug fixes
|
||||
|
||||
Volker Fischer (v.fischer(at)nt.tu-darmstadt.de)
|
||||
- DRM code
|
||||
- lot's of bug fixes
|
||||
|
||||
Gian-Carlo Pascutto (gpascutto(at)nero.com)
|
||||
- DRM PS code
|
||||
- bugfixes
|
||||
|
|
@ -1,350 +0,0 @@
|
|||
|
||||
Any non-GPL usage of this software or parts of this software is strictly
|
||||
forbidden.
|
||||
|
||||
Commercial non-GPL licensing of this software is possible.
|
||||
For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
|
||||
|
||||
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
|
@ -1,126 +0,0 @@
|
|||
8 september 2004 mbakker(at)nero.com
|
||||
- specrec.c: fixed compilation without PS
|
||||
|
||||
4 september 2004 mbakker(at)nero.com
|
||||
- sbr_fbt.c, sbr_hfgen.c: fixed possible lockup with bad data.
|
||||
|
||||
4 september 2004 mbakker(at)nero.com
|
||||
- cfft.c,h, common.c,h, filtbank.c,h, mdct.h, sbr_qmf.h, structs.h, decoder.c, specrec.c:
|
||||
Removed USE_SSE
|
||||
|
||||
4 september 2004 gpascutto(at)nero.com
|
||||
- specrec.c: small optimizations to inverse quant
|
||||
|
||||
3 september 2004 mbakker(at)nero.com
|
||||
- neaacdec.h, decoder.c, syntax.c, structs.h: added output flag for PS
|
||||
|
||||
3 september 2004 mbakker(at)nero.com
|
||||
- common.c: added log2_fix()
|
||||
|
||||
28 august 2004 gpascutto(at)nero.com
|
||||
- sbr_syntax.c: bugfix with PS_DEC and DRM_PS defines
|
||||
|
||||
21 august 2004 mbakker(at)nero.com
|
||||
- cfft.c, cfft_tab.h: added size 128 fixed point FFT tables for HVXC
|
||||
|
||||
18 august 2004 mbakker(at)nero.com
|
||||
- sbr_syntax.c: allow only 1 PS data element per SBR extension data
|
||||
|
||||
18 august 2004 gpascutto(at)nero.com
|
||||
- specrec.c: safeguard against PS suddenly going on
|
||||
|
||||
4 august 2004 gpascutto(at)nero.com
|
||||
- drm_dec.c: make sure we still copy to the right channel if there's no data
|
||||
|
||||
2 august 2004 gpascutto(at)nero.com
|
||||
- hcr.c: bugfix
|
||||
|
||||
31 july 2004 gpascutto(at)nero.com
|
||||
- hcr.c: Rewritten and optimized
|
||||
|
||||
29 july 2004 mbakker(at)nero.com
|
||||
- /mp4ff/mp4ff.c,mp4atoms.c: support video decoding better
|
||||
|
||||
28 july 2004 gpascutto(at)nero.com
|
||||
- drm_dec.*, sbr_dec.c, syntax.c: improved error concealment
|
||||
|
||||
27 july 2004 gpascutto(at)nero.com
|
||||
- sbr_dec.c, sbr_syntax.c: duplicate code removal
|
||||
|
||||
25 july 2004 gpascutto(at)nero.com
|
||||
- syntax.c: re-enable SBR CRC checking for DRM
|
||||
|
||||
22 july 2004 gpascutto(at)nero.com
|
||||
- drm_dec.*: changed delay filter to 2 samples plus fractional delay, as in normal PS AAC
|
||||
(DRM standard is wrong here)
|
||||
|
||||
2 july 2004 mbakker(at)nero.com
|
||||
- huffman.c: Implemented VCB11 error concealment
|
||||
|
||||
22 june 2004 mbakker(at)nero.com
|
||||
- ps_dec.c: Removed samplerate dependancy in PS, likely to be updated in corrigendum
|
||||
|
||||
15 june 2004 mbakker(at)nero.com
|
||||
- sbr_dct.c,h: Removed huge ugly DCT_4_64...
|
||||
- sbr_qmf.c: replaced DCT_IV in qmf synthesis
|
||||
|
||||
13 june 2004 mbakker(at)nero.com
|
||||
- ps_dec.c: Fixed fixed point code, no more cos() and sin() used
|
||||
|
||||
7 june 2004 mbakker(at)nero.com
|
||||
- sbr_*.c,h: Overall speedups and improvements in SBR code.
|
||||
|
||||
4 june 2004 gpascutto(at)nero.com
|
||||
- drm_dec.c: Fixed a bug in the standard (PAN mixing)
|
||||
|
||||
3 june 2004 mbakker(at)nero.com
|
||||
- ps_syntax.c: fixed a bug in one of the huffman tables
|
||||
|
||||
2 june 2004 gpascutto(at)nero.com
|
||||
- drm_dec.c: Fully working fixed point support
|
||||
|
||||
27 may 2004 mbakker(at)nero.com
|
||||
- sbr_qmf.c, sbr_dec.h: Fixed fixed point problems with downsampled QMF
|
||||
|
||||
17 may 2004 mbakker(at)nero.com
|
||||
- syntax.c, decoder.c: Added some logging output
|
||||
|
||||
17 may 2004 mbakker(at)nero.com
|
||||
- mp4atom.c: Fixed an issue with broken MP4 files
|
||||
|
||||
16 may 2004 mbakker(at)nero.com
|
||||
- ps_dec.c: fixed point: forgot to convert a few multiplies
|
||||
|
||||
14 may 2004 mbakker(at)nero.com
|
||||
- sbr_*.c: reduced memory usage
|
||||
|
||||
6 may 2004 mbakker(at)nero.com
|
||||
- common.c: added some bit tricks and fixed point log2/pow2
|
||||
- sbr_hfadj.c: log2/pow2 based gain calculation for SBR
|
||||
- sbr_hfgen.c: use block exponent instead of stupid search to find max value
|
||||
|
||||
5 may 2004 mbakker(at)nero.com
|
||||
- decoder.c, neaacdec.h, decoder.h: added extra decode function to which a
|
||||
buffer can be provided. Instead of the library providing a buffer.
|
||||
|
||||
5 may 2004 mbakker(at)nero.com
|
||||
- mdct.c: fixed fixed point MDCT with framesizes 960, 480, 120
|
||||
|
||||
2 may 2004 mbakker(at)nero.com
|
||||
- mdct_tab.h, mdct.c: Added tables for MDCT, for increased accuracy in fixed point
|
||||
- specrec.c: Moved quantisation, scaling and reordering to 1 function
|
||||
|
||||
20 april 2004 gpacutto(at)nero.com
|
||||
- drm_dec.c, drm_dec.h: Don't do PS processing if no data was read this frame.
|
||||
Fix for bitstread reading bug in specification.
|
||||
|
||||
15 april 2004 mbakker(at)nero.com
|
||||
- sbr_hfadj.c: fixed buffer overflow
|
||||
- multiple: fixed some eVC problems
|
||||
|
||||
12 april 2004 mbakker(at)nero.com
|
||||
- common.h, ps_dec.c: Updates for PS fixed point, should completely work now
|
||||
|
||||
12 april 2004 gpascutto(at)nero.com
|
||||
- drm_dec.c, drm_dec.h: eliminated sqrt and SA mapping/dequantization from DRM PS decoder
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
|
||||
6 February 2004
|
||||
- FAAD2 version 2.0 released
|
||||
|
||||
25 July 2003
|
||||
- Release version with SBR decoding
|
||||
|
|
@ -1,122 +0,0 @@
|
|||
|
||||
Freeware Advanced Audio (AAC) Decoder including SBR decoding
|
||||
http://www.audiocoding.com/
|
||||
|
||||
FAAD2 is a HE, LC, MAIN and LTP profile, MPEG2 and MPEG-4 AAC decoder.
|
||||
FAAD2 includes code for SBR (HE AAC) decoding.
|
||||
FAAD2 is licensed under the GPL.
|
||||
|
||||
|
||||
__________
|
||||
COPYRIGHTS
|
||||
|
||||
For FAAD2 the following license applies:
|
||||
|
||||
******************************************************************************
|
||||
** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
|
||||
** Copyright (C) 2003 M. Bakker (mbakker(at)nero.com), Ahead Software AG
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation; either version 2 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program; if not, write to the Free Software
|
||||
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
**
|
||||
** Commercial non-GPL licensing of this software is also possible.
|
||||
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
|
||||
******************************************************************************
|
||||
|
||||
|
||||
Please note that the use of this software may require the payment of
|
||||
patent royalties. You need to consider this issue before you start
|
||||
building derivative works. We are not warranting or indemnifying you in
|
||||
any way for patent royalities! YOU ARE SOLELY RESPONSIBLE FOR YOUR OWN
|
||||
ACTIONS!
|
||||
|
||||
|
||||
______
|
||||
PEOPLE
|
||||
|
||||
FAAD2 is written by:
|
||||
- M. Bakker (mbakker(at)nero.com).
|
||||
|
||||
|
||||
_______________
|
||||
VERSION HISTORY
|
||||
|
||||
Sorry, try building a ChangeLog from CVS.
|
||||
|
||||
__________________________________
|
||||
REDISTRIBUTED OPEN SOURCE PACKAGES
|
||||
|
||||
This is the list of redistributed open source packages that are included
|
||||
in FAAD2:
|
||||
|
||||
Name: mp4v2
|
||||
Version: 0.9.8.6
|
||||
Origin: http://www.mpeg4ip.net
|
||||
Author: David Mackie
|
||||
Directory: common/mp4v2
|
||||
License: MPL, Mozilla Public License, version 1.1
|
||||
|
||||
Name: mp4av
|
||||
Version: 0.9.8.6
|
||||
Origin: http://www.mpeg4ip.net
|
||||
Author: David Mackie
|
||||
Directory: common/mp4av
|
||||
License: MPL, Mozilla Public License, version 1.1
|
||||
|
||||
|
||||
___________________
|
||||
DIRECTORY STRUCTURE
|
||||
|
||||
faad2 - top level directory.
|
||||
|
||||
aacDECdrop - windows decoder/player with drag'n'drop functionality
|
||||
|
||||
common - generally used libraries and code.
|
||||
|
||||
faad - general common functions like filereading and streaming
|
||||
as well as getting info from aac files.
|
||||
|
||||
mp4v2 - MPEG-4 file reading library.
|
||||
|
||||
mp4av - MPEG-4 file general function library.
|
||||
|
||||
mp4ff - Small MP4 file format library (includes tagging abilities).
|
||||
|
||||
CoreAAC - AAC DirectShow filter.
|
||||
|
||||
frontend - command line frontend to the FAAD2 library, also supports
|
||||
MPEG-4 file decoding.
|
||||
|
||||
include - inlude file for the FAAD2 library.
|
||||
|
||||
libfaad - the FAAD2 AAC decoder library including SBR.
|
||||
|
||||
codebook - Huffman codebooks
|
||||
|
||||
plugins - plugins for all kinds of pograms.
|
||||
|
||||
in_mp4 - winamp MPEG-4 AAC file input plugin.
|
||||
|
||||
QCD - Quintessential player AAC plugin.
|
||||
|
||||
QCDMp4 - Quintessential player MP4 plugin.
|
||||
|
||||
winamp - winamp2 AAC input plugin.
|
||||
|
||||
winamp3 - winamp3 AAC input plugin.
|
||||
|
||||
xmms - xmms AAC plugin
|
||||
|
||||
mpeg4ip - plugin for the mpeg4ip player
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
To compile under Linux.
|
||||
----------------------
|
||||
just run :
|
||||
|
||||
autoreconf -vif
|
||||
./configure --with-mp4v2
|
||||
make
|
||||
sudo make install
|
||||
|
||||
|
||||
about the xmms plugin.
|
||||
---------------------
|
||||
The xmms plugin need to be build after the install of the faad project.
|
||||
so after you have installed correctly faad (--with-xmms options) you need
|
||||
to configure and build the xmms plugin part in the plugins/xmms directory.
|
||||
Read the README and INSTALL files into the xmms directory.
|
|
@ -1,2 +0,0 @@
|
|||
|
||||
- Not much...
|
|
@ -1,366 +0,0 @@
|
|||
/*
|
||||
** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
|
||||
** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation; either version 2 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program; if not, write to the Free Software
|
||||
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
**
|
||||
** Any non-GPL usage of this software or parts of this software is strictly
|
||||
** forbidden.
|
||||
**
|
||||
** Commercial non-GPL licensing of this software is possible.
|
||||
** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
|
||||
**
|
||||
** $Id: aacinfo.c 19 2005-06-07 04:16:15Z vspader $
|
||||
**/
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
//#include "filestream.h"
|
||||
#include "aacinfo.h"
|
||||
|
||||
#define ADIF_MAX_SIZE 30 /* Should be enough */
|
||||
#define ADTS_MAX_SIZE 10 /* Should be enough */
|
||||
|
||||
static int sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000};
|
||||
|
||||
static int read_ADIF_header(FILE *file, faadAACInfo *info)
|
||||
{
|
||||
int bitstream;
|
||||
unsigned char buffer[ADIF_MAX_SIZE];
|
||||
int skip_size = 0;
|
||||
int sf_idx;
|
||||
|
||||
/* Get ADIF header data */
|
||||
info->headertype = 1;
|
||||
|
||||
if(fread(buffer, 1, ADIF_MAX_SIZE, file) < 0)
|
||||
return -1;
|
||||
|
||||
/* copyright string */
|
||||
if(buffer[0] & 0x80)
|
||||
skip_size += 9; /* skip 9 bytes */
|
||||
|
||||
bitstream = buffer[0 + skip_size] & 0x10;
|
||||
info->bitrate = ((unsigned int)(buffer[0 + skip_size] & 0x0F)<<19)|
|
||||
((unsigned int)buffer[1 + skip_size]<<11)|
|
||||
((unsigned int)buffer[2 + skip_size]<<3)|
|
||||
((unsigned int)buffer[3 + skip_size] & 0xE0);
|
||||
|
||||
if (bitstream == 0)
|
||||
{
|
||||
info->object_type = ((buffer[6 + skip_size]&0x01)<<1)|((buffer[7 + skip_size]&0x80)>>7);
|
||||
sf_idx = (buffer[7 + skip_size]&0x78)>>3;
|
||||
} else {
|
||||
info->object_type = (buffer[4 + skip_size] & 0x18)>>3;
|
||||
sf_idx = ((buffer[4 + skip_size] & 0x07)<<1)|((buffer[5 + skip_size] & 0x80)>>7);
|
||||
}
|
||||
info->sampling_rate = sample_rates[sf_idx];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int read_ADTS_header(FILE *file, faadAACInfo *info,
|
||||
unsigned long **seek_table, int *seek_table_len,
|
||||
int tagsize, int no_seek_table)
|
||||
{
|
||||
/* Get ADTS header data */
|
||||
unsigned char buffer[ADTS_MAX_SIZE];
|
||||
int frames, framesinsec=0, t_framelength = 0, frame_length, sr_idx, ID;
|
||||
int second = 0, pos;
|
||||
int i;
|
||||
float frames_per_sec = 0;
|
||||
unsigned long bytes;
|
||||
unsigned long *tmp_seek_table = NULL;
|
||||
|
||||
info->headertype = 2;
|
||||
|
||||
/* Read all frames to ensure correct time and bitrate */
|
||||
for(frames=0; /* */; frames++, framesinsec++)
|
||||
{
|
||||
/* If streaming, only go until we hit 5 seconds worth */
|
||||
/* if(file->http)
|
||||
{
|
||||
if(frames >= 43 * 5)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
pos = ftell(file);//tell_filestream(file);
|
||||
|
||||
/* 12 bit SYNCWORD */
|
||||
bytes = fread(buffer, 1, ADTS_MAX_SIZE, file);
|
||||
|
||||
if(bytes != ADTS_MAX_SIZE)
|
||||
{
|
||||
/* Bail out if no syncword found */
|
||||
break;
|
||||
}
|
||||
|
||||
/* check syncword */
|
||||
if (!((buffer[0] == 0xFF)&&((buffer[1] & 0xF6) == 0xF0)))
|
||||
break;
|
||||
|
||||
if(!frames)
|
||||
{
|
||||
/* fixed ADTS header is the same for every frame, so we read it only once */
|
||||
/* Syncword found, proceed to read in the fixed ADTS header */
|
||||
ID = buffer[1] & 0x08;
|
||||
info->object_type = (buffer[2]&0xC0)>>6;
|
||||
sr_idx = (buffer[2]&0x3C)>>2;
|
||||
info->channels = ((buffer[2]&0x01)<<2)|((buffer[3]&0xC0)>>6);
|
||||
|
||||
frames_per_sec = sample_rates[sr_idx] / 1024.f;
|
||||
}
|
||||
|
||||
/* ...and the variable ADTS header */
|
||||
if (ID == 0) {
|
||||
info->version = 4;
|
||||
} else { /* MPEG-2 */
|
||||
info->version = 2;
|
||||
}
|
||||
frame_length = ((((unsigned int)buffer[3] & 0x3)) << 11)
|
||||
| (((unsigned int)buffer[4]) << 3) | (buffer[5] >> 5);
|
||||
|
||||
t_framelength += frame_length;
|
||||
|
||||
// if(!file->http)
|
||||
{
|
||||
if(framesinsec == 43)
|
||||
framesinsec = 0;
|
||||
|
||||
if(framesinsec == 0 && seek_table_len)
|
||||
{
|
||||
tmp_seek_table = (unsigned long *) realloc(tmp_seek_table, (second + 1) * sizeof(unsigned long));
|
||||
tmp_seek_table[second] = pos;
|
||||
}
|
||||
if(framesinsec == 0)
|
||||
second++;
|
||||
}
|
||||
|
||||
/* NOTE: While simply skipping ahead by reading may seem to be more work than seeking,
|
||||
it is actually much faster, and keeps compatibility with streaming */
|
||||
//F THAT
|
||||
fseek(file, frame_length - ADTS_MAX_SIZE, SEEK_CUR);
|
||||
/* for(i=0; i < frame_length - ADTS_MAX_SIZE; i++)
|
||||
{
|
||||
if(read_byte_filestream(file) < 0)
|
||||
break;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
if(seek_table_len)
|
||||
{
|
||||
*seek_table_len = second;
|
||||
*seek_table = tmp_seek_table;
|
||||
}
|
||||
|
||||
info->sampling_rate = sample_rates[sr_idx];
|
||||
info->bitrate = (int)(((t_framelength / frames) * (info->sampling_rate/1024.0)) +0.5)*8;
|
||||
|
||||
/* if(file->http)
|
||||
{
|
||||
// Since we only use 5 seconds of aac data to get a rough bitrate, we must use a different
|
||||
// method of calculating the overall length
|
||||
if(filelength_filestream(file))
|
||||
{
|
||||
info->length = (int)((filelength_filestream(file)/(((info->bitrate*8)/1024)*16))*1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Since the server didnt tell us how long the file is,
|
||||
// we have no way of determining length
|
||||
info->length = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
*/ {
|
||||
info->length = (int)((float)(frames/frames_per_sec))*1000;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_AAC_format(FILE *file, faadAACInfo *info,
|
||||
unsigned long **seek_table, int *seek_table_len,
|
||||
int no_seek_table)
|
||||
{
|
||||
unsigned long tagsize;
|
||||
char buffer[10];
|
||||
unsigned long file_len;
|
||||
unsigned char adxx_id[5];
|
||||
unsigned long tmp;
|
||||
|
||||
memset(info, 0, sizeof(faadAACInfo));
|
||||
|
||||
fseek(file, 0, SEEK_END);
|
||||
file_len = ftell(file);
|
||||
|
||||
/* Skip the tag, if it's there */
|
||||
tmp = fread(buffer, 1, 10, file);
|
||||
|
||||
if (StringComp(buffer, "ID3", 3) == 0)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
/* high bit is not used */
|
||||
tagsize = (buffer[6] << 21) | (buffer[7] << 14) |
|
||||
(buffer[8] << 7) | (buffer[9] << 0);
|
||||
|
||||
fseek(file, tagsize, SEEK_CUR);
|
||||
|
||||
tagsize += 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
tagsize = 0;
|
||||
|
||||
fseek(file, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
if(file_len)
|
||||
file_len -= tagsize;
|
||||
|
||||
tmp = fread(adxx_id, 1, 2, file);
|
||||
//seek_filestream(file, tagsize, FILE_BEGIN);
|
||||
|
||||
adxx_id[5-1] = 0;
|
||||
info->length = 0;
|
||||
|
||||
/* Determine the header type of the file, check the first two bytes */
|
||||
if(strncasecmp((char *)adxx_id, "AD", 2) == 0)
|
||||
{
|
||||
/* We think its an ADIF header, but check the rest just to make sure */
|
||||
tmp = fread(adxx_id+2, 1, 2, file);
|
||||
|
||||
if(strncasecmp((char *)adxx_id, "ADIF", 4) == 0)
|
||||
{
|
||||
read_ADIF_header(file, info);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No ADIF, check for ADTS header */
|
||||
if ((adxx_id[0] == 0xFF)&&((adxx_id[1] & 0xF6) == 0xF0))
|
||||
{
|
||||
/* ADTS header located */
|
||||
/* Since this routine must work for streams, we can't use the seek function to go backwards, thus
|
||||
we have to use a quick hack as seen below to go back where we need to. */
|
||||
|
||||
fseek(file, -2, SEEK_CUR);
|
||||
/* if(file->buffer_offset >= 2)
|
||||
{
|
||||
// simple seeking hack, though not really safe, the probability of it causing a problem is low.
|
||||
file->buffer_offset -= 2;
|
||||
file->file_offset -= 2;
|
||||
}
|
||||
*/
|
||||
read_ADTS_header(file, info, seek_table, seek_table_len, tagsize,
|
||||
no_seek_table);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Unknown/headerless AAC file, assume format: */
|
||||
info->version = 2;
|
||||
info->bitrate = 128000;
|
||||
info->sampling_rate = 44100;
|
||||
info->channels = 2;
|
||||
info->headertype = 0;
|
||||
info->object_type = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int StringComp(char const *str1, char const *str2, unsigned long len)
|
||||
{
|
||||
signed int c1 = 0, c2 = 0;
|
||||
|
||||
while (len--) {
|
||||
c1 = *str1++;
|
||||
c2 = *str2++;
|
||||
|
||||
if (c1 == 0 || c1 != c2)
|
||||
break;
|
||||
}
|
||||
|
||||
return c1 - c2;
|
||||
}
|
||||
|
||||
#ifdef TEST
|
||||
/* Program to test aacinfo functionality */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void main(int argc, char *argv[])
|
||||
{
|
||||
faadAACInfo info;
|
||||
unsigned long *seek_table = NULL;
|
||||
int seek_table_len = 0;
|
||||
char *header, *object;
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
fprintf(stderr, "USAGE: aacinfo aacfile.aac\n");
|
||||
return;
|
||||
}
|
||||
|
||||
get_AAC_format(argv[1], &info, &seek_table, &seek_table_len, 0);
|
||||
|
||||
fprintf(stdout, "MPEG version: %d\n", info.version);
|
||||
fprintf(stdout, "channels: %d\n", info.channels);
|
||||
fprintf(stdout, "sampling_rate: %d\n", info.sampling_rate);
|
||||
fprintf(stdout, "bitrate: %d\n", info.bitrate);
|
||||
fprintf(stdout, "length: %.3f\n", (float)info.length/1000.0);
|
||||
|
||||
switch (info.object_type)
|
||||
{
|
||||
case 0:
|
||||
object = "MAIN";
|
||||
break;
|
||||
case 1:
|
||||
object = "LC";
|
||||
break;
|
||||
case 2:
|
||||
object = "SSR";
|
||||
break;
|
||||
case 3:
|
||||
object = "LTP";
|
||||
break;
|
||||
}
|
||||
fprintf(stdout, "object_type: %s\n", object);
|
||||
|
||||
switch (info.headertype)
|
||||
{
|
||||
case 0:
|
||||
header = "RAW";
|
||||
break;
|
||||
case 1:
|
||||
header = "ADIF";
|
||||
break;
|
||||
case 2:
|
||||
header = "ADTS";
|
||||
break;
|
||||
}
|
||||
fprintf(stdout, "headertype: %s\n", header);
|
||||
}
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue