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的重要性,值越大,越重要.
    解碼器在解碼處理不過(guò)來(lái)的時(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, 長(zhǎng)度不一定是8的倍數(shù),此時(shí)需要對(duì)齊. 
RBSP: 在SODB的后面填加了結(jié)尾比特(RBSP trailing bits 一個(gè)bit“1”)若干比特“0”,以便字節(jié)對(duì)齊.

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)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市挑格,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌沾歪,老刑警劉巖漂彤,帶你破解...
    沈念sama閱讀 217,084評(píng)論 6 503
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異灾搏,居然都是意外死亡挫望,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,623評(píng)論 3 392
  • 文/潘曉璐 我一進(jìn)店門狂窑,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)媳板,“玉大人,你說(shuō)我怎么就攤上這事泉哈◎刃遥” “怎么了?”我有些...
    開(kāi)封第一講書人閱讀 163,450評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵丛晦,是天一觀的道長(zhǎng)奕纫。 經(jīng)常有香客問(wèn)我,道長(zhǎng)采呐,這世上最難降的妖魔是什么若锁? 我笑而不...
    開(kāi)封第一講書人閱讀 58,322評(píng)論 1 293
  • 正文 為了忘掉前任,我火速辦了婚禮斧吐,結(jié)果婚禮上又固,老公的妹妹穿的比我還像新娘仲器。我一直安慰自己,他們只是感情好仰冠,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,370評(píng)論 6 390
  • 文/花漫 我一把揭開(kāi)白布乏冀。 她就那樣靜靜地躺著,像睡著了一般洋只。 火紅的嫁衣襯著肌膚如雪辆沦。 梳的紋絲不亂的頭發(fā)上,一...
    開(kāi)封第一講書人閱讀 51,274評(píng)論 1 300
  • 那天识虚,我揣著相機(jī)與錄音肢扯,去河邊找鬼。 笑死担锤,一個(gè)胖子當(dāng)著我的面吹牛蔚晨,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播肛循,決...
    沈念sama閱讀 40,126評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼铭腕,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了多糠?” 一聲冷哼從身側(cè)響起累舷,我...
    開(kāi)封第一講書人閱讀 38,980評(píng)論 0 275
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎夹孔,沒(méi)想到半個(gè)月后被盈,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,414評(píng)論 1 313
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡析蝴,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,599評(píng)論 3 334
  • 正文 我和宋清朗相戀三年害捕,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片闷畸。...
    茶點(diǎn)故事閱讀 39,773評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡尝盼,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出佑菩,到底是詐尸還是另有隱情盾沫,我是刑警寧澤,帶...
    沈念sama閱讀 35,470評(píng)論 5 344
  • 正文 年R本政府宣布殿漠,位于F島的核電站赴精,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏绞幌。R本人自食惡果不足惜蕾哟,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,080評(píng)論 3 327
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧谭确,春花似錦帘营、人聲如沸。這莊子的主人今日做“春日...
    開(kāi)封第一講書人閱讀 31,713評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至昂秃,卻和暖如春禀梳,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背肠骆。 一陣腳步聲響...
    開(kāi)封第一講書人閱讀 32,852評(píng)論 1 269
  • 我被黑心中介騙來(lái)泰國(guó)打工算途, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人蚀腿。 一個(gè)月前我還...
    沈念sama閱讀 47,865評(píng)論 2 370
  • 正文 我出身青樓郊艘,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親唯咬。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,689評(píng)論 2 354

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

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