資源簡介
自己注釋的jm8.6最終的注釋版本,希望和廣大學者一起研究,一起進步

代碼片段和文件信息
/*!
?*************************************************************************************
?*?\file?annexb.c
?*
?*?\brief
?*????Annex?B?Byte?Stream?format
?*
?*?\author
?*????Main?contributors?(see?contributors.h?for?copyright?address?and?affiliation?details)
?*??????-?Stephan?Wenger??????????????????
?*************************************************************************************
?*/
#include?
#include?
#include?“global.h“
#include?“annexb.h“
#include?“memalloc.h“
FILE?*bits?=?NULL;????????????????//!static?int?FindStartCode?(unsigned?char?*Buf?int?zeros_in_startcode);
int?IsFirstByteStreamNALU=1;
int?LastAccessUnitExists=0;
int?NALUCount=0;
/*!
?************************************************************************
?*?\brief
?*????Returns?the?size?of?the?NALU?(bits?between?start?codes?in?case?of
?*????Annex?B.??nalu->buf?and?nalu->len?are?filled.??Other?field?in
?*????nalu->?remain?uninitialized?(will?be?taken?care?of?by?NALUtoRBSP.
?*
?*?\return
?*?????0?if?there?is?nothing?any?more?to?read?(EOF)
?*????-1?in?case?of?any?error
?*
?*??\note?Side-effect:?Returns?length?of?start-code?in?bytes.?
?*
?*?\note
?*???GetAnnexbNALU?expects?start?codes?at?byte?aligned?positions?in?the?file
?*
?************************************************************************
?*/
int?GetAnnexbNALU?(NALU_t?*nalu)
{
??int?info2?info3?pos?=?0;
??int?StartCodeFound?rewind;
??char?*Buf;
??int?LeadingZero8BitsCount=0?TrailingZero8Bits=0;
????
??if?((Buf?=?(char*)calloc?(nalu->max_size??sizeof(char)))?==?NULL)?no_mem_exit(“GetAnnexbNALU:?Buf“);
??while(!feof(bits)?&&?(Buf[pos++]=fgetc(bits))==0);
??
??if(feof(bits))
??{
????if(pos==0)
????return?0;
????else
????{
??????printf(?“GetAnnexbNALU?can‘t?read?start?code\n“);
??????free(Buf);
??????return?-1;
????}
??}
??if(Buf[pos-1]!=1)
??{
????printf?(“GetAnnexbNALU:?no?Start?Code?at?the?begin?of?the?NALU?return?-1\n“);
????free(Buf);
????return?-1;
??}
??if(pos<3)
??{
????printf?(“GetAnnexbNALU:?no?Start?Code?at?the?begin?of?the?NALU?return?-1\n“);
????free(Buf);
????return?-1;
??}
??else?if(pos==3)
??{
????nalu->startcodeprefix_len?=?3;
????LeadingZero8BitsCount?=?0;
??}
??else
??{
????LeadingZero8BitsCount?=?pos-4;
????nalu->startcodeprefix_len?=?4;
??}
??//the?1st?byte?stream?NAL?unit?can?has?leading_zero_8bits?but?subsequent?ones?are?not
??//allowed?to?contain?it?since?these?zeros(if?any)?are?considered?trailing_zero_8bits
??//of?the?previous?byte?stream?NAL?unit.
??if(!IsFirstByteStreamNALU?&&?LeadingZero8BitsCount>0)
??{
????printf?(“GetAnnexbNALU:?The?leading_zero_8bits?syntax?can?only?be?present?in?the?first?byte?stream?NAL?unit?return?-1\n“);
????free(Buf);
????return?-1;
??}
??IsFirstByteStreamNALU=0;
??StartCodeFound?=?0;
??info2?=?0;
??info3?=?0;
??while?(!StartCodeFound)
??{
????if?(feof?(bits))
????{
??
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????644??2012-12-14?11:42??jm8.6最終注釋版\jm8.6final\JM\bin\data.txt
?????文件????????160??2013-01-19?21:41??jm8.6最終注釋版\jm8.6final\JM\bin\dataDec.txt
?????文件????????753??2004-09-16?22:38??jm8.6最終注釋版\jm8.6final\JM\bin\decoder.cfg
?????文件??????11218??2012-11-28?11:51??jm8.6最終注釋版\jm8.6final\JM\bin\encoder_ba
?????文件??????11221??2004-09-02?12:46??jm8.6最終注釋版\jm8.6final\JM\bin\encoder_extended.cfg
?????文件??????11217??2012-11-28?11:51??jm8.6最終注釋版\jm8.6final\JM\bin\encoder_main.cfg
?????文件?????114048??2001-09-03?13:05??jm8.6最終注釋版\jm8.6final\JM\bin\foreman_part_qcif.yuv
?????文件???11404800??2006-04-22?05:18??jm8.6最終注釋版\jm8.6final\JM\bin\foreman_qcif.yuv
?????文件?????430179??2013-01-19?21:38??jm8.6最終注釋版\jm8.6final\JM\bin\ldecod.exe
?????文件?????136188??2013-01-19?21:38??jm8.6最終注釋版\jm8.6final\JM\bin\ldecod.map
?????文件?????730112??2013-01-19?21:38??jm8.6最終注釋版\jm8.6final\JM\bin\ldecod.pdb
?????文件????????100??2012-12-14?11:42??jm8.6最終注釋版\jm8.6final\JM\bin\leakybucketparam.cfg
?????文件?????????16??2001-12-20?10:42??jm8.6最終注釋版\jm8.6final\JM\bin\leakybucketrate.cfg
?????文件????1587836??2013-01-12?22:02??jm8.6最終注釋版\jm8.6final\JM\bin\lencod.ilk
?????文件??????????0??2013-01-12?22:02??jm8.6最終注釋版\jm8.6final\JM\bin\lencod.map
?????文件????1025024??2013-01-12?22:02??jm8.6最終注釋版\jm8.6final\JM\bin\lencod.pdb
?????文件???????2593??2012-12-14?11:42??jm8.6最終注釋版\jm8.6final\JM\bin\log.dat
?????文件????????642??2013-01-19?21:41??jm8.6最終注釋版\jm8.6final\JM\bin\log.dec
?????文件?????????66??2004-05-25?15:54??jm8.6最終注釋版\jm8.6final\JM\bin\sg0conf.cfg
?????文件????????126??2004-05-25?15:54??jm8.6最終注釋版\jm8.6final\JM\bin\sg2conf.cfg
?????文件???????1188??2004-05-25?15:54??jm8.6最終注釋版\jm8.6final\JM\bin\sg6conf.cfg
?????文件???????2919??2012-12-14?11:42??jm8.6最終注釋版\jm8.6final\JM\bin\stat.dat
?????文件???????7487??2012-12-14?11:42??jm8.6最終注釋版\jm8.6final\JM\bin\test.264
?????文件??????????0??2013-01-19?21:41??jm8.6最終注釋版\jm8.6final\JM\bin\test_dec.yuv
?????文件?????380160??2012-12-14?11:42??jm8.6最終注釋版\jm8.6final\JM\bin\test_rec.yuv
?????文件????2004269??2012-12-14?11:42??jm8.6最終注釋版\jm8.6final\JM\bin\trace_enc.txt
?????文件??????30821??2004-09-16?18:00??jm8.6最終注釋版\jm8.6final\JM\CHANGES.TXT
?????文件???????5002??2004-01-14?15:19??jm8.6最終注釋版\jm8.6final\JM\Changes_detail.txt
?????文件???????1383??2003-06-11?20:22??jm8.6最終注釋版\jm8.6final\JM\copyright.txt
?????文件???????1069??2001-08-29?13:58??jm8.6最終注釋版\jm8.6final\JM\disclaimer.txt
............此處省略361個文件信息
- 上一篇:DICOM讀取,解析
- 下一篇:Maple 數學軟件
評論
共有 條評論