每个profile 都规定了一个算法特征和限制的子集,任何遵守某个profile 的解码器都应该支持与其相应的子集。
每个级别都规定了一组对标准中语法成员(syntax element)所采用的各种参数值的限制。所有profile 都使用相同的一组级别定义,但是单独的一个实现可以对不同的profile 支持不同的级别。在给定的profile下,级别通常与解码器的处理能力和内存容量相对应。每一个档次设置不同的参数(如取样速率、图像尺寸、编码比特率等),得到对应的编解码器性能的不同级别。
一、档次 (profile)Baseline Profile
符合Baseline Profile 的比特流应该遵守如下的限制:
-- 比特流中只能出现I 和 P 片。
-- NAL 单元比特流的nal_unit_type 值不应该落在[2,4](包括2,4,下同)范围内。
注释:nal_unit_type=2对应片分区A;nal_unit_type=3对应片分区B;nal_unit_type=4对应片分区C。因为baseline profile不采用数据分区的方法。
-- 序列参数集中的frame_mbs_only_flag 应该等于1。
注释:frame_mbs_only_flag 等于0 表示编码视频序列的编码图像可能是编码场或编码帧。frame_mbs_only_flag 等于1表示编码视频序列的每个编码图像都是一个仅包含帧宏块的编码帧。
-- 图像参数集中的weighted_pred_flag 和weighted_bipred_idc 都应该等于0。
注释:weighted_pred_flag equal to 0 specifies that weighted prediction(加权预测) shall not be applied to P and SP slices.weighted_pred_flag equal to 1 specifies that weighted prediction shall be applied to P and SP slices.
weighted_bipred_idc equal to 0 specifies that the default weighted prediction(默认的加权预测) shall be applied to B slices.weighted_bipred_idc equal to 1 specifies that explicit weighted prediction(指定的加权预测方式) shall be applied to B slices.weighted_bipred_idc equal to 2 specifies that implicit weighted prediction(隐含的加权预测方式) shall be applied to B slices. The value ofweighted_bipred_idc shall be in the range of 0 to 2, inclusive.
-- 图像参数集中的entropy_coding_mode_flag 应该等于0。
注释:entropy_coding_mode_flag=0,表示熵编码使用CAVLC。
-- 图像参数集中的num_slice_groups_minus1 应该在[0,7]范围之内。
注释:本句法元素加1表示图像中片组的个数。H.264中没有专门的句法元素用于指明是否使用片组模式,当本句法元素等于0时(即只有一个片组),表示不使用片组模式,后面也不会跟有用于计算片组映射到句法元素。
-- 应该满足在A.3 节中规定的Baseline profile 级别限制。
与Baseline profile 相符的比特流,它的profile_idc 应该等于66。对一个遵守Baseline profile某个指定级别的解码器,它能够解码任何符合如下要求的比特流:1. profile_idc 等于66 或者constraint_set0_flag等于1; 2. level_idc 所代表的级别小于或等于这个指定的级别。
注释:constraint_set0_flag 其值等于1表示必须遵从标准中附录A.2.1(即上面)所指明的所有约束条件;等于0表示不必遵从所以条件。
二、级别(level)
对本附录中各种限制的表示做如下规定:
-- 在解码顺序中,访问单元从0 开始标号,访问单元n 表示第n 个访问单元。
-- 图像n 表示访问单元n 的基本编码图像或者相应的已解码图像。
1、与具体Profile 无关的级别限制
2、与Profile 相关的级别限制
2.1与Baseline profile 相关的级别限制
与profile和level相关的图表:
level:
encoder: