83 class SeekableReadStream;
92 class PacketizedAudioStream;
394 #endif // VIDEO_BINK_H
Huffman huffman
Huffman codebook.
void readPatterns(VideoFrame &video, Bundle &bundle)
int countLength
Length of number of entries to decode (in bits) for the current plane.
void readHuffman(VideoFrame &video, Huffman &huffman)
Read the symbols for a Huffman code.
An abstract representation of an audio track.
void readResidue(VideoFrame &video, int16 *block, int masksCount)
Reads 8x8 block with residue after motion compensation.
int _colLastVal
Value of the last decoded high nibble in color data types.
A simple rational class that holds fractions.
Pixel values used for different block types.
void blockMotion(DecodeContext &ctx)
Common::Rational _frameRate
The frame rate of the video.
uint32 readBundleCount(VideoFrame &video, Bundle &bundle)
Read a count value out of a bundle.
void decodePacket(Graphics::Surface &surface, VideoFrame &frame)
Decode a video packet.
(Inverse) Discrete Cosine Transforms.
Block is composed from runs of colors with custom scan order.
void blockRaw(DecodeContext &ctx)
void readAudioCoeffs(Common::BitStream &bits, float *coeffs)
Common::ScopedArray< byte > data
Buffer for decoded symbols.
void blockScaledPattern(DecodeContext &ctx)
void readRuns(VideoFrame &video, Bundle &bundle)
bool canBufferData() const
DC values for intrablocks with DCT.
void blockScaledSkip(DecodeContext &ctx)
int getFrameCount() const
byte * curPtr
Pointer to the data that wasn't yet read.
void videoPacket(VideoFrame &video)
Decode a video packet.
int16 prevCoeffs[kAudioBlockSizeMax]
void audioBlockRDFT(Common::BitStream &bits)
Decode a RDFT'd audio block.
A generic interface for video decoders.
A decoder for RAD Game Tools' Bink videos.
void blockScaledIntra(DecodeContext &ctx)
void blockRun(DecodeContext &ctx)
A simple scoped smart pointer template.
int32 getBundleValue(Source source)
Get a direct value out of a bundle.
uint32 _audioTrack
Audio track to use.
void blockScaledFill(DecodeContext &ctx)
Common::Timestamp _audioBuffered
X components of motion value.
void blockScaledRun(DecodeContext &ctx)
void IDCTPut(DecodeContext &ctx, int16 *block)
void readBlockTypes(VideoFrame &video, Bundle &bundle)
bool _hasAlpha
Do video frames have alpha?
Source
IDs for different data types used in Bink video codec.
void initBundles()
Initialize the bundles.
void readColors(VideoFrame &video, Bundle &bundle)
BlockType
Bink video block types.
Huffman _colHighHuffman[16]
Huffman codebooks to use for decoding high nibbles in color data types.
An AudioStream designed to work in terms of packets.
Motion block with DCT applied to the difference.
static void floatToInt16Interleave(int16 *dst, const float **src, uint32 length, uint8 channels)
Low-level type definitions to handle fixed width types portably.
std::vector< VideoFrame > _frames
All video frames.
bool _swapPlanes
Are the planes ordered (A)YVU instead of (A)YUV?
uint32 _id
The BIK FourCC.
An abstract representation of a video track.
BinkAudioTrack(size_t index, AudioInfo &audio)
Common::ScopedArray< byte > _curPlanes[4]
The 4 color planes, YUVA, current frame.
float * coeffsPtr[kAudioChannelsMax]
byte * curDec
Pointer to the data that wasn't yet decoded.
Bundle _bundles[kSourceMAX]
Bundles for decoding all data types.
void blockFill(DecodeContext &ctx)
void blockPattern(DecodeContext &ctx)
Common::ScopedPtr< Common::Huffman > _huffman[16]
The 16 Huffman codebooks used in Bink decoding.
Sound::AudioStream * getAudioStream() const
16x16 block types (a subset of 8x8 block types).
Generic audio input stream.
Common::ScopedPtr< Common::SeekableReadStream > _bink
void initHuffman()
Initialize the Huffman decoders.
void readMotionValues(VideoFrame &video, Bundle &bundle)
Block is copied from previous frame with some offset.
int countLengths[2]
Lengths of number of entries to decode (in bits).
Motion block with some difference added.
Data structure used for decoding a single Bink data type.
float coeffs[16 *kAudioBlockSizeMax]
8-bit values for 2-color pattern fill.
void readDCS(VideoFrame &video, Bundle &bundle, int startBits, bool hasSign)
byte * dataEnd
Pointer to the data end end.
void readBundle(VideoFrame &video, Source source)
Read/Initialize a bundle for decoding a plane.
void decodeNextTrackFrame(VideoTrack &track)
Decode enough data for the next frame.
Sound::PacketizedAudioStream * _audioStream
Timestamps allow specifying points in time and measuring time intervals with a sub-millisecond granul...
Common::Rational getFrameRate() const
void blockInter(DecodeContext &ctx)
byte symbols[16]
Huffman symbol => Bink symbol translation list.
static const int kAudioBlockSizeMax
int _curFrame
Current Frame.
byte getHuffmanSymbol(VideoFrame &video, Huffman &huffman)
Read and translate a symbol out of a Huffman code.
Y components of motion value.
Block is filled with two colors following custom pattern.
void load()
Load a Bink file.
Rational number implementation.
DC values for interblocks with DCT.
void checkAudioBuffer(AudioTrack &track, const Common::Timestamp &endTime)
Ensure that there is enough audio buffered in the given track to reach the given timestamp.
void IDCTAdd(DecodeContext &ctx, int16 *block)
static const int kAudioChannelsMax
void blockScaledRaw(DecodeContext &ctx)
Data structure for decoding and translating Huffman'd data.
void audioBlock(Common::BitStream &bits, int16 *out)
Decode an audio block.
BinkVideoTrack(uint32 width, uint32 height, uint32 frameCount, const Common::Rational &frameRate, bool swapPlanes, bool hasAlpha, uint32 id)
void decodeAudio(Common::SeekableReadStream &bink, const std::vector< VideoFrame > &frames, const std::vector< AudioInfo > &audioTracks, const Common::Timestamp &endTime)
Decode audio data up to endTime.
(Inverse) Real Discrete Fourier Transform.
Run lengths for special fill block.
void blockResidue(DecodeContext &ctx)
void decodePlane(VideoFrame &video, int planeIdx, bool isChroma)
Decode a plane.
Common::ScopedArray< byte > _oldPlanes[4]
The 4 color planes, YUVA, last frame.
float getFloat(Common::BitStream &bits)
Interface for a seekable & readable data stream.
void initAudioTrack(AudioInfo &audio)
Bink(Common::SeekableReadStream *bink)
void audioBlockDCT(Common::BitStream &bits)
Decode a DCT'd audio block.
void blockSkip(DecodeContext &ctx)
std::vector< AudioInfo > _audioTracks
All audio tracks.
int index
Index of the Huffman codebook to use.
Block is filled with single color.
void blockIntra(DecodeContext &ctx)
Generic video decoder interface.
void blockScaled(DecodeContext &ctx)
void readDCTCoeffs(VideoFrame &video, int16 *block, bool isIntra)
Reads 8x8 block of DCT coefficients.
void mergeHuffmanSymbols(VideoFrame &video, byte *dst, const byte *src, int size)
Merge two Huffman symbol lists.