Skip to content

Commit

Permalink
Merge branch 'macos-CI'
Browse files Browse the repository at this point in the history
  • Loading branch information
fador committed Jul 31, 2024
2 parents 96ade5c + 22490f6 commit 7c7a56b
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 8 deletions.
30 changes: 26 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test-uvg266: &test-template
stage: test
script:
- bash .travis-install.bash
- export PATH="${HOME}/bin:${PATH}"
- export PATH="/opt/homebrew/bin/:${HOME}/bin:${PATH}"
- cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=./ . || (cat config.log && false)
- make install
- env CTEST_PARALLEL_LEVEL=8 CTEST_OUTPUT_ON_FAILURE=1 make test
Expand Down Expand Up @@ -43,9 +43,31 @@ test-valgrind:
variables:
UVG_TEST_VALGRIND: 1

# TODO: If someone knows YAML better, there has to be some better way to
# concatenate stuff into the test-template script than just manually copy
# pasting
test-macos:
<<: *test-template
tags:
- macOS

test-macos-asan:
<<: *test-template
tags:
- macOS
variables:
CFLAGS: '-fsanitize=address -g'
# LeakSanitizer doesn't work inside the container because it requires
# ptrace so we disable it.
ASAN_OPTIONS: 'detect_leaks=0'
# AddressSanitizer adds some extra symbols so we expect a failure from
# the external symbols test.
XFAIL_TESTS: test_external_symbols

test-macos-ubsan:
<<: *test-template
tags:
- macOS
variables:
CFLAGS: '-fsanitize=undefined -fno-sanitize-recover=all -fno-sanitize=alignment -g'

#test-distcheck:
# <<: *test-template
# script:
Expand Down
23 changes: 22 additions & 1 deletion .travis-install.bash
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
#!/bin/bash

# Download FFmpeg and HM decoder and place them in $PATH.
# Download FFmpeg and VTM decoder and place them in $PATH.

set -euvo pipefail

mkdir -p "${HOME}/bin"

export PATH="/opt/homebrew/bin/:${PATH}"

if [ "$(uname)" == "Darwin" ]; then
wget http://ultravideo.fi/ffmpeg-release-7.0-static-applesilicon.tar.xz
sha256sum -c - << EOF
c2bf6c192fac269ec298ee20b403cc6c9b493970ca3902a2123e649813ea1aba ffmpeg-release-7.0-static-applesilicon.tar.xz
EOF
tar xf ffmpeg-release-7.0-static-applesilicon.tar.xz
cp ffmpeg "${HOME}/bin/ffmpeg"
chmod +x "${HOME}/bin/ffmpeg"

wget http://ultravideo.fi/vtm-23.4-applesilicon.tar.xz
sha256sum -c - << EOF
193c71adca4f4882425de20f93f63ec6e20fe84154137d6894571a354962c7e1 vtm-23.4-applesilicon.tar.xz
EOF
tar xf vtm-23.4-applesilicon.tar.xz
cp DecoderApp "${HOME}/bin/DecoderAppStatic"
chmod +x "${HOME}/bin/DecoderAppStatic"

else
wget http://ultravideo.fi/ffmpeg-release-4.2.1-32bit-static.tar.xz
sha256sum -c - << EOF
226f55f8a94d71f3d231a20fe59fcbb7f6100cabf663f9bcb887d17b332a91c5 ffmpeg-release-4.2.1-32bit-static.tar.xz
Expand All @@ -21,5 +41,6 @@ EOF
tar xf ubuntu-vtm-13.0.tgz
cp DecoderApp "${HOME}/bin/DecoderAppStatic"
chmod +x "${HOME}/bin/DecoderAppStatic"
fi

export PATH="${HOME}/bin:${PATH}"
3 changes: 2 additions & 1 deletion src/intra.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,9 @@ static void predict_cclm(
if (x_scu == 0) available_left_below = MIN(MIN(height / 2, (64 - y_scu - height * 2) / 4), (state->tile->frame->height - y0 - height * 2) / 4);
for (; available_left_below < height / 2; available_left_below++) {
int y_extension = y_scu + height * 2 + 4 * available_left_below;
if (y_extension >= ctu_size) break;
const cu_info_t* pu = LCU_GET_CU_AT_PX(lcu, (x_scu) - 4, y_extension);
if (y_extension >= ctu_size || pu->type == CU_NOTSET || (pu->type == CU_INTRA && pu->intra.mode_chroma == -1)) break;
if (pu->type == CU_NOTSET || (pu->type == CU_INTRA && pu->intra.mode_chroma == -1)) break;
if(x_scu == 32 && y_scu == 0 && pu->log2_height == 6 && pu->log2_width == 6 ) break;
}
for(int i = 0; i < height + available_left_below * 2; i++) {
Expand Down
4 changes: 2 additions & 2 deletions tests/test_external_symbols.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

# Check for external symbols without uvg_ prefix.
# Check for external symbols without uvg_ prefix (or _uvg_ on macOS).

set -eu${BASH+o pipefail}

if nm -go --defined-only ../lib/libuvg266.a | grep -v ' uvg_'; then
if nm -go --defined-only ../lib/libuvg266.a | grep -v ' uvg_' | grep -v ' _uvg_'; then
printf '%s\n' 'Only symbols prefixed with "uvg_" should be exported from libuvg266.'
false
fi

0 comments on commit 7c7a56b

Please sign in to comment.