-
Notifications
You must be signed in to change notification settings - Fork 0
/
BitStream.h
67 lines (52 loc) · 1.14 KB
/
BitStream.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
///////////////////////////////////////////////////////////
//
// SuperDiskIndex
//
////////////////////
//
//
//
#pragma once
#include "Types.h"
///////////////////////////////////////////////////////////
struct streamblockdef
{
u32 SyncWord;
u32 PayloadLength;
};
///////////////////////////////////////////////////////////
class BitStream
{
public:
BitStream(class Format *fmt, u8 currev);
virtual ~BitStream();
void InitSyncWords();
void AddSyncWord(u32 dw, u32 payload_length);
void SetRev(u8 currev) { CurRev=currev; }
void Feed(u8 bit);
void LostSync();
void Flush();
class Buffer *GetBuffer() { return Data; }
bool IsSynced() { return SyncFlag==1; }
u8 GetActiveSyncDef() { return ActiveSyncDef; }
void EnableRawBitstream();
void DisableRawBitstream();
void ResetRawBitstream();
class Buffer *GetRawBuffer();
protected:
void Store(u8 val);
class Format *Fmt;
class Buffer *Data;
u32 Capture;
u8 CaptureUsed;
u8 const CaptureWidth = sizeof(Capture);
int SyncFlag;
streamblockdef SyncDefs[8];
int SyncDefCount;
int ActiveSyncDef;
u32 PayloadCounter;
u8 CurRev;
class Buffer *RawTrack;
u8 RawTrackSR;
u8 RawTrackC;
};