资源简介
找了好久的AVS1参考代码RM60,很好的资源,用于学习AVS1标准和实现!
代码片段和文件信息
/*
***********************************************************************
* COPYRIGHT AND WARRANTY INFORMATION
*
* Copyright 2003 Advanced Audio Video Coding Standard Part II
*
* DISCLAIMER OF WARRANTY
*
* These software programs are available to the users without any
* license fee or royalty on an “as is“ basis. The AVS disclaims
* any and all warranties whether express implied or statutory
* including any implied warranties of merchantability or of fitness
* for a particular purpose. In no event shall the contributors or
* the AVS be liable for any incidental punitive or consequential
* damages of any kind whatsoever arising from the use of this program.
*
* This disclaimer of warranty extends to the user of this program
* and user‘s customers employees agents transferees successors
* and assigns.
*
* The AVS does not represent or warrant that the program furnished
* hereunder are free of infringement of any third-party patents.
* Commercial implementations of AVS including shareware may be
* subject to royalty fees to patent holders. Information regarding
* the AVS patent policy is available from the AVS Web site at
* http://www.avs.org.cn
*
* THIS IS NOT A GRANT OF PATENT RIGHTS - SEE THE AVS PATENT POLICY.
************************************************************************
*/
/*
*************************************************************************************
* File name: bitstream.c
* Function: decode bitstream
*
*************************************************************************************
*/
#include
#include
#include
#include “global.h“
#include “annexb.h“
#include “memalloc.h“
#include “vlc.h“
FILE *bitsfile = NULL; //!< the bit stream file
#define SVA_STREAM_BUF_SIZE 1024
unsigned char bit[8] = {0x800x400x200x100x080x040x020x01};
typedef struct {
FILE *f;
unsigned char buf[SVA_STREAM_BUF_SIZE]; //流缓冲区size must be large than 3 bytes
unsigned int uClearBits;//不含填充位的位缓冲,32位,初始值是0xFFFFFFFF
unsigned int uPre3Bytes;// 含填充位的位缓冲,32位,初始值是0x00000000
int iBytePosition; //当前字节位置
int iBufBytesNum; //最近一次读入缓冲区的字节数
int iClearBitsNum; //不含填充位的位的个数
int iStuffBitsNum; //已剔除的填充位的个数,遇到开始码时置0
int iBitsCount; //码流总位数
} InputStream;
InputStream IRABS;
InputStream *pIRABS = &IRABS;
void OpenIRABS(InputStream *p char *fname)
{
p->f = fopen(fname“rb“);
if(p->f==NULL){printf (“\nCan‘t open file %s“fname);exit(-1);}
p->uClearBits = 0xffffffff;
p->iBytePosition = 0;
p->iBufBytesNum = 0;
p->iClearBitsNum = 0;
p->iStuffBitsNum = 0;
p->iBitsCount = 0;
p->uPre3Bytes = 0;
}
void CloseIRABS(InputStream *p)
{
fclose(p->f);
}
//------------------------------------------------------------------------
// move iBytePosition to the next byte of start code prefix
//return
// 0 : OK
// -1 : arrive at stream end and start code is not found
// -2 : p->iByte
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 720 2005-07-21 14:15 rm60\rmMBAFF on rm52c\bin\dataDec.txt
文件 503 2005-04-25 11:34 rm60\rmMBAFF on rm52c\bin\decoder.cfg
文件 5424 2005-07-20 15:36 rm60\rmMBAFF on rm52c\bin\encoder.cfg
文件 1155 2005-07-20 15:42 rm60\rmMBAFF on rm52c\bin\log.dat
文件 642 2005-07-21 14:15 rm60\rmMBAFF on rm52c\bin\log.dec
文件 11119 2005-07-21 14:15 rm60\rmMBAFF on rm52c\bin\stat.dat
文件 576786 2005-07-20 15:42 rm60\rmMBAFF on rm52c\bin\test.avs
文件 0 2005-07-20 15:36 rm60\rmMBAFF on rm52c\bin\trace_enc.txt
文件 1889 2005-03-20 21:04 rm60\rmMBAFF on rm52c\ldecod\inc\annexb.h
文件 5867 2005-03-20 21:04 rm60\rmMBAFF on rm52c\ldecod\inc\avs.h
文件 3752 2005-03-20 21:04 rm60\rmMBAFF on rm52c\ldecod\inc\block.h
文件 1765 2005-03-20 21:04 rm60\rmMBAFF on rm52c\ldecod\inc\b_fr
文件 7853 2005-03-20 21:04 rm60\rmMBAFF on rm52c\ldecod\inc\contributors.h
文件 8014 2005-04-22 11:19 rm60\rmMBAFF on rm52c\ldecod\inc\defines.h
文件 3175 2005-03-20 21:04 rm60\rmMBAFF on rm52c\ldecod\inc\elements.h
文件 20324 2005-03-21 01:14 rm60\rmMBAFF on rm52c\ldecod\inc\global.h
文件 2045 2005-03-20 21:04 rm60\rmMBAFF on rm52c\ldecod\inc\golomb_dec.h
文件 2049 2005-03-20 21:04 rm60\rmMBAFF on rm52c\ldecod\inc\header.h
文件 1758 2005-03-20 21:04 rm60\rmMBAFF on rm52c\ldecod\inc\image.h
文件 4046 2005-03-21 01:14 rm60\rmMBAFF on rm52c\ldecod\inc\macroblock.h
文件 333 2005-03-20 21:04 rm60\rmMBAFF on rm52c\ldecod\inc\mbaff.h
文件 4245 2005-03-20 21:04 rm60\rmMBAFF on rm52c\ldecod\inc\mbuffer.h
文件 2307 2005-03-20 21:04 rm60\rmMBAFF on rm52c\ldecod\inc\memalloc.h
文件 2924 2005-03-20 21:04 rm60\rmMBAFF on rm52c\ldecod\inc\vlc.h
文件 256 2005-03-20 21:04 rm60\rmMBAFF on rm52c\ldecod\inc\vssver.scc
文件 1596 2005-03-20 21:04 rm60\rmMBAFF on rm52c\ldecod\Makefile
文件 222208 2008-06-25 09:31 rm60\rmMBAFF on rm52c\ldecod\Release\ldecod.bsc
文件 9502 2005-03-21 01:03 rm60\rmMBAFF on rm52c\ldecod\src\bitstream.c
文件 35867 2005-07-19 21:04 rm60\rmMBAFF on rm52c\ldecod\src\block.c
文件 64209 2005-03-20 21:04 rm60\rmMBAFF on rm52c\ldecod\src\block_const.c
............此处省略92个文件信息
- 上一篇:flex视频监控播放器
- 下一篇:USB CCID 规范
评论
共有 条评论