aboutsummaryrefslogtreecommitdiff
path: root/Src/replicant/nsmp3dec/mpegbitstream.h
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/replicant/nsmp3dec/mpegbitstream.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/replicant/nsmp3dec/mpegbitstream.h')
-rw-r--r--Src/replicant/nsmp3dec/mpegbitstream.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/Src/replicant/nsmp3dec/mpegbitstream.h b/Src/replicant/nsmp3dec/mpegbitstream.h
new file mode 100644
index 00000000..ec37626a
--- /dev/null
+++ b/Src/replicant/nsmp3dec/mpegbitstream.h
@@ -0,0 +1,71 @@
+/***************************************************************************\
+ *
+* MPEG Layer3-Audio Decoder
+* © 1997-2006 by Fraunhofer IIS
+ * All Rights Reserved
+ *
+ * filename: mpegbitstream.h
+ * project : MPEG Decoder
+ * author : Martin Sieler
+ * date : 1997-12-05
+ * contents/description: MPEG bitstream - HEADER
+ *
+ *
+\***************************************************************************/
+
+/*
+ * $Date: 2010/11/17 20:46:04 $
+ * $Id: mpegbitstream.h,v 1.1 2010/11/17 20:46:04 audiodsp Exp $
+ */
+
+#ifndef __MPEGBITSTREAM_H__
+#define __MPEGBITSTREAM_H__
+
+/* ------------------------ includes --------------------------------------*/
+
+#include "bitstream.h"
+#include "mpegheader.h"
+#include "mp3sscdef.h"
+
+/*-------------------------- defines --------------------------------------*/
+
+/*-------------------------------------------------------------------------*/
+
+//
+// MPEG bitstream class.
+//
+// This object is derived from CBitStream. In addition to CBitStream
+// this object is able to sync to the next ISO/MPEG header position.
+//
+
+class CMpegBitStream : public CBitStream
+{
+public:
+ CMpegBitStream(int cbSize);
+ CMpegBitStream(unsigned char *pBuf, int cbSize, bool fDataValid = false);
+ virtual ~CMpegBitStream();
+
+ virtual void Reset();
+
+ SSC DoSync();
+ int GetSyncPosition() const { return m_SyncPosition; }
+ const CMpegHeader *GetHdr() const { return &m_Hdr; }
+
+protected:
+
+private:
+
+ SSC DoSyncInitial();
+ SSC DoSyncContinue();
+
+ enum { FRAMES_TO_CHECK = 10 };
+
+ CMpegHeader m_Hdr; // mpeg header
+ unsigned long m_FirstHdr; // "relevant" bits of first good header
+ unsigned long m_nFramesToCheck; // # frames to be checked for next mpeg header
+ int m_SyncPosition; // offset of first sync in bits
+ SSC m_SyncState; // last sync state
+};
+
+/*-------------------------------------------------------------------------*/
+#endif