📄 bitstrm.h
字号:
/*************************************************************************
This software module was originally developed by
Ming-Chieh Lee (mingcl@microsoft.com), Microsoft Corporation
Wei-ge Chen (wchen@microsoft.com), Microsoft Corporation
Bruce Lin (blin@microsoft.com), Microsoft Corporation
Chuang Gu (chuanggu@microsoft.com), Microsoft Corporation
(date: March, 1996)
and also edited by
Yoshihiro Kikuchi (TOSHIBA CORPORATION)
Takeshi Nagai (TOSHIBA CORPORATION)
Toshiaki Watanabe (TOSHIBA CORPORATION)
Noboru Yamaguchi (TOSHIBA CORPORATION)
in the course of development of the MPEG-4 Video (ISO/IEC 14496-2).
This software module is an implementation of a part of one or more MPEG-4 Video tools
as specified by the MPEG-4 Video.
ISO/IEC gives users of the MPEG-4 Video free license to this software module or modifications
thereof for use in hardware or software products claiming conformance to the MPEG-4 Video.
Those intending to use this software module in hardware or software products are advised that its use may infringe existing patents.
The original developer of this software module and his/her company,
the subsequent editors and their companies,
and ISO/IEC have no liability for use of this software module or modifications thereof in an implementation.
Copyright is not released for non MPEG-4 Video conforming products.
Microsoft retains full right to use the code for his/her own purpose,
assign or donate the code to a third party and to inhibit third parties from using the code for non <MPEG standard> conforming products.
This copyright notice must be included in all copies or derivative works.
Copyright (c) 1996, 1997.
Module Name:
bitstrm.h
Abstract:
Classes for bitstream I/O.
Revision History:
*************************************************************************/
#ifndef _BITSTREAM_H_
#define _BITSTREAM_H_
/************************** Fast Bitstream routines ***************************/
#define _BSFAST_DECL unsigned long _cbits; unsigned long _bitsused=0;
#define _BSFAST_INIT() _BSFastPreload()
#define _BSFAST_DONE() _BSFastFlushBits(_bitsused); _bitsused=0;
#define _BSFastPreload() _BSFastFlushBits(_bitsused); _cbits = _BSFastPeekMaxBits(); _bitsused=0;
#if MIN_BITS_PREHUFF>0
#define _BSFastCheckedPreload() if (_bitsused>MIN_BITS_PREHUFF) { _BSFastFlushBits(_bitsused); _cbits = _BSFastPeekMaxBits(); _bitsused=0; }
#else
#define _BSFastCheckedPreload _BSFastPreload
#endif
#define _BSFastSkipBits(_count) _cbits<<=_count; _bitsused+=_count
#define _BSFastPeekBits(_count) (_cbits>>(32-_count))
#define _BSFastGetBits(_count) (_cbits>>(32-(_count))); _cbits<<=(_count); _bitsused+=(_count)
#define _BSFastGetBits2(_cbits_,_count,_bitsused_,_outbits_) { (_outbits_)=((_cbits_)>>(32-(_count))); (_cbits_)<<=(_count); (_bitsused_)+=(_count); }
#define _BSFastFlushBits(_count) getBits(_count);
#define _BSFastPeekMaxBits() (peekBits( 24)<<8)
#define _BSFastCurrentBits() _cbits
#ifdef FAST_LUT_DECODE
/* fast LUT decoder */
typedef union {
int lut_entry;
struct {
short sym;
short len;
} ;
} sym_tab;
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -