aboutsummaryrefslogtreecommitdiff
path: root/Src/replicant/nsmp3dec/mp3ancofl.h
diff options
context:
space:
mode:
Diffstat (limited to 'Src/replicant/nsmp3dec/mp3ancofl.h')
-rw-r--r--Src/replicant/nsmp3dec/mp3ancofl.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/Src/replicant/nsmp3dec/mp3ancofl.h b/Src/replicant/nsmp3dec/mp3ancofl.h
new file mode 100644
index 00000000..77e1ea01
--- /dev/null
+++ b/Src/replicant/nsmp3dec/mp3ancofl.h
@@ -0,0 +1,86 @@
+/***************************************************************************\
+*
+* MPEG Layer3-Audio Decoder
+* © 1997-2006 by Fraunhofer IIS
+* All Rights Reserved
+*
+* filename: mp3ancofl.h
+* project : MPEG Decoder
+* author : Dieter Weninger
+* date : 2003-05-14
+* contents: ancillary data and original file length - HEADER
+*
+\***************************************************************************/
+#ifndef __MP3ANCOFL_H__
+#define __MP3ANCOFL_H__
+
+#include "mpegbitstream.h"
+
+#define ID_OFL 0xB
+#define VERSION_0_LEN 8 /* bytes */
+#define VERSION_1_LEN 10 /* bytes */
+
+class CMp3AncOfl
+{
+ public:
+ CMp3AncOfl(CBitStream &__Db);
+ ~CMp3AncOfl();
+
+ void Reset(void);
+
+ int getVersion(void);
+ unsigned int getTotalLength(void);
+ unsigned int getCodecDelay(void);
+ unsigned int getAddDelay(void);
+
+ bool validOfl(void);
+
+ void fetchOfl(int oflOn,
+ CBitStream &Db,
+ int beforeScf,
+ unsigned int* startDelay,
+ unsigned int* totalLength);
+
+ int readAnc(unsigned char *ancBytes,
+ CBitStream &Db,
+ const int numAncBits);
+
+ int doReadBytes(){return m_readBytes;}
+
+ private:
+ void crcOfl(unsigned short crcPoly,
+ unsigned short crcMask,
+ unsigned long *crc,
+ unsigned char byte);
+
+ void cleanUp(void);
+ bool isFhGAnc( int size);
+ bool readOfl(CBitStream &Db, int beforeScaleFactors);
+ bool isOfl(void);
+ bool justSearched(void);
+ int toSkip(void);
+ void getOfl(CBitStream &Db, const int len);
+
+ CBitStream &m_Db; // dynamic buffer
+
+ unsigned char oflArray[10];
+
+ bool m_valid;
+ bool m_searched;
+ bool m_semaphor;
+ bool m_FhGAncChecked;
+ bool m_collecting;
+ bool m_mp3pro;
+
+ unsigned char* m_FhGAncBuf;
+ unsigned char* m_tmpAncBuf;
+
+ int m_pFhGAncBuf;
+ int m_FhGAncBufSize;
+
+ // flag signalling byte- or bit-wise reading
+ int m_readBytes;
+
+};
+
+#endif /* __MP3ANCOFL_H__ */