NALU

NALU

H.264碼流在網(wǎng)絡(luò)中傳輸時(shí)實(shí)際是以NALU的形式進(jìn)行傳輸?shù)?

NALU結(jié)構(gòu)

每個(gè)NALU一個(gè)字節(jié)HeaderRBSP組成.

NAL Header
NAL Header
  • forbidden_zero_bit

forbidden_zero_bit shall be equal to 0.

  • nal_ref_idc
    用于表示當(dāng)前NALU的重要性,值越大,越重要.
    解碼器在解碼處理不過來的時(shí)候,可以丟掉重要性為0的NALU.
nal_ref_idc

nal_ref_idc不等于0時(shí), NAL unit的內(nèi)容可能是SPS/PPS/參考圖像的片等.
nal_ref_idc等于0時(shí),NAL unit的內(nèi)容可能是非參考圖像的片等.

nal_ref_idc shall not be equal to 0 for sequence parameter set or picture parameter set NAL units.
When nal_ref_idc is equal to 0 for one slice or slice data partition NAL unit of a particular picture, it shall be equal to 0 for all slice and slice data partition NAL units of the picture.

SPS/PPS時(shí),nal_ref_idc不可為0.
當(dāng)某個(gè)圖像的片的nal_ref_id等于0時(shí),該圖像的所有片均應(yīng)等于0.

nal_ref_idc shall not be equal to 0 for IDR NAL units, i.e., NAL units with nal_unit_type equal to 5.
nal_ref_idc shall be equal to 0 for all NAL units having nal_unit_type equal to 6, 9, 10, 11, or 12.

The relationship of nal_unit_type and nal_ref_idc
  • nal_unit_type

nal_unit_type specifies the type of RBSP data structure contained in the NAL unit as specified in Table 7-1.

NAL unit type codes

nal_unit_type從是否包含VCL層編碼數(shù)據(jù)分為VCL NAL unitsnon-VCL NAL units.
VCL NAL units中包含VCL層編碼輸出的數(shù)據(jù), 而non-VCL NAL units不包括.

VCL NAL units & non-VCL NAL units

VCL NAL units常用的是nal_unit_type=5nal_unit_type=1.
nal_unit_type=5表明該NALU的類型是IDR的slice, 也表明該NALU所在圖像也屬于IDR幀.
nal_unit_type=1時(shí)一般表示該NALU所在的幀是P幀.

RBSP(Raw Byte Sequence Payload)

A syntax structure containing an integer number of bytes that is
encapsulated in a NAL unit
.
An RBSP is either empty or has the form of a string of data bits containing syntax
elements followed by an RBSP stop bit and followed by zero or more subsequent bits equal to 0.

  • (RBSP) stop bit

A bit equal to 1 present within a raw byte sequence payload
(RBSP) after a string of data bits. The location of the end of the string of data bits within an RBSP can be identified by searching from the end of the RBSP for the RBSP stop bit, which is the last non-zero bit in the
RBSP.

stop bit用于標(biāo)示RBSP中數(shù)據(jù)部分的結(jié)束. 其后會(huì)填充0.

An RBSP is specified as an ordered sequence of bytes as follows.
The RBSP contains an SODB as follows.

  • If the SODB is empty (i.e., zero bits in length), the RBSP is also empty.
  • Otherwise, the RBSP contains the SODB as follows.
  1. The first byte of the RBSP contains the (most significant, left-most) eight bits of the SODB; the next byte of the RBSP shall contain the next eight bits of the SODB, etc., until fewer than eight bits of the SODB remain.
  2. rbsp_trailing_bits( ) are present after the SODB as follows:
    i) The first (most significant, left-most) bits of the final RBSP byte contains the remaining bits of the SODB, (if any)
    ii) The next bit consists of a single rbsp_stop_one_bit equal to 1, and
    iii) When the rbsp_stop_one_bit is not the last bit of a byte-aligned byte, one or more rbsp_alignment_zero_bit is present to result in byte alignment.
  3. One or more cabac_zero_word 16-bit syntax elements equal to 0x0000 may be present in some RBSPs after the rbsp_trailing_bits( ) at the end of the RBSP.

SODB(String Of Data Bits):
最原始的編碼數(shù)據(jù)RBSP, 長度不一定是8的倍數(shù),此時(shí)需要對齊. 
RBSP: 在SODB的后面填加了結(jié)尾比特(RBSP trailing bits 一個(gè)bit“1”)若干比特“0”,以便字節(jié)對齊.

RBSP

References:
14496-10.pdf
14496-15.pdf
http://blog.csdn.net/newthinker_wei/article/details/8748442
http://www.360doc.com/content/14/0520/17/17532616_379388909.shtml
http://www.samirchen.com/video-concept/

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 230,622評論 6 544
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 99,716評論 3 429
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事。” “怎么了?”我有些...
    開封第一講書人閱讀 178,746評論 0 383
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經(jīng)常有香客問我,道長,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 63,991評論 1 318
  • 正文 為了忘掉前任,我火速辦了婚禮,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 72,706評論 6 413
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 56,036評論 1 329
  • 那天,我揣著相機(jī)與錄音,去河邊找鬼。 笑死,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 44,029評論 3 450
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 43,203評論 0 290
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 49,725評論 1 336
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 41,451評論 3 361
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 43,677評論 1 374
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 39,161評論 5 365
  • 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 44,857評論 3 351
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 35,266評論 0 28
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 36,606評論 1 295
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 52,407評論 3 400
  • 正文 我出身青樓,卻偏偏與公主長得像,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 48,643評論 2 380

推薦閱讀更多精彩內(nèi)容

  • 年后新房交付,簡單裝修后高高興興入住了。 小區(qū)整體環(huán)境不錯(cuò),道路干凈,路兩旁樹木錯(cuò)落有致,生活設(shè)施齊全,運(yùn)動(dòng)場,兒...
    留逝閱讀 285評論 1 2
  • 群里有麻麻私信我,問第一叛逆期…… 不是叛逆啦,是反抗期!這個(gè)必須要先說明,對于無論2.3歲還是青春期的孩子,用叛...
    和翊浛閱讀 103評論 0 0
  • 翻譯《Stack Overflow: The Hardware》 (20160717已完成)技術(shù)《About Ga...
    RiboseYim閱讀 144評論 0 0
  • ?真琴實(shí)在是很喜歡各式各樣的花,雖然對園藝和插花技術(shù)都有遠(yuǎn)超同齡人的審美品位和高超技術(shù)造詣,真琴卻從來不參與學(xué)校花...
    GAssembly閱讀 226評論 0 0
  • 最近再考慮要不要再買一個(gè)外研社的點(diǎn)讀筆?拿不定主意是因?yàn)椋易约簩c(diǎn)讀筆的看法,但是音頻有時(shí)候不好找,看看汪琣珽老...
    木木sani閱讀 249評論 0 0