13#define M4_CLIP(X,A) (X > A) ? (A) : (X)
14#define M4_ABS(X) (((X)>0)?(X):-(X))
65 while((index = mBitstream->
show(9)) == 1)
70 mBitstream->
skip(
VLC_LEN(mVLCDecoder.mTabCbpCIntra[index]));
71 return VLC_CODE(mVLCDecoder.mTabCbpCIntra[index]);
77 while((index =
M4_CLIP(mBitstream->
show(9), 256)) == 1)
81 mBitstream->
skip(
VLC_LEN(mVLCDecoder.mTabCbpCInter[index]));
82 return VLC_CODE(mVLCDecoder.mTabCbpCInter[index]);
88 for(type = 0; type <= 3; type++)
111 mBitstream->
skip(
VLC_LEN(mVLCDecoder.mTabCbpY[index]));
125 return (
quant + 13) >> 1;
144 code = mBitstream->
show(11);
145 for (i = 11; i > 3; i--)
150 return (
int32)(i + 1);
154 mBitstream->
skip(
VLC_LEN(mVLCDecoder.mDCLumTab[code]));
155 return VLC_CODE(mVLCDecoder.mDCLumTab[code]);
159 code = mBitstream->
show(12);
160 for(i = 12; i > 2; i--)
178 return msb == 0 ? -1 * (code^((1<<
dc_size) - 1)) : code;
193 if ( !mBitstream->
getBit() )
197 else if (!mBitstream->
getBit() )
231 M4CHECK((
level >= -2047) && (
level <= 2047) &&
"getIntraBlock: intra_overflow!!");
232 M4CHECK(
run != -1 &&
"getIntraBlock: invalid run");
233 M4CHECK(
run >= 0 &&
"getIntraBlock: invalid run");
251 M4CHECK((
level >= -2047) && (
level <= 2047) &&
"getInterBlock: level overflow!!");
252 M4CHECK(
run != -1 &&
"getInterBlock: invalid run");
306 void readGMCSprite();
309 void decodeGMCSprite();
314 for(
uint32 i=0; i<64; ++i)
341 value = mBitstream->
getBits(8);
344 while(value != 0 && i < 64);
354 int32 getTrajaPoint();
364 index = mBitstream->
show(12);
368 index = (index >> 8) - 2;
369 mBitstream->
skip(
VLC_LEN(mVLCDecoder.mTabTMNMV0[index]));
375 index = (index >> 2) - 32;
376 mBitstream->
skip(
VLC_LEN(mVLCDecoder.mTabTMNMV1[index]));
381 mBitstream->
skip(
VLC_LEN(mVLCDecoder.mTabTMNMV2[index]));
441 uint8* mScanTable[3];
446 bool mLoadIntraQuant;
447 bool mLoadInterQuant;
449 uint8 mIntraMatrix[64];
450 uint8 mInterMatrix[64];
458 static uint8 mScanTableInput[3][64];
460 static const uint32 mIntraDCThresholdTable[8];
461 static const uint8 mDefaultIntraMatrix[64];
462 static const uint8 mDefaultInterMatrix[64];
487 return *mpCacheEntry;
GLenum GLuint GLint level
Definition AndroidOpenGLFunctions.h:46
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
void Init()
Definition LockFreeList.h:4
#define M4_ABS(X)
Definition M4BitstreamParser.h:14
#define M4_CLIP(X, A)
Definition M4BitstreamParser.h:13
#define VLC_LEN(a)
Definition M4VlcDecoder.h:16
#define VLC_CODE(a)
Definition M4VlcDecoder.h:13
Definition M4BitstreamParser.h:476
M4BitstreamCacheEntry & Alloc()
Definition M4BitstreamParser.h:484
~M4BitstreamCache()
Definition M4BitstreamParser.cpp:1424
M4BitstreamCache()
Definition M4BitstreamParser.cpp:1419
Definition M4BitstreamParser.h:39
~M4BitstreamParser()
Destructor.
Definition M4BitstreamParser.cpp:133
uint16 mVopTimeIncrementBits
Definition M4BitstreamParser.h:402
uint16 getDCScaler(uint8 quant, bool luminance)
Definition M4BitstreamParser.h:117
int32 getQuantiserChange()
Definition M4BitstreamParser.h:191
VIDError init(M4Decoder *decoder, M4Bitstream *bitstream)
Perform initialization of data structures.
Definition M4BitstreamParser.cpp:148
uint8 getMBType()
Definition M4BitstreamParser.h:85
uint64 mTime
Definition M4BitstreamParser.h:413
uint16 mFcodeForward
Definition M4BitstreamParser.h:396
M4_VECTOR mSpriteDelta[2]
Definition M4BitstreamParser.h:430
uint32 mIntraDCThreshold
Definition M4BitstreamParser.h:399
uint32 mVopTimeFixedIncrement
Definition M4BitstreamParser.h:404
int16 _free
Definition M4BitstreamParser.h:427
uint64 mTimePP
Definition M4BitstreamParser.h:416
int16 GetWidth() const
Definition M4BitstreamParser.h:282
uint64 mLastNonBTime
Definition M4BitstreamParser.h:414
VIDStreamEvents::VOLInfo mVOLInfo
Definition M4BitstreamParser.h:393
uint32 mResyncMacroblockNumber
Definition M4BitstreamParser.h:419
int32 getDCDiff(uint32 dc_size)
Definition M4BitstreamParser.h:173
uint32 getCbpy(bool intra)
Definition M4BitstreamParser.h:108
const VIDStreamEvents::VOLInfo & GetVOLInfo() const
Definition M4BitstreamParser.h:297
void decodeInterBlock(int16 *block)
Definition M4BitstreamParser.h:181
int16 mSpriteWarpingAccuracy
Definition M4BitstreamParser.h:426
M4BitstreamHeaderInfo mHeaderInfo
Definition M4BitstreamParser.h:392
bool mbVopTimeFixedRate
Definition M4BitstreamParser.h:405
uint32 mLastTimeBase
Definition M4BitstreamParser.h:410
VIDError parseMPEG4ES(M4PictureType &pictureType)
Parsing of full MPEG4-ES.
Definition M4BitstreamParser.cpp:436
int32 getMv(const uint16 code)
Definition M4BitstreamParser.h:261
uint16 mFcodeBackward
Definition M4BitstreamParser.h:397
uint16 mVopTimeIncrementResolution
Definition M4BitstreamParser.h:403
void getIntraBlockNoAsm(int16 *block, uint32 direction, uint32 startCoeff)
Definition M4BitstreamParser.h:223
int32 getDCSize(bool luminance)
Definition M4BitstreamParser.h:138
uint32 mSpriteUsage
Definition M4BitstreamParser.h:421
M4_VECTOR mSpriteShift
Definition M4BitstreamParser.h:431
double mTicksPerSecond
Definition M4BitstreamParser.h:407
uint64 mTimeBP
Definition M4BitstreamParser.h:417
VIDError reset()
Attach parser to new stream.
Definition M4BitstreamParser.cpp:181
uint16 mSpriteWarpingPoints
Definition M4BitstreamParser.h:423
M4BitstreamParser()
Default constructor.
Definition M4BitstreamParser.cpp:127
M4_VECTOR mSpriteOffset[2]
Definition M4BitstreamParser.h:429
void decodeIntraBlock(int16 *block, uint32 direction, uint32 startCoeff)
Definition M4BitstreamParser.h:186
int32 getCbpCIntra()
Definition M4BitstreamParser.h:62
uint32 mScalability
Definition M4BitstreamParser.h:400
void getInterBlockNoAsm(int16 *block)
Definition M4BitstreamParser.h:242
uint32 mTimeBase
Definition M4BitstreamParser.h:411
uint16 mSpriteWarpingPointsUsed
Definition M4BitstreamParser.h:424
double mVopTime
Definition M4BitstreamParser.h:408
VIDError findNextStartCode(uint32 &absolutePos)
Scan stream for next valid startcode.
VIDError videoPacketHeader()
Definition M4BitstreamParser.cpp:1116
void initFrame(int16 width, int16 height)
Handle change/update of frame parameters.
Definition M4BitstreamParser.cpp:236
double GetLastVopTime() const
Definition M4BitstreamParser.h:292
int16 GetHeight() const
Definition M4BitstreamParser.h:287
int32 getCbpCInter()
Definition M4BitstreamParser.h:74
uint16 mLowDelay
set to '1' indicates the VOL contains NO B-VOPs!
Definition M4BitstreamParser.h:395
Definition M4Bitstream.h:22
uint32 show(const uint32 bits)
Show indicated bit from stream without moving file position.
Definition M4Bitstream.h:279
uint32 getBits(const uint32 bits)
Return indicated # of bits from stream.
Definition M4Bitstream.h:451
uint32 getBit()
Return 1 bit from stream.
Definition M4Bitstream.h:463
void skip(const uint32 bits)
Skip indicated bits in stream.
Definition M4Bitstream.h:302
Definition M4Decoder.h:30
Definition M4VlcDecoder.h:36
int32 getCoeffInterNoAsm(int32 &run, int32 &last, M4Bitstream &bs)
Definition M4VlcDecoder.h:119
int32 getCoeffIntraNoAsm(int32 &run, int32 &last, M4Bitstream &bs)
Definition M4VlcDecoder.h:50
Definition M4Bitstream.h:9
M4PictureType
Picture type in input stream to decode.
Definition M4BitstreamParser.h:21
@ M4PIC_VOL
Definition M4BitstreamParser.h:26
@ M4PIC_B_VOP
Definition M4BitstreamParser.h:24
@ M4PIC_I_VOP
Definition M4BitstreamParser.h:22
@ M4PIC_P_VOP
Definition M4BitstreamParser.h:23
@ M4PIC_S_VOP
Definition M4BitstreamParser.h:25
int32 VIDError
Generic error type.
Definition vdecmpeg4_ErrorCodes.h:10
static UE_FORCEINLINE_HINT void * Memzero(void *Dest, SIZE_T Count)
Definition UnrealMemory.h:131
Information per macroblock filled-in by the bitstream parser.
Definition M4Global.h:54
int16 mDctFromBitstream[6 *64]
parsed idct coefficients from the bitstream (6 blocks (4:1:1) by 8x8 values)
Definition M4Global.h:57
Motion vector.
Definition M4Global.h:71
VideoObjectLayer.
Definition vdecmpeg4_Stream.h:63
int16 mWidth
Definition vdecmpeg4_Stream.h:64
int16 mHeight
Definition vdecmpeg4_Stream.h:65
#define M4CHECK
Definition vdecmpeg4_Types.h:8