Windows环境下编译 aom 源码详细过程

AV1

AV1是一种开源的视频编码格式,由开放媒体联盟(AOMedia Video 1,简称AOMedia或AOM)开发。AV1旨在提供比现有的视频编码格式如H.264和H.265更好的压缩效率,同时保持或提高视频质量。AV1的编码效率显著高于H.264,且与H.265相近,但AV1的解码复杂度较低,这意味着在相同的硬件条件下,AV1可以提供更快的解码速度。

AV1的主要优势包括:

  • 开放和免费:AV1是完全开源的,并且不需要支付专利费用,这使得它在商业和非商业应用中都非常有吸引力。

  • 高压缩率:AV1提供了比H.264和H.265更高的压缩率,这意味着在相同的视频质量下,AV1的视频文件可以更小。

  • 兼容性:AV1支持8K分辨率的视频,这使得它非常适合未来的视频应用,如超高清视频流和虚拟现实。

  • 跨平台:AV1可以在各种设备上运行,包括智能手机、平板电脑、PC和游戏机。

  • 实时编码:虽然AV1的编码过程比H.264和H.265更复杂,但随着硬件的发展,实时编码AV1视频已经成为可能。

AV1的劣势包括:

  • 编码时间:由于AV1的编码过程较为复杂,因此编码时间通常比H.264和H.265更长。

  • 解码要求:尽管AV1的解码复杂度低于H.265,但对于一些旧的或性能较低的设备来说,解码AV1视频可能仍然具有挑战性。

  • 市场接受度:尽管AV1具有许多优势,但它仍然是一个相对较新的技术,需要时间来获得广泛的市场接受度

aom

AOMedia Video 1视频组开发符合AV1标准的参考源码。

Windows环境编译aom源码详细过程

  1. 源码下载:git clone https://aomedia.googlesource.com/aom;源码文件目录如下:
D:\_codec\aom [main ≡]> ls


    目录: D:\_codec\aom


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         2024/5/11     23:03                aom
d-----         2024/5/11     23:03                aom_dsp
d-----         2024/5/11     23:03                aom_mem
d-----         2024/5/11     23:03                aom_ports
d-----         2024/5/11     23:03                aom_scale
d-----         2024/5/11     23:03                aom_util
d-----         2024/5/11     23:03                apps
d-----         2024/5/11     23:03                av1
d-----         2024/5/11     23:03                build
d-----         2024/5/11     23:03                common
d-----         2024/5/11     23:03                doc
d-----         2024/5/11     23:03                examples
d-----         2024/5/11     23:03                stats
d-----         2024/5/11     23:03                test
d-----         2024/5/11     23:03                third_party
d-----         2024/5/11     23:03                tools
-a----         2024/5/11     23:03            255 .clang-format
-a----         2024/5/11     23:03           3204 .cmake-format.py
-a----         2024/5/11     23:03            466 .gitattributes
-a----         2024/5/11     23:03             70 .gitignore
-a----         2024/5/11     23:03           5891 .mailmap
-a----         2024/5/11     23:03           7052 aomedia_logo_200.png
-a----         2024/5/11     23:03          12411 AUTHORS
-a----         2024/5/11     23:03          42892 CHANGELOG
-a----         2024/5/11     23:03          43052 CMakeLists.txt
-a----         2024/5/11     23:03            173 codereview.settings
-a----         2024/5/11     23:03          15260 docs.cmake
-a----         2024/5/11     23:03           2183 keywords.dox
-a----         2024/5/11     23:03         107932 libs.doxy_template
-a----         2024/5/11     23:03           1343 LICENSE
-a----         2024/5/11     23:03           1719 mainpage.dox
-a----         2024/5/11     23:03           5809 PATENTS
-a----         2024/5/11     23:03          25188 README.md
-a----         2024/5/11     23:03           2466 Sample.cfg
-a----         2024/5/11     23:03           5327 usage.dox
-a----         2024/5/11     23:03            232 usage_cx.dox
-a----         2024/5/11     23:03            977 usage_dx.dox

  1. 根据README.md提示下载依赖工具
### Prerequisites {#prerequisites}

1. [CMake](https://cmake.org). See CMakeLists.txt for the minimum version
   required.
2. [Git](https://git-scm.com/).
3. A modern C compiler. gcc 6+, clang 7+, Microsoft Visual Studio 2019+ or
   the latest version of MinGW-w64 (clang64 or ucrt toolchains) are
   recommended. A C++ compiler is necessary to build the unit tests and some
   features contained in the examples.
4. [Perl](https://www.perl.org/).
5. For x86 targets, [yasm](http://yasm.tortall.net/) or a recent version (2.14
   or later) of [nasm](http://www.nasm.us/). (If both yasm and nasm are
   present, yasm will be used by default. Pass -DENABLE_NASM=ON to cmake to
   select nasm.) If you download yasm with the intention to work with Visual
   Studio, please download win32.exe or win64.exe and rename it into yasm.exe.
   DO NOT download or use vsyasm.exe.
6. Building the documentation requires
   [doxygen version 1.8.10 or newer](http://doxygen.org).
7. Emscripten builds require the portable
   [EMSDK](https://kripken.github.io/emscripten-site/index.html).
  1. 下载CMake工具。
    在这里插入图片描述
D:\_codec\emsdk [main ≡]> cmake
Usage

  cmake [options] <path-to-source>
  cmake [options] <path-to-existing-build>
  cmake [options] -S <path-to-source> -B <path-to-build>

Specify a source directory to (re-)generate a build system for it in the
current working directory.  Specify an existing build directory to
re-generate its build system.

Run 'cmake --help' for more information.
  1. 下载git:https://git-scm.com/
    在这里插入图片描述
D:\_codec\emsdk [main ≡]> git
usage: git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [--config-env=<name>=<envvar>] <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone     Clone a repository into a new directory
   init      Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add       Add file contents to the index
   mv        Move or rename a file, a directory, or a symlink
   restore   Restore working tree files
   rm        Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect    Use binary search to find the commit that introduced a bug
   diff      Show changes between commits, commit and working tree, etc
   grep      Print lines matching a pattern
   log       Show commit logs
   show      Show various types of objects
   status    Show the working tree status

grow, mark and tweak your common history
   branch    List, create, or delete branches
   commit    Record changes to the repository
   merge     Join two or more development histories together
   rebase    Reapply commits on top of another base tip
   reset     Reset current HEAD to the specified state
   switch    Switch branches
   tag       Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
   fetch     Download objects and refs from another repository
   pull      Fetch from and integrate with another repository or a local branch
   push      Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
See 'git help git' for an overview of the system.
  1. A modern C compiler. gcc 6+, clang 7+, Microsoft Visual Studio 2019+ or the latest version of MinGW-w64 (clang64 or ucrt toolchains)。
  2. nasm安装
D:\_codec\emsdk [main ≡]> nasm
nasm: fatal: no input file specified
Type C:\Users\yance\AppData\Local\bin\NASM\nasm.exe -h for help.
  1. 官网下载Doxygen安装软件。
    在这里插入图片描述
    Doxygen
    在这里插入图片描述

  2. 安装Graphviz:https://www.graphviz.org/download/,点击安装即可,注意要勾选到环境变量中。
    在这里插入图片描述
    在这里插入图片描述

  3. Perl官网下载安装包,下载MSI后缀的安装包。Perl是一种计算机程序语言。
    在这里插入图片描述
    安装配置Perl,点击下载下来的strawberry-perl-5.38.2.2-64bit.msi进行安装,一直next下去即可。
    在这里插入图片描述
    在这里插入图片描述
    验证Perl:PowerShell中输入命令 perl -v,出现如下提示信息即表示安装成功。

C:\Users\yance> perl -v
Locale 'Chinese (Simplified)_China.936' is unsupported, and may crash the interpreter.

This is perl 5, version 38, subversion 2 (v5.38.2) built for MSWin32-x64-multi-thread

Copyright 1987-2023, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at https://www.perl.org/, the Perl Home Page.
  1. EMSDK安装,下载:https://github.com/emscripten-core/emsdk,之后cd到源码,输入如下命令
.\emsdk update
git pull
.\emsdk install --global latest
.\emsdk activate latest
.\emsdk_env.bat

EMSDK验证:

D:\_codec\emsdk [main ≡]> emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.59 (0e4c5994eb5b8defd38367a416d0703fd506ad81)
clang version 19.0.0git (https:/github.com/llvm/llvm-project df762a1643bb5b0b3c907611d118c82d4b68a39d)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: D:\_codec\emsdk\upstream\bin
  1. 用CMake-GUI生成sln文件:按照1-2-3-4-5的过程即可生成sln文件

在这里插入图片描述
生成sln文件:
在这里插入图片描述

  1. 用VS2022打开sln文件,点击运行:一段时间等待,完成编译。
    在这里插入图片描述
    在目录可以看到生成的所有库文件和可执行文件,后续可以研究aom源码了。
D:\_codec\aom\build\debug [main ≡ +1963 ~0 -0 !]> ls


    目录: D:\_codec\aom\build\debug


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         2024/5/12     10:10       40067812 aom.lib
-a----         2024/5/12     10:10       18613760 aomdec.exe
-a----         2024/5/12     10:10       18788352 aomdec.pdb
-a----         2024/5/12     10:10       18707456 aomenc.exe
-a----         2024/5/12     10:10       18919424 aomenc.pdb
-a----         2024/5/12     10:10         191722 aom_av1_rc.lib
-a----         2024/5/12     10:10         438272 aom_av1_rc.pdb
-a----         2024/5/12     10:10       18641408 aom_cx_set_ref.exe
-a----         2024/5/12     10:10       18845696 aom_cx_set_ref.pdb
-a----         2024/5/12     10:09        2789186 aom_gmock.lib
-a----         2024/5/12     10:09        1404928 aom_gmock.pdb
-a----         2024/5/12     10:09        9564822 aom_gtest.lib
-a----         2024/5/12     10:09        1847296 aom_gtest.pdb
-a----         2024/5/12     10:09           2112 aom_pc.lib
-a----         2024/5/12     10:09          69632 aom_pc.pdb
-a----         2024/5/12     10:03           2206 aom_version.lib
-a----         2024/5/12     10:03          69632 aom_version.pdb
-a----         2024/5/12     10:10       18588160 decode_to_md5.exe
-a----         2024/5/12     10:10       18755584 decode_to_md5.pdb
-a----         2024/5/12     10:10       18588672 decode_with_drops.exe
-a----         2024/5/12     10:10       18755584 decode_with_drops.pdb
-a----         2024/5/12     10:10       18592256 dump_obu.exe
-a----         2024/5/12     10:10       18796544 dump_obu.pdb
-a----         2024/5/12     10:10       18661888 lightfield_bitstream_parsing.exe
-a----         2024/5/12     10:10       18894848 lightfield_bitstream_parsing.pdb
-a----         2024/5/12     10:10       18597376 lightfield_decoder.exe
-a----         2024/5/12     10:10       18771968 lightfield_decoder.pdb
-a----         2024/5/12     10:10       18705408 lightfield_encoder.exe
-a----         2024/5/12     10:10       18886656 lightfield_encoder.pdb
-a----         2024/5/12     10:10       18593280 lightfield_tile_list_decoder.exe
-a----         2024/5/12     10:10       18763776 lightfield_tile_list_decoder.pdb
-a----         2024/5/12     10:10       18634240 lossless_encoder.exe
-a----         2024/5/12     10:10       18837504 lossless_encoder.pdb
-a----         2024/5/12     10:10       18644480 noise_model.exe
-a----         2024/5/12     10:10       18837504 noise_model.pdb
-a----         2024/5/12     10:10       18638336 photon_noise_table.exe
-a----         2024/5/12     10:10       18837504 photon_noise_table.pdb
-a----         2024/5/12     10:10       18589696 scalable_decoder.exe
-a----         2024/5/12     10:10       18755584 scalable_decoder.pdb
-a----         2024/5/12     10:10       18637312 scalable_encoder.exe
-a----         2024/5/12     10:10       18837504 scalable_encoder.pdb
-a----         2024/5/12     10:10       18635776 set_maps.exe
-a----         2024/5/12     10:10       18829312 set_maps.pdb
-a----         2024/5/12     10:10       18588160 simple_decoder.exe
-a----         2024/5/12     10:10       18739200 simple_decoder.pdb
-a----         2024/5/12     10:10       18635264 simple_encoder.exe
-a----         2024/5/12     10:10       18837504 simple_encoder.pdb
-a----         2024/5/12     10:10       18756096 svc_encoder_rtc.exe
-a----         2024/5/12     10:10       18993152 svc_encoder_rtc.pdb
-a----         2024/5/12     10:10       19226112 test_aom_rc.exe
-a----         2024/5/12     10:10       23744512 test_aom_rc.pdb
-a----         2024/5/12     10:10       19263488 test_intra_pred_speed.exe
-a----         2024/5/12     10:10       23531520 test_intra_pred_speed.pdb
-a----         2024/5/12     10:11       50193408 test_libaom.exe
-a----         2024/5/12     10:11      203837440 test_libaom.pdb
-a----         2024/5/12     10:10       18637312 twopass_encoder.exe
-a----         2024/5/12     10:10       18829312 twopass_encoder.pdb

  • 17
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Codec Conductor

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

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

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

打赏作者

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

抵扣说明:

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

余额充值