H.264——H.264的profile 和 level

21 篇文章 21 订阅

profile与level简介

profile在NAL Header之后的RBSP中解析得出

  • Profile是对视频压缩特性的描述(CABAC呀、颜色采样数等等)。

  • Level是对视频本身特性的描述(码率、分辨率、fps)。

  • 简单来说,Profile越高,就说明采用了越高级的压缩特性。
    Level越高,视频的码率、分辨率、fps越高。

一些移动设备(手机、游戏机、PMP)由于性能有限,不支持全部高级视频压缩特性和高分辨率图像,只支持基础压缩特性和分辨率低一些的图像。
为了让这个限制更加清晰明了,H264从低到高划分了很多Profile和Level,设备只需要标出所支持的Profile和Level就可以让用户和开发者一看既知。
具体哪些Profile和Level对应哪些特性,可以参考下面给出的维基百科。我记得PSP是支持到MainProfile的Level 2.1。

这个解释也不能说错,只是个人觉得不够准确,profile主要是定义了编码工具的集合,不同的profile,包含了不同的编码技术;而level主要是对码流的关键参数的取值范围作了限定,与解码器的处理能力和存储能力相关联

H264的profile

  • Baseline
    (最低Profile)级别支持I/P 帧,只支持无交错(Progressive)和CAVLC,一般用于低阶或需要额外容错的应用,比如视频通话、手机视频等;
    profile_idc = 66
  • Extended
    EP-Extended profile:进阶画质,是后来才加入的。支持I/P/B/SP/SI 帧,只支持无交错(Progressive)和CAVLC
    profile_idc = 88
  • Main
    (主要Profile)级别提供I/P/B 帧,支持无交错(Progressive)和交错(Interlaced),同样提供对于CAVLC 和CABAC 的支持,用于主流消费类电子产品规格如低解码(相对而言)的mp4、便携的视频播放器、PSP和Ipod等;
    profile_idc = 77
  • High
    (高端Profile,也叫FRExt)级别在Main的基础上增加了8x8 内部预测、自定义量化、无损视频编码和更多的YUV 格式(如4:4:4),用于广播及视频碟片存储(蓝光影片),高清电视的应用。
    profile_idc = 100

H264 的profile主要是针对兼容性的,不同的规格能在相同级别上的平台应用。
  至于Baseline@L x.x、Main@L x.x、High@L x.x形式则是在不同级别下的码流级别,数值越大码流就越大,更耗费资源。所以就码流而言High@L3.0<High@L4.0<High@L5.1。


  • H.264 Baseline profile、Extended profile和Main profile都是针对8位样本数据、4:2:0格式的视频序列
  • High profile将其扩展到8~12位样本数据,视频格式可以为4:2:0、4:2:2、4:4:4
    设立了High profile(HP)、High 10 profile(Hi10P)、High 4:2:2 profile(Hi422P)、High 4:4:4 profile(Hi444P) 4个profile,这4个profile都以Main profile为基础。

在相同配置情况下,High profile(HP)可以比Main profile(MP)节省10%的码流量,比MPEG-2
MP节省60%的码流量,具有更好的编码性能。

根据应用领域的不同

  • Baseline profile多应用于实时通信领域
  • Main profile多应用于流媒体领域
  • High profile则多应用于广电和存储领域。

H.264 Baseline Profile对应MPEG-4 SP
H.264 Main Profile对应MPEG-4 ASP H.264
Extended Profile对应MPEG-4 ARTS or FGS
H.264 Baseline Profile对应MPEG-4 Studio

维基百科原文

For h.264 users, how to specify the profile/level seems to be a fairly common question. Profiles define sets of bit stream features a h.264 stream can use. Levels define restrictions on the video resolution, frame rate and some stuff called VBV (Video Buffer Verifier).


H.264 Profiles

H.264 Profiles are discussed in depth on Wikipedia, but to simplify the considerations for the average user, I will focus on the Baseline, Main and High Profiles.

Baseline Profile

  • I/P slices
  • Multiple reference frames (–refs , >1 in the x264 CLI)
  • In-loop deblocking
  • CAVLC entropy coding (–no-cabac in the x264 CLI)

Main Profile

  • Baseline Profile features mentioned above
  • B slices
  • CABAC entropy coding
    Interlaced coding – PAFF/MBAFF
    Weighted prediction

High Profile

  • Main Profile features mentioned above
  • 8×8 transform option (–8×8dct in the x264 CLI)
  • Custom quantisation matrices

H.264 Levels

H.264 Levels are also discussed on Wikipedia, though in my opinion, less explicitly and less successfully than for the profiles. For practical use, to specify a Level, a number of constraints have to be met.

The resolutions/frame rates in the following table are merely a guideline – the number of macroblocks per second is the actual restriction. To calculate this:

Macroblocks are 16×16 in H.264 and so to code a frame one can calulate the number of macroblocks per frame as:

  • ceil( width / 16.0 ) * ceil( height / 16.0 )

Note: The ceil() function rounds up its argument to the next integer. For example, ceil( 10.2 ) returns 11.

Then you need to multiply the number of macroblocks per frame by the number of frames per second to get the number of macroblocks per second.

  • macroblocks per second = ceil( width / 16.0 ) * ceil( height / 16.0 ) * frame rate

H.264 Profile、Level、Encoder关系图

h.264 profile
在这里插入图片描述
h.264 level
在这里插入图片描述
h.264 software encoder
在这里插入图片描述

  • 3
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Spark!

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值