xoreos  0.0.5
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Video::XMVWMV2Codec Class Reference

#include <xmvwmv2.h>

Inheritance diagram for Video::XMVWMV2Codec:
Inheritance graph
[legend]
Collaboration diagram for Video::XMVWMV2Codec:
Collaboration graph
[legend]

Classes

struct  ACDecoder
 Decoders for DCT AC coefficients. More...
 
struct  BlockContext
 Context for decoding a block. More...
 
class  CBP
 Which block pattern are coded? More...
 
struct  DecodeContext
 Context for decoding a frame. More...
 
struct  MVDecoder
 Decoder for motion vectors. More...
 

Public Member Functions

 XMVWMV2Codec (uint32 width, uint32 height, Common::SeekableReadStream &extraData)
 
 ~XMVWMV2Codec ()
 
void decodeFrame (Graphics::Surface &surface, Common::SeekableReadStream &dataStream)
 
- Public Member Functions inherited from Video::Codec
 Codec ()
 
virtual ~Codec ()
 

Private Member Functions

void init ()
 Init the decoder. More...
 
void parseExtraData (Common::SeekableReadStream &extraData)
 Parse the extra data containing video encoding properties. More...
 
void initDecodeContext (DecodeContext &ctx)
 
void decodeIFrame (DecodeContext &ctx)
 Decode an I-Frame (intra frame). More...
 
void decodeJFrame (DecodeContext &ctx)
 Decode a J-Frame (intra X8 frame). More...
 
void decodePFrame (DecodeContext &ctx)
 Decode a P-Frame (inter frame). More...
 
void decodeIMacroBlock (DecodeContext &ctx)
 Decode an I-Frame (intra frame) macro block. More...
 
void decodeIBlock (DecodeContext &ctx, BlockContext &block)
 Decode an I-Frame (intra frame) block. More...
 
void IDCTPut (byte *dest, int32 *block, uint32 pitch)
 
void IDCT (int32 *block)
 
void IDCTRow (int32 *b)
 
void IDCTCol (int32 *b)
 

Static Private Member Functions

static uint8 getTrit (Common::BitStream &bits)
 Decode a "tri-state". More...
 

Private Attributes

uint32 _width
 Width of a frame. More...
 
uint32 _height
 Height of a frame. More...
 
uint32 _lumaWidth
 Width of the luma portion of a decoded frame. More...
 
uint32 _lumaHeight
 Height of the luma portion of a decoded frame. More...
 
uint32 _chromaWidth
 Width of the chroma portion of a decoded frame. More...
 
uint32 _chromaHeight
 Height of the chroma portion of a decoded frame. More...
 
uint32 _mbCountWidth
 Width of a frame in macro blocks. More...
 
uint32 _mbCountHeight
 Height of a frame in macro blocks. More...
 
Common::ScopedArray< byte_curPlanes [3]
 The 3 color planes, YUV, current frame. More...
 
Common::ScopedArray< byte_oldPlanes [3]
 The 3 color planes, YUV, last frame. More...
 
bool _hasMixedPelMC
 Does the video have mixed pel motion compensation? More...
 
bool _hasLoopFilter
 Does the video use the loop filter? More...
 
bool _hasVarSizeTrans
 Does the video have variable sized transforms? More...
 
bool _hasJFrames
 Does the video have j-frames (IntraX8)? More...
 
bool _hasHybridMV
 Does the video have hybrid motion vectors? More...
 
bool _hasACPerMacroBlock
 Are the AC selected per macro block instead of per frame? More...
 
uint8 _sliceCount
 Number of slices per frame. More...
 
Common::ScopedArray< CBP_cbp
 Coded block pattern, previous row. More...
 
Common::ScopedPtr< Common::Huffman_huffCBP [4]
 Huffman codes for coded block pattern. More...
 
Common::ScopedPtr< Common::Huffman_huffDC [2][2]
 Huffman code for DCT DC coefficients, [luma/chroma][low/high motion]. More...
 
Common::ScopedArray< int32_predAC [3]
 AC predictors, previous row. More...
 
ACDecoder _decoderAC [2][3]
 Decoders for DCT AC coefficients [luma/chroma][low motion/high motion/MPEG4]. More...
 
MVDecoder _decoderMV [2]
 Huffman code for the motion vectors [low/high motion]. More...
 
uint32 _currentFrame
 

Static Private Attributes

static const uint32 kMacroBlockSize = 16
 Size of a macro block. More...
 
static const uint32 kBlockSize = 8
 Size of a block. More...
 

Detailed Description

Definition at line 68 of file xmvwmv2.h.

Constructor & Destructor Documentation

◆ XMVWMV2Codec()

Video::XMVWMV2Codec::XMVWMV2Codec ( uint32  width,
uint32  height,
Common::SeekableReadStream extraData 
)

Definition at line 228 of file xmvwmv2.cpp.

References init(), and parseExtraData().

Here is the call graph for this function:

◆ ~XMVWMV2Codec()

Video::XMVWMV2Codec::~XMVWMV2Codec ( )

Definition at line 237 of file xmvwmv2.cpp.

Member Function Documentation

◆ decodeFrame()

void Video::XMVWMV2Codec::decodeFrame ( Graphics::Surface surface,
Common::SeekableReadStream dataStream 
)
virtual

◆ decodeIBlock()

void Video::XMVWMV2Codec::decodeIBlock ( DecodeContext ctx,
BlockContext block 
)
private

◆ decodeIFrame()

void Video::XMVWMV2Codec::decodeIFrame ( DecodeContext ctx)
private

◆ decodeIMacroBlock()

void Video::XMVWMV2Codec::decodeIMacroBlock ( DecodeContext ctx)
private

◆ decodeJFrame()

void Video::XMVWMV2Codec::decodeJFrame ( DecodeContext ctx)
private

Decode a J-Frame (intra X8 frame).

Definition at line 471 of file xmvwmv2.cpp.

References _chromaHeight, _chromaWidth, _curPlanes, _currentFrame, _lumaHeight, _lumaWidth, _oldPlanes, and warning().

Referenced by decodeFrame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decodePFrame()

void Video::XMVWMV2Codec::decodePFrame ( DecodeContext ctx)
private

Decode a P-Frame (inter frame).

Definition at line 480 of file xmvwmv2.cpp.

References _chromaHeight, _chromaWidth, _curPlanes, _lumaHeight, _lumaWidth, and _oldPlanes.

Referenced by decodeFrame().

Here is the caller graph for this function:

◆ getTrit()

uint8 Video::XMVWMV2Codec::getTrit ( Common::BitStream bits)
staticprivate

Decode a "tri-state".

Definition at line 805 of file xmvwmv2.cpp.

References Common::BitStream::getBit().

Referenced by decodeIFrame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IDCT()

void Video::XMVWMV2Codec::IDCT ( int32 block)
private

Definition at line 735 of file xmvwmv2.cpp.

References IDCTCol(), and IDCTRow().

Referenced by IDCTPut().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IDCTCol()

void Video::XMVWMV2Codec::IDCTCol ( int32 b)
private

Definition at line 778 of file xmvwmv2.cpp.

References W0, W1, W2, W3, W5, W6, and W7.

Referenced by IDCT().

Here is the caller graph for this function:

◆ IDCTPut()

void Video::XMVWMV2Codec::IDCTPut ( byte dest,
int32 block,
uint32  pitch 
)
private

Definition at line 727 of file xmvwmv2.cpp.

References CLIP(), and IDCT().

Referenced by decodeIBlock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IDCTRow()

void Video::XMVWMV2Codec::IDCTRow ( int32 b)
private

Definition at line 752 of file xmvwmv2.cpp.

References W0, W1, W2, W3, W5, W6, and W7.

Referenced by IDCT().

Here is the caller graph for this function:

◆ init()

void Video::XMVWMV2Codec::init ( )
private

◆ initDecodeContext()

void Video::XMVWMV2Codec::initDecodeContext ( DecodeContext ctx)
private

◆ parseExtraData()

void Video::XMVWMV2Codec::parseExtraData ( Common::SeekableReadStream extraData)
private

Parse the extra data containing video encoding properties.

Definition at line 355 of file xmvwmv2.cpp.

References _hasACPerMacroBlock, _hasHybridMV, _hasJFrames, _hasLoopFilter, _hasMixedPelMC, _hasVarSizeTrans, _sliceCount, Common::ReadStream::readUint32LE(), Common::SeekableReadStream::size(), and warning().

Referenced by XMVWMV2Codec().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _cbp

Common::ScopedArray<CBP> Video::XMVWMV2Codec::_cbp
private

◆ _chromaHeight

uint32 Video::XMVWMV2Codec::_chromaHeight
private

Height of the chroma portion of a decoded frame.

Definition at line 184 of file xmvwmv2.h.

Referenced by decodeJFrame(), decodePFrame(), and init().

◆ _chromaWidth

uint32 Video::XMVWMV2Codec::_chromaWidth
private

Width of the chroma portion of a decoded frame.

Definition at line 183 of file xmvwmv2.h.

Referenced by decodeFrame(), decodeJFrame(), decodePFrame(), init(), and initDecodeContext().

◆ _curPlanes

Common::ScopedArray<byte> Video::XMVWMV2Codec::_curPlanes[3]
private

The 3 color planes, YUV, current frame.

Definition at line 191 of file xmvwmv2.h.

Referenced by decodeFrame(), decodeJFrame(), decodePFrame(), init(), and initDecodeContext().

◆ _currentFrame

uint32 Video::XMVWMV2Codec::_currentFrame
private

Definition at line 227 of file xmvwmv2.h.

Referenced by decodeFrame(), and decodeJFrame().

◆ _decoderAC

ACDecoder Video::XMVWMV2Codec::_decoderAC[2][3]
private

Decoders for DCT AC coefficients [luma/chroma][low motion/high motion/MPEG4].

Definition at line 220 of file xmvwmv2.h.

Referenced by decodeIFrame(), and init().

◆ _decoderMV

MVDecoder Video::XMVWMV2Codec::_decoderMV[2]
private

Huffman code for the motion vectors [low/high motion].

Definition at line 225 of file xmvwmv2.h.

Referenced by init().

◆ _hasACPerMacroBlock

bool Video::XMVWMV2Codec::_hasACPerMacroBlock
private

Are the AC selected per macro block instead of per frame?

Definition at line 201 of file xmvwmv2.h.

Referenced by decodeIFrame(), and parseExtraData().

◆ _hasHybridMV

bool Video::XMVWMV2Codec::_hasHybridMV
private

Does the video have hybrid motion vectors?

Definition at line 200 of file xmvwmv2.h.

Referenced by parseExtraData().

◆ _hasJFrames

bool Video::XMVWMV2Codec::_hasJFrames
private

Does the video have j-frames (IntraX8)?

Definition at line 199 of file xmvwmv2.h.

Referenced by decodeFrame(), and parseExtraData().

◆ _hasLoopFilter

bool Video::XMVWMV2Codec::_hasLoopFilter
private

Does the video use the loop filter?

Definition at line 197 of file xmvwmv2.h.

Referenced by decodeIFrame(), and parseExtraData().

◆ _hasMixedPelMC

bool Video::XMVWMV2Codec::_hasMixedPelMC
private

Does the video have mixed pel motion compensation?

Definition at line 196 of file xmvwmv2.h.

Referenced by parseExtraData().

◆ _hasVarSizeTrans

bool Video::XMVWMV2Codec::_hasVarSizeTrans
private

Does the video have variable sized transforms?

Definition at line 198 of file xmvwmv2.h.

Referenced by parseExtraData().

◆ _height

uint32 Video::XMVWMV2Codec::_height
private

Height of a frame.

Definition at line 178 of file xmvwmv2.h.

Referenced by init().

◆ _huffCBP

Common::ScopedPtr<Common::Huffman> Video::XMVWMV2Codec::_huffCBP[4]
private

Huffman codes for coded block pattern.

Definition at line 208 of file xmvwmv2.h.

Referenced by decodeIFrame(), and init().

◆ _huffDC

Common::ScopedPtr<Common::Huffman> Video::XMVWMV2Codec::_huffDC[2][2]
private

Huffman code for DCT DC coefficients, [luma/chroma][low/high motion].

Definition at line 213 of file xmvwmv2.h.

Referenced by decodeIFrame(), and init().

◆ _lumaHeight

uint32 Video::XMVWMV2Codec::_lumaHeight
private

Height of the luma portion of a decoded frame.

Definition at line 181 of file xmvwmv2.h.

Referenced by decodeFrame(), decodeJFrame(), decodePFrame(), and init().

◆ _lumaWidth

uint32 Video::XMVWMV2Codec::_lumaWidth
private

Width of the luma portion of a decoded frame.

Definition at line 180 of file xmvwmv2.h.

Referenced by decodeFrame(), decodeJFrame(), decodePFrame(), init(), and initDecodeContext().

◆ _mbCountHeight

uint32 Video::XMVWMV2Codec::_mbCountHeight
private

Height of a frame in macro blocks.

Definition at line 187 of file xmvwmv2.h.

Referenced by decodeIFrame(), and init().

◆ _mbCountWidth

uint32 Video::XMVWMV2Codec::_mbCountWidth
private

Width of a frame in macro blocks.

Definition at line 186 of file xmvwmv2.h.

Referenced by decodeIFrame(), init(), and initDecodeContext().

◆ _oldPlanes

Common::ScopedArray<byte> Video::XMVWMV2Codec::_oldPlanes[3]
private

The 3 color planes, YUV, last frame.

Definition at line 192 of file xmvwmv2.h.

Referenced by decodeFrame(), decodeJFrame(), decodePFrame(), init(), and initDecodeContext().

◆ _predAC

Common::ScopedArray<int32> Video::XMVWMV2Codec::_predAC[3]
private

AC predictors, previous row.

Definition at line 217 of file xmvwmv2.h.

Referenced by init(), and initDecodeContext().

◆ _sliceCount

uint8 Video::XMVWMV2Codec::_sliceCount
private

Number of slices per frame.

Definition at line 203 of file xmvwmv2.h.

Referenced by parseExtraData().

◆ _width

uint32 Video::XMVWMV2Codec::_width
private

Width of a frame.

Definition at line 177 of file xmvwmv2.h.

Referenced by init().

◆ kBlockSize

const uint32 Video::XMVWMV2Codec::kBlockSize = 8
staticprivate

Size of a block.

Definition at line 77 of file xmvwmv2.h.

Referenced by decodeIBlock(), initDecodeContext(), and Video::XMVWMV2Codec::DecodeContext::startRow().

◆ kMacroBlockSize

const uint32 Video::XMVWMV2Codec::kMacroBlockSize = 16
staticprivate

Size of a macro block.

Definition at line 76 of file xmvwmv2.h.

Referenced by init(), and initDecodeContext().


The documentation for this class was generated from the following files: