[libopenapv] Add dimension validation in dec_frm_prepare

Validates that the provided image buffer (imgb) has sufficient
dimensions to accommodate the frame being decoded as specified in the
Frame PBU header. This prevents a heap buffer overflow when Frame PBU
dimensions are larger than those in AU_INFO (which are used for buffer
allocation).

Bug: 492492028
Test: oapv_repro (local test program)
Flag: EXEMPT BUGFIX
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:cf05ca54cffdb52567dbdc30ebc7eeff46b75e05
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:28622a8174204e332b17da89683a0385d7cda857
Merged-In: I7d3f778d519343d6d20f00ea84346e7dd4d984a7
Change-Id: I7d3f778d519343d6d20f00ea84346e7dd4d984a7
1 file changed
tree: 3d3f8398bf712821f7bfebc75784a90c0156fcf1
  1. .github/
  2. android/
  3. app/
  4. inc/
  5. pkgconfig/
  6. readme/
  7. src/
  8. test/
  9. util/
  10. .clang-format
  11. .gitignore
  12. Android.bp
  13. arm64_toolchain.cmake
  14. cmake_uninstall.cmake.in
  15. CMakeLists.txt
  16. LICENSE
  17. METADATA
  18. MODULE_LICENSE_BSD
  19. OWNERS
  20. README.md
  21. windows_x86_64_toolchain.cmake
README.md

OAPV OAPV

OpenAPV (Open Advanced Professional Video Codec)

Build and test

OpenAPV provides the reference implementation of the APV codec which can be used to record professional-grade video and associated metadata without quality degradation. OpenAPV is free and open source software provided by LICENSE.

The OpenAPV supports the following features:

  • fully compliant with 422-10 and 400-10 profile of APV codec
  • Low complexity by optimization for ARM NEON and x86(64bit) SEE/AVX CPU
  • Supports tile-based multi-threading
  • Supports Various metadata including HDR10/10+ and user-defined format
  • Constant QP (CQP), average bitrate (ABR), and constant rate factor (CRF) are supported

APV codec

The APV codec is a professional video codec, which was developed in response to the need for professional level high quality video recording and post production. The primary purpose of the APV codec is for use in professional video recording and editing workflows for various types of content.

APV codec utilizes technologies known to be over 20 years old to achieve a royalty free codec. APV builds a video codec using only conventional coding technologies, which consist of traditional methods published between the early 1980s and the end of the 1990s.

The APV codec standard has the following features:

  • Perceptually lossless video quality, which is close to raw video quality
  • Low complexity and high throughput intra frame only coding without pixel domain prediction
  • Support for high bit-rate range up to a few Gbps for 2K, 4K and 8K resolution content, enabled by a lightweight entropy coding scheme
  • Frame tiling for immersive content and for enabling parallel encoding and decoding
  • Support for various chroma sampling formats from 4:2:2 to 4:4:4, and bit-depths from 10 to 16
  • Support for multiple decoding and re-encoding without severe visual quality degradation
  • Support multi-view video and auxiliary video like depth, alpha, and preview
  • Support various metadata including HDR10/10+ and user-defined format

Related specification

How to build

  • Build Requirements

    For ARM

    • gcc-aarch64-linux-gnu
    • binutils-aarch64-linux-gnu

    For Windows (crosscompile)

    • mingw-w64
    • mingw-w64-tools
  • Build Instructions PC (Linux)

    cmake -DCMAKE_BUILD_TYPE=Release -S . -B build
    cmake --build build
    
  • Build Instructions ARM (Crosscompile)

    cmake -S . -B build-arm -DCMAKE_TOOLCHAIN_FILE=aarch64_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
    cmake --build build-arm
    
  • Build Instructions Windows (Crosscompile)

    cmake -S . -B build-windows -DCMAKE_TOOLCHAIN_FILE=windows_x86_64_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
    cmake --build build-windows
    
  • Output Location

    • Executable applications can be found under build*/bin/
    • Library files can be found under build*/lib/

How to use applications

Encoder

Encoder requires raw YCbCr file (422, 444), 10-bit or more, as input.

Displaying help:

oapv_app_enc --help

Encoding:

oapv_app_enc -i input_1920x1080_yuv422_10bit.yuv -w 1920 -h 1080 -d 10 -z 30 --input-csp 2 -o encoded.apv
oapv_app_enc -i input.y4m -o encoded.apv

Decoder

Decoder output can be in yuv or y4m formats.

Displaying help:

oapv_app_dec --help

Decoding:

oapv_app_dec -i encoded.apv -o output.y4m

Utility

Graphical APV bitstream parser

Pattern file of APV bitstream for ImHex is provided here.

  1. Install ImHex application
  2. Download APV pattern file and copy it to ‘patterns’ directory of the ImHex application
  3. Open an APV bitstream (*.apv file) file with the ImHex application
  4. The APV pattern file will be selected automatically and press ‘yes’ to apply it

APV_on_ImHex

Testing

In build directory run ctest

Packaging

For generating package ready for distribution (default deb) execute in build directory cpack, or other formats (tgz, zip etc.) cpack -G TGZ.

Versioning

This project is using the following versioning scheme API-SET.MAJOR.MINOR.PATCH. It's mostly based on Semantic Versioning with addition of API-SET on first place. Project and library share a common version number.

License

See LICENSE file for details.

Graphic logo

logo for light mode

OAPV OAPV OAPV

logo for dark mode

OAPV OAPV OAPV