转载自:http://blog.youkuaiyun.com/sphone89/article/details/17492433
H.264 Profiles
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)。主要用于可视电话、会议电视、无线通信等实时视频通信。
2、EP-Extendedprofile:
支持I/P/B/SP/SI帧,即支持码流之间有效的切换(SP和SI片)、改进误码性能;只支持无交错(Progressive)和CAVLC;但不支持隔行视频和CABAC。
3、MP-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 的支持;主要用于数字广播电视与数字视频存储。
4、HP-High profile:a、Main Profile features mentioned above
b、8×8 transform option (–8×8dct in the x264 CLI)
c 、 Custom 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 profile和Main profile都是针对8位样本数据、4:2:0格式的视频序列,FRExt将其扩展到8~12位样本数据,视频格式可以为4:2:0、4:2:2、4:4:4,设立了High profile(HP)、High 10profile(Hi10P)、High 4:2:2 profile(Hi422P)、High 4:4:4 profile(Hi444P) 4个profile,这4个profile都以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
--
-- NAL
注释:nal_unit_type=2对应片分区A;nal_unit_type=3对应片分区B;nal_unit_type=4对应片分区C。因为baselineprofile不采用数据分区的方法。
--
注释:frame_mbs_only_flag
--
注释:weighted_pred_flagequal to 0 specifies that weighted prediction(加权预测)
weighted_bipred_idcequal to 0 specifies that the default weighted prediction(默认的加权预测)
--
注释:entropy_coding_mode_flag=0,表示熵编码使用CAVLC。
--
注释:本句法元素加1表示图像中片组的个数。H.264中没有专门的句法元素用于指明是否使用片组模式,当本句法元素等于0时(即只有一个片组),表示不使用片组模式,后面也不会跟有用于计算片组映射到句法元素。
--
与Baselineprofile
注释:constraint_set0_flag
--------------------------------------------------------------------------------------------
h264 level
每个profile
每个level都规定了一组对标准中语法成员(syntax element)所采用的各种参数值的限制。
在给定的profile下,level通常与解码器的处理能力和内存容量相对应。每一个档次设置不同的参数(如取样速率、图像尺寸、编码比特率等),得到对应的编解码器性能的不同level。
下图是levels参数表格
几种h.264 software encoder