diff options
Diffstat (limited to 'image/codecs/indeo/indeo.h')
-rw-r--r-- | image/codecs/indeo/indeo.h | 352 |
1 files changed, 176 insertions, 176 deletions
diff --git a/image/codecs/indeo/indeo.h b/image/codecs/indeo/indeo.h index bff5501bcb..3b0b1854f5 100644 --- a/image/codecs/indeo/indeo.h +++ b/image/codecs/indeo/indeo.h @@ -46,18 +46,18 @@ namespace Indeo { * Indeo 4 frame types. */ enum { - IVI4_FRAMETYPE_INTRA = 0, - IVI4_FRAMETYPE_INTRA1 = 1, ///< intra frame with slightly different bitstream coding - IVI4_FRAMETYPE_INTER = 2, ///< non-droppable P-frame - IVI4_FRAMETYPE_BIDIR = 3, ///< bidirectional frame - IVI4_FRAMETYPE_INTER_NOREF = 4, ///< droppable P-frame - IVI4_FRAMETYPE_NULL_FIRST = 5, ///< empty frame with no data - IVI4_FRAMETYPE_NULL_LAST = 6 ///< empty frame with no data + IVI4_FRAMETYPE_INTRA = 0, + IVI4_FRAMETYPE_INTRA1 = 1, ///< intra frame with slightly different bitstream coding + IVI4_FRAMETYPE_INTER = 2, ///< non-droppable P-frame + IVI4_FRAMETYPE_BIDIR = 3, ///< bidirectional frame + IVI4_FRAMETYPE_INTER_NOREF = 4, ///< droppable P-frame + IVI4_FRAMETYPE_NULL_FIRST = 5, ///< empty frame with no data + IVI4_FRAMETYPE_NULL_LAST = 6 ///< empty frame with no data }; enum { - IVI_MB_HUFF = 0, /// Huffman table is used for coding macroblocks - IVI_BLK_HUFF = 1 /// Huffman table is used for coding blocks + IVI_MB_HUFF = 0, /// Huffman table is used for coding macroblocks + IVI_BLK_HUFF = 1 /// Huffman table is used for coding blocks }; /** @@ -83,16 +83,16 @@ typedef void (*IviMCAvgFunc)(int16 *buf, const int16 *refBuf1, const int16 *refB * calculate number of macroblocks in a tile */ #define IVI_MBs_PER_TILE(tileWidth, tileHeight, mbSize) \ - ((((tileWidth) + (mbSize) - 1) / (mbSize)) * (((tileHeight) + (mbSize) - 1) / (mbSize))) + ((((tileWidth) + (mbSize) - 1) / (mbSize)) * (((tileHeight) + (mbSize) - 1) / (mbSize))) /** * huffman codebook descriptor */ struct IVIHuffDesc { - int32 _numRows; - uint8 _xBits[16]; + int32 _numRows; + uint8 _xBits[16]; - /* + /** * Generate a huffman codebook from the given descriptor * and convert it into the FFmpeg VLC table. * @@ -102,7 +102,7 @@ struct IVIHuffDesc { */ int createHuffFromDesc(VLC *vlc, bool flag) const; - /* + /** * Compare two huffman codebook descriptors. * * @param[in] desc2 Ptr to the 2nd descriptor to compare @@ -110,7 +110,7 @@ struct IVIHuffDesc { */ bool huffDescCompare(const IVIHuffDesc *desc2) const; - /* + /** * Copy huffman codebook descriptors. * * @param[in] src ptr to the source descriptor @@ -127,11 +127,11 @@ struct IVIHuffTab { public: int32 _tabSel; /// index of one of the predefined tables /// or "7" for custom one - VLC * _tab; /// pointer to the table associated with tab_sel + VLC * _tab; /// pointer to the table associated with tab_sel - /// the following are used only when tab_sel == 7 - IVIHuffDesc _custDesc; /// custom Huffman codebook descriptor - VLC _custTab; /// vlc table for custom codebook + /// the following are used only when tab_sel == 7 + IVIHuffDesc _custDesc; /// custom Huffman codebook descriptor + VLC _custTab; /// vlc table for custom codebook /** * Constructor @@ -154,26 +154,26 @@ public: * run-value (RLE) table descriptor */ struct RVMapDesc { - uint8 _eobSym; ///< end of block symbol - uint8 _escSym; ///< escape symbol - uint8 _runtab[256]; - int8 _valtab[256]; + uint8 _eobSym; ///< end of block symbol + uint8 _escSym; ///< escape symbol + uint8 _runtab[256]; + int8 _valtab[256]; }; /** * information for Indeo macroblock (16x16, 8x8 or 4x4) */ struct IVIMbInfo { - int16 _xPos; - int16 _yPos; - uint32 _bufOffs; ///< address in the output buffer for this mb - uint8 _type; ///< macroblock type: 0 - INTRA, 1 - INTER - uint8 _cbp; ///< coded block pattern - int8 _qDelta; ///< quant delta - int8 _mvX; ///< motion vector (x component) - int8 _mvY; ///< motion vector (y component) - int8 _bMvX; ///< second motion vector (x component) - int8 _bMvY; ///< second motion vector (y component) + int16 _xPos; + int16 _yPos; + uint32 _bufOffs; ///< address in the output buffer for this mb + uint8 _type; ///< macroblock type: 0 - INTRA, 1 - INTER + uint8 _cbp; ///< coded block pattern + int8 _qDelta; ///< quant delta + int8 _mvX; ///< motion vector (x component) + int8 _mvY; ///< motion vector (y component) + int8 _bMvX; ///< second motion vector (x component) + int8 _bMvY; ///< second motion vector (y component) IVIMbInfo(); }; @@ -182,16 +182,16 @@ struct IVIMbInfo { * information for Indeo tile */ struct IVITile { - int _xPos; - int _yPos; - int _width; - int _height; - int _mbSize; - bool _isEmpty; - int _dataSize; ///< size of the data in bytes - int _numMBs; ///< number of macroblocks in this tile - IVIMbInfo * _mbs; ///< array of macroblock descriptors - IVIMbInfo * _refMbs; ///< ptr to the macroblock descriptors of the reference tile + int _xPos; + int _yPos; + int _width; + int _height; + int _mbSize; + bool _isEmpty; + int _dataSize; ///< size of the data in bytes + int _numMBs; ///< number of macroblocks in this tile + IVIMbInfo * _mbs; ///< array of macroblock descriptors + IVIMbInfo * _refMbs; ///< ptr to the macroblock descriptors of the reference tile IVITile(); }; @@ -200,49 +200,49 @@ struct IVITile { * information for Indeo wavelet band */ struct IVIBandDesc { - int _plane; ///< plane number this band belongs to - int _bandNum; ///< band number - int _width; - int _height; - int _aHeight; ///< aligned band height - const uint8 * _dataPtr; ///< ptr to the first byte of the band data - int _dataSize; ///< size of the band data - int16 * _buf; ///< pointer to the output buffer for this band - int16 * _refBuf; ///< pointer to the reference frame buffer (for motion compensation) - int16 * _bRefBuf; ///< pointer to the second reference frame buffer (for motion compensation) - int16 * _bufs[4]; ///< array of pointers to the band buffers - int _pitch; ///< _pitch associated with the buffers above - bool _isEmpty; - int _mbSize; ///< macroblock size - int _blkSize; ///< block size - uint8 _isHalfpel; ///< precision of the motion compensation: 0 - fullpel, 1 - halfpel - bool _inheritMv; ///< tells if motion vector is inherited from reference macroblock - bool _inheritQDelta; ///< tells if quantiser delta is inherited from reference macroblock - bool _qdeltaPresent; ///< tells if Qdelta signal is present in the bitstream (Indeo5 only) - int _quantMat; ///< dequant matrix index - int _globQuant; ///< quant base for this band - const uint8 * _scan; ///< ptr to the scan pattern - int _scanSize; ///< size of the scantable - - IVIHuffTab _blkVlc; ///< vlc table for decoding block data - - int _numCorr; ///< number of correction entries - uint8 _corr[61 * 2]; ///< rvmap correction pairs - int _rvmapSel; ///< rvmap table selector - RVMapDesc * _rvMap; ///< ptr to the RLE table for this band - int _numTiles; ///< number of tiles in this band - IVITile * _tiles; ///< array of tile descriptors - InvTransformPtr *_invTransform; - int _transformSize; - DCTransformPtr *_dcTransform; - bool _is2dTrans; - int32 _checksum; ///< for debug purposes - int _checksumPresent; - int _bufSize; ///< band buffer size in bytes - const uint16 * _intraBase; ///< quantization matrix for intra blocks - const uint16 * _interBase; ///< quantization matrix for inter blocks - const uint8 * _intraScale; ///< quantization coefficient for intra blocks - const uint8 * _interScale; ///< quantization coefficient for inter blocks + int _plane; ///< plane number this band belongs to + int _bandNum; ///< band number + int _width; + int _height; + int _aHeight; ///< aligned band height + const uint8 * _dataPtr; ///< ptr to the first byte of the band data + int _dataSize; ///< size of the band data + int16 * _buf; ///< pointer to the output buffer for this band + int16 * _refBuf; ///< pointer to the reference frame buffer (for motion compensation) + int16 * _bRefBuf; ///< pointer to the second reference frame buffer (for motion compensation) + int16 * _bufs[4]; ///< array of pointers to the band buffers + int _pitch; ///< _pitch associated with the buffers above + bool _isEmpty; + int _mbSize; ///< macroblock size + int _blkSize; ///< block size + uint8 _isHalfpel; ///< precision of the motion compensation: 0 - fullpel, 1 - halfpel + bool _inheritMv; ///< tells if motion vector is inherited from reference macroblock + bool _inheritQDelta; ///< tells if quantiser delta is inherited from reference macroblock + bool _qdeltaPresent; ///< tells if Qdelta signal is present in the bitstream (Indeo5 only) + int _quantMat; ///< dequant matrix index + int _globQuant; ///< quant base for this band + const uint8 * _scan; ///< ptr to the scan pattern + int _scanSize; ///< size of the scantable + + IVIHuffTab _blkVlc; ///< vlc table for decoding block data + + int _numCorr; ///< number of correction entries + uint8 _corr[61 * 2]; ///< rvmap correction pairs + int _rvmapSel; ///< rvmap table selector + RVMapDesc * _rvMap; ///< ptr to the RLE table for this band + int _numTiles; ///< number of tiles in this band + IVITile * _tiles; ///< array of tile descriptors + InvTransformPtr *_invTransform; + int _transformSize; + DCTransformPtr *_dcTransform; + bool _is2dTrans; + int32 _checksum; ///< for debug purposes + int _checksumPresent; + int _bufSize; ///< band buffer size in bytes + const uint16 * _intraBase; ///< quantization matrix for intra blocks + const uint16 * _interBase; ///< quantization matrix for inter blocks + const uint8 * _intraScale; ///< quantization coefficient for intra blocks + const uint8 * _interScale; ///< quantization coefficient for inter blocks IVIBandDesc(); @@ -250,14 +250,14 @@ struct IVIBandDesc { }; struct IVIPicConfig { - uint16 _picWidth; - uint16 _picHeight; - uint16 _chromaWidth; - uint16 _chromaHeight; - uint16 _tileWidth; - uint16 _tileHeight; - uint8 _lumaBands; - uint8 _chromaBands; + uint16 _picWidth; + uint16 _picHeight; + uint16 _chromaWidth; + uint16 _chromaHeight; + uint16 _tileWidth; + uint16 _tileHeight; + uint8 _lumaBands; + uint8 _chromaBands; IVIPicConfig(); @@ -271,10 +271,10 @@ struct IVIPicConfig { * color plane (luma or chroma) information */ struct IVIPlaneDesc { - uint16 _width; - uint16 _height; - uint8 _numBands; ///< number of bands this plane subdivided into - IVIBandDesc * _bands; ///< array of band descriptors + uint16 _width; + uint16 _height; + uint8 _numBands; ///< number of bands this plane subdivided into + IVIBandDesc * _bands; ///< array of band descriptors IVIPlaneDesc(); @@ -282,7 +282,7 @@ struct IVIPlaneDesc { static int initTiles(IVIPlaneDesc *planes, int tileWidth, int tileHeight); - /* + /** * Free planes, bands and macroblocks buffers. * * @param[in] planes pointer to the array of the plane descriptors @@ -309,35 +309,35 @@ struct AVFrame { #define AV_NUM_DATA_POINTERS 3 /** - * pointer to the picture/channel planes. - * This might be different from the first allocated byte - * - * Some decoders access areas outside 0,0 - width,height, please - * see avcodec_align_dimensions2(). Some filters and swscale can read - * up to 16 bytes beyond the planes, if these filters are to be used, - * then 16 extra bytes must be allocated. - * - * NOTE: Except for hwaccel formats, pointers not needed by the format - * MUST be set to NULL. - */ + * pointer to the picture/channel planes. + * This might be different from the first allocated byte + * + * Some decoders access areas outside 0,0 - width,height, please + * see avcodec_align_dimensions2(). Some filters and swscale can read + * up to 16 bytes beyond the planes, if these filters are to be used, + * then 16 extra bytes must be allocated. + * + * NOTE: Except for hwaccel formats, pointers not needed by the format + * MUST be set to NULL. + */ uint8 *_data[AV_NUM_DATA_POINTERS]; - /** - * For video, size in bytes of each picture line. - * For audio, size in bytes of each plane. - * - * For audio, only linesize[0] may be set. For planar audio, each channel - * plane must be the same size. - * - * For video the linesizes should be multiples of the CPUs alignment - * preference, this is 16 or 32 for modern desktop CPUs. - * Some code requires such alignment other code can be slower without - * correct alignment, for yet other it makes no difference. - * - * @note The linesize may be larger than the size of usable data -- there - * may be extra padding present for performance reasons. - */ - int _linesize[AV_NUM_DATA_POINTERS]; + /** + * For video, size in bytes of each picture line. + * For audio, size in bytes of each plane. + * + * For audio, only linesize[0] may be set. For planar audio, each channel + * plane must be the same size. + * + * For video the linesizes should be multiples of the CPUs alignment + * preference, this is 16 or 32 for modern desktop CPUs. + * Some code requires such alignment other code can be slower without + * correct alignment, for yet other it makes no difference. + * + * @note The linesize may be larger than the size of usable data -- there + * may be extra padding present for performance reasons. + */ + int _linesize[AV_NUM_DATA_POINTERS]; /** * Constructor @@ -372,56 +372,56 @@ private: VLC _iviMbVlcTabs[8]; ///< static macroblock Huffman tables VLC _iviBlkVlcTabs[8]; ///< static block Huffman tables public: - GetBits * _gb; - RVMapDesc _rvmapTabs[9]; ///< local corrected copy of the static rvmap tables - - uint32 _frameNum; - int _frameType; - int _prevFrameType; ///< frame type of the previous frame - uint32 _dataSize; ///< size of the frame data in bytes from picture header - int _isScalable; - const uint8 * _frameData; ///< input frame data pointer - int _interScal; ///< signals a sequence of scalable inter frames - uint32 _frameSize; ///< frame size in bytes - uint32 _picHdrSize; ///< picture header size in bytes - uint8 _frameFlags; - uint16 _checksum; ///< frame _checksum - - IVIPicConfig _picConf; - IVIPlaneDesc _planes[3]; ///< color planes - - int _bufSwitch; ///< used to switch between three buffers - int _dstBuf; ///< buffer index for the currently decoded frame - int _refBuf; ///< inter frame reference buffer index - int _ref2Buf; ///< temporal storage for switching buffers - int _bRefBuf; ///< second reference frame buffer index - - IVIHuffTab _mbVlc; ///< current macroblock table descriptor - IVIHuffTab _blkVlc; ///< current block table descriptor - - uint8 _rvmapSel; - bool _inImf; - bool _inQ; ///< flag for explicitly stored quantiser delta - uint8 _picGlobQuant; - uint8 _unknown1; - - uint16 _gopHdrSize; - uint8 _gopFlags; - uint32 _lockWord; - - bool _hasBFrames; - bool _hasTransp; ///< transparency mode enabled - bool _usesTiling; - bool _usesHaar; - bool _usesFullpel; - - bool _gopInvalid; - int _bufInvalid[4]; - - bool _isIndeo4; - - AVFrame * _pFrame; - bool _gotPFrame; + GetBits * _gb; + RVMapDesc _rvmapTabs[9]; ///< local corrected copy of the static rvmap tables + + uint32 _frameNum; + int _frameType; + int _prevFrameType; ///< frame type of the previous frame + uint32 _dataSize; ///< size of the frame data in bytes from picture header + int _isScalable; + const uint8 * _frameData; ///< input frame data pointer + int _interScal; ///< signals a sequence of scalable inter frames + uint32 _frameSize; ///< frame size in bytes + uint32 _picHdrSize; ///< picture header size in bytes + uint8 _frameFlags; + uint16 _checksum; ///< frame _checksum + + IVIPicConfig _picConf; + IVIPlaneDesc _planes[3]; ///< color planes + + int _bufSwitch; ///< used to switch between three buffers + int _dstBuf; ///< buffer index for the currently decoded frame + int _refBuf; ///< inter frame reference buffer index + int _ref2Buf; ///< temporal storage for switching buffers + int _bRefBuf; ///< second reference frame buffer index + + IVIHuffTab _mbVlc; ///< current macroblock table descriptor + IVIHuffTab _blkVlc; ///< current block table descriptor + + uint8 _rvmapSel; + bool _inImf; + bool _inQ; ///< flag for explicitly stored quantiser delta + uint8 _picGlobQuant; + uint8 _unknown1; + + uint16 _gopHdrSize; + uint8 _gopFlags; + uint32 _lockWord; + + bool _hasBFrames; + bool _hasTransp; ///< transparency mode enabled + bool _usesTiling; + bool _usesHaar; + bool _usesFullpel; + + bool _gopInvalid; + int _bufInvalid[4]; + + bool _isIndeo4; + + AVFrame * _pFrame; + bool _gotPFrame; IVI45DecContext(); private: |