# 1 "parse.c" # 1 "" # 1 "" # 1 "parse.c" # 1 "parse.h" 1 # 49 "parse.h" typedef short CoefElement; typedef struct { unsigned char const* zigZagToDirectArray; unsigned short const* weightArray; unsigned short maxCoefficientToParse; unsigned short lastPass; unsigned int padding; } DctModeCacheEntry; typedef struct { unsigned char ID[3]; unsigned char STAQNOValue; unsigned char y0[14]; unsigned char y1[14]; unsigned char y2[14]; unsigned char y3[14]; unsigned char cr[10]; unsigned char cb[10]; } DIFVideoBlock, *DIFVideoBlockPtr; typedef struct { unsigned char ID[3]; unsigned char reserved[77]; } DIFHeaderBlock, *DIFHeaderBlockPtr; typedef struct { unsigned char ID[3]; char data[77]; } DIFVAUXBlock, *DIFVAUXBlockPtr; typedef struct { unsigned char ID[3]; char data[77]; } DIFAudioBlock, *DIFAudioBlockPtr; typedef struct { union { unsigned char dataBlk[80]; DIFHeaderBlock headerBlk; DIFVAUXBlock VAUXBlk; DIFVideoBlock videoBlk; DIFAudioBlock audioBlk; } u; } DIFBlock, *DIFBlockPtr; typedef struct { DIFBlock videoDIFBlock[5]; } CodedVideoSegmentRecord, *CodedVideoSegmentRecordPtr; typedef struct { union { CoefElement coefArray[64]; CoefElement coefArray88[8][8]; }u; unsigned short quantizationShiftList; unsigned char dctMode; unsigned char coefIndex; } CoefficientRecord, *CoefficientRecordPtr; typedef struct { CoefficientRecord videoSeg[6]; } DecodedMBSegmentRecord, *DecodedMBSegmentRecordPtr; typedef struct { DecodedMBSegmentRecord decMBSeg[5]; } DecodedVideoSegmentRecord, *DecodedVideoSegmentRecordPtr; struct BitStream{ unsigned short* bufferCurrentPtr; unsigned int currentBits; short currentBitOffset; short bitsLeft; unsigned int padding; }; typedef struct BitStream BitStream; typedef struct { union { unsigned int Init[(5*6 +5 +2)/4]; unsigned char Link[5*6 +5 +2]; } u; } BitStreamLinkStruct; void InitDctModeCache (DctModeCacheEntry dctModeCache[2]); void ParseVideoSegment (CodedVideoSegmentRecord *codedDataPtr, DecodedVideoSegmentRecordPtr decodedVideoSegmentPtr, DctModeCacheEntry dctModeCache[2]); # 2 "parse.c" 2 # 87 "parse.c" static const unsigned short QuantClassToShiftList [16][4] = { ((15 -6 -1 -(1+0))<<0) +((15 -6 -1 -(2+0))<<4) +((15 -6 -1 -(2+0))<<8) +((15 -6 -1 -(3+0))<<12), ((15 -6 -1 -(2+0))<<0) +((15 -6 -1 -(3+0))<<4) +((15 -6 -1 -(3+0))<<8) +((15 -6 -1 -(4+0))<<12), ((15 -6 -1 -(3+0))<<0) +((15 -6 -1 -(3+0))<<4) +((15 -6 -1 -(4+0))<<8) +((15 -6 -1 -(4+0))<<12), ((15 -6 -1 -(3+1))<<0) +((15 -6 -1 -(3+1))<<4) +((15 -6 -1 -(4+1))<<8) +((15 -6 -1 -(4+1))<<12), ((15 -6 -1 -(1+0))<<0) +((15 -6 -1 -(2+0))<<4) +((15 -6 -1 -(2+0))<<8) +((15 -6 -1 -(3+0))<<12), ((15 -6 -1 -(2+0))<<0) +((15 -6 -1 -(2+0))<<4) +((15 -6 -1 -(3+0))<<8) +((15 -6 -1 -(3+0))<<12), ((15 -6 -1 -(3+0))<<0) +((15 -6 -1 -(3+0))<<4) +((15 -6 -1 -(4+0))<<8) +((15 -6 -1 -(4+0))<<12), ((15 -6 -1 -(2+1))<<0) +((15 -6 -1 -(3+1))<<4) +((15 -6 -1 -(3+1))<<8) +((15 -6 -1 -(4+1))<<12), ((15 -6 -1 -(1+0))<<0) +((15 -6 -1 -(1+0))<<4) +((15 -6 -1 -(2+0))<<8) +((15 -6 -1 -(2+0))<<12), ((15 -6 -1 -(2+0))<<0) +((15 -6 -1 -(2+0))<<4) +((15 -6 -1 -(3+0))<<8) +((15 -6 -1 -(3+0))<<12), ((15 -6 -1 -(2+0))<<0) +((15 -6 -1 -(3+0))<<4) +((15 -6 -1 -(3+0))<<8) +((15 -6 -1 -(4+0))<<12), ((15 -6 -1 -(2+1))<<0) +((15 -6 -1 -(3+1))<<4) +((15 -6 -1 -(3+1))<<8) +((15 -6 -1 -(4+1))<<12), ((15 -6 -1 -(1+0))<<0) +((15 -6 -1 -(1+0))<<4) +((15 -6 -1 -(2+0))<<8) +((15 -6 -1 -(2+0))<<12), ((15 -6 -1 -(1+0))<<0) +((15 -6 -1 -(2+0))<<4) +((15 -6 -1 -(2+0))<<8) +((15 -6 -1 -(3+0))<<12), ((15 -6 -1 -(2+0))<<0) +((15 -6 -1 -(3+0))<<4) +((15 -6 -1 -(3+0))<<8) +((15 -6 -1 -(4+0))<<12), ((15 -6 -1 -(2+1))<<0) +((15 -6 -1 -(2+1))<<4) +((15 -6 -1 -(3+1))<<8) +((15 -6 -1 -(3+1))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(1+0))<<4) +((15 -6 -1 -(1+0))<<8) +((15 -6 -1 -(2+0))<<12), ((15 -6 -1 -(1+0))<<0) +((15 -6 -1 -(2+0))<<4) +((15 -6 -1 -(2+0))<<8) +((15 -6 -1 -(3+0))<<12), ((15 -6 -1 -(2+0))<<0) +((15 -6 -1 -(2+0))<<4) +((15 -6 -1 -(3+0))<<8) +((15 -6 -1 -(3+0))<<12), ((15 -6 -1 -(2+1))<<0) +((15 -6 -1 -(2+1))<<4) +((15 -6 -1 -(3+1))<<8) +((15 -6 -1 -(3+1))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(1+0))<<4) +((15 -6 -1 -(1+0))<<8) +((15 -6 -1 -(2+0))<<12), ((15 -6 -1 -(1+0))<<0) +((15 -6 -1 -(1+0))<<4) +((15 -6 -1 -(2+0))<<8) +((15 -6 -1 -(2+0))<<12), ((15 -6 -1 -(2+0))<<0) +((15 -6 -1 -(2+0))<<4) +((15 -6 -1 -(3+0))<<8) +((15 -6 -1 -(3+0))<<12), ((15 -6 -1 -(1+1))<<0) +((15 -6 -1 -(2+1))<<4) +((15 -6 -1 -(2+1))<<8) +((15 -6 -1 -(3+1))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(1+0))<<8) +((15 -6 -1 -(1+0))<<12), ((15 -6 -1 -(1+0))<<0) +((15 -6 -1 -(1+0))<<4) +((15 -6 -1 -(2+0))<<8) +((15 -6 -1 -(2+0))<<12), ((15 -6 -1 -(1+0))<<0) +((15 -6 -1 -(2+0))<<4) +((15 -6 -1 -(2+0))<<8) +((15 -6 -1 -(3+0))<<12), ((15 -6 -1 -(1+1))<<0) +((15 -6 -1 -(2+1))<<4) +((15 -6 -1 -(2+1))<<8) +((15 -6 -1 -(3+1))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(1+0))<<8) +((15 -6 -1 -(1+0))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(1+0))<<4) +((15 -6 -1 -(1+0))<<8) +((15 -6 -1 -(2+0))<<12), ((15 -6 -1 -(1+0))<<0) +((15 -6 -1 -(2+0))<<4) +((15 -6 -1 -(2+0))<<8) +((15 -6 -1 -(3+0))<<12), ((15 -6 -1 -(1+1))<<0) +((15 -6 -1 -(1+1))<<4) +((15 -6 -1 -(2+1))<<8) +((15 -6 -1 -(2+1))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(0+0))<<8) +((15 -6 -1 -(1+0))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(1+0))<<4) +((15 -6 -1 -(1+0))<<8) +((15 -6 -1 -(2+0))<<12), ((15 -6 -1 -(1+0))<<0) +((15 -6 -1 -(1+0))<<4) +((15 -6 -1 -(2+0))<<8) +((15 -6 -1 -(2+0))<<12), ((15 -6 -1 -(1+1))<<0) +((15 -6 -1 -(1+1))<<4) +((15 -6 -1 -(2+1))<<8) +((15 -6 -1 -(2+1))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(0+0))<<8) +((15 -6 -1 -(0+0))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(1+0))<<8) +((15 -6 -1 -(1+0))<<12), ((15 -6 -1 -(1+0))<<0) +((15 -6 -1 -(1+0))<<4) +((15 -6 -1 -(2+0))<<8) +((15 -6 -1 -(2+0))<<12), ((15 -6 -1 -(0+1))<<0) +((15 -6 -1 -(1+1))<<4) +((15 -6 -1 -(1+1))<<8) +((15 -6 -1 -(2+1))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(0+0))<<8) +((15 -6 -1 -(0+0))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(1+0))<<8) +((15 -6 -1 -(1+0))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(1+0))<<4) +((15 -6 -1 -(1+0))<<8) +((15 -6 -1 -(2+0))<<12), ((15 -6 -1 -(0+1))<<0) +((15 -6 -1 -(1+1))<<4) +((15 -6 -1 -(1+1))<<8) +((15 -6 -1 -(2+1))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(0+0))<<8) +((15 -6 -1 -(0+0))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(0+0))<<8) +((15 -6 -1 -(1+0))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(1+0))<<4) +((15 -6 -1 -(1+0))<<8) +((15 -6 -1 -(2+0))<<12), ((15 -6 -1 -(0+1))<<0) +((15 -6 -1 -(0+1))<<4) +((15 -6 -1 -(1+1))<<8) +((15 -6 -1 -(1+1))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(0+0))<<8) +((15 -6 -1 -(0+0))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(0+0))<<8) +((15 -6 -1 -(0+0))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(1+0))<<8) +((15 -6 -1 -(1+0))<<12), ((15 -6 -1 -(0+1))<<0) +((15 -6 -1 -(0+1))<<4) +((15 -6 -1 -(1+1))<<8) +((15 -6 -1 -(1+1))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(0+0))<<8) +((15 -6 -1 -(0+0))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(0+0))<<8) +((15 -6 -1 -(0+0))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(1+0))<<8) +((15 -6 -1 -(1+0))<<12), ((15 -6 -1 -(0+1))<<0) +((15 -6 -1 -(0+1))<<4) +((15 -6 -1 -(0+1))<<8) +((15 -6 -1 -(1+1))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(0+0))<<8) +((15 -6 -1 -(0+0))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(0+0))<<8) +((15 -6 -1 -(0+0))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(0+0))<<8) +((15 -6 -1 -(1+0))<<12), ((15 -6 -1 -(0+1))<<0) +((15 -6 -1 -(0+1))<<4) +((15 -6 -1 -(0+1))<<8) +((15 -6 -1 -(0+1))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(0+0))<<8) +((15 -6 -1 -(0+0))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(0+0))<<8) +((15 -6 -1 -(0+0))<<12), ((15 -6 -1 -(0+0))<<0) +((15 -6 -1 -(0+0))<<4) +((15 -6 -1 -(0+0))<<8) +((15 -6 -1 -(0+0))<<12), ((15 -6 -1 -(0+1))<<0) +((15 -6 -1 -(0+1))<<4) +((15 -6 -1 -(0+1))<<8) +((15 -6 -1 -(0+1))<<12), }; static const short VLCLookupTable[(0x01E0+0x01C0)] = { ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((-1<<10) | (0<<4) | (2+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((-2<<10) | (0<<4) | (3+1)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((0<<10) | (63<<4) | (4)), ((1<<10) | (1<<4) | (4+1)), ((1<<10) | (1<<4) | (4+1)), ((1<<10) | (1<<4) | (4+1)), ((1<<10) | (1<<4) | (4+1)), ((1<<10) | (1<<4) | (4+1)), ((1<<10) | (1<<4) | (4+1)), ((1<<10) | (1<<4) | (4+1)), ((1<<10) | (1<<4) | (4+1)), ((1<<10) | (1<<4) | (4+1)), ((1<<10) | (1<<4) | (4+1)), ((1<<10) | (1<<4) | (4+1)), ((1<<10) | (1<<4) | (4+1)), ((1<<10) | (1<<4) | (4+1)), ((1<<10) | (1<<4) | (4+1)), ((1<<10) | (1<<4) | (4+1)), ((1<<10) | (1<<4) | (4+1)), ((-1<<10) | (1<<4) | (4+1)), ((-1<<10) | (1<<4) | (4+1)), ((-1<<10) | (1<<4) | (4+1)), ((-1<<10) | (1<<4) | (4+1)), ((-1<<10) | (1<<4) | (4+1)), ((-1<<10) | (1<<4) | (4+1)), ((-1<<10) | (1<<4) | (4+1)), ((-1<<10) | (1<<4) | (4+1)), ((-1<<10) | (1<<4) | (4+1)), ((-1<<10) | (1<<4) | (4+1)), ((-1<<10) | (1<<4) | (4+1)), ((-1<<10) | (1<<4) | (4+1)), ((-1<<10) | (1<<4) | (4+1)), ((-1<<10) | (1<<4) | (4+1)), ((-1<<10) | (1<<4) | (4+1)), ((-1<<10) | (1<<4) | (4+1)), ((3<<10) | (0<<4) | (4+1)), ((3<<10) | (0<<4) | (4+1)), ((3<<10) | (0<<4) | (4+1)), ((3<<10) | (0<<4) | (4+1)), ((3<<10) | (0<<4) | (4+1)), ((3<<10) | (0<<4) | (4+1)), ((3<<10) | (0<<4) | (4+1)), ((3<<10) | (0<<4) | (4+1)), ((3<<10) | (0<<4) | (4+1)), ((3<<10) | (0<<4) | (4+1)), ((3<<10) | (0<<4) | (4+1)), ((3<<10) | (0<<4) | (4+1)), ((3<<10) | (0<<4) | (4+1)), ((3<<10) | (0<<4) | (4+1)), ((3<<10) | (0<<4) | (4+1)), ((3<<10) | (0<<4) | (4+1)), ((-3<<10) | (0<<4) | (4+1)), ((-3<<10) | (0<<4) | (4+1)), ((-3<<10) | (0<<4) | (4+1)), ((-3<<10) | (0<<4) | (4+1)), ((-3<<10) | (0<<4) | (4+1)), ((-3<<10) | (0<<4) | (4+1)), ((-3<<10) | (0<<4) | (4+1)), ((-3<<10) | (0<<4) | (4+1)), ((-3<<10) | (0<<4) | (4+1)), ((-3<<10) | (0<<4) | (4+1)), ((-3<<10) | (0<<4) | (4+1)), ((-3<<10) | (0<<4) | (4+1)), ((-3<<10) | (0<<4) | (4+1)), ((-3<<10) | (0<<4) | (4+1)), ((-3<<10) | (0<<4) | (4+1)), ((-3<<10) | (0<<4) | (4+1)), ((4<<10) | (0<<4) | (4+1)), ((4<<10) | (0<<4) | (4+1)), ((4<<10) | (0<<4) | (4+1)), ((4<<10) | (0<<4) | (4+1)), ((4<<10) | (0<<4) | (4+1)), ((4<<10) | (0<<4) | (4+1)), ((4<<10) | (0<<4) | (4+1)), ((4<<10) | (0<<4) | (4+1)), ((4<<10) | (0<<4) | (4+1)), ((4<<10) | (0<<4) | (4+1)), ((4<<10) | (0<<4) | (4+1)), ((4<<10) | (0<<4) | (4+1)), ((4<<10) | (0<<4) | (4+1)), ((4<<10) | (0<<4) | (4+1)), ((4<<10) | (0<<4) | (4+1)), ((4<<10) | (0<<4) | (4+1)), ((-4<<10) | (0<<4) | (4+1)), ((-4<<10) | (0<<4) | (4+1)), ((-4<<10) | (0<<4) | (4+1)), ((-4<<10) | (0<<4) | (4+1)), ((-4<<10) | (0<<4) | (4+1)), ((-4<<10) | (0<<4) | (4+1)), ((-4<<10) | (0<<4) | (4+1)), ((-4<<10) | (0<<4) | (4+1)), ((-4<<10) | (0<<4) | (4+1)), ((-4<<10) | (0<<4) | (4+1)), ((-4<<10) | (0<<4) | (4+1)), ((-4<<10) | (0<<4) | (4+1)), ((-4<<10) | (0<<4) | (4+1)), ((-4<<10) | (0<<4) | (4+1)), ((-4<<10) | (0<<4) | (4+1)), ((-4<<10) | (0<<4) | (4+1)), ((1<<10) | (2<<4) | (5+1)), ((1<<10) | (2<<4) | (5+1)), ((1<<10) | (2<<4) | (5+1)), ((1<<10) | (2<<4) | (5+1)), ((1<<10) | (2<<4) | (5+1)), ((1<<10) | (2<<4) | (5+1)), ((1<<10) | (2<<4) | (5+1)), ((1<<10) | (2<<4) | (5+1)), ((-1<<10) | (2<<4) | (5+1)), ((-1<<10) | (2<<4) | (5+1)), ((-1<<10) | (2<<4) | (5+1)), ((-1<<10) | (2<<4) | (5+1)), ((-1<<10) | (2<<4) | (5+1)), ((-1<<10) | (2<<4) | (5+1)), ((-1<<10) | (2<<4) | (5+1)), ((-1<<10) | (2<<4) | (5+1)), ((2<<10) | (1<<4) | (5+1)), ((2<<10) | (1<<4) | (5+1)), ((2<<10) | (1<<4) | (5+1)), ((2<<10) | (1<<4) | (5+1)), ((2<<10) | (1<<4) | (5+1)), ((2<<10) | (1<<4) | (5+1)), ((2<<10) | (1<<4) | (5+1)), ((2<<10) | (1<<4) | (5+1)), ((-2<<10) | (1<<4) | (5+1)), ((-2<<10) | (1<<4) | (5+1)), ((-2<<10) | (1<<4) | (5+1)), ((-2<<10) | (1<<4) | (5+1)), ((-2<<10) | (1<<4) | (5+1)), ((-2<<10) | (1<<4) | (5+1)), ((-2<<10) | (1<<4) | (5+1)), ((-2<<10) | (1<<4) | (5+1)), ((5<<10) | (0<<4) | (5+1)), ((5<<10) | (0<<4) | (5+1)), ((5<<10) | (0<<4) | (5+1)), ((5<<10) | (0<<4) | (5+1)), ((5<<10) | (0<<4) | (5+1)), ((5<<10) | (0<<4) | (5+1)), ((5<<10) | (0<<4) | (5+1)), ((5<<10) | (0<<4) | (5+1)), ((-5<<10) | (0<<4) | (5+1)), ((-5<<10) | (0<<4) | (5+1)), ((-5<<10) | (0<<4) | (5+1)), ((-5<<10) | (0<<4) | (5+1)), ((-5<<10) | (0<<4) | (5+1)), ((-5<<10) | (0<<4) | (5+1)), ((-5<<10) | (0<<4) | (5+1)), ((-5<<10) | (0<<4) | (5+1)), ((6<<10) | (0<<4) | (5+1)), ((6<<10) | (0<<4) | (5+1)), ((6<<10) | (0<<4) | (5+1)), ((6<<10) | (0<<4) | (5+1)), ((6<<10) | (0<<4) | (5+1)), ((6<<10) | (0<<4) | (5+1)), ((6<<10) | (0<<4) | (5+1)), ((6<<10) | (0<<4) | (5+1)), ((-6<<10) | (0<<4) | (5+1)), ((-6<<10) | (0<<4) | (5+1)), ((-6<<10) | (0<<4) | (5+1)), ((-6<<10) | (0<<4) | (5+1)), ((-6<<10) | (0<<4) | (5+1)), ((-6<<10) | (0<<4) | (5+1)), ((-6<<10) | (0<<4) | (5+1)), ((-6<<10) | (0<<4) | (5+1)), ((1<<10) | (3<<4) | (6+1)), ((1<<10) | (3<<4) | (6+1)), ((1<<10) | (3<<4) | (6+1)), ((1<<10) | (3<<4) | (6+1)), ((-1<<10) | (3<<4) | (6+1)), ((-1<<10) | (3<<4) | (6+1)), ((-1<<10) | (3<<4) | (6+1)), ((-1<<10) | (3<<4) | (6+1)), ((1<<10) | (4<<4) | (6+1)), ((1<<10) | (4<<4) | (6+1)), ((1<<10) | (4<<4) | (6+1)), ((1<<10) | (4<<4) | (6+1)), ((-1<<10) | (4<<4) | (6+1)), ((-1<<10) | (4<<4) | (6+1)), ((-1<<10) | (4<<4) | (6+1)), ((-1<<10) | (4<<4) | (6+1)), ((7<<10) | (0<<4) | (6+1)), ((7<<10) | (0<<4) | (6+1)), ((7<<10) | (0<<4) | (6+1)), ((7<<10) | (0<<4) | (6+1)), ((-7<<10) | (0<<4) | (6+1)), ((-7<<10) | (0<<4) | (6+1)), ((-7<<10) | (0<<4) | (6+1)), ((-7<<10) | (0<<4) | (6+1)), ((8<<10) | (0<<4) | (6+1)), ((8<<10) | (0<<4) | (6+1)), ((8<<10) | (0<<4) | (6+1)), ((8<<10) | (0<<4) | (6+1)), ((-8<<10) | (0<<4) | (6+1)), ((-8<<10) | (0<<4) | (6+1)), ((-8<<10) | (0<<4) | (6+1)), ((-8<<10) | (0<<4) | (6+1)), ((1<<10) | (5<<4) | (7+1)), ((1<<10) | (5<<4) | (7+1)), ((-1<<10) | (5<<4) | (7+1)), ((-1<<10) | (5<<4) | (7+1)), ((1<<10) | (6<<4) | (7+1)), ((1<<10) | (6<<4) | (7+1)), ((-1<<10) | (6<<4) | (7+1)), ((-1<<10) | (6<<4) | (7+1)), ((2<<10) | (2<<4) | (7+1)), ((2<<10) | (2<<4) | (7+1)), ((-2<<10) | (2<<4) | (7+1)), ((-2<<10) | (2<<4) | (7+1)), ((3<<10) | (1<<4) | (7+1)), ((3<<10) | (1<<4) | (7+1)), ((-3<<10) | (1<<4) | (7+1)), ((-3<<10) | (1<<4) | (7+1)), ((4<<10) | (1<<4) | (7+1)), ((4<<10) | (1<<4) | (7+1)), ((-4<<10) | (1<<4) | (7+1)), ((-4<<10) | (1<<4) | (7+1)), ((9<<10) | (0<<4) | (7+1)), ((9<<10) | (0<<4) | (7+1)), ((-9<<10) | (0<<4) | (7+1)), ((-9<<10) | (0<<4) | (7+1)), ((10<<10) | (0<<4) | (7+1)), ((10<<10) | (0<<4) | (7+1)), ((-10<<10) | (0<<4) | (7+1)), ((-10<<10) | (0<<4) | (7+1)), ((11<<10) | (0<<4) | (7+1)), ((11<<10) | (0<<4) | (7+1)), ((-11<<10) | (0<<4) | (7+1)), ((-11<<10) | (0<<4) | (7+1)), ((1<<10) | (7<<4) | (8+1)), ((-1<<10) | (7<<4) | (8+1)), ((1<<10) | (8<<4) | (8+1)), ((-1<<10) | (8<<4) | (8+1)), ((1<<10) | (9<<4) | (8+1)), ((-1<<10) | (9<<4) | (8+1)), ((1<<10) | (10<<4) | (8+1)), ((-1<<10) | (10<<4) | (8+1)), ((2<<10) | (3<<4) | (8+1)), ((-2<<10) | (3<<4) | (8+1)), ((2<<10) | (4<<4) | (8+1)), ((-2<<10) | (4<<4) | (8+1)), ((3<<10) | (2<<4) | (8+1)), ((-3<<10) | (2<<4) | (8+1)), ((5<<10) | (1<<4) | (8+1)), ((-5<<10) | (1<<4) | (8+1)), ((6<<10) | (1<<4) | (8+1)), ((-6<<10) | (1<<4) | (8+1)), ((7<<10) | (1<<4) | (8+1)), ((-7<<10) | (1<<4) | (8+1)), ((12<<10) | (0<<4) | (8+1)), ((-12<<10) | (0<<4) | (8+1)), ((13<<10) | (0<<4) | (8+1)), ((-13<<10) | (0<<4) | (8+1)), ((14<<10) | (0<<4) | (8+1)), ((-14<<10) | (0<<4) | (8+1)), ((15<<10) | (0<<4) | (8+1)), ((-15<<10) | (0<<4) | (8+1)), ((16<<10) | (0<<4) | (8+1)), ((-16<<10) | (0<<4) | (8+1)), ((17<<10) | (0<<4) | (8+1)), ((-17<<10) | (0<<4) | (8+1)), ((1<<10) | (11<<4) | (9+1)), ((1<<10) | (11<<4) | (9+1)), ((1<<10) | (11<<4) | (9+1)), ((1<<10) | (11<<4) | (9+1)), ((1<<10) | (11<<4) | (9+1)), ((1<<10) | (11<<4) | (9+1)), ((1<<10) | (11<<4) | (9+1)), ((1<<10) | (11<<4) | (9+1)), ((-1<<10) | (11<<4) | (9+1)), ((-1<<10) | (11<<4) | (9+1)), ((-1<<10) | (11<<4) | (9+1)), ((-1<<10) | (11<<4) | (9+1)), ((-1<<10) | (11<<4) | (9+1)), ((-1<<10) | (11<<4) | (9+1)), ((-1<<10) | (11<<4) | (9+1)), ((-1<<10) | (11<<4) | (9+1)), ((1<<10) | (12<<4) | (9+1)), ((1<<10) | (12<<4) | (9+1)), ((1<<10) | (12<<4) | (9+1)), ((1<<10) | (12<<4) | (9+1)), ((1<<10) | (12<<4) | (9+1)), ((1<<10) | (12<<4) | (9+1)), ((1<<10) | (12<<4) | (9+1)), ((1<<10) | (12<<4) | (9+1)), ((-1<<10) | (12<<4) | (9+1)), ((-1<<10) | (12<<4) | (9+1)), ((-1<<10) | (12<<4) | (9+1)), ((-1<<10) | (12<<4) | (9+1)), ((-1<<10) | (12<<4) | (9+1)), ((-1<<10) | (12<<4) | (9+1)), ((-1<<10) | (12<<4) | (9+1)), ((-1<<10) | (12<<4) | (9+1)), ((1<<10) | (13<<4) | (9+1)), ((1<<10) | (13<<4) | (9+1)), ((1<<10) | (13<<4) | (9+1)), ((1<<10) | (13<<4) | (9+1)), ((1<<10) | (13<<4) | (9+1)), ((1<<10) | (13<<4) | (9+1)), ((1<<10) | (13<<4) | (9+1)), ((1<<10) | (13<<4) | (9+1)), ((-1<<10) | (13<<4) | (9+1)), ((-1<<10) | (13<<4) | (9+1)), ((-1<<10) | (13<<4) | (9+1)), ((-1<<10) | (13<<4) | (9+1)), ((-1<<10) | (13<<4) | (9+1)), ((-1<<10) | (13<<4) | (9+1)), ((-1<<10) | (13<<4) | (9+1)), ((-1<<10) | (13<<4) | (9+1)), ((1<<10) | (14<<4) | (9+1)), ((1<<10) | (14<<4) | (9+1)), ((1<<10) | (14<<4) | (9+1)), ((1<<10) | (14<<4) | (9+1)), ((1<<10) | (14<<4) | (9+1)), ((1<<10) | (14<<4) | (9+1)), ((1<<10) | (14<<4) | (9+1)), ((1<<10) | (14<<4) | (9+1)), ((-1<<10) | (14<<4) | (9+1)), ((-1<<10) | (14<<4) | (9+1)), ((-1<<10) | (14<<4) | (9+1)), ((-1<<10) | (14<<4) | (9+1)), ((-1<<10) | (14<<4) | (9+1)), ((-1<<10) | (14<<4) | (9+1)), ((-1<<10) | (14<<4) | (9+1)), ((-1<<10) | (14<<4) | (9+1)), ((2<<10) | (5<<4) | (9+1)), ((2<<10) | (5<<4) | (9+1)), ((2<<10) | (5<<4) | (9+1)), ((2<<10) | (5<<4) | (9+1)), ((2<<10) | (5<<4) | (9+1)), ((2<<10) | (5<<4) | (9+1)), ((2<<10) | (5<<4) | (9+1)), ((2<<10) | (5<<4) | (9+1)), ((-2<<10) | (5<<4) | (9+1)), ((-2<<10) | (5<<4) | (9+1)), ((-2<<10) | (5<<4) | (9+1)), ((-2<<10) | (5<<4) | (9+1)), ((-2<<10) | (5<<4) | (9+1)), ((-2<<10) | (5<<4) | (9+1)), ((-2<<10) | (5<<4) | (9+1)), ((-2<<10) | (5<<4) | (9+1)), ((2<<10) | (6<<4) | (9+1)), ((2<<10) | (6<<4) | (9+1)), ((2<<10) | (6<<4) | (9+1)), ((2<<10) | (6<<4) | (9+1)), ((2<<10) | (6<<4) | (9+1)), ((2<<10) | (6<<4) | (9+1)), ((2<<10) | (6<<4) | (9+1)), ((2<<10) | (6<<4) | (9+1)), ((-2<<10) | (6<<4) | (9+1)), ((-2<<10) | (6<<4) | (9+1)), ((-2<<10) | (6<<4) | (9+1)), ((-2<<10) | (6<<4) | (9+1)), ((-2<<10) | (6<<4) | (9+1)), ((-2<<10) | (6<<4) | (9+1)), ((-2<<10) | (6<<4) | (9+1)), ((-2<<10) | (6<<4) | (9+1)), ((3<<10) | (3<<4) | (9+1)), ((3<<10) | (3<<4) | (9+1)), ((3<<10) | (3<<4) | (9+1)), ((3<<10) | (3<<4) | (9+1)), ((3<<10) | (3<<4) | (9+1)), ((3<<10) | (3<<4) | (9+1)), ((3<<10) | (3<<4) | (9+1)), ((3<<10) | (3<<4) | (9+1)), ((-3<<10) | (3<<4) | (9+1)), ((-3<<10) | (3<<4) | (9+1)), ((-3<<10) | (3<<4) | (9+1)), ((-3<<10) | (3<<4) | (9+1)), ((-3<<10) | (3<<4) | (9+1)), ((-3<<10) | (3<<4) | (9+1)), ((-3<<10) | (3<<4) | (9+1)), ((-3<<10) | (3<<4) | (9+1)), ((3<<10) | (4<<4) | (9+1)), ((3<<10) | (4<<4) | (9+1)), ((3<<10) | (4<<4) | (9+1)), ((3<<10) | (4<<4) | (9+1)), ((3<<10) | (4<<4) | (9+1)), ((3<<10) | (4<<4) | (9+1)), ((3<<10) | (4<<4) | (9+1)), ((3<<10) | (4<<4) | (9+1)), ((-3<<10) | (4<<4) | (9+1)), ((-3<<10) | (4<<4) | (9+1)), ((-3<<10) | (4<<4) | (9+1)), ((-3<<10) | (4<<4) | (9+1)), ((-3<<10) | (4<<4) | (9+1)), ((-3<<10) | (4<<4) | (9+1)), ((-3<<10) | (4<<4) | (9+1)), ((-3<<10) | (4<<4) | (9+1)), ((4<<10) | (2<<4) | (9+1)), ((4<<10) | (2<<4) | (9+1)), ((4<<10) | (2<<4) | (9+1)), ((4<<10) | (2<<4) | (9+1)), ((4<<10) | (2<<4) | (9+1)), ((4<<10) | (2<<4) | (9+1)), ((4<<10) | (2<<4) | (9+1)), ((4<<10) | (2<<4) | (9+1)), ((-4<<10) | (2<<4) | (9+1)), ((-4<<10) | (2<<4) | (9+1)), ((-4<<10) | (2<<4) | (9+1)), ((-4<<10) | (2<<4) | (9+1)), ((-4<<10) | (2<<4) | (9+1)), ((-4<<10) | (2<<4) | (9+1)), ((-4<<10) | (2<<4) | (9+1)), ((-4<<10) | (2<<4) | (9+1)), ((5<<10) | (2<<4) | (9+1)), ((5<<10) | (2<<4) | (9+1)), ((5<<10) | (2<<4) | (9+1)), ((5<<10) | (2<<4) | (9+1)), ((5<<10) | (2<<4) | (9+1)), ((5<<10) | (2<<4) | (9+1)), ((5<<10) | (2<<4) | (9+1)), ((5<<10) | (2<<4) | (9+1)), ((-5<<10) | (2<<4) | (9+1)), ((-5<<10) | (2<<4) | (9+1)), ((-5<<10) | (2<<4) | (9+1)), ((-5<<10) | (2<<4) | (9+1)), ((-5<<10) | (2<<4) | (9+1)), ((-5<<10) | (2<<4) | (9+1)), ((-5<<10) | (2<<4) | (9+1)), ((-5<<10) | (2<<4) | (9+1)), ((8<<10) | (1<<4) | (9+1)), ((8<<10) | (1<<4) | (9+1)), ((8<<10) | (1<<4) | (9+1)), ((8<<10) | (1<<4) | (9+1)), ((8<<10) | (1<<4) | (9+1)), ((8<<10) | (1<<4) | (9+1)), ((8<<10) | (1<<4) | (9+1)), ((8<<10) | (1<<4) | (9+1)), ((-8<<10) | (1<<4) | (9+1)), ((-8<<10) | (1<<4) | (9+1)), ((-8<<10) | (1<<4) | (9+1)), ((-8<<10) | (1<<4) | (9+1)), ((-8<<10) | (1<<4) | (9+1)), ((-8<<10) | (1<<4) | (9+1)), ((-8<<10) | (1<<4) | (9+1)), ((-8<<10) | (1<<4) | (9+1)), ((18<<10) | (0<<4) | (9+1)), ((18<<10) | (0<<4) | (9+1)), ((18<<10) | (0<<4) | (9+1)), ((18<<10) | (0<<4) | (9+1)), ((18<<10) | (0<<4) | (9+1)), ((18<<10) | (0<<4) | (9+1)), ((18<<10) | (0<<4) | (9+1)), ((18<<10) | (0<<4) | (9+1)), ((-18<<10) | (0<<4) | (9+1)), ((-18<<10) | (0<<4) | (9+1)), ((-18<<10) | (0<<4) | (9+1)), ((-18<<10) | (0<<4) | (9+1)), ((-18<<10) | (0<<4) | (9+1)), ((-18<<10) | (0<<4) | (9+1)), ((-18<<10) | (0<<4) | (9+1)), ((-18<<10) | (0<<4) | (9+1)), ((19<<10) | (0<<4) | (9+1)), ((19<<10) | (0<<4) | (9+1)), ((19<<10) | (0<<4) | (9+1)), ((19<<10) | (0<<4) | (9+1)), ((19<<10) | (0<<4) | (9+1)), ((19<<10) | (0<<4) | (9+1)), ((19<<10) | (0<<4) | (9+1)), ((19<<10) | (0<<4) | (9+1)), ((-19<<10) | (0<<4) | (9+1)), ((-19<<10) | (0<<4) | (9+1)), ((-19<<10) | (0<<4) | (9+1)), ((-19<<10) | (0<<4) | (9+1)), ((-19<<10) | (0<<4) | (9+1)), ((-19<<10) | (0<<4) | (9+1)), ((-19<<10) | (0<<4) | (9+1)), ((-19<<10) | (0<<4) | (9+1)), ((20<<10) | (0<<4) | (9+1)), ((20<<10) | (0<<4) | (9+1)), ((20<<10) | (0<<4) | (9+1)), ((20<<10) | (0<<4) | (9+1)), ((20<<10) | (0<<4) | (9+1)), ((20<<10) | (0<<4) | (9+1)), ((20<<10) | (0<<4) | (9+1)), ((20<<10) | (0<<4) | (9+1)), ((-20<<10) | (0<<4) | (9+1)), ((-20<<10) | (0<<4) | (9+1)), ((-20<<10) | (0<<4) | (9+1)), ((-20<<10) | (0<<4) | (9+1)), ((-20<<10) | (0<<4) | (9+1)), ((-20<<10) | (0<<4) | (9+1)), ((-20<<10) | (0<<4) | (9+1)), ((-20<<10) | (0<<4) | (9+1)), ((21<<10) | (0<<4) | (9+1)), ((21<<10) | (0<<4) | (9+1)), ((21<<10) | (0<<4) | (9+1)), ((21<<10) | (0<<4) | (9+1)), ((21<<10) | (0<<4) | (9+1)), ((21<<10) | (0<<4) | (9+1)), ((21<<10) | (0<<4) | (9+1)), ((21<<10) | (0<<4) | (9+1)), ((-21<<10) | (0<<4) | (9+1)), ((-21<<10) | (0<<4) | (9+1)), ((-21<<10) | (0<<4) | (9+1)), ((-21<<10) | (0<<4) | (9+1)), ((-21<<10) | (0<<4) | (9+1)), ((-21<<10) | (0<<4) | (9+1)), ((-21<<10) | (0<<4) | (9+1)), ((-21<<10) | (0<<4) | (9+1)), ((22<<10) | (0<<4) | (9+1)), ((22<<10) | (0<<4) | (9+1)), ((22<<10) | (0<<4) | (9+1)), ((22<<10) | (0<<4) | (9+1)), ((22<<10) | (0<<4) | (9+1)), ((22<<10) | (0<<4) | (9+1)), ((22<<10) | (0<<4) | (9+1)), ((22<<10) | (0<<4) | (9+1)), ((-22<<10) | (0<<4) | (9+1)), ((-22<<10) | (0<<4) | (9+1)), ((-22<<10) | (0<<4) | (9+1)), ((-22<<10) | (0<<4) | (9+1)), ((-22<<10) | (0<<4) | (9+1)), ((-22<<10) | (0<<4) | (9+1)), ((-22<<10) | (0<<4) | (9+1)), ((-22<<10) | (0<<4) | (9+1)), ((3<<10) | (5<<4) | (10+1)), ((3<<10) | (5<<4) | (10+1)), ((3<<10) | (5<<4) | (10+1)), ((3<<10) | (5<<4) | (10+1)), ((-3<<10) | (5<<4) | (10+1)), ((-3<<10) | (5<<4) | (10+1)), ((-3<<10) | (5<<4) | (10+1)), ((-3<<10) | (5<<4) | (10+1)), ((4<<10) | (3<<4) | (10+1)), ((4<<10) | (3<<4) | (10+1)), ((4<<10) | (3<<4) | (10+1)), ((4<<10) | (3<<4) | (10+1)), ((-4<<10) | (3<<4) | (10+1)), ((-4<<10) | (3<<4) | (10+1)), ((-4<<10) | (3<<4) | (10+1)), ((-4<<10) | (3<<4) | (10+1)), ((5<<10) | (3<<4) | (10+1)), ((5<<10) | (3<<4) | (10+1)), ((5<<10) | (3<<4) | (10+1)), ((5<<10) | (3<<4) | (10+1)), ((-5<<10) | (3<<4) | (10+1)), ((-5<<10) | (3<<4) | (10+1)), ((-5<<10) | (3<<4) | (10+1)), ((-5<<10) | (3<<4) | (10+1)), ((6<<10) | (2<<4) | (10+1)), ((6<<10) | (2<<4) | (10+1)), ((6<<10) | (2<<4) | (10+1)), ((6<<10) | (2<<4) | (10+1)), ((-6<<10) | (2<<4) | (10+1)), ((-6<<10) | (2<<4) | (10+1)), ((-6<<10) | (2<<4) | (10+1)), ((-6<<10) | (2<<4) | (10+1)), ((9<<10) | (1<<4) | (10+1)), ((9<<10) | (1<<4) | (10+1)), ((9<<10) | (1<<4) | (10+1)), ((9<<10) | (1<<4) | (10+1)), ((-9<<10) | (1<<4) | (10+1)), ((-9<<10) | (1<<4) | (10+1)), ((-9<<10) | (1<<4) | (10+1)), ((-9<<10) | (1<<4) | (10+1)), ((10<<10) | (1<<4) | (10+1)), ((10<<10) | (1<<4) | (10+1)), ((10<<10) | (1<<4) | (10+1)), ((10<<10) | (1<<4) | (10+1)), ((-10<<10) | (1<<4) | (10+1)), ((-10<<10) | (1<<4) | (10+1)), ((-10<<10) | (1<<4) | (10+1)), ((-10<<10) | (1<<4) | (10+1)), ((11<<10) | (1<<4) | (10+1)), ((11<<10) | (1<<4) | (10+1)), ((11<<10) | (1<<4) | (10+1)), ((11<<10) | (1<<4) | (10+1)), ((-11<<10) | (1<<4) | (10+1)), ((-11<<10) | (1<<4) | (10+1)), ((-11<<10) | (1<<4) | (10+1)), ((-11<<10) | (1<<4) | (10+1)), ((0<<10) | (0<<4) | (11)), ((0<<10) | (0<<4) | (11)), ((0<<10) | (0<<4) | (11)), ((0<<10) | (0<<4) | (11)), ((0<<10) | (1<<4) | (11)), ((0<<10) | (1<<4) | (11)), ((0<<10) | (1<<4) | (11)), ((0<<10) | (1<<4) | (11)), ((3<<10) | (6<<4) | (11+1)), ((3<<10) | (6<<4) | (11+1)), ((-3<<10) | (6<<4) | (11+1)), ((-3<<10) | (6<<4) | (11+1)), ((4<<10) | (4<<4) | (11+1)), ((4<<10) | (4<<4) | (11+1)), ((-4<<10) | (4<<4) | (11+1)), ((-4<<10) | (4<<4) | (11+1)), ((6<<10) | (3<<4) | (11+1)), ((6<<10) | (3<<4) | (11+1)), ((-6<<10) | (3<<4) | (11+1)), ((-6<<10) | (3<<4) | (11+1)), ((12<<10) | (1<<4) | (11+1)), ((12<<10) | (1<<4) | (11+1)), ((-12<<10) | (1<<4) | (11+1)), ((-12<<10) | (1<<4) | (11+1)), ((13<<10) | (1<<4) | (11+1)), ((13<<10) | (1<<4) | (11+1)), ((-13<<10) | (1<<4) | (11+1)), ((-13<<10) | (1<<4) | (11+1)), ((14<<10) | (1<<4) | (11+1)), ((14<<10) | (1<<4) | (11+1)), ((-14<<10) | (1<<4) | (11+1)), ((-14<<10) | (1<<4) | (11+1)), ((0<<10) | (2<<4) | (12)), ((0<<10) | (2<<4) | (12)), ((0<<10) | (3<<4) | (12)), ((0<<10) | (3<<4) | (12)), ((0<<10) | (4<<4) | (12)), ((0<<10) | (4<<4) | (12)), ((0<<10) | (5<<4) | (12)), ((0<<10) | (5<<4) | (12)), ((2<<10) | (7<<4) | (12+1)), ((-2<<10) | (7<<4) | (12+1)), ((2<<10) | (8<<4) | (12+1)), ((-2<<10) | (8<<4) | (12+1)), ((2<<10) | (9<<4) | (12+1)), ((-2<<10) | (9<<4) | (12+1)), ((2<<10) | (10<<4) | (12+1)), ((-2<<10) | (10<<4) | (12+1)), ((3<<10) | (7<<4) | (12+1)), ((-3<<10) | (7<<4) | (12+1)), ((3<<10) | (8<<4) | (12+1)), ((-3<<10) | (8<<4) | (12+1)), ((5<<10) | (4<<4) | (12+1)), ((-5<<10) | (4<<4) | (12+1)), ((7<<10) | (3<<4) | (12+1)), ((-7<<10) | (3<<4) | (12+1)), ((7<<10) | (2<<4) | (12+1)), ((-7<<10) | (2<<4) | (12+1)), ((8<<10) | (2<<4) | (12+1)), ((-8<<10) | (2<<4) | (12+1)), ((9<<10) | (2<<4) | (12+1)), ((-9<<10) | (2<<4) | (12+1)), ((10<<10) | (2<<4) | (12+1)), ((-10<<10) | (2<<4) | (12+1)), ((11<<10) | (2<<4) | (12+1)), ((-11<<10) | (2<<4) | (12+1)), ((15<<10) | (1<<4) | (12+1)), ((-15<<10) | (1<<4) | (12+1)), ((16<<10) | (1<<4) | (12+1)), ((-16<<10) | (1<<4) | (12+1)), ((17<<10) | (1<<4) | (12+1)), ((-17<<10) | (1<<4) | (12+1)), ((0<<10) | (0<<4) | (13)), ((0<<10) | (1<<4) | (13)), ((0<<10) | (2<<4) | (13)), ((0<<10) | (3<<4) | (13)), ((0<<10) | (4<<4) | (13)), ((0<<10) | (5<<4) | (13)), ((0<<10) | (6<<4) | (13)), ((0<<10) | (7<<4) | (13)), ((0<<10) | (8<<4) | (13)), ((0<<10) | (9<<4) | (13)), ((0<<10) | (10<<4) | (13)), ((0<<10) | (11<<4) | (13)), ((0<<10) | (12<<4) | (13)), ((0<<10) | (13<<4) | (13)), ((0<<10) | (14<<4) | (13)), ((0<<10) | (15<<4) | (13)), ((0<<10) | (16<<4) | (13)), ((0<<10) | (17<<4) | (13)), ((0<<10) | (18<<4) | (13)), ((0<<10) | (19<<4) | (13)), ((0<<10) | (20<<4) | (13)), ((0<<10) | (21<<4) | (13)), ((0<<10) | (22<<4) | (13)), ((0<<10) | (23<<4) | (13)), ((0<<10) | (24<<4) | (13)), ((0<<10) | (25<<4) | (13)), ((0<<10) | (26<<4) | (13)), ((0<<10) | (27<<4) | (13)), ((0<<10) | (28<<4) | (13)), ((0<<10) | (29<<4) | (13)), ((0<<10) | (30<<4) | (13)), ((0<<10) | (31<<4) | (13)), ((0<<10) | (32<<4) | (13)), ((0<<10) | (33<<4) | (13)), ((0<<10) | (34<<4) | (13)), ((0<<10) | (35<<4) | (13)), ((0<<10) | (36<<4) | (13)), ((0<<10) | (37<<4) | (13)), ((0<<10) | (38<<4) | (13)), ((0<<10) | (39<<4) | (13)), ((0<<10) | (40<<4) | (13)), ((0<<10) | (41<<4) | (13)), ((0<<10) | (42<<4) | (13)), ((0<<10) | (43<<4) | (13)), ((0<<10) | (44<<4) | (13)), ((0<<10) | (45<<4) | (13)), ((0<<10) | (46<<4) | (13)), ((0<<10) | (47<<4) | (13)), ((0<<10) | (48<<4) | (13)), ((0<<10) | (49<<4) | (13)), ((0<<10) | (50<<4) | (13)), ((0<<10) | (51<<4) | (13)), ((0<<10) | (52<<4) | (13)), ((0<<10) | (53<<4) | (13)), ((0<<10) | (54<<4) | (13)), ((0<<10) | (55<<4) | (13)), ((0<<10) | (56<<4) | (13)), ((0<<10) | (57<<4) | (13)), ((0<<10) | (58<<4) | (13)), ((0<<10) | (59<<4) | (13)), ((0<<10) | (60<<4) | (13)), ((0<<10) | (61<<4) | (13)), ((0<<10) | (62<<4) | (13)), ((0<<10) | (63<<4) | (13)), }; void ParseVideoSegment (CodedVideoSegmentRecord *codedDataPtr, DecodedVideoSegmentRecordPtr decodedVideoSegmentPtr, DctModeCacheEntry dctModeCache[2]) { int ixMacroBlock, ixBlock; unsigned int difBlockIDBytes; unsigned int data; int dcValue; int macroBlockQNoValue; DIFBlock* difBlockPtr; DecodedMBSegmentRecord* decodedMBSegmentRecordPtr; unsigned char* compressedDataPtr; CoefficientRecordPtr coefPtr; int lastPass; BitStream dctBlockState[5*6]; BitStream* dctBlockPtr; unsigned short* bufferCurrentPtr; unsigned int currentBits; int currentBitOffset; int bitsLeft; int componentSize; BitStreamLinkStruct bitStreamLink; int pass; int currentBitStreamIndex; int nextBitStreamIndex; int spillTailIndex; int spillLimitIndex; int segSpillTailIndex; short const* vlcLookupTable1 = VLCLookupTable; short const* vlcLookupTable2 = vlcLookupTable1 + (0x01E0); unsigned short quantizationShiftList; unsigned char const* zigZagToDirectArray; unsigned short const* weightArray; unsigned int index; short codedValue; int amplitude; unsigned int runLength, flushBits; int area; int quantizationShift; int zigzagNonZeroDCTCoefficientPosition; int positionOfNonZeroDCTCoefficient; int weight; int weightedAmplitude; int tmp; int maxCoefficientToParse; unsigned int incompleteList; int dctModeTag; int STA_or; difBlockPtr = codedDataPtr->videoDIFBlock; decodedMBSegmentRecordPtr = decodedVideoSegmentPtr->decMBSeg; STA_or = 0; for( ixMacroBlock=0; ixMacroBlock<5; ixMacroBlock++){ difBlockIDBytes = difBlockPtr->u.videoBlk.STAQNOValue; macroBlockQNoValue = (difBlockIDBytes) & 0x0F; STA_or |= difBlockIDBytes; compressedDataPtr = difBlockPtr->u.videoBlk.y0; dctBlockPtr = &dctBlockState[ixMacroBlock*6]; coefPtr = decodedMBSegmentRecordPtr->videoSeg; componentSize = 14; for(ixBlock=0; ixBlock<=5; ixBlock++){ if (ixBlock == (3 +1)) componentSize = 10; bufferCurrentPtr = ((unsigned short*)((compressedDataPtr))); currentBits = (*bufferCurrentPtr); currentBitOffset = 0; bufferCurrentPtr++; currentBits = (currentBits << 16) | (*bufferCurrentPtr); bitsLeft = componentSize*8; { data=(( currentBits) << (( currentBitOffset)))>>(32-12); ( currentBitOffset)+=12; ( bitsLeft)-=12; }; dctBlockPtr->bufferCurrentPtr = bufferCurrentPtr; dctBlockPtr->currentBits = currentBits; dctBlockPtr->currentBitOffset = currentBitOffset; dctBlockPtr->bitsLeft = bitsLeft; coefPtr->coefIndex = 1; coefPtr->dctMode = (data>>2) & 0x01; coefPtr->quantizationShiftList = QuantClassToShiftList[macroBlockQNoValue][data & 0x03]; for (zigzagNonZeroDCTCoefficientPosition = 0; zigzagNonZeroDCTCoefficientPosition < (sizeof(coefPtr->u.coefArray)/8); zigzagNonZeroDCTCoefficientPosition++) { *(((double *) coefPtr->u.coefArray)+zigzagNonZeroDCTCoefficientPosition) = +0.0; } dcValue = (( ((int)((data & (0x1FF<<3)))) << 20) >> (20 + 3 - (6 -1))); coefPtr->u.coefArray[0] = dcValue; compressedDataPtr += componentSize; dctBlockPtr++; coefPtr++; } difBlockPtr++; decodedMBSegmentRecordPtr++; } for(ixBlock=0; ixBlock<=(((6*5)+1)/4); ixBlock++){ bitStreamLink.u.Init[ixBlock] = ((6*5)<<24) | ((6*5)<<16) | ((6*5)<<8) | ((6*5)<<0); } lastPass = dctModeCache[0].lastPass; if ( (STA_or & (0x9<<4)) != 0) lastPass =1; dctModeTag = 2; nextBitStreamIndex = (6*5); spillTailIndex = (6*5); spillLimitIndex = (6*5); segSpillTailIndex = ((6*5)+1); incompleteList = (1<<(5*6)) - 1; for (pass = 1; (pass <= lastPass) && (incompleteList != 0); pass++) { decodedMBSegmentRecordPtr = decodedVideoSegmentPtr->decMBSeg; if (pass > 2) { bitStreamLink.u.Link[segSpillTailIndex] = (6*5); nextBitStreamIndex = bitStreamLink.u.Link[((6*5)+1)]; spillLimitIndex = (6*5); } for( ixMacroBlock=0; ixMacroBlock<5; ixMacroBlock++){ coefPtr = decodedMBSegmentRecordPtr->videoSeg; currentBitStreamIndex = ixMacroBlock*6; if (pass == 2) { nextBitStreamIndex = bitStreamLink.u.Link[bitStreamLink.u.Link[((6*5)+1)+ixMacroBlock]]; spillTailIndex = bitStreamLink.u.Link[((6*5)+1)+ixMacroBlock+1]; spillLimitIndex = currentBitStreamIndex+6; } if ( ((incompleteList >> currentBitStreamIndex) & ((1<<6)-1) ) != 0) { for(ixBlock=0; ixBlock<=5; ixBlock++){ if( ((incompleteList >> currentBitStreamIndex) & 1) != 0){ if(coefPtr->dctMode != dctModeTag){ dctModeTag = coefPtr->dctMode; zigZagToDirectArray = dctModeCache[dctModeTag].zigZagToDirectArray; weightArray = dctModeCache[dctModeTag].weightArray; maxCoefficientToParse = dctModeCache[dctModeTag].maxCoefficientToParse; } quantizationShiftList = coefPtr->quantizationShiftList; zigzagNonZeroDCTCoefficientPosition = coefPtr->coefIndex; dctBlockPtr = &dctBlockState[currentBitStreamIndex]; bufferCurrentPtr = dctBlockPtr->bufferCurrentPtr; currentBits = dctBlockPtr->currentBits; currentBitOffset = dctBlockPtr->currentBitOffset; bitsLeft = dctBlockPtr->bitsLeft; if (nextBitStreamIndex < spillLimitIndex) concatenateBitStreams: { unsigned int prependData; int prependSize; prependData = (currentBits << currentBitOffset) >> (32-bitsLeft); prependSize = bitsLeft; bufferCurrentPtr = dctBlockState[nextBitStreamIndex].bufferCurrentPtr; currentBits = dctBlockState[nextBitStreamIndex].currentBits; currentBitOffset = dctBlockState[nextBitStreamIndex].currentBitOffset; bitsLeft = dctBlockState[nextBitStreamIndex].bitsLeft; if (currentBitOffset < prependSize) { currentBits >>= 16; currentBitOffset += 16; bufferCurrentPtr -= 1; } currentBits <<= currentBitOffset; currentBits >>= currentBitOffset; currentBits |= (prependData << (32-currentBitOffset)); currentBitOffset -= prependSize; bitsLeft += prependSize; nextBitStreamIndex = bitStreamLink.u.Link[nextBitStreamIndex]; { if (( currentBitOffset) > 16) { ( bufferCurrentPtr)++; ( currentBits) = (( currentBits) << 16) | (*( bufferCurrentPtr)); ( currentBitOffset) -= 16; } }; } do { { index=(( currentBits) << (( currentBitOffset))); }; if(index<0xF0000000){ index >>= (32-(8+1)); codedValue = vlcLookupTable1[index]; amplitude =((short)(codedValue))>>10; runLength =(codedValue>>4)&0x3F; flushBits =codedValue&0x0F; }else if(index<0xFE000000){ index = (index&0x0FF80000) >> (32-(12+1)); codedValue = vlcLookupTable2[index]; amplitude =((short)(codedValue))>>10; runLength =(codedValue>>4)&0x3F; flushBits =codedValue&0x0F; }else{ amplitude = (index>>17) & 0xFF; index = (index>>16) & 0x01; amplitude = (amplitude ^ -(index)) + (index); runLength = 0; flushBits = 15+1; } if( flushBits > bitsLeft){ if (nextBitStreamIndex < spillLimitIndex) goto concatenateBitStreams; else goto bitStreamEmpty; } { ( currentBitOffset)+=flushBits; ( bitsLeft)-=flushBits; }; zigzagNonZeroDCTCoefficientPosition += runLength; if( zigzagNonZeroDCTCoefficientPosition > maxCoefficientToParse){ zigzagNonZeroDCTCoefficientPosition -= runLength; goto endOfBlockFound; } positionOfNonZeroDCTCoefficient = zigZagToDirectArray[zigzagNonZeroDCTCoefficientPosition]; area = (positionOfNonZeroDCTCoefficient >> (6-2)) & (3<<2); positionOfNonZeroDCTCoefficient &= 0x3F; weight = weightArray[positionOfNonZeroDCTCoefficient]; weightedAmplitude = amplitude * weight; quantizationShift = (quantizationShiftList >> area) & 0x0F; zigzagNonZeroDCTCoefficientPosition += 1; tmp= ((weightedAmplitude) >> (quantizationShift)); tmp= (tmp+1)>>1; coefPtr->u.coefArray[positionOfNonZeroDCTCoefficient] = tmp; { if (( currentBitOffset) > 16) { ( bufferCurrentPtr)++; ( currentBits) = (( currentBits) << 16) | (*( bufferCurrentPtr)); ( currentBitOffset) -= 16; } }; } while(1); endOfBlockFound: if (pass < 2) { bitStreamLink.u.Link[spillTailIndex] = currentBitStreamIndex; spillTailIndex = currentBitStreamIndex; } else { bitStreamLink.u.Link[currentBitStreamIndex] = nextBitStreamIndex; if (nextBitStreamIndex >= spillLimitIndex) spillTailIndex = currentBitStreamIndex; nextBitStreamIndex = currentBitStreamIndex; } incompleteList &= ~(1<bufferCurrentPtr = bufferCurrentPtr; dctBlockPtr->currentBits = currentBits; dctBlockPtr->currentBitOffset = currentBitOffset; dctBlockPtr->bitsLeft = bitsLeft; coefPtr->coefIndex = zigzagNonZeroDCTCoefficientPosition; if( ((incompleteList >> currentBitStreamIndex) & 1) != 0){ if (pass >= 2) { goto doneLoopingOverBlocksInThisMacroBlock; } } } coefPtr++; currentBitStreamIndex++; } } if (pass == 2) { if (spillTailIndex < spillLimitIndex) { bitStreamLink.u.Link[segSpillTailIndex] = nextBitStreamIndex; segSpillTailIndex = spillTailIndex; } } doneLoopingOverBlocksInThisMacroBlock: decodedMBSegmentRecordPtr++; if (pass < 2) bitStreamLink.u.Link[((6*5)+1)+ixMacroBlock+1] = spillTailIndex; } } return; } static unsigned char const sgkZigZagToDirectAreaArray[2][64]= { ((0*8+0)+(0<<6)), ((0*8+1)+(0<<6)), ((1*8+0)+(0<<6)), ((2*8+0)+(0<<6)), ((1*8+1)+(0<<6)), ((0*8+2)+(0<<6)), ((0*8+3)+(1<<6)), ((1*8+2)+(1<<6)), ((2*8+1)+(1<<6)), ((3*8+0)+(1<<6)), ((4*8+0)+(1<<6)), ((3*8+1)+(1<<6)), ((2*8+2)+(1<<6)), ((1*8+3)+(1<<6)), ((0*8+4)+(1<<6)), ((0*8+5)+(1<<6)), ((1*8+4)+(1<<6)), ((2*8+3)+(1<<6)), ((3*8+2)+(1<<6)), ((4*8+1)+(1<<6)), ((5*8+0)+(1<<6)), ((6*8+0)+(2<<6)), ((5*8+1)+(2<<6)), ((4*8+2)+(2<<6)), ((3*8+3)+(2<<6)), ((2*8+4)+(2<<6)), ((1*8+5)+(2<<6)), ((0*8+6)+(2<<6)), ((0*8+7)+(2<<6)), ((1*8+6)+(2<<6)), ((2*8+5)+(2<<6)), ((3*8+4)+(2<<6)), ((4*8+3)+(2<<6)), ((5*8+2)+(2<<6)), ((6*8+1)+(2<<6)), ((7*8+0)+(2<<6)), ((7*8+1)+(2<<6)), ((6*8+2)+(2<<6)), ((5*8+3)+(2<<6)), ((4*8+4)+(2<<6)), ((3*8+5)+(2<<6)), ((2*8+6)+(2<<6)), ((1*8+7)+(2<<6)), ((2*8+7)+(3<<6)), ((3*8+6)+(3<<6)), ((4*8+5)+(3<<6)), ((5*8+4)+(3<<6)), ((6*8+3)+(3<<6)), ((7*8+2)+(3<<6)), ((7*8+3)+(3<<6)), ((6*8+4)+(3<<6)), ((5*8+5)+(3<<6)), ((4*8+6)+(3<<6)), ((3*8+7)+(3<<6)), ((4*8+7)+(3<<6)), ((5*8+6)+(3<<6)), ((6*8+5)+(3<<6)), ((7*8+4)+(3<<6)), ((7*8+5)+(3<<6)), ((6*8+6)+(3<<6)), ((5*8+7)+(3<<6)), ((6*8+7)+(3<<6)), ((7*8+6)+(3<<6)), ((7*8+7)+(3<<6)), ((0*8+0)+(0<<6)), ((4*8+0)+(0<<6)), ((0*8+1)+(0<<6)), ((4*8+1)+(0<<6)), ((1*8+0)+(0<<6)), ((5*8+0)+(0<<6)), ((0*8+2)+(1<<6)), ((4*8+2)+(1<<6)), ((1*8+1)+(1<<6)), ((5*8+1)+(1<<6)), ((2*8+0)+(1<<6)), ((6*8+0)+(1<<6)), ((3*8+0)+(1<<6)), ((7*8+0)+(1<<6)), ((2*8+1)+(1<<6)), ((6*8+1)+(1<<6)), ((1*8+2)+(1<<6)), ((5*8+2)+(1<<6)), ((0*8+3)+(1<<6)), ((4*8+3)+(1<<6)), ((0*8+4)+(1<<6)), ((4*8+4)+(2<<6)), ((1*8+3)+(2<<6)), ((5*8+3)+(2<<6)), ((2*8+2)+(2<<6)), ((6*8+2)+(2<<6)), ((3*8+1)+(2<<6)), ((7*8+1)+(2<<6)), ((3*8+2)+(2<<6)), ((7*8+2)+(2<<6)), ((2*8+3)+(2<<6)), ((6*8+3)+(2<<6)), ((1*8+4)+(2<<6)), ((5*8+4)+(2<<6)), ((0*8+5)+(2<<6)), ((4*8+5)+(2<<6)), ((0*8+6)+(2<<6)), ((4*8+6)+(2<<6)), ((1*8+5)+(2<<6)), ((5*8+5)+(2<<6)), ((2*8+4)+(2<<6)), ((6*8+4)+(2<<6)), ((3*8+3)+(2<<6)), ((7*8+3)+(3<<6)), ((3*8+4)+(3<<6)), ((7*8+4)+(3<<6)), ((2*8+5)+(3<<6)), ((6*8+5)+(3<<6)), ((1*8+6)+(3<<6)), ((5*8+6)+(3<<6)), ((0*8+7)+(3<<6)), ((4*8+7)+(3<<6)), ((1*8+7)+(3<<6)), ((5*8+7)+(3<<6)), ((2*8+6)+(3<<6)), ((6*8+6)+(3<<6)), ((3*8+5)+(3<<6)), ((7*8+5)+(3<<6)), ((3*8+6)+(3<<6)), ((7*8+6)+(3<<6)), ((2*8+7)+(3<<6)), ((6*8+7)+(3<<6)), ((3*8+7)+(3<<6)), ((7*8+7)+(3<<6)), }; static unsigned short const sgkWeight8x8Array[64] = { ((int) ((0.50000000)*(1<<15)+0.5)), ((int) ((0.35355339)*(1<<15)+0.5)), ((int) ((0.35355339)*(1<<15)+0.5)), ((int) ((0.32664074)*(1<<15)+0.5)), ((int) ((0.28571429)*(1<<15)+0.5)), ((int) ((0.34567086)*(1<<15)+0.5)), ((int) ((0.42677670)*(1<<15)+0.5)), ((int) ((0.48096988)*(1<<15)+0.5)), ((int) ((0.35355339)*(1<<15)+0.5)), ((int) ((0.50000000)*(1<<15)+0.5)), ((int) ((0.50000000)*(1<<15)+0.5)), ((int) ((0.46193977)*(1<<15)+0.5)), ((int) ((0.40406102)*(1<<15)+0.5)), ((int) ((0.48885242)*(1<<15)+0.5)), ((int) ((0.60355339)*(1<<15)+0.5)), ((int) ((0.68019413)*(1<<15)+0.5)), ((int) ((0.35355339)*(1<<15)+0.5)), ((int) ((0.50000000)*(1<<15)+0.5)), ((int) ((0.50000000)*(1<<15)+0.5)), ((int) ((0.46193977)*(1<<15)+0.5)), ((int) ((0.40406102)*(1<<15)+0.5)), ((int) ((0.48885242)*(1<<15)+0.5)), ((int) ((0.60355339)*(1<<15)+0.5)), ((int) ((0.68019413)*(1<<15)+0.5)), ((int) ((0.32664074)*(1<<15)+0.5)), ((int) ((0.46193977)*(1<<15)+0.5)), ((int) ((0.46193977)*(1<<15)+0.5)), ((int) ((0.42677670)*(1<<15)+0.5)), ((int) ((0.37330370)*(1<<15)+0.5)), ((int) ((0.45164074)*(1<<15)+0.5)), ((int) ((0.55761062)*(1<<15)+0.5)), ((int) ((0.62841744)*(1<<15)+0.5)), ((int) ((0.28571429)*(1<<15)+0.5)), ((int) ((0.40406102)*(1<<15)+0.5)), ((int) ((0.40406102)*(1<<15)+0.5)), ((int) ((0.37330370)*(1<<15)+0.5)), ((int) ((0.32653061)*(1<<15)+0.5)), ((int) ((0.39505241)*(1<<15)+0.5)), ((int) ((0.48774479)*(1<<15)+0.5)), ((int) ((0.54967987)*(1<<15)+0.5)), ((int) ((0.34567086)*(1<<15)+0.5)), ((int) ((0.48885242)*(1<<15)+0.5)), ((int) ((0.48885242)*(1<<15)+0.5)), ((int) ((0.45164074)*(1<<15)+0.5)), ((int) ((0.39505241)*(1<<15)+0.5)), ((int) ((0.47795337)*(1<<15)+0.5)), ((int) ((0.59009707)*(1<<15)+0.5)), ((int) ((0.66502909)*(1<<15)+0.5)), ((int) ((0.42677670)*(1<<15)+0.5)), ((int) ((0.60355339)*(1<<15)+0.5)), ((int) ((0.60355339)*(1<<15)+0.5)), ((int) ((0.55761062)*(1<<15)+0.5)), ((int) ((0.48774479)*(1<<15)+0.5)), ((int) ((0.59009707)*(1<<15)+0.5)), ((int) ((0.72855339)*(1<<15)+0.5)), ((int) ((0.82106695)*(1<<15)+0.5)), ((int) ((0.48096988)*(1<<15)+0.5)), ((int) ((0.68019413)*(1<<15)+0.5)), ((int) ((0.68019413)*(1<<15)+0.5)), ((int) ((0.62841744)*(1<<15)+0.5)), ((int) ((0.54967987)*(1<<15)+0.5)), ((int) ((0.66502909)*(1<<15)+0.5)), ((int) ((0.82106695)*(1<<15)+0.5)), ((int) ((0.92532811)*(1<<15)+0.5)), }; static unsigned short const sgkWeight2x4x8Array[64]= { ((int) ((0.50000000)*(1<<15)+0.5)), ((int) ((0.35355339)*(1<<15)+0.5)), ((int) ((0.35355339)*(1<<15)+0.5)), ((int) ((0.32664074)*(1<<15)+0.5)), ((int) ((0.28571429)*(1<<15)+0.5)), ((int) ((0.34567086)*(1<<15)+0.5)), ((int) ((0.42677670)*(1<<15)+0.5)), ((int) ((0.48096988)*(1<<15)+0.5)), ((int) ((0.35355339)*(1<<15)+0.5)), ((int) ((0.50000000)*(1<<15)+0.5)), ((int) ((0.50000000)*(1<<15)+0.5)), ((int) ((0.46193977)*(1<<15)+0.5)), ((int) ((0.40406102)*(1<<15)+0.5)), ((int) ((0.48885242)*(1<<15)+0.5)), ((int) ((0.60355339)*(1<<15)+0.5)), ((int) ((0.68019413)*(1<<15)+0.5)), ((int) ((0.28571429)*(1<<15)+0.5)), ((int) ((0.40406102)*(1<<15)+0.5)), ((int) ((0.40406102)*(1<<15)+0.5)), ((int) ((0.37330370)*(1<<15)+0.5)), ((int) ((0.32653061)*(1<<15)+0.5)), ((int) ((0.39505241)*(1<<15)+0.5)), ((int) ((0.48774479)*(1<<15)+0.5)), ((int) ((0.54967987)*(1<<15)+0.5)), ((int) ((0.17677670)*(1<<15)+0.5)), ((int) ((0.25000000)*(1<<15)+0.5)), ((int) ((0.25000000)*(1<<15)+0.5)), ((int) ((0.23096988)*(1<<15)+0.5)), ((int) ((0.20203051)*(1<<15)+0.5)), ((int) ((0.24442621)*(1<<15)+0.5)), ((int) ((0.30177670)*(1<<15)+0.5)), ((int) ((0.34009707)*(1<<15)+0.5)), ((int) ((0.25000000)*(1<<15)+0.5)), ((int) ((0.35355339)*(1<<15)+0.5)), ((int) ((0.35355339)*(1<<15)+0.5)), ((int) ((0.32664074)*(1<<15)+0.5)), ((int) ((0.28571429)*(1<<15)+0.5)), ((int) ((0.34567086)*(1<<15)+0.5)), ((int) ((0.42677670)*(1<<15)+0.5)), ((int) ((0.48096988)*(1<<15)+0.5)), ((int) ((0.35355339)*(1<<15)+0.5)), ((int) ((0.50000000)*(1<<15)+0.5)), ((int) ((0.50000000)*(1<<15)+0.5)), ((int) ((0.46193977)*(1<<15)+0.5)), ((int) ((0.40406102)*(1<<15)+0.5)), ((int) ((0.48885242)*(1<<15)+0.5)), ((int) ((0.60355339)*(1<<15)+0.5)), ((int) ((0.68019413)*(1<<15)+0.5)), ((int) ((0.28571429)*(1<<15)+0.5)), ((int) ((0.40406102)*(1<<15)+0.5)), ((int) ((0.40406102)*(1<<15)+0.5)), ((int) ((0.37330370)*(1<<15)+0.5)), ((int) ((0.32653061)*(1<<15)+0.5)), ((int) ((0.39505241)*(1<<15)+0.5)), ((int) ((0.48774479)*(1<<15)+0.5)), ((int) ((0.54967987)*(1<<15)+0.5)), ((int) ((0.17677670)*(1<<15)+0.5)), ((int) ((0.25000000)*(1<<15)+0.5)), ((int) ((0.25000000)*(1<<15)+0.5)), ((int) ((0.23096988)*(1<<15)+0.5)), ((int) ((0.20203051)*(1<<15)+0.5)), ((int) ((0.24442621)*(1<<15)+0.5)), ((int) ((0.30177670)*(1<<15)+0.5)), ((int) ((0.34009707)*(1<<15)+0.5)), }; void InitDctModeCache (DctModeCacheEntry dctModeCache[2]) { dctModeCache[0].zigZagToDirectArray = sgkZigZagToDirectAreaArray[0]; dctModeCache[1].zigZagToDirectArray = sgkZigZagToDirectAreaArray[1]; dctModeCache[0].weightArray = sgkWeight8x8Array; dctModeCache[1].weightArray = sgkWeight2x4x8Array; dctModeCache[0].maxCoefficientToParse = (64 -1); dctModeCache[1].maxCoefficientToParse = (64 -1); dctModeCache[0].lastPass = 3; }