xoreos
0.0.5
|
#include <xmvwmv2.h>
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... | |
Video::XMVWMV2Codec::XMVWMV2Codec | ( | uint32 | width, |
uint32 | height, | ||
Common::SeekableReadStream & | extraData | ||
) |
Definition at line 228 of file xmvwmv2.cpp.
References init(), and parseExtraData().
Video::XMVWMV2Codec::~XMVWMV2Codec | ( | ) |
Definition at line 237 of file xmvwmv2.cpp.
|
virtual |
Implements Video::Codec.
Definition at line 309 of file xmvwmv2.cpp.
References _chromaWidth, _curPlanes, _currentFrame, _hasJFrames, _lumaHeight, _lumaWidth, _oldPlanes, Video::XMVWMV2Codec::DecodeContext::bits, decodeIFrame(), decodeJFrame(), decodePFrame(), Common::ScopedPtrBase< T, Deallocator >::get(), Common::BitStream::getBit(), Common::BitStream::getBits(), Graphics::Surface::getData(), Graphics::Surface::getWidth(), initDecodeContext(), Graphics::YUVToRGBManager::kScaleITU, Video::XMVWMV2Codec::DecodeContext::setQScale(), Common::BitStream::skip(), and YUVToRGBMan.
|
private |
Decode an I-Frame (intra frame) block.
Definition at line 507 of file xmvwmv2.cpp.
References Video::XMVWMV2Codec::BlockContext::acQuantLeft, Video::XMVWMV2Codec::BlockContext::acQuantTop, Video::XMVWMV2Codec::DecodeContext::acRLELevelLength, Video::XMVWMV2Codec::DecodeContext::acRLERunLength, Video::XMVWMV2Codec::DecodeContext::bits, Video::XMVWMV2Codec::BlockContext::curPlane, Video::XMVWMV2Codec::BlockContext::dcEscapeCode, Video::XMVWMV2Codec::DecodeContext::dcStepSize, Video::XMVWMV2Codec::BlockContext::dcTopLeft, Video::XMVWMV2Codec::BlockContext::decoderAC, Video::WMV2ACCoefficientTable::escapeCode, Common::BitStream::getBit(), Common::BitStream::getBits(), Common::Huffman::getSymbol(), Video::XMVWMV2Codec::BlockContext::hasACCoeffs, Video::XMVWMV2Codec::DecodeContext::hasACPrediction, Video::XMVWMV2Codec::BlockContext::huffDC, IDCTPut(), kBlockSize, Video::WMV2ACCoefficientTable::lastRunIndex, Video::WMV2ACCoefficientTable::levelDeltaTable, Video::WMV2ACCoefficientTable::levelDeltaTableLast, Video::WMV2ACCoefficientTable::levelTable, Video::XMVWMV2Codec::BlockContext::planePitch, Video::XMVWMV2Codec::DecodeContext::qScale, Video::WMV2ACCoefficientTable::runDeltaTable, Video::WMV2ACCoefficientTable::runDeltaTableLast, Video::WMV2ACCoefficientTable::runTable, Video::wmv2ZigZagHorizontal, Video::wmv2ZigZagNormal, and Video::wmv2ZigZagVertical.
Referenced by decodeIMacroBlock().
|
private |
Decode an I-Frame (intra frame).
Definition at line 409 of file xmvwmv2.cpp.
References _decoderAC, _hasACPerMacroBlock, _hasLoopFilter, _huffCBP, _huffDC, _mbCountHeight, _mbCountWidth, Video::XMVWMV2Codec::DecodeContext::bits, Video::XMVWMV2Codec::DecodeContext::curCBP, decodeIMacroBlock(), Video::XMVWMV2Codec::DecodeContext::decoderAC, Video::XMVWMV2Codec::CBP::empty(), Video::XMVWMV2Codec::DecodeContext::finishMacroBlock(), Video::XMVWMV2Codec::DecodeContext::finishRow(), Common::ScopedPtrBase< T, Deallocator >::get(), Common::BitStream::getBit(), getTrit(), Video::XMVWMV2Codec::DecodeContext::hasACPerMacroBlock, Video::XMVWMV2Codec::DecodeContext::hasACPrediction, Video::XMVWMV2Codec::DecodeContext::huffDC, Video::XMVWMV2Codec::DecodeContext::startMacroBlock(), and Video::XMVWMV2Codec::DecodeContext::startRow().
Referenced by decodeFrame().
|
private |
Decode an I-Frame (intra frame) macro block.
Definition at line 487 of file xmvwmv2.cpp.
References Video::XMVWMV2Codec::BlockContext::acQuantLeft, Video::XMVWMV2Codec::BlockContext::acQuantTop, Video::XMVWMV2Codec::DecodeContext::block, Video::XMVWMV2Codec::DecodeContext::curCBP, Video::XMVWMV2Codec::BlockContext::dcTopLeft, decodeIBlock(), Video::XMVWMV2Codec::BlockContext::hasACCoeffs, and Video::XMVWMV2Codec::CBP::isSet().
Referenced by decodeIFrame().
|
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().
|
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().
|
staticprivate |
Decode a "tri-state".
Definition at line 805 of file xmvwmv2.cpp.
References Common::BitStream::getBit().
Referenced by decodeIFrame().
|
private |
Definition at line 735 of file xmvwmv2.cpp.
References IDCTCol(), and IDCTRow().
Referenced by IDCTPut().
|
private |
Definition at line 727 of file xmvwmv2.cpp.
References CLIP(), and IDCT().
Referenced by decodeIBlock().
|
private |
|
private |
Init the decoder.
Definition at line 240 of file xmvwmv2.cpp.
References _cbp, _chromaHeight, _chromaWidth, _curPlanes, _decoderAC, _decoderMV, _height, _huffCBP, _huffDC, _lumaHeight, _lumaWidth, _mbCountHeight, _mbCountWidth, _oldPlanes, _predAC, _width, Video::WMV2ACCoefficientTable::huffman, Video::WMV2MVTable::huffman, Video::XMVWMV2Codec::ACDecoder::huffman, Video::XMVWMV2Codec::MVDecoder::huffman, kMacroBlockSize, Video::XMVWMV2Codec::ACDecoder::parameters, Video::XMVWMV2Codec::MVDecoder::parameters, Common::ScopedPtrBase< T, Deallocator >::reset(), Video::wmv2AC, Video::wmv2HuffmanDC, Video::wmv2HuffmanIMB, Video::wmv2HuffmanPMB, and Video::wmv2MV.
Referenced by XMVWMV2Codec().
|
private |
Definition at line 380 of file xmvwmv2.cpp.
References _cbp, _chromaWidth, _curPlanes, _lumaWidth, _mbCountWidth, _oldPlanes, _predAC, Video::XMVWMV2Codec::DecodeContext::acQuantTop, Video::XMVWMV2Codec::DecodeContext::block, Video::XMVWMV2Codec::BlockContext::blockPitch, Video::XMVWMV2Codec::BlockContext::curPlane, Common::ScopedPtrBase< T, Deallocator >::get(), kBlockSize, kMacroBlockSize, Video::XMVWMV2Codec::BlockContext::planePitch, Video::XMVWMV2Codec::BlockContext::refPlane, and Video::XMVWMV2Codec::DecodeContext::rowCBP.
Referenced by decodeFrame().
|
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().
|
private |
Coded block pattern, previous row.
Definition at line 207 of file xmvwmv2.h.
Referenced by Video::XMVWMV2Codec::CBP::clear(), Video::XMVWMV2Codec::CBP::decode(), Video::XMVWMV2Codec::CBP::empty(), init(), initDecodeContext(), Video::XMVWMV2Codec::CBP::isSet(), and Video::XMVWMV2Codec::CBP::set().
|
private |
Height of the chroma portion of a decoded frame.
Definition at line 184 of file xmvwmv2.h.
Referenced by decodeJFrame(), decodePFrame(), and init().
|
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().
|
private |
The 3 color planes, YUV, current frame.
Definition at line 191 of file xmvwmv2.h.
Referenced by decodeFrame(), decodeJFrame(), decodePFrame(), init(), and initDecodeContext().
|
private |
Definition at line 227 of file xmvwmv2.h.
Referenced by decodeFrame(), and decodeJFrame().
|
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().
|
private |
|
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().
|
private |
Does the video have hybrid motion vectors?
Definition at line 200 of file xmvwmv2.h.
Referenced by parseExtraData().
|
private |
Does the video have j-frames (IntraX8)?
Definition at line 199 of file xmvwmv2.h.
Referenced by decodeFrame(), and parseExtraData().
|
private |
Does the video use the loop filter?
Definition at line 197 of file xmvwmv2.h.
Referenced by decodeIFrame(), and parseExtraData().
|
private |
Does the video have mixed pel motion compensation?
Definition at line 196 of file xmvwmv2.h.
Referenced by parseExtraData().
|
private |
Does the video have variable sized transforms?
Definition at line 198 of file xmvwmv2.h.
Referenced by parseExtraData().
|
private |
|
private |
Huffman codes for coded block pattern.
Definition at line 208 of file xmvwmv2.h.
Referenced by decodeIFrame(), and init().
|
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().
|
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().
|
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().
|
private |
Height of a frame in macro blocks.
Definition at line 187 of file xmvwmv2.h.
Referenced by decodeIFrame(), and init().
|
private |
Width of a frame in macro blocks.
Definition at line 186 of file xmvwmv2.h.
Referenced by decodeIFrame(), init(), and initDecodeContext().
|
private |
The 3 color planes, YUV, last frame.
Definition at line 192 of file xmvwmv2.h.
Referenced by decodeFrame(), decodeJFrame(), decodePFrame(), init(), and initDecodeContext().
|
private |
AC predictors, previous row.
Definition at line 217 of file xmvwmv2.h.
Referenced by init(), and initDecodeContext().
|
private |
Number of slices per frame.
Definition at line 203 of file xmvwmv2.h.
Referenced by parseExtraData().
|
private |
|
staticprivate |
Size of a block.
Definition at line 77 of file xmvwmv2.h.
Referenced by decodeIBlock(), initDecodeContext(), and Video::XMVWMV2Codec::DecodeContext::startRow().
|
staticprivate |
Size of a macro block.
Definition at line 76 of file xmvwmv2.h.
Referenced by init(), and initDecodeContext().