xoreos
0.0.5
|
Classes | |
struct | Bundle |
Data structure used for decoding a single Bink data type. More... | |
struct | DecodeContext |
A decoder state. More... | |
struct | Huffman |
Data structure for decoding and translating Huffman'd data. More... | |
Public Member Functions | |
BinkVideoTrack (uint32 width, uint32 height, uint32 frameCount, const Common::Rational &frameRate, bool swapPlanes, bool hasAlpha, uint32 id) | |
uint32 | getWidth () const |
uint32 | getHeight () const |
int | getCurFrame () const |
int | getFrameCount () const |
void | decodePacket (Graphics::Surface &surface, VideoFrame &frame) |
Decode a video packet. More... | |
Protected Member Functions | |
Common::Rational | getFrameRate () const |
Private Types | |
enum | Source { kSourceBlockTypes = 0, kSourceSubBlockTypes, kSourceColors, kSourcePattern, kSourceXOff, kSourceYOff, kSourceIntraDC, kSourceInterDC, kSourceRun, kSourceMAX } |
IDs for different data types used in Bink video codec. More... | |
enum | BlockType { kBlockSkip = 0, kBlockScaled, kBlockMotion, kBlockRun, kBlockResidue, kBlockIntra, kBlockFill, kBlockInter, kBlockPattern, kBlockRaw } |
Bink video block types. More... | |
Private Member Functions | |
void | initBundles () |
Initialize the bundles. More... | |
void | initHuffman () |
Initialize the Huffman decoders. More... | |
void | videoPacket (VideoFrame &video) |
Decode a video packet. More... | |
void | decodePlane (VideoFrame &video, int planeIdx, bool isChroma) |
Decode a plane. More... | |
void | readBundle (VideoFrame &video, Source source) |
Read/Initialize a bundle for decoding a plane. More... | |
void | readHuffman (VideoFrame &video, Huffman &huffman) |
Read the symbols for a Huffman code. More... | |
void | mergeHuffmanSymbols (VideoFrame &video, byte *dst, const byte *src, int size) |
Merge two Huffman symbol lists. More... | |
byte | getHuffmanSymbol (VideoFrame &video, Huffman &huffman) |
Read and translate a symbol out of a Huffman code. More... | |
int32 | getBundleValue (Source source) |
Get a direct value out of a bundle. More... | |
uint32 | readBundleCount (VideoFrame &video, Bundle &bundle) |
Read a count value out of a bundle. More... | |
void | blockSkip (DecodeContext &ctx) |
void | blockScaledSkip (DecodeContext &ctx) |
void | blockScaledRun (DecodeContext &ctx) |
void | blockScaledIntra (DecodeContext &ctx) |
void | blockScaledFill (DecodeContext &ctx) |
void | blockScaledPattern (DecodeContext &ctx) |
void | blockScaledRaw (DecodeContext &ctx) |
void | blockScaled (DecodeContext &ctx) |
void | blockMotion (DecodeContext &ctx) |
void | blockRun (DecodeContext &ctx) |
void | blockResidue (DecodeContext &ctx) |
void | blockIntra (DecodeContext &ctx) |
void | blockFill (DecodeContext &ctx) |
void | blockInter (DecodeContext &ctx) |
void | blockPattern (DecodeContext &ctx) |
void | blockRaw (DecodeContext &ctx) |
void | readRuns (VideoFrame &video, Bundle &bundle) |
void | readMotionValues (VideoFrame &video, Bundle &bundle) |
void | readBlockTypes (VideoFrame &video, Bundle &bundle) |
void | readPatterns (VideoFrame &video, Bundle &bundle) |
void | readColors (VideoFrame &video, Bundle &bundle) |
void | readDCS (VideoFrame &video, Bundle &bundle, int startBits, bool hasSign) |
void | readDCTCoeffs (VideoFrame &video, int16 *block, bool isIntra) |
Reads 8x8 block of DCT coefficients. More... | |
void | readResidue (VideoFrame &video, int16 *block, int masksCount) |
Reads 8x8 block with residue after motion compensation. More... | |
void | IDCT (int16 *block) |
void | IDCTPut (DecodeContext &ctx, int16 *block) |
void | IDCTAdd (DecodeContext &ctx, int16 *block) |
Private Attributes | |
uint32 | _width |
uint32 | _height |
int | _curFrame |
Current Frame. More... | |
int | _frameCount |
Common::Rational | _frameRate |
The frame rate of the video. More... | |
bool | _swapPlanes |
Are the planes ordered (A)YVU instead of (A)YUV? More... | |
bool | _hasAlpha |
Do video frames have alpha? More... | |
uint32 | _id |
The BIK FourCC. More... | |
Bundle | _bundles [kSourceMAX] |
Bundles for decoding all data types. More... | |
Common::ScopedPtr< Common::Huffman > | _huffman [16] |
The 16 Huffman codebooks used in Bink decoding. More... | |
Huffman | _colHighHuffman [16] |
Huffman codebooks to use for decoding high nibbles in color data types. More... | |
int | _colLastVal |
Value of the last decoded high nibble in color data types. More... | |
Common::ScopedArray< byte > | _curPlanes [4] |
The 4 color planes, YUVA, current frame. More... | |
Common::ScopedArray< byte > | _oldPlanes [4] |
The 4 color planes, YUVA, last frame. More... | |
|
private |
Bink video block types.
|
private |
IDs for different data types used in Bink video codec.
Video::Bink::BinkVideoTrack::BinkVideoTrack | ( | uint32 | width, |
uint32 | height, | ||
uint32 | frameCount, | ||
const Common::Rational & | frameRate, | ||
bool | swapPlanes, | ||
bool | hasAlpha, | ||
uint32 | id | ||
) |
Definition at line 1608 of file bink.cpp.
References _curPlanes, _height, _oldPlanes, _width, initBundles(), initHuffman(), and Common::ScopedPtrBase< T, Deallocator >::reset().
|
private |
Definition at line 859 of file bink.cpp.
References Video::Bink::BinkVideoTrack::DecodeContext::dest, and Video::Bink::BinkVideoTrack::DecodeContext::pitch.
|
private |
Definition at line 867 of file bink.cpp.
References Video::Bink::BinkVideoTrack::DecodeContext::video.
|
private |
Definition at line 848 of file bink.cpp.
References Video::Bink::BinkVideoTrack::DecodeContext::video.
|
private |
Definition at line 791 of file bink.cpp.
References Video::Bink::BinkVideoTrack::DecodeContext::blockX, Video::Bink::BinkVideoTrack::DecodeContext::blockY, Video::Bink::BinkVideoTrack::DecodeContext::dest, Video::Bink::BinkVideoTrack::DecodeContext::pitch, Video::Bink::BinkVideoTrack::DecodeContext::prev, Video::Bink::BinkVideoTrack::DecodeContext::prevEnd, and Video::Bink::BinkVideoTrack::DecodeContext::prevStart.
|
private |
Definition at line 880 of file bink.cpp.
References Video::Bink::BinkVideoTrack::DecodeContext::dest, and Video::Bink::BinkVideoTrack::DecodeContext::pitch.
|
private |
Definition at line 895 of file bink.cpp.
References Video::Bink::BinkVideoTrack::DecodeContext::dest, and Video::Bink::BinkVideoTrack::DecodeContext::pitch.
|
private |
Definition at line 831 of file bink.cpp.
References Video::Bink::VideoFrame::bits, Video::Bink::BinkVideoTrack::DecodeContext::dest, Common::BitStream::getBits(), Video::Bink::BinkVideoTrack::DecodeContext::pitch, and Video::Bink::BinkVideoTrack::DecodeContext::video.
|
private |
Definition at line 804 of file bink.cpp.
References binkPatterns, Video::Bink::VideoFrame::bits, Video::Bink::BinkVideoTrack::DecodeContext::coordMap, Video::Bink::BinkVideoTrack::DecodeContext::dest, Common::BitStream::getBit(), Common::BitStream::getBits(), and Video::Bink::BinkVideoTrack::DecodeContext::video.
|
private |
Definition at line 758 of file bink.cpp.
References Video::Bink::BinkVideoTrack::DecodeContext::blockX, Video::Bink::BinkVideoTrack::DecodeContext::dest, and Video::Bink::BinkVideoTrack::DecodeContext::prev.
|
private |
Definition at line 719 of file bink.cpp.
References Video::Bink::BinkVideoTrack::DecodeContext::dest, and Video::Bink::BinkVideoTrack::DecodeContext::pitch.
|
private |
Definition at line 698 of file bink.cpp.
References Video::Bink::BinkVideoTrack::DecodeContext::dest, Video::Bink::BinkVideoTrack::DecodeContext::pitch, and Video::Bink::BinkVideoTrack::DecodeContext::video.
|
private |
Definition at line 727 of file bink.cpp.
References Video::Bink::BinkVideoTrack::DecodeContext::dest, and Video::Bink::BinkVideoTrack::DecodeContext::pitch.
|
private |
Definition at line 743 of file bink.cpp.
References Video::Bink::BinkVideoTrack::DecodeContext::dest, and Video::Bink::BinkVideoTrack::DecodeContext::pitch.
|
private |
Definition at line 662 of file bink.cpp.
References binkPatterns, Video::Bink::VideoFrame::bits, Video::Bink::BinkVideoTrack::DecodeContext::coordScaledMap1, Video::Bink::BinkVideoTrack::DecodeContext::coordScaledMap2, Video::Bink::BinkVideoTrack::DecodeContext::coordScaledMap3, Video::Bink::BinkVideoTrack::DecodeContext::coordScaledMap4, Video::Bink::BinkVideoTrack::DecodeContext::dest, Common::BitStream::getBit(), Common::BitStream::getBits(), and Video::Bink::BinkVideoTrack::DecodeContext::video.
|
private |
Definition at line 654 of file bink.cpp.
References Video::Bink::BinkVideoTrack::DecodeContext::dest, Video::Bink::BinkVideoTrack::DecodeContext::pitch, and Video::Bink::BinkVideoTrack::DecodeContext::prev.
|
private |
Definition at line 646 of file bink.cpp.
References Video::Bink::BinkVideoTrack::DecodeContext::dest, Video::Bink::BinkVideoTrack::DecodeContext::pitch, and Video::Bink::BinkVideoTrack::DecodeContext::prev.
void Video::Bink::BinkVideoTrack::decodePacket | ( | Graphics::Surface & | surface, |
VideoFrame & | frame | ||
) |
Decode a video packet.
Definition at line 203 of file bink.cpp.
References _curFrame, _curPlanes, _hasAlpha, _height, _id, _oldPlanes, _swapPlanes, _width, Video::Bink::VideoFrame::bits, decodePlane(), Common::ScopedPtrBase< T, Deallocator >::get(), Graphics::Surface::getData(), Graphics::Surface::getWidth(), kBIKiID, Graphics::YUVToRGBManager::kScaleITU, Common::BitStream::pos(), Common::BitStream::size(), Common::BitStream::skip(), and YUVToRGBMan.
Referenced by Video::Bink::decodeNextTrackFrame().
|
private |
Decode a plane.
Definition at line 239 of file bink.cpp.
References _height, _width, Video::Bink::VideoFrame::bits, kDCStartBits, Common::BitStream::pos(), Common::BitStream::skip(), and Video::Bink::BinkVideoTrack::DecodeContext::video.
Referenced by decodePacket().
|
inline |
Definition at line 181 of file bink.h.
References _curFrame.
Referenced by Video::Bink::decodeNextTrackFrame().
|
inline |
Definition at line 182 of file bink.h.
References _frameCount.
|
inlineprotected |
Definition at line 188 of file bink.h.
References _frameRate.
|
inline |
|
private |
Read and translate a symbol out of a Huffman code.
Definition at line 617 of file bink.cpp.
References Video::Bink::VideoFrame::bits, Video::Bink::BinkVideoTrack::Huffman::index, and Video::Bink::BinkVideoTrack::Huffman::symbols.
|
inline |
|
private |
Definition at line 1577 of file bink.cpp.
References IDCT_ROW, and Video::IDCTCol().
|
private |
Definition at line 1588 of file bink.cpp.
References Video::Bink::BinkVideoTrack::DecodeContext::dest, and Video::Bink::BinkVideoTrack::DecodeContext::pitch.
|
private |
Definition at line 1598 of file bink.cpp.
References Video::Bink::BinkVideoTrack::DecodeContext::dest, IDCT_ROW, Video::IDCTCol(), and Video::Bink::BinkVideoTrack::DecodeContext::pitch.
|
private |
Initialize the bundles.
Definition at line 583 of file bink.cpp.
References _height, _width, and Common::intLog2().
Referenced by BinkVideoTrack().
|
private |
Initialize the Huffman decoders.
Definition at line 612 of file bink.cpp.
References binkHuffmanCodes, and binkHuffmanLengths.
Referenced by BinkVideoTrack().
|
private |
Merge two Huffman symbol lists.
Definition at line 418 of file bink.cpp.
References Video::Bink::VideoFrame::bits, and Common::BitStream::getBit().
|
private |
Definition at line 961 of file bink.cpp.
References Video::Bink::VideoFrame::bits, Video::Bink::BinkVideoTrack::Bundle::curDec, Video::Bink::BinkVideoTrack::Bundle::dataEnd, Common::BitStream::getBit(), Common::BitStream::getBits(), Video::Bink::BinkVideoTrack::Bundle::huffman, and Video::rleLens.
|
private |
|
private |
Read a count value out of a bundle.
Definition at line 635 of file bink.cpp.
References Video::Bink::VideoFrame::bits, Video::Bink::BinkVideoTrack::Bundle::countLength, Video::Bink::BinkVideoTrack::Bundle::curDec, Video::Bink::BinkVideoTrack::Bundle::curPtr, and Common::BitStream::getBits().
|
private |
Definition at line 1016 of file bink.cpp.
References Graphics::Renderable::_id, Video::Bink::VideoFrame::bits, Video::Bink::BinkVideoTrack::Bundle::curDec, Video::Bink::BinkVideoTrack::Bundle::dataEnd, Common::BitStream::getBit(), Video::Bink::BinkVideoTrack::Bundle::huffman, and kBIKiID.
|
private |
Definition at line 1060 of file bink.cpp.
References Video::Bink::VideoFrame::bits, Video::Bink::BinkVideoTrack::Bundle::curDec, Common::BitStream::getBit(), and Common::BitStream::getBits().
|
private |
Reads 8x8 block of DCT coefficients.
Definition at line 1126 of file bink.cpp.
References binkInterQuant, binkIntraQuant, binkScan, Video::Bink::VideoFrame::bits, Video::dequant(), Common::BitStream::getBit(), Common::BitStream::getBits(), and XOREOS_FALLTHROUGH.
|
private |
Read the symbols for a Huffman code.
Definition at line 364 of file bink.cpp.
References Video::Bink::VideoFrame::bits, Common::BitStream::getBit(), Common::BitStream::getBits(), Video::Bink::BinkVideoTrack::Huffman::index, SWAP(), and Video::Bink::BinkVideoTrack::Huffman::symbols.
|
private |
Definition at line 924 of file bink.cpp.
References Video::Bink::VideoFrame::bits, Video::Bink::BinkVideoTrack::Bundle::curDec, Video::Bink::BinkVideoTrack::Bundle::dataEnd, Common::BitStream::getBit(), Common::BitStream::getBits(), and Video::Bink::BinkVideoTrack::Bundle::huffman.
|
private |
Definition at line 998 of file bink.cpp.
References Video::Bink::BinkVideoTrack::Bundle::curDec, Video::Bink::BinkVideoTrack::Bundle::dataEnd, and Video::Bink::BinkVideoTrack::Bundle::huffman.
|
private |
Reads 8x8 block with residue after motion compensation.
Definition at line 1225 of file bink.cpp.
References binkScan, Video::Bink::VideoFrame::bits, Common::BitStream::getBit(), Common::BitStream::getBits(), and XOREOS_FALLTHROUGH.
|
private |
Definition at line 904 of file bink.cpp.
References Video::Bink::VideoFrame::bits, Video::Bink::BinkVideoTrack::Bundle::curDec, Video::Bink::BinkVideoTrack::Bundle::dataEnd, Common::BitStream::getBit(), Common::BitStream::getBits(), and Video::Bink::BinkVideoTrack::Bundle::huffman.
|
private |
Decode a video packet.
|
private |
|
private |
|
private |
|
private |
Current Frame.
Definition at line 271 of file bink.h.
Referenced by decodePacket(), and getCurFrame().
|
private |
The 4 color planes, YUVA, current frame.
Definition at line 290 of file bink.h.
Referenced by BinkVideoTrack(), and decodePacket().
|
private |
Definition at line 272 of file bink.h.
Referenced by getFrameCount().
|
private |
|
private |
|
private |
Definition at line 269 of file bink.h.
Referenced by BinkVideoTrack(), decodePacket(), and getHeight().
|
private |
|
private |
|
private |
The 4 color planes, YUVA, last frame.
Definition at line 291 of file bink.h.
Referenced by BinkVideoTrack(), and decodePacket().
|
private |
Are the planes ordered (A)YVU instead of (A)YUV?
Definition at line 276 of file bink.h.
Referenced by decodePacket().
|
private |
Definition at line 268 of file bink.h.
Referenced by BinkVideoTrack(), decodePacket(), and getWidth().