这些 FFmpeg APNG 编码器预测方法是什么意思?

Nic*_*rin 3 png ffmpeg image-compression apng

通过运行ffmpeg -h encoder=apng,我得到了这个:

APNG encoder AVOptions:
  -dpi               <int>        E..V..... Set image resolution (in dots per inch) (from 0 to 65536) (default 0)
  -dpm               <int>        E..V..... Set image resolution (in dots per meter) (from 0 to 65536) (default 0)
  -pred              <int>        E..V..... Prediction method (from 0 to 5) (default none)
     none                         E..V.....
     sub                          E..V.....
     up                           E..V.....
     avg                          E..V.....
     paeth                        E..V.....
     mixed                        E..V.....
Run Code Online (Sandbox Code Playgroud)

这些用 指定的预测方法有什么区别-pred

我在 ffmpeg.org 或其他地方找不到任何文档。

loo*_*ops 5

PNG规范指定了 5 种不同的过滤器类型,用于在压缩图像数据之前提高其可压缩性:none、sub、up、average 和 Paeth。每个滤波器的想法是从附近像素导出当前像素,然后仅存储调整估计值以获得真实值的量。图像的每条扫描线都有一个为其指定的过滤器。每个过滤器在不同的情况下都能发挥最佳效果。过滤器不会影响实际的图像数据,只会影响其存储方式。

mixed不是过滤器,而是告诉 ffmpeg 为每一行选择最佳过滤器。这也称为动态过滤。这使得编码速度变慢,因为每行都需要尝试 5 个不同的过滤器,但可以带来更好的压缩效果。使用最小绝对差和方法找到最佳滤波器。