Skip to content

Commit

Permalink
First upload
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Novomesky <[email protected]>
  • Loading branch information
novomesk committed Apr 29, 2020
1 parent 800c2a7 commit 6d03a39
Show file tree
Hide file tree
Showing 1,170 changed files with 549,773 additions and 0 deletions.
108 changes: 108 additions & 0 deletions PATENTS
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
Alliance for Open Media Patent License 1.0

1. License Terms.

1.1. Patent License. Subject to the terms and conditions of this License, each
Licensor, on behalf of itself and successors in interest and assigns,
grants Licensee a non-sublicensable, perpetual, worldwide, non-exclusive,
no-charge, royalty-free, irrevocable (except as expressly stated in this
License) patent license to its Necessary Claims to make, use, sell, offer
for sale, import or distribute any Implementation.

1.2. Conditions.

1.2.1. Availability. As a condition to the grant of rights to Licensee to make,
sell, offer for sale, import or distribute an Implementation under
Section 1.1, Licensee must make its Necessary Claims available under
this License, and must reproduce this License with any Implementation
as follows:

a. For distribution in source code, by including this License in the
root directory of the source code with its Implementation.

b. For distribution in any other form (including binary, object form,
and/or hardware description code (e.g., HDL, RTL, Gate Level Netlist,
GDSII, etc.)), by including this License in the documentation, legal
notices, and/or other written materials provided with the
Implementation.

1.2.2. Additional Conditions. This license is directly from Licensor to
Licensee. Licensee acknowledges as a condition of benefiting from it
that no rights from Licensor are received from suppliers, distributors,
or otherwise in connection with this License.

1.3. Defensive Termination. If any Licensee, its Affiliates, or its agents
initiates patent litigation or files, maintains, or voluntarily
participates in a lawsuit against another entity or any person asserting
that any Implementation infringes Necessary Claims, any patent licenses
granted under this License directly to the Licensee are immediately
terminated as of the date of the initiation of action unless 1) that suit
was in response to a corresponding suit regarding an Implementation first
brought against an initiating entity, or 2) that suit was brought to
enforce the terms of this License (including intervention in a third-party
action by a Licensee).

1.4. Disclaimers. The Reference Implementation and Specification are provided
"AS IS" and without warranty. The entire risk as to implementing or
otherwise using the Reference Implementation or Specification is assumed
by the implementer and user. Licensor expressly disclaims any warranties
(express, implied, or otherwise), including implied warranties of
merchantability, non-infringement, fitness for a particular purpose, or
title, related to the material. IN NO EVENT WILL LICENSOR BE LIABLE TO
ANY OTHER PARTY FOR LOST PROFITS OR ANY FORM OF INDIRECT, SPECIAL,
INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER FROM ANY CAUSES OF
ACTION OF ANY KIND WITH RESPECT TO THIS LICENSE, WHETHER BASED ON BREACH
OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, AND WHETHER OR
NOT THE OTHER PARTRY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

2. Definitions.

2.1. Affiliate. "Affiliate" means an entity that directly or indirectly
Controls, is Controlled by, or is under common Control of that party.

2.2. Control. "Control" means direct or indirect control of more than 50% of
the voting power to elect directors of that corporation, or for any other
entity, the power to direct management of such entity.

2.3. Decoder. "Decoder" means any decoder that conforms fully with all
non-optional portions of the Specification.

2.4. Encoder. "Encoder" means any encoder that produces a bitstream that can
be decoded by a Decoder only to the extent it produces such a bitstream.

2.5. Final Deliverable. "Final Deliverable" means the final version of a
deliverable approved by the Alliance for Open Media as a Final
Deliverable.

2.6. Implementation. "Implementation" means any implementation, including the
Reference Implementation, that is an Encoder and/or a Decoder. An
Implementation also includes components of an Implementation only to the
extent they are used as part of an Implementation.

2.7. License. "License" means this license.

2.8. Licensee. "Licensee" means any person or entity who exercises patent
rights granted under this License.

2.9. Licensor. "Licensor" means (i) any Licensee that makes, sells, offers
for sale, imports or distributes any Implementation, or (ii) a person
or entity that has a licensing obligation to the Implementation as a
result of its membership and/or participation in the Alliance for Open
Media working group that developed the Specification.

2.10. Necessary Claims. "Necessary Claims" means all claims of patents or
patent applications, (a) that currently or at any time in the future,
are owned or controlled by the Licensor, and (b) (i) would be an
Essential Claim as defined by the W3C Policy as of February 5, 2004
(https://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential)
as if the Specification was a W3C Recommendation; or (ii) are infringed
by the Reference Implementation.

2.11. Reference Implementation. "Reference Implementation" means an Encoder
and/or Decoder released by the Alliance for Open Media as a Final
Deliverable.

2.12. Specification. "Specification" means the specification designated by
the Alliance for Open Media as a Final Deliverable for which this
License was issued.

21 changes: 21 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
file-avif plug-in with AVIF format support for GIMP 2.99 and newer.
The plug-in doesn’t work with versions 2.10.x and older because they use different plug-in API.
Dependencies:
libavif 0.6.0 or newer
https://github.com/AOMediaCodec/libavif

In case your system has libavif library installed, the plug-in will be linked dynamically.
In case your system doesn’t have libavif, the build script will attempt to build libavif locally and static linking will be used. Another library libaom will be built during static local build, sources included.

How to build:
./build_file-avif.sh

If you are builing static version you may review build_local_libaom_libavif.sh in ext folder where you can see details how libaom and libavif are being prepared.
If you are sure you are going to make a static build, you may run build_local_libaom_libavif.sh in ext folder before running build_file-avif.sh,
you will compilation process of libaom and libavif.

yasm is needed to build libaom!

Examples of files in AVIF format:
https://github.com/AOMediaCodec/av1-avif/tree/master/testFiles

45 changes: 45 additions & 0 deletions build_file-avif.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

if ! [ -x "$(command -v meson)" ]; then
echo 'Error: meson is not installed.' >&2
exit 1
fi

if ! [ -x "$(command -v ninja)" ]; then
echo 'Error: ninja is not installed.' >&2
exit 1
fi

RELATIVE_PATH=`dirname "$BASH_SOURCE"`
cd "$RELATIVE_PATH"

if ! [ -f src/builddir/file-avif ]; then
cd src
#we clean previous incomplete build
if [ -d builddir ]; then
rm -r builddir
fi

meson setup --buildtype=release builddir
cd builddir
ninja

if ! [ -f file-avif ]; then
echo 'Error: we failed to compile file-avif!' >&2
exit 1
fi

cd ../..
fi

cp src/builddir/file-avif .

echo 'file-avif build sucess.'
echo 'Info how to install the plug-in for local users of GIMP 2.99:'
echo ' mkdir ~/.config/GIMP/2.99/plug-ins/file-avif'
echo ' cp file-avif ~/.config/GIMP/2.99/plug-ins/file-avif/'
echo 'Info how to install the plug-in for all users (needs root permission) of GIMP 2.99 on local machine:'
echo ' mkdir /usr/lib/gimp/2.99/plug-ins/file-avif'
echo ' cp file-avif /usr/lib/gimp/2.99/plug-ins/file-avif/'

exit 0
49 changes: 49 additions & 0 deletions ext/build_local_libaom_libavif.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

if ! [ -x "$(command -v cmake)" ]; then
echo 'Error: cmake is not installed.' >&2
exit 1
fi

if ! [ -x "$(command -v ninja)" ]; then
echo 'Error: ninja is not installed.' >&2
exit 1
fi

RELATIVE_PATH=`dirname "$BASH_SOURCE"`
cd "$RELATIVE_PATH"

if ! [ -f libavif/ext/aom/build.libavif/libaom.a ]; then
echo 'We are going to build libaom.a'
cd libavif/ext/aom
mkdir -p build.libavif
cd build.libavif

cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DENABLE_DOCS=0 -DENABLE_EXAMPLES=0 -DENABLE_TESTDATA=0 -DENABLE_TESTS=0 -DENABLE_TOOLS=0 ..
ninja

if ! [ -f libaom.a ]; then
echo 'Error: libaom.a build failed!' >&2
exit 1
fi
cd ../../../..
fi


if ! [ -f libavif/build/libavif.a ]; then
echo 'We are going to build libavif.a'
cd libavif
mkdir -p build
cd build

cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DAVIF_CODEC_AOM=ON -DAVIF_LOCAL_AOM=ON ..
ninja

if ! [ -f libavif.a ]; then
echo 'Error: libavif.a build failed!' >&2
exit 1
fi
cd ../..
fi

exit 0
Loading

0 comments on commit 6d03a39

Please sign in to comment.