summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr45874.C
blob: 70965ff574ea1ee03adafc8a96d5f9811cfe081f (plain)
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
// { dg-do compile }

typedef struct {
} IppLibraryVersion;
typedef unsigned char Ipp8u;
typedef unsigned int Ipp32u;
typedef signed int Ipp32s;
typedef enum e_vm_Status {
    VM_OK = 0,     VM_OPERATION_FAILED =-999,     VM_NOT_INITIALIZED =-998,     VM_TIMEOUT =-987,     VM_NOT_ENOUGH_DATA =-996,      VM_NULL_PTR =-995,     VM_SO_CANT_LOAD =-994,     VM_SO_INVALID_HANDLE =-993,     VM_SO_CANT_GET_ADDR =-992 }
    vm_status;
    typedef Ipp32s Status;
    class MediaReceiver {
    };
class MediaBuffer : public MediaReceiver {
};
struct TrackInfo {
};
struct Mpeg2TrackInfo : public TrackInfo     {
};
class BitstreamReader     {
public:          BitstreamReader(void);
		 virtual ~BitstreamReader(void) {
		 }
		 Ipp32u GetBits(Ipp32s iNum);
		 void SkipBits(Ipp32s iNum);
protected:          virtual void Refresh(void);
		    Ipp32s m_iReadyBits;
};
class FrameConstructor : public MediaBuffer     {
};
class VideoFrameConstructor : public FrameConstructor     {
};
class Mpeg2FrameConstructor : public VideoFrameConstructor     {
    static Status ParsePictureHeader(Ipp8u *buf, Ipp32s iLen, Mpeg2TrackInfo *pInfo);
};
Status Mpeg2FrameConstructor::ParsePictureHeader(Ipp8u *buf, Ipp32s iLen, Mpeg2TrackInfo *pInfo) {
    BitstreamReader bs;
    bs.SkipBits(32 + 4 + 4 + 4 + 4 + 4 + 2);
    bs.SkipBits(1 + 1 + 1 + 1 + 1 + 1 + 1);
    bs.SkipBits(5);
    bs.SkipBits(3);
    Ipp8u source_format;
    bs.SkipBits(22);
    bs.SkipBits(8);
    if (7 == source_format)     {
	Ipp8u ufep = (Ipp8u)bs.GetBits(3);
	if (0x01 == ufep)         {
	    bs.SkipBits(10);
	}
    }
}
void BitstreamReader::SkipBits(Ipp32s iNum) {
    if (iNum <= m_iReadyBits)     {
	m_iReadyBits -= iNum;
	Refresh();
    }
}
void BitstreamReader::Refresh(void) { }