h264 profile & level

H.264 Profiles

http://blog.csdn.net/sphone89/article/details/17492433

H.264有四種profile,每個profile支持一組特定的編碼功能,並支持一類特定的應用,分別是BP、EP、MP、HP:

1、BP-Baseline Profile:

       a、I/P slices

       b、Multiple reference frames (–refs <int>, >1 in the x264 CLI)

       c、In-loop deblocking(環路濾波)

       d、CAVLC entropy coding (–no-cabac in the x264 CLI)

利用I片和P片支持幀內和幀間編碼,支持利用基於上下文的自適應的變長編碼進行的熵編碼(CAVLC)和只支持無交錯(Progressive)。主要用於可視電話、會議電視、無線通信等實時視頻通信。

2EP-Extendedprofile

         支持I/P/B/SP/SI幀,即支持碼流之間有效的切換(SPSI片)、改進誤碼性能;只支持無交錯(Progressive)和CAVLC;但不支持隔行視頻和CABAC

3MP-Main profile

       a、Baseline Profile features mentioned above

       b、B slices

       c、CABACentropy coding

       d、Interlacedcoding – PAFF/MBAFF

       e、Weightedprediction

提供I/P/B 幀,支持無交錯(Progressive)和交錯(Interlaced),也支持CAVLC 和CABAC 的支持;主要用於數字廣播電視與數字視頻存儲。

4HP-High profile

        a、Main Profile features mentioned above

        b、8×8 transform option (–8×8dct in the x264 CLI)

cCustom quantisation matrices

        在mainProfile的基礎上增加了8x8內部預測、自定義量化、 無損視頻編碼和更多的YUV格式。

   H.264 FRExt(即:FidelityRange Extensions)擴展部分(Amendment),包括High profile(HP)、High10 profile(Hi10P)、High 4:2:2 profile(Hi422P)、High4:4:4 profile(Hi444P)4個profile。H.264 Baseline profile、Extended profileMain profile都是針對8位樣本數據、4:2:0格式的視頻序列,FRExt將其擴展到812位樣本數據,視頻格式可以爲4:2:04:2:24:4:4,設立了High profileHP)、High 10profileHi10P)、High 4:2:2 profileHi422P)、High 4:4:4 profileHi444P 4profile,這4profile都以Main profile爲基礎

   在相同配置情況下,Highprofile(HP)可以比Mainprofile(MP)節省10%的碼流量,比MPEG-2 MP節省60%的碼流量,具有更好的編碼性能。根據應用領域的不同,Baselineprofile多應用於實時通信領域,Main profile多應用於流媒體領域,High profile則多應用於廣電和存儲領域。


---------------------------

下面是x264關於profile的簡單特點描述

--profile<string>      Force the limits ofan H.264 profile

                                  Overrides allsettings.

                                  - baseline:

                                    --no-8x8dct--bframes 0 --no-cabac

                                    --cqm flat--weightp 0

                                    Nointerlaced.

                                    Nolossless.

                                  - main:

                                    --no-8x8dct--cqm flat

                                    Nolossless.

                                  - high:

                                    Nolossless.

                                  - high10:

                                    Nolossless.

                                    Support forbit depth 8-10.

                                  - high422:

                                    Nolossless.

                                    Support forbit depth 8-10.

                                    Support for4:2:0/4:2:2 chroma subsampling.

                                  - high444:

                                    Support forbit depth 8-10.

                                    Support for4:2:0/4:2:2/4:4:4 chroma subsampling.

-----------------------------------------------------------------------------------------------

符合BaselineProfile 的比特流應該遵守如下的限制:

-- 比特流中只能出現I  P 片。

-- NAL 單元比特流的nal_unit_type 值不應該落在[24](包括24,下同)範圍內。

註釋:nal_unit_type=2對應片分區Anal_unit_type=3對應片分區Bnal_unit_type=4對應片分區C。因爲baselineprofile不採用數據分區的方法。

-- 序列參數集中的frame_mbs_only_flag 應該等於1

註釋:frame_mbs_only_flag 等於0 表示編碼視頻序列的編碼圖像可能是編碼場或編碼幀。frame_mbs_only_flag 等於1表示編碼視頻序列的每個編碼圖像都是一個僅包含幀宏塊的編碼幀。

-- 圖像參數集中的weighted_pred_flag weighted_bipred_idc 都應該等於0

註釋:weighted_pred_flagequal to 0 specifies that weighted prediction(加權預測) shall not be applied to P and SPslices.weighted_pred_flag equal to 1 specifies that weighted prediction shallbe applied to P and SP slices.

weighted_bipred_idcequal to 0 specifies that the default weighted prediction(默認的加權預測) shall be applied to B slices.weighted_bipred_idcequal to 1 specifies that explicit weighted prediction(指定的加權預測方式) shall be applied to B slices.weighted_bipred_idcequal to 2 specifies that implicit weighted prediction(隱含的加權預測方式) shall be applied to B slices. The value ofweighted_bipred_idcshall be in the range of 0 to 2, inclusive.

-- 圖像參數集中的entropy_coding_mode_flag 應該等於0

註釋:entropy_coding_mode_flag=0,表示熵編碼使用CAVLC

-- 圖像參數集中的num_slice_groups_minus1 應該在[07]範圍之內。

註釋:本句法元素加1表示圖像中片組的個數。H.264中沒有專門的句法元素用於指明是否使用片組模式,當本句法元素等於0時(即只有一個片組),表示不使用片組模式,後面也不會跟有用於計算片組映射到句法元素。

-- 應該滿足在A.3 節中規定的Baseline profile 級別限制。

Baselineprofile 相符的比特流,它的profile_idc 應該等於66。對一個遵守Baseline profile某個指定級別的解碼器,它能夠解碼任何符合如下要求的比特流:1. profile_idc 等於66 或者constraint_set0_flag 等於1; 2. level_idc所代表的級別小於或等於這個指定的級別。

註釋:constraint_set0_flag  其值等於1表示必須遵從標準中附錄A.2.1(即上面)所指明的所有約束條件;等於0表示不必遵從所以條件。


--------------------------------------------------------------------------------------------

h264 level

   每個profile 都規定了一個算法特徵和限制的子集,任何遵守某個profile 的解碼器都應該支持與其相應的子集。

   每個level都規定了一組對標準中語法成員(syntax element)所採用的各種參數值的限制。

在給定的profile下,level通常與解碼器的處理能力和內存容量相對應。每一個檔次設置不同的參數(如取樣速率、圖像尺寸、編碼比特率等),得到對應的編解碼器性能的不同level。

下圖是levels參數表格


幾種h.264 software encoder


版權聲明:本文爲博主原創文章,未經博主允許不得轉載。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章