commit | 452ac6d242aad0b6e998f8ac25c892b1ccd07840 | [log] [tgz] |
---|---|---|
author | Joe Drago <jdrago@netflix.com> | Tue Sep 21 16:52:39 2021 -0700 |
committer | Joe Drago <jdrago@netflix.com> | Tue Sep 21 16:52:39 2021 -0700 |
tree | 7b9497f0afcd66bcb20768fd7b5b0588728c771d | |
parent | 1dea33e5ad6864527de7687addcfc19408e8681f [diff] |
Redesign AVIF_DECODER_SOURCE_AUTO to honor the FileTypeBox's major brand When using AVIF_DECODER_SOURCE_AUTO, use the major_brand field in the FileTypeBox ('ftyp') in the beginning of the file as a hint to whether or not to treat this file as an AVIF sequence or an items-based single image. In practice (and currently in the field), this won't change pre-existing behavior as the vast majority of AVIFs in existence right now are single images and signal the major brand 'avif' anyway, and sequences generated by avifenc have always used the major brand 'avis'. This design is more in the spirit of ISO-BMFF Section 4.3's explanation of major_brand: Files would normally be externally identified (e.g. with a file extension or mime type) that identifies the ‘best use’ (major brand), or the brand that the author believes will provide the greatest compatibility. This also would allow for currently unexercised use-cases such as "live photos", where an AVIF can internally hold an image sequence recorded by a camera, but suggest (via the major brand) to only display it as a single image, specifying one of the frame samples as an item.
This library aims to be a friendly, portable C implementation of the AV1 Image File Format, as described here:
https://aomediacodec.github.io/av1-avif/
It is a work-in-progress, but can already encode and decode all AOM supported YUV formats and bit depths (with alpha).
For now, it is recommended that you checkout/use tagged releases instead of just using the master branch. I will regularly create new versions as bugfixes and features are added.
Please see the examples in the examples directory. If you're already building libavif
, enable the CMake option AVIF_BUILD_EXAMPLES
in order to build and run the examples too.
Building libavif requires CMake.
No AV1 codecs are enabled by default. Enable them by enabling any of the following CMake options:
AVIF_CODEC_AOM
- requires CMake, NASMAVIF_CODEC_DAV1D
- requires Meson, Ninja, NASMAVIF_CODEC_LIBGAV1
- requires CMake, NinjaAVIF_CODEC_RAV1E
- requires cargo (Rust), NASMThese libraries (in their C API form) must be externally available (discoverable via CMake‘s FIND_LIBRARY
) to use them, or if libavif is a child CMake project, the appropriate CMake target must already exist by the time libavif’s CMake scripts are executed.
The ext/
subdirectory contains a handful of basic scripts which each pull down a known-good copy of an AV1 codec and make a local static library build. If you want to statically link any codec into your local (static) build of libavif, building using one of these scripts and then enabling the associated AVIF_LOCAL_*
is a convenient method, but you must make sure to disable BUILD_SHARED_LIBS
in CMake to instruct it to make a static libavif library.
If you want to build/install shared libraries for AV1 codecs, you can still peek inside of each script to see where the current known-good SHA is for each codec.
If you're building on Windows with Visual Studio 2019 and want to try out libavif without going through the build process, static library builds for both Debug and Release are available on AppVeyor.
Released under the BSD License.
Copyright 2019 Joe Drago. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.