Skip to content

Commit

Permalink
fix: macOS arm64 illegal instruction segmentation fault with aom enco…
Browse files Browse the repository at this point in the history
…ding (#60)

This updates the libavif sha to incorporate the fix in AOMediaCodec/libavif#2265
  • Loading branch information
fdintino authored Jul 14, 2024
1 parent 7017e78 commit 926c1af
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ jobs:
${{ env.LIBAVIF_VERSION }}-${{ hashFiles('.github/workflows/*.sh', '.github/workflows/test.yml', 'depends/*') }}-${{ matrix.os }}

- name: Install nasm
if: steps.build-cache.outputs.cache-hit != 'true'
uses: ilammy/setup-nasm@v1
with:
version: 2.15.05
Expand Down
12 changes: 12 additions & 0 deletions tests/test_file_avif.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,18 @@ def test_decoder_strict_flags(self):
with Image.open("%s/tests/images/chimera-missing-pixi.avif" % CURR_DIR) as im:
assert im.size == (480, 270)

@skip_unless_avif_encoder("aom")
def test_aom_optimizations(self):
im = hopper("RGB")
buf = BytesIO()
im.save(buf, format="AVIF", codec="aom", speed=1)

@skip_unless_avif_encoder("svt")
def test_svt_optimizations(self):
im = hopper("RGB")
buf = BytesIO()
im.save(buf, format="AVIF", codec="svt", speed=1)


class TestAvifAnimation:
@contextmanager
Expand Down
6 changes: 3 additions & 3 deletions wheelbuild/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eo pipefail
CONFIG_DIR=$(abspath $(dirname "${BASH_SOURCE[0]}"))

ARCHIVE_SDIR=pillow-avif-plugin-depends
LIBAVIF_VERSION=e10e6d98e6d1dbcdd409859a924d1b607a1e06dc
LIBAVIF_VERSION=02fc53e73d68dccacc54ce543b1be1e9b3236495
RAV1E_VERSION=0.7.1
CCACHE_VERSION=4.7.1
SCCACHE_VERSION=0.3.0
Expand Down Expand Up @@ -229,7 +229,7 @@ function build_libavif {
cmake --version
if [ -n "$IS_MACOS" ] && [ "$PLAT" == "arm64" ]; then
# SVT-AV1 NEON intrinsics require macOS 14
local macos_ver==$(sw_vers --productVersion | sed 's/\.[0-9]*//')
local macos_ver=$(sw_vers --productVersion | sed 's/\.[0-9]*//')
if [ "$macos_ver" -gt "13" ]; then
LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_SVT=LOCAL)
fi
Expand Down Expand Up @@ -270,7 +270,7 @@ EOF
group_start "Download libavif source"

fetch_unpack \
"https://github.com/AOMediaCodec/libavif/archive/$LIBAVIF_VERSION.tar.gz" \
"https://github.com/fdintino/libavif/archive/$LIBAVIF_VERSION.tar.gz" \
"libavif-$LIBAVIF_VERSION.tar.gz"

group_end
Expand Down
6 changes: 3 additions & 3 deletions winbuild/build_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ def cmd_msbuild(
"libavif": {
"url": (
"https://github.com/fdintino/libavif/archive/"
"e10e6d98e6d1dbcdd409859a924d1b607a1e06dc.zip"
"02fc53e73d68dccacc54ce543b1be1e9b3236495.zip"
),
"filename": "libavif-e10e6d98e6d1dbcdd409859a924d1b607a1e06dc.zip",
"dir": "libavif-e10e6d98e6d1dbcdd409859a924d1b607a1e06dc",
"filename": "libavif-02fc53e73d68dccacc54ce543b1be1e9b3236495.zip",
"dir": "libavif-02fc53e73d68dccacc54ce543b1be1e9b3236495",
"license": "LICENSE",
"build": [
cmd_mkdir("build.pillow"),
Expand Down

0 comments on commit 926c1af

Please sign in to comment.