Giter Club home page Giter Club logo

libavif-container's Introduction

libavif-container

Sorry, this repository is no longer maintained due to the retirement of the main maintainer. After some time, this repository will be archived.

Ther source is currently maitained on avif-community by the maintaier. It's not a official community of AVIF codec. We take no resposibility the name of this community.

This repository will be removed after 2023-01-31 to resolve the confusing situation.

Unit tests

A library to parsing and writing avif container.

(It is not for neither decoding nor encoding.)

Related repositories

How to use

To clone this repo

git clone --recurse-submodules --recursive https://github.com/link-u/libavif-container.git

From CMake

We suggest you to vendor this library to your repo using git submodule add.

# example: git submodule add <this repo> external/libavif-container
add_subdirectory(external/libavif-container)

# libavif-container depends on C++17 features,
# so we strongly recommended you to use C++17 or higher.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# link to your library or executable
target_link_libraries(<your-target> libavif-container)

License

MIT

References

AV1 / AVIF

ISOBMFF

HEIF - MPEG-H Part 12 (ISO/IEC 23008-12)

MIAF - MPEG-A Part 22 (ISO/IEC 23000-22:2019)

ComplianceWarden

libavif-container's People

Contributors

dependabot[bot] avatar kotaro-shibata avatar ledyba-z avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

libavif-container's Issues

Interpretation of imir may be inverted

Quoting the discussion at bugs.chromium.org:

The 'axis' field of the 'imir' item property is often misinterpreted.
In HEIF (ISO/IEC 23008-12:2017(E)) it is specified as follows:

    6.5.12.2 Syntax

    aligned(8) class ImageMirror
    extends ItemProperty('imir') {
          unsigned int (7) reserved = 0;
          unsigned int (1) axis;
    }

    6.5.12.3 Semantics

    axis specifies a vertical (axis = 0) or horizontal (axis = 1) axis for the mirroring operation.

We believe it should be interpreted as follows (I quote the comments from libavif's avif.h header):

typedef struct avifImageMirror
{
    // 'imir' from ISO/IEC 23008-12:2017 6.5.12:
    // "axis specifies a vertical (axis = 0) or horizontal (axis = 1) axis for the mirroring operation."
    //
    // Legal values: [0, 1]
    //
    // 0: Mirror about a vertical axis ("left-to-right")
    // 1: Mirror about a horizontal axis ("top-to-bottom")
    uint8_t axis;
} avifImageMirror;

Contrasting with src/avif/img/TransformImpl.hpp:16..28:

template <>
struct FlipTrans<ImageMirrorBox::Axis::Vertical> {
  std::tuple <size_t, size_t> operator()(size_t srcWidth, size_t x, size_t srcHeight, size_t y) {
    return std::make_tuple(x, srcHeight - y - 1);
  }
};

template <>
struct FlipTrans<ImageMirrorBox::Axis::Horizontal> {
  std::tuple <size_t,size_t> operator()(size_t srcWidth, size_t x, size_t srcHeight, size_t y) {
    return std::make_tuple(srcWidth - x - 1, y);
  }
};

We see conversely that vertical mirror is applied "top-to-bottom" and horizontal mirror is applied "left-to-right", in link-u/libavif-container. So the test images generated with link-u/cavif appear rotated 180 degrees in recent Chromium builds, as reported on bugs.chromium.org:

Testing example images from the following page in Chrome Beta 90.0.4430.61:
https://aomediacodec.github.io/av1-avif/testFiles/Link-U/#kimono---transformation-tests

The following images render rotated by 180deg compared to the expectation:
https://aomediacodec.github.io/av1-avif/testFiles/Link-U/kimono.mirror-horizontal.avif
https://aomediacodec.github.io/av1-avif/testFiles/Link-U/kimono.mirror-vertical.avif
https://aomediacodec.github.io/av1-avif/testFiles/Link-U/kimono.mirror-vertical.rotate270.avif

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.