UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
vdecmpeg4 Namespace Reference

Classes

struct  CLIPinitializer
 
struct  M4_MB
 
struct  M4_VECTOR
 Motion vector. More...
 
class  M4Bitstream
 
class  M4BitstreamCache
 
struct  M4BitstreamCacheEntry
 Information per macroblock filled-in by the bitstream parser. More...
 
struct  M4BitstreamHeaderInfo
 
class  M4BitstreamParser
 
struct  M4BlockVlcCodeTab
 helper struct for passing some C++ tables to the ASM routines. Must be initialized only once. More...
 
class  M4Decoder
 
class  M4Image
 
class  M4MemHandler
 
class  M4MotionVectorMgr
 
class  M4VlcDecoder
 
class  M4XCmdSingleThread
 
class  MemOpOffsets
 
struct  VIDDecoderSetup
 
struct  VIDImage
 
struct  VIDImageInfo
 Statistical information about decoded frame. This struct is returned via a call to VIDGetFrameInfo. More...
 
struct  VIDImageMacroblockInfo
 Statistical information about the possible mpeg block from which this frame is made. More...
 
class  VIDStreamEvents
 
class  VIDStreamIO
 
struct  VIDYUVTexture
 

Typedefs

typedef uint32 M4_VLC
 Definition of VLC data types.
 
typedef int32 VIDError
 Generic error type.
 
typedef void *(* VIDAllocator) (uint32 size, uint32 alignment)
 
typedef void(* VIDReporting) (const char *pMessage)
 
typedef void(* VIDDeallocator) (void *block)
 memory release callback
 
typedef voidVIDDecoder
 Opaque type of decoder to outside world. See VIDCreateDecoder to create a decoder.
 

Enumerations

enum  { M4_SHAPE_RECT = 0 , M4_SHAPE_BIN , M4_SHAPE_BIN_ONLY , M4_SHAPE_GRAY }
 Indicated video texture shape. More...
 
enum  { M4_SPRITE_STATIC = 1 , M4_SPRITE_GMC }
 Possible sprite types. More...
 
enum  M4PictureType {
  M4PIC_I_VOP = 0 , M4PIC_P_VOP , M4PIC_B_VOP , M4PIC_S_VOP ,
  M4PIC_VOL
}
 Picture type in input stream to decode. More...
 
enum  M4_MBMODE {
  M4_MBMODE_INTER = 0 , M4_MBMODE_INTER_Q = 1 , M4_MBMODE_INTER4V = 2 , M4_MBMODE_INTRA = 3 ,
  M4_MBMODE_INTRA_Q = 4 , M4_MBMODE_STUFFING = 7 , M4_MBMODE_NOT_CODED_PVOP = 16 , M4_MBMODE_NOT_CODED_SVOP = 17
}
 supported macroblock coding types More...
 
enum  M4_MBFLAGS {
  M4_MBFLAG_MVTYPE_DIRECT = 0 , M4_MBFLAG_MVTYPE_INTERPOLATE = 1 , M4_MBFLAG_MVTYPE_BACKWARD = 2 , M4_MBFLAG_MVTYPE_FORWARD = 3 ,
  M4_MBFLAG_MVTYPE_MASK = 0x03 , M4_MBFLAG_FIELD_DCT_BIT = 0x04 , M4_MBFLAG_FIELD_PREDICTION_BIT = 0x08 , M4_MBFLAG_FIELD_REF_FWD_MASK = 0x30 ,
  M4_MBFLAG_HAS_MOTION_VECTOR = 0x80
}
 macroblock additional flags More...
 
enum  MV_PREDICTION { MV_PREDICTION_NONE , MV_PREDICTION_P_FORWARD , MV_PREDICTION_B_FORWARD , MV_PREDICTION_B_BACKWARD }
 Possible motion vector prediction. More...
 
enum  VID_DECODER_INIT { VID_DECODER_VID_BUFFERS = (1<<0) , VID_DECODER_DEFAULT = 0 }
 Possible decoder initialization flags used in VIDDecoderSetup::flags. More...
 
enum  VIDFrameType {
  VID_FT_ERROR = -1 , VID_FT_I_FRAME = 0 , VID_FT_P_FRAME , VID_FT_B_FRAME ,
  VID_FT_S_FRAME
}
 Possible return values for VIDGetFrameType() function. More...
 
enum  VID_IMAGEINFO_FRAMETYPE {
  VID_IMAGEINFO_FRAMETYPE_UNKNOWN , VID_IMAGEINFO_FRAMETYPE_I , VID_IMAGEINFO_FRAMETYPE_P , VID_IMAGEINFO_FRAMETYPE_B ,
  VID_IMAGEINFO_FRAMETYPE_S
}
 Possible frame types returned via VIDImageInfo. More...
 
enum  VIDStreamResult { VID_STREAM_OK = 0 , VID_STREAM_EOF , VID_STREAM_ERROR }
 Possible resuls for VIDStream methods. More...
 

Functions

uint32 XSWAP (uint32 value)
 
void M4idct (int16 *block)
 Inverse DCT on 8x8 block.
 
void M4ImageCreatePadding (void *img)
 
void swapM4Image (M4Image *&img1, M4Image *&img2)
 
void M4InvQuantType0Intra (int16 *output, const int16 *input, uint8 quantiserScale, uint16 DCScaler)
 
void M4InvQuantType0Inter (int16 *output, const int16 *input, uint8 quantiserScale)
 
void M4InvQuantType1Intra (int16 *output, const int16 *input, uint8 quantiserScale, uint16 DCScaler, const uint8 *dequantMtx)
 
void M4InvQuantType1Inter (int16 *output, const int16 *input, uint8 quantiserScale, const uint8 *dequantMtx)
 
void M4MemOpIntraMBAll (void *mCurrent, int32 mbx, int32 mby, void *dct)
 
void M4MemOpInterMBCopyAll (void *mCurrent, int32 x, int32 y, void *mReference)
 
void M4MemOpInterMBAdd (void *mCurrent, int32 x, int32 y, void *dctData, uint32 cpb)
 
void M4MemHalfPelInterpolate (void *dst, void *src, int32 stride, int32 xpos, int32 ypos, void *mv, uint32 rounding, bool b4x4=false)
 
void M4MemOpInterpolateAll (void *mCurrent, int32 mbx, int32 mby, void *mReference)
 
void M4MotionVectorClear (M4_MB *mb)
 GENERIC: Set all motion vectors to 0.
 
void M4PredictionInit (M4_MB *macroblocks, int32 mbx, int32 mby, int32 pMBWidth, uint32 block, uint8 currentQuant, uint16 iDcScaler, int16 *pPredictionOut)
 
void M4PredictionAdd (M4_MB *mb, int16 *dctBlock, uint32 block, uint16 iDcScaler, const int16 *pPrediction)
 
int32 rescale (int32 predictQuant, int32 currentQuant, int32 coeff)
 
VIDError VIDCreateDecoder (const VIDDecoderSetup *setup, VIDDecoder *pNewDecoder)
 
void VIDDestroyDecoder (VIDDecoder dec)
 
const VIDImageInfoVIDGetFrameInfo (const VIDImage *_pImage)
 
void VIDDebugVideoOutToBMP (VIDDecoder dec, const char *pBaseName)
 
VIDError VIDStreamSet (VIDDecoder decoder, VIDStreamIO *pStream, VIDStreamEvents *pEvents)
 
VIDError VIDStreamDecode (VIDDecoder decoder, float time, const VIDImage **result)
 
VIDError VIDStreamEventsSet (VIDDecoder decoder, VIDStreamEvents *pEvents)
 
VIDError VIDStreamSeekNotify (VIDDecoder decoder)
 

Typedef Documentation

◆ M4_VLC

Definition of VLC data types.

◆ VIDAllocator

typedef void *(* vdecmpeg4::VIDAllocator) (uint32 size, uint32 alignment)

Memory allocation callback.

This is used for all internal decoder memory allocations. Allocations are freed via VIDDeallocator.

Parameters
sizeNumber of bytes to allocate
alignmentAlignment to use for this allocation
Returns
Pointer to memory

◆ VIDDeallocator

typedef void(* vdecmpeg4::VIDDeallocator) (void *block)

memory release callback

Memory release/free callback.

All allocations via VIDAllocator are freed here.

Parameters
blockPointer to memory block to free

◆ VIDDecoder

Opaque type of decoder to outside world. See VIDCreateDecoder to create a decoder.

◆ VIDError

Generic error type.

◆ VIDReporting

typedef void(* vdecmpeg4::VIDReporting) (const char *pMessage)

Message reporting callback

Parameters
pMessagepreformatted message

Enumeration Type Documentation

◆ anonymous enum

Indicated video texture shape.

Enumerator
M4_SHAPE_RECT 
M4_SHAPE_BIN 
M4_SHAPE_BIN_ONLY 
M4_SHAPE_GRAY 

◆ anonymous enum

Possible sprite types.

Enumerator
M4_SPRITE_STATIC 
M4_SPRITE_GMC 

◆ M4_MBFLAGS

macroblock additional flags

Enumerator
M4_MBFLAG_MVTYPE_DIRECT 
M4_MBFLAG_MVTYPE_INTERPOLATE 
M4_MBFLAG_MVTYPE_BACKWARD 
M4_MBFLAG_MVTYPE_FORWARD 
M4_MBFLAG_MVTYPE_MASK 
M4_MBFLAG_FIELD_DCT_BIT 
M4_MBFLAG_FIELD_PREDICTION_BIT 
M4_MBFLAG_FIELD_REF_FWD_MASK 
M4_MBFLAG_HAS_MOTION_VECTOR 

◆ M4_MBMODE

supported macroblock coding types

Enumerator
M4_MBMODE_INTER 
M4_MBMODE_INTER_Q 
M4_MBMODE_INTER4V 
M4_MBMODE_INTRA 
M4_MBMODE_INTRA_Q 
M4_MBMODE_STUFFING 
M4_MBMODE_NOT_CODED_PVOP 
M4_MBMODE_NOT_CODED_SVOP 

◆ M4PictureType

Picture type in input stream to decode.

Enumerator
M4PIC_I_VOP 
M4PIC_P_VOP 
M4PIC_B_VOP 
M4PIC_S_VOP 
M4PIC_VOL 

◆ MV_PREDICTION

Possible motion vector prediction.

Enumerator
MV_PREDICTION_NONE 
MV_PREDICTION_P_FORWARD 
MV_PREDICTION_B_FORWARD 
MV_PREDICTION_B_BACKWARD 

◆ VID_DECODER_INIT

Possible decoder initialization flags used in VIDDecoderSetup::flags.

Enumerator
VID_DECODER_VID_BUFFERS 

Allocate indicated number of vid buffers - min 3.

VID_DECODER_DEFAULT 

◆ VID_IMAGEINFO_FRAMETYPE

Possible frame types returned via VIDImageInfo.

Enumerator
VID_IMAGEINFO_FRAMETYPE_UNKNOWN 

Unknown frame.

VID_IMAGEINFO_FRAMETYPE_I 

I frame.

VID_IMAGEINFO_FRAMETYPE_P 

P frame.

VID_IMAGEINFO_FRAMETYPE_B 

B frame.

VID_IMAGEINFO_FRAMETYPE_S 

S frame (gmc)

◆ VIDFrameType

Possible return values for VIDGetFrameType() function.

Enumerator
VID_FT_ERROR 

Cannot determine frame type from data.

VID_FT_I_FRAME 

Input data stream is I frame.

VID_FT_P_FRAME 

Input data stream is P frame.

VID_FT_B_FRAME 

Input data stream is B frame.

VID_FT_S_FRAME 

Input data stream is S frame.

◆ VIDStreamResult

Possible resuls for VIDStream methods.

Enumerator
VID_STREAM_OK 
VID_STREAM_EOF 
VID_STREAM_ERROR 

Function Documentation

◆ M4idct()

void vdecmpeg4::M4idct ( int16 block)

Inverse DCT on 8x8 block.

◆ M4ImageCreatePadding()

void vdecmpeg4::M4ImageCreatePadding ( void img)

Create padding

Parameters
img

◆ M4InvQuantType0Inter()

void vdecmpeg4::M4InvQuantType0Inter ( int16 output,
const int16 input,
uint8  quantiserScale 
)

◆ M4InvQuantType0Intra()

void vdecmpeg4::M4InvQuantType0Intra ( int16 output,
const int16 input,
uint8  quantiserScale,
uint16  DCScaler 
)

◆ M4InvQuantType1Inter()

void vdecmpeg4::M4InvQuantType1Inter ( int16 output,
const int16 input,
uint8  quantiserScale,
const uint8 dequantMtx 
)

◆ M4InvQuantType1Intra()

void vdecmpeg4::M4InvQuantType1Intra ( int16 output,
const int16 input,
uint8  quantiserScale,
uint16  DCScaler,
const uint8 dequantMtx 
)

◆ M4MemHalfPelInterpolate()

void vdecmpeg4::M4MemHalfPelInterpolate ( void dst,
void src,
int32  stride,
int32  xpos,
int32  ypos,
void mv,
uint32  rounding,
bool  b4x4 = false 
)

◆ M4MemOpInterMBAdd()

void vdecmpeg4::M4MemOpInterMBAdd ( void mCurrent,
int32  x,
int32  y,
void dctData,
uint32  cpb 
)

◆ M4MemOpInterMBCopyAll()

void vdecmpeg4::M4MemOpInterMBCopyAll ( void mCurrent,
int32  x,
int32  y,
void mReference 
)

◆ M4MemOpInterpolateAll()

void vdecmpeg4::M4MemOpInterpolateAll ( void mCurrent,
int32  mbx,
int32  mby,
void mReference 
)

◆ M4MemOpIntraMBAll()

void vdecmpeg4::M4MemOpIntraMBAll ( void mCurrent,
int32  mbx,
int32  mby,
void dct 
)

◆ M4MotionVectorClear()

void vdecmpeg4::M4MotionVectorClear ( M4_MB mb)
inline

GENERIC: Set all motion vectors to 0.

◆ M4PredictionAdd()

void vdecmpeg4::M4PredictionAdd ( M4_MB mb,
int16 dctBlock,
uint32  block,
uint16  iDcScaler,
const int16 pPrediction 
)

Add prediction to residual

Parameters
mb
dctBlock
block
iDcScaler
pPrediction

◆ M4PredictionInit()

void vdecmpeg4::M4PredictionInit ( M4_MB macroblocks,
int32  mbx,
int32  mby,
int32  pMBWidth,
uint32  block,
uint8  currentQuant,
uint16  iDcScaler,
int16 pPredictionOut 
)

Perform ACDC prediction

Parameters
macroblocksmacroblock array
mbxmacroblock x
mbymacroblock y
pMBWidthstride for macroblocks
blockcurrent yuv subblock (0..5)
currentQuant
iDcScaler
pPredictionOut

◆ rescale()

int32 vdecmpeg4::rescale ( int32  predictQuant,
int32  currentQuant,
int32  coeff 
)
inline

◆ swapM4Image()

void vdecmpeg4::swapM4Image ( M4Image *&  img1,
M4Image *&  img2 
)
inline

◆ VIDCreateDecoder()

VIDError vdecmpeg4::VIDCreateDecoder ( const VIDDecoderSetup setup,
VIDDecoder pNewDecoder 
)

Create new decoder instance based on setup parameters

Parameters
setup
pNewDecoder
Returns

Create decoder

Used to create and initialize the decoder instance. All memory allocations happen inside this method and the amount of required memory is determined by inspecting the values inside the ::VIDDecoderSetup.

Parameters
[in]setuppointer to ::VIDDecoderSetup. Can be deleted after this method returns.
[out]pNewDecoderpointer to VIDDecoder variable which get.
Returns
VIDError result

◆ VIDDebugVideoOutToBMP()

void vdecmpeg4::VIDDebugVideoOutToBMP ( VIDDecoder  dec,
const char pBaseName 
)

Enable bmp output of decoded frames

Parameters
dec
pBaseName

Automatic output of decoded images to disk.

If available (see note below), this function activates the automatic output of the decoded images as BMP files to disk. The supplied base name is prepended to the generated file name.

Parameters
[in]decoderhandle to decoder.
[in]pBaseNameptr to filename base to prepend to images.
Returns
none (even no error if write fails!)

◆ VIDDestroyDecoder()

void vdecmpeg4::VIDDestroyDecoder ( VIDDecoder  dec)

Destroy decoder instance

Parameters
dec

Destroy decoder

Used to destroy the decoder instance and free all the memory

Parameters
[in]decoderhandle to decoder.
Returns
none

◆ VIDGetFrameInfo()

const VIDImageInfo * vdecmpeg4::VIDGetFrameInfo ( const VIDImage _pImage)

Return frame info

Parameters
_pImage
Returns

Extract image information from frame.

Some additional paramters about the decoded frame are stored in the ::VIDImageInfo struct which can be extracted from a decoder returned ::VIDImage result by calling this function.

Parameters
[in]pImagepointer to decoder created image.
Returns
pointer to ::VIDImageInfo containing extended results.

◆ VIDStreamDecode()

VIDError vdecmpeg4::VIDStreamDecode ( VIDDecoder  decoder,
float  time,
const VIDImage **  result 
)

Handle stream processing

Parameters
decoder
time
result
Returns
none

Perform decoding of stream

This initiates the processing of all stream. TODO: Check: Callbacks?

Parameters
[in]decoderhandle to decoder.
[in]timeTODO: deltaTime or
Returns
VIDError result

◆ VIDStreamEventsSet()

VIDError vdecmpeg4::VIDStreamEventsSet ( VIDDecoder  decoder,
VIDStreamEvents pEvents 
)

Set event sink explicitely

Parameters
decoder
pEvents
Returns
none

Set stream event interface explicitly

Parameters
[in]decoderhandle to decoder.
[in]pEventswhich event sink to use
Returns
VIDError result

◆ VIDStreamSeekNotify()

VIDError vdecmpeg4::VIDStreamSeekNotify ( VIDDecoder  decoder)

Handle seek notify

Parameters
decoder
Returns
none

Inform decoder about seeking

Parameters
[in]decoderhandle to decoder.
Returns
VIDError result

◆ VIDStreamSet()

VIDError vdecmpeg4::VIDStreamSet ( VIDDecoder  decoder,
VIDStreamIO pStream,
VIDStreamEvents pEvents 
)

Attach a stream to the decoder

Parameters
decoder
pStream
pEvents
Returns
none

Set current stream for playback

The stream is 'attached' to the decoder and processing happens in the VIDStreamDecode function.

Parameters
[in]decoderhandle to decoder.
[in]pStreamptr to stream to play.
Returns
VIDError result

◆ XSWAP()

uint32 vdecmpeg4::XSWAP ( uint32  value)
inline