《Advanced Video Coding》

资料:《Advanced Video Coding》


AVC(Advanced Video Coding)高级视频编码,也称为H.264,是一个 面向块 的视频压缩标准,使用motion-compensated和integer-DCT coding算法。H.264至今为止广泛用于 recording(录制),compression(压缩),distributing(分发)。目前91%的视频厂商都在使用H.264。另外H.264支持8K UHD(Ultra High Definition超高清)

H.264的目标是 实现高质量低比特率(bit rate)的能力

H.264没有增加设计的复杂度,其实现的算法和功能,如下:

  • 现了低复杂度的DCT算法(从FFT演变出来的压缩算法)
  • 可变块分段(variable block-size segmentation)
  • 多画面画面间预测(multi-picture inter-picutre predict)
  • 灵活的标准,可以适应各种网络和系统

H.264是由一系列配置文件组成的大家族,实际上大部分情况下都会使用 “High Profile”。特定的profile decoder至少会解析一个Profile。H.264标准指定编码数据的格式,以及如何对数据进行解码。但它并没有指定编码的算法,目前有多种广泛使用的算法。H.264是典型的有损压缩(lossy compression),当然也支持无损压缩(像素的亮度和色度信息老老实实传,但这样还压缩个毛线)
H.264的标准是由 ITU-T VCEG及MPEG两个组织一起制定的,H.265是H.264的继承者。H.264同时被严格限制于专利(加钱!)

Naming

H.264,H.264/AVC,H.264/MPEG-4 AVC,JVT,都是指H.264,因为是两个组织一起实现的标准

History

overall

1998年,VCEG-ITU-T在开发项目H.26L,因为他们质疑目前市场上视频编码标准的效率
2001年,VCEG & MPEG → JVT
2003年,最终版的H.264被发布
2005年~2007年,JVT基于H.264/AVC在研究SVC(Scalable Video Coding)
2006年~2009年,JVT基于H.264/AVC在研究MVC(multiview Video Coding),产出了一个新的Profile
SEI(supplemental enhancement information)和VUI(Video usability information)用于传输用户自定义数据,以及音视频播放之类的数据

Fidelity range and professional profiles(保真范围和专业配置)

2003年出版后,JVT又拓展了些功能,FRExt Project

  • 能获取更高的bit depth
  • 更高的resolution
  • sampling structures
  • DCT
  • 更高效的lossiless coding

Scalable Video Coding

SVC允许包含sub-bitstreams。有一种称为base layer的比特流,可以被不支持H.264/AVC的codec decode。2007年SVC扩展完成,历时两年多

Multiview Video Coding

多视角,立体3D的比特流数据。2009年完成,历时三年

Application

H.264需要的比特流,比MPEG-2少一半
很多厂商在H.264/AVC的基础上,添加了些自己的规则,以便用户更好地使用产品

Design

Features

  • Multi-picture inter -picture prediction
  • Spatial prediction from the edges of neighboring blocks for “intra” coding
  • integer discrete cosin transform(DTC)
  • Lossless macroblock coding features
  • An entropy coding design(熵编码)
  • Loss resilience(损失恢复)
  • Supplemental enhancement information (SEI) and video usability information (VUI)
  • Support of 4:0:0,4:2:0,4:2:2,4:4:4色度采样
  • Support of sample bit depth from 8 to 14

Profiles

Profiles就是codec的capabilities,它们通过配置文件代码(profile_idc)和一些codec中一些额外的约束 被声明。目前为止,最常使用的Profile是High Profile
不可扩展2D视频应用Profile

Constrained Baseline Profile(CBP,66 with contranint set 1

主要应用于低耗应用,这个Profile最典型用于videoconferencing and mobile applications。这个Profile是Baseline,Main,High Profiles的公共交集

Baseline Profile(BP, 66)

拥有CBP的所有功能,但多了3个降低鲁棒性的feature。自从CBP出现以来,BP就用的少了

Exended Profild(XP, 88)

更高的压缩能力并且有一些额外的tricks,提高在数据丢失和服务器流切换的鲁棒性

Main Profile(MP, 77)

用于高清数字电视,自从High Profile开发后,这个也用的少了

High Profile

广播和光盘存储的主要Profile,尤其是高清电视

Progressive High Profile(PHiP, 100 with constraint set 4)

和Hight Profile很相似,但是不支持field coding features

Constrained High Profile(100 with constraint set 4 and 5)

和Progressive Hight Profile很相似,但是不支持B slices

High 10 Profile(Hi10P, 110)

主流产品不会用这个Profile(我想应该是成本太高),它基于High Profile,有10 depth bit去存储更高精度的Pixel信息

High 4:2:2 Profile(Hi422P, 122)

比High 10 Profile还牛

High 4:4:4 Predictive Profile(Hi444P, 244)

比4:2:2还牛,支持4:4:4采样,而且支持高效无损编码
对于专业的相机,编辑和专业应用,标准还提供了四种额外的帧内配置

High 10 Intra Profile(110 with constraint set 3)
High 4:2:2 Intra Profile(122 with constraint set 3)
High 4:4:4 Intra Profile(244 with constraint set 3)
CAVLC 4:4:4 Intra Profile(44)

使用熵编码(entropy coding)
因为Scalable Video Coding的发展,有了五个额外的scalable profiles

Scalable Baseline Profile(83)

该配置文件主要针对视频会议,移动和监控程序,Primarily targeting video conferencing, mobile, and surveillance applications, this profile builds on top of the Constrained Baseline profile to which the base layer (a subset of the bitstream) must conform

Scalable Constrained Baseline Profile(86 with constraint set 5)

SBP的子集,主要用于实时通信应用

Scalable High Intra Profile(86 with constraint set 3)

因为Multiview Video Coding(MVC)的发展,以下有两个multiview profiles

Stereo High Profile(128)

这个Profile针对两视图立体3D视频

Multiview High Profile(118)

这个Profile支持多试图的3D视频,但是不支持macroblock-adaptive

因为Multi-resolution Frame-Compatible(MFC)扩展了两个profile

MFC High Profile(134)

支持 两层分辨率增强的立体编码

MFC Depth High Profile(135)

因为3D AVC的发展,添加2个Profile

Multiview Depth High Profile(138)

利用深度图和视频纹理信息,提高3D视频的压缩率

Enhanced Multiview Depth High Profile(139)

用深度信息,合并多视图编码
在这里插入图片描述

Level

Level指示某种Profile所需要的解码器能力。比如CBP这个Profile,需要解码器的能力到达某个level
High Profile的maximum bit rate是cbp,bp的1.25倍
亮度采样数量是宏块数量的256倍

decoded picture buffering(图片解码缓存)

H.264/AVC使用前面的编码图片来预测其他图片,这个允许编码器在编码的时候做最高效的决策。在解码器中,pictures被存储在一个叫decoded picture buffer(DPB)中。它的计算方式如下
DpbCapacity = min( floor(MaxDpbMbs/(PicWidthInMbs * FrameHeightInMbes)),16)
For example, for an HDTV picture that is 1,920 samples wide (PicWidthInMbs = 120) and 1,080 samples high (FrameHeightInMbs = 68), a Level 4 decoder has a maximum DPB storage capacity of floor(32768/(120*68)) = 4 frames (or 8 fields). Thus, the value 4 is shown in parentheses in the table above in the right column of the row for Level 4 with the frame size 1920×1080. 为什么从1920→120,1080→68呢?
很重要的是,当前解码的图片,不包括在DPB的最大frame中(除非解码器指明了)。因此解码器必须有足够的内存(至少比DPB多一帧)

Implementations实践(八卦起来

2009年,HTML5工作组分裂了(嗯… 内讧了),分割成一部分支持Ogg Theora(免费开源,无专利)。一部分分割成H.264,有专利。 在当时,谷歌和苹果支持H.264,Mozilla和Opera支持Ogg Theora(现在谷歌和火狐,Opera都支持Theora和VP8)。随着IE9的开发,微软支持使用H.264对HTML5视频进行编码。2011年,谷歌宣布取消对H.264的支持(怪不得chromium的rtc_use_h264默认关闭
2012年,火狐,Opera等等,都可以支持H.264了,因为H.264的性能在某些平台上会更好
2013年,思科宣布公布OpenH264(魔改H264),然后给专利管理组织付了专利费,用于完全开源OpenH264(此时默默致敬思科)

Software encoders

AVC编码器,因为H264并不指定编码的算法,由使用者决定,只要最后的bitstream符合规范就可以
在这里插入图片描述

Hardware

因为软件解码在CPU上还是会受限,但最新基于X86架构的CPUs拥有充足的算力。压缩效率取决于压缩的算法,因此软硬件编解码的区别,在于性能方面的考虑。因此出现了专门用于特殊目的的硬件出现了(类似GPU的地位)
但基于CPU的solutions是更加的flexible
英特尔第二代Sandy BrigeCPU处理器,提供了抓门用于编码H264的芯片
H264编码器可以称为ASIC或者FPGA

疑问

  • 涂黄底的地方
  • base layer是什么概念
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
H264编码开源代码 Video Usability Information (VUI) Guide by Christian Heine ( sennindemokrit at gmx dot net ) 1. Sample Aspect Ratio ----------------------- * What is it? The Sample Aspect Ratio (SAR) (sometimes called Pixel Aspect Ratio or just Pel Aspect Ratio) is defined as the ratio of the width of the sample to the height of the sample. While pixels on a computer monitor generally are "square" meaning that their SAR is 1:1, digitized video usually has rather odd SARs. Playback of material with a particular SAR on a system with a different SAR will result in a stretched/squashed image. A correction is necessary that relies on the knowledge of both SARs. * How do I use it? You can derive the SAR of an image from the width, height and the display aspect ratio (DAR) of the image as follows: SAR_x DAR_x * height ----- = -------------- SAR_y DAR_y * width for example: width x height = 704x576, DAR = 4:3 ==> SAR = 2304:2112 or 12:11 Please note that if your material is a digitized analog signal, you should not use this equation to calculate the SAR. Refer to the manual of your digitizing equipment or this link instead. A Quick Guide to Digital Video Resolution and Aspect Ratio Conversions http://www.iki.fi/znark/video/conversion/ * Should I use this option? In one word: yes. Most decoders/ media players nowadays support automatic correction of aspect ratios, and there are just few exceptions. You should even use it, if the SAR of your material is 1:1, as the default of x264 is "SAR not defined".

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值