video codec 学习

video codec

Posted by wangdiqi on August 14, 2022

基础知识

压缩:混合编码,通常将图像分成小块

帧内预测 帧间预测

典型帧结构 适合 非实时场景

熵编码:Huffman编码,算数编码

VP9 和 HEVC 在 2013 年提出,比 H.264/AVC 压缩性能高 50%

AV1 于 2018 年提出, 比 VP9 压缩性能高 30%

AV1 codec 支持输入的视频信号是 4:0:0(monochrome), 4:2:0, 4:2:2 和 4:4:4,允许的像素表示是 8位,10位和12位比特。

信源模型

  1. 如果采用 “一幅图像由许多像素构成” 的信源模型,这种信源模型的参数就是每个像素的亮度和色度的幅度值,对
    这些参数进行压缩编码的技术称为基于波形的编码。
  2. 如果采用 “一个分量由几个物体构成” 的信源模型,这种信源模型的参数就是各个物体的形状、纹理和运动,对
    这些参数进行压缩编码的技术称为基于内容的编码。

编码方式

视频编码方法与可采用的信源模型有关

预测编码

变换编码 ???

##

AV1

./aomenc -y --kf-min-dist=300 --kf-max-dist=300 -t 1 --psnr=1 --rt --cpu-used=9 --lag-in-frames=0 --fps=30/1 -w 352 -h 288 --end-usage=q --cq-level=36 -o test.ivf foreman_352x288.yuv


-y --disable-warning-prompt    Display warnings, but do not prompt user to continue
--kf-min-dist                  Minimum keyframe interval (frames)
--kf-max-dist                  Maximum keyframe interval (frames)
--psnr                         Show PSNR in status line (0: Disable PSNR status line display,
                                 1: PSNR calculated using input bit-depth (default),
                                 2: PSNR calculated using stream bit-depth);
                               takes default option when arguments are not specified
--rt                           Use Realtime Quality Deadline
--cpu-used                     Speed setting (0..6 in good mode, 5..10 in realtime mode, 0..9 in all intra mode)
--lag-in-frames                Max number of frames to lag
--fps=30/1                     Stream frame rate (rate/scale)
-w --width=<arg>               Frame width
-h --height=<arg>              Frame height
--end-usage                    Rate control mode
                                 vbr(Variable Bitrate), cbr(Constant Bitrate), cq(Constant Quality), q
                               end-usage是码率控制设置(rate control),VBR/CBR 都是产生码流平均码率固定,但是CBR对每帧大小要求比较严格,这两种mode下cq-level就没有意义了
                               q是固定视频质量,cq是固定视频质量同时有码率要求,这时cq-level是质量的级别,数越小质量越好
--cq-level                     Constant/Constrained Quality level
-o --output=<arg>              Output filename

QA

新一代视频压缩编码标准H.264AVC(第2版)(毕厚杰)

P59 ??? 怎么计算的