22 #include "common/scummsys.h" 23 #include "graphics/surface.h" 24 #include "image/codecs/codec.h" 35 #ifndef IMAGE_CODECS_INDEO_INDEO_H 36 #define IMAGE_CODECS_INDEO_INDEO_H 38 #include "image/codecs/indeo/get_bits.h" 39 #include "image/codecs/indeo/vlc.h" 48 IVI4_FRAMETYPE_INTRA = 0,
49 IVI4_FRAMETYPE_INTRA1 = 1,
50 IVI4_FRAMETYPE_INTER = 2,
51 IVI4_FRAMETYPE_BIDIR = 3,
52 IVI4_FRAMETYPE_INTER_NOREF = 4,
53 IVI4_FRAMETYPE_NULL_FIRST = 5,
54 IVI4_FRAMETYPE_NULL_LAST = 6
65 typedef void (InvTransformPtr)(
const int32 *in, int16 *out, uint32 pitch,
const uint8 *flags);
66 typedef void (DCTransformPtr)(
const int32 *in, int16 *out, uint32 pitch,
int blkSize);
68 typedef void (*IviMCFunc)(int16 *buf,
const int16 *refBuf, uint32 pitch,
int mcType);
69 typedef void (*IviMCAvgFunc)(int16 *buf,
const int16 *refBuf1,
const int16 *refBuf2,
70 uint32 pitch,
int mcType,
int mcType2);
73 #define IVI_VLC_BITS 13 74 #define IVI5_IS_PROTECTED 0x20 79 #define IVI_TOSIGNED(val) (-(((val) >> 1) ^ -((val) & 1))) 84 #define IVI_MBs_PER_TILE(tileWidth, tileHeight, mbSize) \ 85 ((((tileWidth) + (mbSize) - 1) / (mbSize)) * (((tileHeight) + (mbSize) - 1) / (mbSize))) 234 InvTransformPtr *_invTransform;
236 DCTransformPtr *_dcTransform;
239 int _checksumPresent;
248 int initTiles(
IVITile *refTile,
int p,
int b,
int tHeight,
int tWidth);
255 uint16 _chromaHeight;
282 static int initTiles(
IVIPlaneDesc *planes,
int tileWidth,
int tileHeight);
300 static int checkImageSize(
unsigned int w,
unsigned int h,
int logOffset);
309 #define AV_NUM_DATA_POINTERS 3 322 uint8 *_data[AV_NUM_DATA_POINTERS];
339 int _linesize[AV_NUM_DATA_POINTERS];
354 int setDimensions(uint16 width, uint16 height);
359 int getBuffer(
int flags);
370 VLC_TYPE _tableData[8192 * 16][2];
371 VLC _iviMbVlcTabs[8];
372 VLC _iviBlkVlcTabs[8];
422 uint32 _transKeyColor;
432 static const RVMapDesc _ff_ivi_rvmap_tabs[9];
452 void recomposeHaar(
const IVIPlaneDesc *plane, uint8 *dst,
const int dstPitch);
461 void recompose53(
const IVIPlaneDesc *plane, uint8 *dst,
const int dstPitch);
472 void outputPlane(
IVIPlaneDesc *plane, uint8 *dst,
int dstPitch);
494 int decodeTileDataSize(
GetBits *gb);
509 int iviMc(
IVIBandDesc *band, IviMCFunc mc, IviMCAvgFunc mcAvg,
510 int offs,
int mvX,
int mvY,
int mvX2,
int mvY2,
int mcType,
int mcType2);
513 IviMCFunc mc, IviMCAvgFunc mcAvg,
int mvX,
int mvY,
514 int mvX2,
int mvY2, int32 *prevDc,
int isIntra,
515 int mcType,
int mcType2, uint32 quant,
int offs);
517 int iviDcTransform(
IVIBandDesc *band, int32 *prevDc,
int bufOffs,
530 static const uint8 _ffIviVerticalScan8x8[64];
531 static const uint8 _ffIviHorizontalScan8x8[64];
532 static const uint8 _ffIviDirectScan4x4[16];
549 virtual int decodePictureHeader() = 0;
554 virtual void switchBuffers() = 0;
556 virtual bool isNonNullFrame()
const = 0;
564 virtual int decodeBandHeader(
IVIBandDesc *band) = 0;
585 int decodeIndeoFrame();
590 int scaleMV(
int mv,
int mvScale);
IVIHuffTab _blkVlc
current block table descriptor
Definition: indeo.h:399
int8 _bMvX
second motion vector (x component)
Definition: indeo.h:174
int _dataSize
size of the band data
Definition: indeo.h:208
bool _inheritMv
tells if motion vector is inherited from reference macroblock
Definition: indeo.h:218
int _pitch
_pitch associated with the buffers above
Definition: indeo.h:213
const uint8 * _scan
ptr to the scan pattern
Definition: indeo.h:223
const uint8 * _frameData
input frame data pointer
Definition: indeo.h:382
int _globQuant
quant base for this band
Definition: indeo.h:222
uint8 _escSym
escape symbol
Definition: indeo.h:157
int _ref2Buf
temporal storage for switching buffers
Definition: indeo.h:395
int16 * _buf
pointer to the output buffer for this band
Definition: indeo.h:209
uint32 _bufOffs
address in the output buffer for this mb
Definition: indeo.h:168
bool huffDescCompare(const IVIHuffDesc *desc2) const
int8 _bMvY
second motion vector (y component)
Definition: indeo.h:175
uint16 _checksum
frame _checksum
Definition: indeo.h:387
IVIHuffDesc _custDesc
pointer to the table associated with tab_sel
Definition: indeo.h:132
IVIMbInfo * _mbs
array of macroblock descriptors
Definition: indeo.h:192
int _prevFrameType
frame type of the previous frame
Definition: indeo.h:379
uint32 _dataSize
size of the frame data in bytes from picture header
Definition: indeo.h:380
const uint16 * _intraBase
quantization matrix for intra blocks
Definition: indeo.h:241
bool _inQ
flag for explicitly stored quantiser delta
Definition: indeo.h:404
RVMapDesc * _rvMap
ptr to the RLE table for this band
Definition: indeo.h:231
uint8 _type
macroblock type: 0 - INTRA, 1 - INTER
Definition: indeo.h:169
int _numMBs
number of macroblocks in this tile
Definition: indeo.h:191
int _bufSwitch
used to switch between three buffers
Definition: indeo.h:392
int16 * _bRefBuf
pointer to the second reference frame buffer (for motion compensation)
Definition: indeo.h:211
bool _inheritQDelta
tells if quantiser delta is inherited from reference macroblock
Definition: indeo.h:219
IVIHuffTab _transVlc
current transparency table descriptor
Definition: indeo.h:400
virtual int decodeTransparency()
Definition: indeo.h:579
IVIMbInfo * _refMbs
ptr to the macroblock descriptors of the reference tile
Definition: indeo.h:193
uint32 _picHdrSize
picture header size in bytes
Definition: indeo.h:385
const uint8 * _dataPtr
ptr to the first byte of the band data
Definition: indeo.h:207
int16 * _refBuf
pointer to the reference frame buffer (for motion compensation)
Definition: indeo.h:210
int _aHeight
aligned band height
Definition: indeo.h:206
int _rvmapSel
rvmap table selector
Definition: indeo.h:230
int _numTiles
number of tiles in this band
Definition: indeo.h:232
int _bRefBuf
second reference frame buffer index
Definition: indeo.h:396
int _bandNum
band number
Definition: indeo.h:203
uint8 _eobSym
end of block symbol
Definition: indeo.h:156
int _bufSize
band buffer size in bytes
Definition: indeo.h:240
VLC _custTab
custom Huffman codebook descriptor
Definition: indeo.h:133
int8 _qDelta
quant delta
Definition: indeo.h:171
int createHuffFromDesc(VLC *vlc, bool flag) const
int32 _checksum
for debug purposes
Definition: indeo.h:238
uint8 _cbp
coded block pattern
Definition: indeo.h:170
const uint8 * _interScale
quantization coefficient for inter blocks
Definition: indeo.h:244
int _mbSize
macroblock size
Definition: indeo.h:215
IVIHuffTab _mbVlc
current macroblock table descriptor
Definition: indeo.h:398
int _quantMat
dequant matrix index
Definition: indeo.h:221
const uint8 * _intraScale
quantization coefficient for intra blocks
Definition: indeo.h:243
int _blkSize
block size
Definition: indeo.h:216
int _numCorr
number of correction entries
Definition: indeo.h:228
int _dataSize
size of the data in bytes
Definition: indeo.h:190
int8 _mvX
motion vector (x component)
Definition: indeo.h:172
bool setOutputPixelFormat(const Graphics::PixelFormat &format) override
Definition: indeo.h:543
~AVFrame()
Definition: indeo.h:349
Graphics::PixelFormat getPixelFormat() const override
Definition: indeo.h:537
bool _hasTransp
transparency mode enabled
Definition: indeo.h:413
int8 _mvY
motion vector (y component)
Definition: indeo.h:173
IVITile * _tiles
array of tile descriptors
Definition: indeo.h:233
int _width
Definition: indeo.h:307
uint8 _numBands
number of bands this plane subdivided into
Definition: indeo.h:275
IVIBandDesc * _bands
array of band descriptors
Definition: indeo.h:276
IVIHuffTab _blkVlc
vlc table for decoding block data
Definition: indeo.h:226
int _interScal
signals a sequence of scalable inter frames
Definition: indeo.h:383
const uint16 * _interBase
quantization matrix for inter blocks
Definition: indeo.h:242
int _dstBuf
buffer index for the currently decoded frame
Definition: indeo.h:393
Definition: get_bits.h:33
Definition: movie_decoder.h:32
void huffDescCopy(const IVIHuffDesc *src)
uint32 _frameSize
frame size in bytes
Definition: indeo.h:384
int _scanSize
size of the scantable
Definition: indeo.h:224
uint8 _isHalfpel
precision of the motion compensation: 0 - fullpel, 1 - halfpel
Definition: indeo.h:217
int _plane
plane number this band belongs to
Definition: indeo.h:202
bool _qdeltaPresent
tells if Qdelta signal is present in the bitstream (Indeo5 only)
Definition: indeo.h:220
int _refBuf
inter frame reference buffer index
Definition: indeo.h:394