AV1源碼分析(一)

AOM 工程

AOMedia Video 1是一個開放、免專利的影片編碼格式,專爲通過網絡進行流傳輸而設計。它由開放媒體聯盟開發,該聯盟由半導體企業、視頻點播供應商和網頁瀏覽器開發商於2015年成立。互聯網工程任務組也將這項工作標準化爲互聯網視頻編解碼器(NetVC)。
AV1的目標是取代其前身,即由谷歌開發的VP9視頻壓縮格式,並與動態圖像專家組(MPEG)領導開發的高效率視頻編碼(HEVC)以及由中華人民共和國的數字音視頻編碼技術標準工作組主導開發的第二代數字音視頻編解碼技術標準(AVS2)競爭。
AV1可以與Opus音頻格式一起封裝在WebM容器格式中,並可用於HTML5網絡視頻和網頁即時通信。

  1. AV1 前期準備:
  • 安裝CMake,版本需求 3.5 以上;
  • 安裝Git;
  • 安裝Perl;
  • 對於x86,需要安裝yasm或nasm;
  • 安裝python;
  1. 獲取源碼
$ git clone https://aomedia.googlesource.com/aom

googlesource不好上,幸好我在github上找到了他們的倉庫:

$ git clone https://github.com/mozilla/aom.git
  1. Linux 下編譯方法
    Linux 下的編譯b比較簡單了,只需要用cmake配置,然後make編譯即可。
$ cmake path/to/aom
$ make

直接在aom目錄下執行cmake命令會報這麼個錯:

Building from within the aom source tree is not supported.

解決辦法是在aom目錄下新建一個aom_build,然後進到aom_build目錄執行上面的兩條命令。
然而,在執行make時,又碰到編譯錯誤:

[ 64%] Linking CXX executable examples/decode_with_drops
/usr/bin/ld: libaom.a(fwd_txfm_ssse3_x86_64.asm.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: libaom.a(quantize_ssse3_x86_64.asm.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: libaom.a(subpel_variance_sse2.asm.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: libaom.a(highbd_subpel_variance_impl_sse2.asm.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
CMakeFiles/decode_with_drops.dir/build.make:144: recipe for target 'examples/decode_with_drops' failed
make[2]: *** [examples/decode_with_drops] Error 1
CMakeFiles/Makefile2:304: recipe for target 'CMakeFiles/decode_with_drops.dir/all' failed
make[1]: *** [CMakeFiles/decode_with_drops.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
  1. Windows 下編譯方法
    Windows下使用Visual Studio同樣可以編譯運行av1的代碼。只需要在cmake時指定 VS 版本號即可,支持的工具可以通過cmake --help來查看。
$ make aom_vs
$ cd aom_vs
$ cmake /path/to/aom -G "Visual Studio 12 2013 Win64" -DCONFIG_AV1_ENCODER=0 -DCONFIG_LOWBITDEPTH=0 -DAOM_TARGET_CPU=generic

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章