forked from Kagami/SVT-AV1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
881 lines (809 loc) · 24.6 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
stages:
- compile
- test
variables:
CMAKE_GENERATOR: Ninja
#
# General checks
#
Style check:
stage: .pre
image: registry.gitlab.com/aomediacodec/aom-testing/alpine3
script:
- ./test/stylecheck.sh
Static analysis (cppcheck):
stage: compile
image: registry.gitlab.com/aomediacodec/aom-testing/ubuntu1804
cache:
key: cppcheck
paths:
- .cppcheck
policy: pull-push
variables:
CMAKE_GENERATOR: Unix Makefiles
script:
- cmake -B Build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- mkdir -p .cppcheck
- jq '.[]|=with_entries(select(.value | test(".asm|/SVT-AV1/Build/cpuinfo") | not)) | unique' Build/compile_commands.json > compile_commands.json
- |
cppcheck \
--project=compile_commands.json \
--error-exitcode=1 \
--enable=all \
-j 2 \
-rp=$PWD \
-ithird_party \
--cppcheck-build-dir=.cppcheck \
--suppress=unusedFunction > /dev/null
#
# Linux CI Jobs
#
.linux-compiler-base:
stage: compile
image: registry.gitlab.com/aomediacodec/aom-testing/ubuntu2004
variables:
CFLAGS: -Werror -Wshadow $EXTRA_CFLAGS
CXXFLAGS: -Werror -Wshadow $EXTRA_CXXFLAGS
CCACHE_DIR: $CI_PROJECT_DIR/.ccache
cache:
key: ${CI_JOB_NAME}
paths:
- .ccache
policy: pull-push
script:
- ccache -s
- eval cmake -B Build -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:=Release} -DBUILD_SHARED_LIBS=OFF $EXTRA_CMAKE_FLAGS
- cmake --build Build --config $CMAKE_BUILD_TYPE --target install
- ccache -s
Linux (Clang 6):
extends: .linux-compiler-base
variables:
CC: clang-6.0
CXX: clang++-6.0
Linux (Clang 10):
extends: .linux-compiler-base
variables:
CC: clang-10
CXX: clang++-10
Linux (GCC 4):
extends: .linux-compiler-base
image: registry.gitlab.com/aomediacodec/aom-testing/centos7
Linux (Valgrind):
extends: .linux-compiler-base
image: registry.gitlab.com/aomediacodec/aom-testing/ubuntu1804
variables:
EXTRA_CFLAGS: -Wno-error -g
EXTRA_CXXFLAGS: -Wno-error -g
EXTRA_CMAKE_FLAGS: -DCMAKE_OUTPUT_DIRECTORY=valgrind
CMAKE_BUILD_TYPE: Debug
artifacts:
untracked: false
expire_in: 30 days
paths:
- valgrind/
Linux (GCC 7):
extends: .linux-compiler-base
variables:
CC: gcc-7
CXX: g++-7
Linux (GCC 8):
extends: .linux-compiler-base
variables:
CC: gcc-8
CXX: g++-8
Linux (GCC 9):
extends: .linux-compiler-base
variables:
CC: gcc-9
CXX: g++-9
Linux (GCC 9, aarch64):
extends: .linux-compiler-base
variables:
CC: aarch64-linux-gnu-gcc
CXX: aarch64-linux-gnu-g++
EXTRA_CMAKE_FLAGS: -DCMAKE_TOOLCHAIN_FILE=$CI_PROJECT_DIR/aarch64-linux-gnu.cmake
before_script:
- curl -Ls "https://aomedia.googlesource.com/aom/+/refs/heads/master/build/cmake/toolchains/arm64-linux-gcc.cmake?format=TEXT" | base64 -d > aarch64-linux-gnu.cmake
Linux (GCC 9, powerpc64le):
extends: .linux-compiler-base
variables:
CC: powerpc64le-linux-gnu-gcc
CXX: powerpc64le-linux-gnu-g++
EXTRA_CMAKE_FLAGS: -DCMAKE_TOOLCHAIN_FILE=$CI_PROJECT_DIR/powerpc64le-linux-gnu.cmake -DCROSS=powerpc64le-linux-gnu-
before_script:
- curl -Ls "https://aomedia.googlesource.com/aom/+/refs/heads/master/build/cmake/toolchains/ppc-linux-gcc.cmake?format=TEXT" | base64 -d > powerpc64le-linux-gnu.cmake
Linux (GCC 10):
extends: .linux-compiler-base
variables:
CC: gcc-10
CXX: g++-10
LDFLAGS: -static -static-libgcc -static-libstdc++
GIT_DEPTH: 0
artifacts:
untracked: false
expire_in: 30 days
paths:
- Bin/Release/SvtAv1EncApp
- Bin/Release/SvtAv1DecApp
Linux (GCC 10, Tests, Static):
extends: .linux-compiler-base
variables:
CC: gcc-10
CXX: g++-10
EXTRA_CFLAGS: -Wno-error -g
EXTRA_CXXFLAGS: -Wno-error -g
LDFLAGS: -static -static-libgcc -static-libstdc++
EXTRA_CMAKE_FLAGS: -DBUILD_TESTING=ON -DBUILD_APPS=OFF
artifacts:
untracked: false
expire_in: 1 day
paths:
- Bin/Release/SvtAv1UnitTests
- Bin/Release/SvtAv1ApiTests
- Bin/Release/SvtAv1E2ETests
Linux (GCC 10, AVX512):
extends: .linux-compiler-base
variables:
CC: gcc-10
CXX: g++-10
EXTRA_CMAKE_FLAGS: -DENABLE_AVX512=ON
.sanitizer compile:
extends: .linux-compiler-base
variables:
CC: clang-10
CXX: clang++-10
CMAKE_BUILD_TYPE: Debug
artifacts:
untracked: false
expire_in: 30 days
paths:
- address/
- memory/
- thread/
Linux (Address sanitizer):
extends: .sanitizer compile
variables:
EXTRA_CMAKE_FLAGS: -DCMAKE_OUTPUT_DIRECTORY=address -DSANITIZER=address
Linux (Memory sanitizer):
extends: .sanitizer compile
variables:
EXTRA_CMAKE_FLAGS: -DCMAKE_OUTPUT_DIRECTORY=memory -DSANITIZER=memory
Linux (Thread sanitizer):
extends: .sanitizer compile
variables:
EXTRA_CMAKE_FLAGS: -DCMAKE_OUTPUT_DIRECTORY=thread -DSANITIZER=thread
.tests:
stage: test
image: registry.gitlab.com/aomediacodec/aom-testing/ubuntu2004
before_script:
- cp /*.zst .
- zstd -d *.zst
Valgrind:
extends: .tests
image: registry.gitlab.com/aomediacodec/aom-testing/ubuntu1804
allow_failure: true
script:
# --error-limit=no --leak-check=full --show-leak-kinds=all makes the log very huge and takes around 16 minutes
- valgrind --error-exitcode=1 --track-origins=yes --suppressions=/usr/lib/valgrind/debian.supp -- ./valgrind/SvtAv1EncApp --preset 6 -i akiyo_cif.y4m -n 10 -b test1.ivf
needs:
- 'Linux (Valgrind)'
Valgrind (Pass 1):
extends: .tests
image: registry.gitlab.com/aomediacodec/aom-testing/ubuntu1804
allow_failure: true
script:
- valgrind --error-exitcode=1 --track-origins=yes --suppressions=/usr/lib/valgrind/debian.supp -- ./valgrind/SvtAv1EncApp --preset 6 --pass 1 -i akiyo_cif.y4m -n 10 -b test1.ivf
needs:
- 'Linux (Valgrind)'
.sanitizer test:
extends: .tests
image: registry.gitlab.com/aomediacodec/aom-testing/ubuntu2004
variables:
LSAN_OPTIONS: "verbosity=2:color=always:log_pointers=1:log_threads=1:report_objects=1"
ASAN_OPTIONS: "verbosity=2:color=always:print_cmdline=1:strict_string_checks=1:symbolize=1:detect_leaks=1:fast_unwind_on_malloc=0:strict_memcmp=0"
MSAN_OPTIONS: "verbosity=2:color=always"
TSAN_OPTIONS: "verbosity=2:color=always:suppressions=./.github/workflows/sanitizers-known-warnings.txt"
script:
- |
command="$PWD/$SANITIZER/SvtAv1EncApp -i Chimera-Aerial_480x264_2997fps_10bit_420_150frames.y4m ${svt_asm:+--asm $svt_asm} -n 60 --preset 8 -b output.ivf"
case $SANITIZER in
address|memory) $command ;;
*) gdb -q -ex "handle SIG32 nostop" -ex r -ex bt -ex q --return-child-result --args $command ;;
esac
Linux (Address sanitizer) test:
extends: .sanitizer test
variables:
SANITIZER: address
needs:
- 'Linux (Address sanitizer)'
Linux (Memory sanitizer) test:
extends: .sanitizer test
variables:
SANITIZER: memory
svt_asm: 0
needs:
- 'Linux (Memory sanitizer)'
Linux (Thread sanitizer) test:
extends: .sanitizer test
allow_failure: true
variables:
SANITIZER: thread
needs:
- 'Linux (Thread sanitizer)'
.unit tests:
extends: .tests
parallel: 50
variables:
GTEST_TOTAL_SHARDS: 50
GTEST_OUTPUT: "xml:report.xml"
artifacts:
when: always
reports:
junit: report.xml
needs:
- 'Linux (GCC 10, Tests, Static)'
Linux Unit Tests:
extends: .unit tests
script:
- export GTEST_SHARD_INDEX=$((CI_NODE_INDEX - 1))
- mkdir -p unittests
- ./Bin/Release/SvtAv1UnitTests
Linux E2E Tests:
extends: .unit tests
script:
- export GTEST_SHARD_INDEX=$((CI_NODE_INDEX - 1))
- export SVT_AV1_TEST_VECTOR_PATH=$PWD
- mkdir -p unittests
- mv test/vectors/* .
- ./Bin/Release/SvtAv1E2ETests --gtest_filter=-*DummySrcTest*
Linux (Gstreamer, Static):
extends: .tests
variables:
CC: gcc-10
CXX: g++-10
CFLAGS: -pipe -O3
CXXFLAGS: -pipe -O3
LDFLAGS: -pipe
CCACHE_DIR: $CI_PROJECT_DIR/.ccache
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
GIT_DEPTH: 0
cache:
key: ${CI_JOB_NAME}
paths:
- .ccache
policy: pull-push
needs:
- 'Linux (GCC 10)'
script:
- cmake -B Build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_APPS=OFF -DBUILD_DEC=OFF
- cmake --build Build --config Release --target install
- meson setup gstreamer-plugin/build gstreamer-plugin -Dprefix=/usr
- ninja -C gstreamer-plugin/build install
- |
gst-launch-1.0 -v filesrc location=akiyo_cif.y4m \
! y4mdec \
! svtav1enc \
! webmmux \
! filesink location=akiyo.mkv
Linux (FFmpeg, Static):
extends: .tests
variables:
CC: gcc-10
CXX: g++-10
CFLAGS: -pipe -O3
CXXFLAGS: -pipe -O3
LDFLAGS: -pipe -static -static-libgcc -static-libstdc++
CCACHE_DIR: $CI_PROJECT_DIR/.ccache
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
GIT_DEPTH: 0
cache:
key: ${CI_JOB_NAME}
paths:
- .ccache
policy: pull-push
needs:
- 'Linux (GCC 10)'
artifacts:
untracked: false
expire_in: 30 days
paths:
- ffmpeg
script:
- ccache -s
- git clone https://aomedia.googlesource.com/aom
- git clone https://chromium.googlesource.com/webm/libvpx
- git clone https://code.videolan.org/videolan/dav1d.git
- git clone https://github.com/Netflix/vmaf.git
- git clone https://github.com/FFmpeg/FFmpeg.git
# SVT-AV1
- cmake -B svtav1-build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_APPS=OFF -DBUILD_DEC=OFF
- cmake --build svtav1-build --config Release --target install
# aom
- cmake -S aom -B aom-build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DENABLE_TESTS=0 -DENABLE_EXAMPLES=0 -DENABLE_DOCS=0 -DENABLE_TESTDATA=0 -DENABLE_TOOLS=0
- cmake --build aom-build --config Release --target install
# libvpx
- mkdir -p vpx-build && cd vpx-build || exit 1
- |
../libvpx/configure \
--disable-dependency-tracking \
--disable-docs \
--disable-examples \
--disable-libyuv \
--disable-postproc \
--disable-shared \
--disable-tools \
--disable-unit-tests \
--disable-webm-io \
--enable-postproc \
--enable-runtime-cpu-detect \
--enable-vp8 --enable-vp9 \
--enable-vp9-highbitdepth \
--enable-vp9-postproc
- make -j $(getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu) install
- cd -
# dav1d
- |
meson setup \
--default-library static \
--buildtype release \
--libdir lib \
-Denable_tests=false \
-Denable_examples=false \
-Denable_tools=false \
dav1d-build dav1d
- meson install -C dav1d-build
# vmaf
- |
meson setup \
--default-library static \
--buildtype release \
--libdir lib \
-Denable_tests=false \
-Denable_docs=false \
-Dbuilt_in_models=true \
-Denable_float=true \
vmaf-build vmaf/libvmaf
- meson install -C vmaf-build
# symbol conflict tests
- |
conflicts=$(
nm -Ag --defined-only /usr/local/lib/lib{SvtAv1Enc,aom,dav1d,vpx,vmaf}.a 2>/dev/null |
sort -k3 |
uniq -D -f2 |
sed '/:$/d;/^$/d'
)
if [ -n "$conflicts" ]; then
printf 'Conflicts Found!\n%s\n' "$conflicts"
exit 1
fi
# FFmpeg
# Uses ld=CXX for libvmaf to autolink the stdc++ library
- mkdir -p FFmpeg-build && cd FFmpeg-build || exit 1
- |
../FFmpeg/configure \
--arch=x86_64 \
--pkg-config-flags="--static" \
--cc="${CC:-ccache gcc}" \
--cxx="${CXX:-ccache g++}" \
--ld="${CXX:-ccache g++}" \
--enable-gpl --enable-static \
--enable-libaom \
--enable-libdav1d \
--enable-libsvtav1 \
--enable-libvmaf \
--enable-libvpx \
--disable-shared || {
less ffbuild/config.log
exit 1
}
- make -j $(getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu) install
- mv ffmpeg ..
- ccache -s
Linux Enc Test:
extends: .tests
stage: test
script:
- ./Bin/Release/SvtAv1EncApp --preset 0 -i "$SVT_ENCTEST_FILENAME" -n 3 -b "test-pr-${SVT_ENCTEST_BITNESS}bit-m0.ivf"
- ./Bin/Release/SvtAv1EncApp --preset 8 -i "$SVT_ENCTEST_FILENAME" -n 120 -b "test-pr-${SVT_ENCTEST_BITNESS}bit-m8.ivf"
parallel:
matrix:
- SVT_ENCTEST_FILENAME: akiyo_cif.y4m
SVT_ENCTEST_BITNESS: 8
- SVT_ENCTEST_FILENAME: Chimera-Aerial_480x264_2997fps_10bit_420_150frames.y4m
SVT_ENCTEST_BITNESS: 10
needs:
- 'Linux (GCC 10)'
#
# macOS CI Jobs
#
.macos-compiler-base:
stage: compile
tags:
- macos-ci
variables:
VLC_PATH: /Users/videolanci/sandbox/bin
CFLAGS: -Werror -Wshadow $EXTRA_CFLAGS
CXXFLAGS: -Werror -Wshadow $EXTRA_CXXFLAGS
script:
- export PATH="${VLC_PATH}:${PATH}"
- eval cmake -B Build -DCMAKE_INSTALL_PREFIX=${PREFIX_DIR:=/usr/local} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:=Release} $EXTRA_CMAKE_FLAGS
- cmake --build Build --config $CMAKE_BUILD_TYPE
.macos-fetch-testdata: &macos-fetch-testdata |
for file in $TEST_FILES; do
curl -fLs "https://gitlab.com/AOMediaCodec/aom-testing/-/raw/master/test-files/$file.zst" | zstd -d - -o $file
done
macOS (Xcode):
extends: .macos-compiler-base
variables:
CMAKE_GENERATOR: Xcode
artifacts:
expire_in: 1 day
paths:
- Bin/Release/*
macOS (Ninja, Static, Tests):
extends: .macos-compiler-base
variables:
EXTRA_CMAKE_FLAGS: -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON
EXTRA_CFLAGS: -Wno-error -g
EXTRA_CXXFLAGS: -Wno-error -g
PREFIX_DIR: ${CI_PROJECT_DIR}/SVT-Install/
after_script:
- mkdir -p ${PREFIX_DIR}
- cmake --build Build --target install
artifacts:
expire_in: 1 day
paths:
- Bin/Release/*
- ${CI_PROJECT_DIR}/SVT-Install/*
macOS Unit Tests:
tags:
- macos-ci
stage: test
parallel: 10
variables:
GTEST_TOTAL_SHARDS: 10
GTEST_OUTPUT: "xml:report.xml"
artifacts:
when: always
reports:
junit: report.xml
script:
- export GTEST_SHARD_INDEX=$((CI_NODE_INDEX - 1))
- ./Bin/Release/SvtAv1UnitTests
needs:
- 'macOS (Ninja, Static, Tests)'
macOS E2E Tests:
tags:
- macos-ci
stage: test
parallel: 10
variables:
GTEST_TOTAL_SHARDS: 10
GTEST_OUTPUT: "xml:report.xml"
artifacts:
when: always
reports:
junit: report.xml
script:
- export GTEST_SHARD_INDEX=$((CI_NODE_INDEX - 1))
- mkdir -p testvectors && export SVT_AV1_TEST_VECTOR_PATH="$PWD/testvectors"
- cmake -GNinja -B Build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
- cmake --build Build --target TestVectors
- ./Bin/Release/SvtAv1E2ETests --gtest_filter=-*DummySrcTest*
needs:
- 'macOS (Ninja, Static, Tests)'
macOS Enc Test:
tags:
- macos-ci
stage: test
variables:
TEST_FILES: akiyo_cif.y4m Chimera-Aerial_480x264_2997fps_10bit_420_150frames.y4m
script:
- *macos-fetch-testdata
- ./Bin/Release/SvtAv1EncApp --preset 0 -i "$SVT_ENCTEST_FILENAME" -n 3 -b "test-pr-${SVT_ENCTEST_BITNESS}bit-m0.ivf"
- ./Bin/Release/SvtAv1EncApp --preset 8 -i "$SVT_ENCTEST_FILENAME" -n 120 -b "test-pr-${SVT_ENCTEST_BITNESS}bit-m8.ivf"
parallel:
matrix:
- SVT_ENCTEST_FILENAME: "akiyo_cif.y4m"
SVT_ENCTEST_BITNESS: 8
- SVT_ENCTEST_FILENAME: "Chimera-Aerial_480x264_2997fps_10bit_420_150frames.y4m"
SVT_ENCTEST_BITNESS: 10
needs:
- 'macOS (Ninja, Static, Tests)'
macOS FFmpeg (Static):
stage: test
tags:
- macos-ci
variables:
PREFIX_DIR: ${CI_PROJECT_DIR}/SVT-Install/
PKG_CONFIG_PATH: ${CI_PROJECT_DIR}/SVT-Install/lib/pkgconfig
CPPFLAGS: -I${CI_PROJECT_DIR}/SVT-Install/include
LDFLAGS: -L${CI_PROJECT_DIR}/SVT-Install/lib
script:
- git clone https://aomedia.googlesource.com/aom
- git clone https://chromium.googlesource.com/webm/libvpx
- git clone https://code.videolan.org/videolan/dav1d.git
- git clone https://github.com/Netflix/vmaf.git
- git clone https://github.com/FFmpeg/FFmpeg.git FFmpeg-src
# SVT-AV1
#- cmake -GNinja -B svtav1-build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_APPS=OFF -DBUILD_DEC=OFF
#- cmake --build svtav1-build --config Release --target install
# aom
- cmake -S aom -B aom-build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${PREFIX_DIR} -DBUILD_SHARED_LIBS=OFF -DENABLE_TESTS=0 -DENABLE_EXAMPLES=0 -DENABLE_DOCS=0 -DENABLE_TESTDATA=0 -DENABLE_TOOLS=0
- cmake --build aom-build --config Release --target install
# libvpx
- mkdir -p vpx-build && cd vpx-build || exit 1
- |
../libvpx/configure \
--disable-dependency-tracking \
--disable-docs \
--disable-examples \
--disable-libyuv \
--disable-postproc \
--disable-shared \
--disable-tools \
--disable-unit-tests \
--disable-webm-io \
--enable-postproc \
--enable-runtime-cpu-detect \
--enable-vp8 --enable-vp9 \
--enable-vp9-highbitdepth \
--enable-vp9-postproc \
--prefix=${PREFIX_DIR}
- make -j $(getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu) install
- cd -
# dav1d
- |
meson setup \
--default-library static \
--buildtype release \
--libdir lib \
--prefix ${PREFIX_DIR} \
-Denable_tests=false \
-Denable_examples=false \
-Denable_tools=false \
dav1d-build dav1d
- meson install -C dav1d-build
# vmaf
- |
meson setup \
--default-library static \
--buildtype release \
--libdir lib \
--prefix ${PREFIX_DIR} \
-Denable_tests=false \
-Denable_docs=false \
-Dbuilt_in_models=true \
-Denable_float=true \
vmaf-build vmaf/libvmaf
- meson install -C vmaf-build
# symbol conflict tests
- |
conflicts=$(
nm -Ag --defined-only ${PREFIX_DIR}/lib/lib{SvtAv1Enc,aom,dav1d,vpx,vmaf}.a 2>/dev/null |
cut -d' ' -f 4 |
sort |
uniq -d
)
if [ -n "$conflicts" ]; then
printf 'Conflicts Found!\n'
for conflict in $conflicts; do
nm -Ag --defined-only ${PREFIX_DIR}/lib/lib{SvtAv1Enc,aom,dav1d,vpx,vmaf}.a 2>/dev/null |
sort -k3 |
grep -- " $conflict$"
done
exit 1
fi
# FFmpeg
# Uses ld=CXX for libvmaf to autolink the stdc++ library
- mkdir -p FFmpeg-build && cd FFmpeg-build || exit 1
- |
../FFmpeg-src/configure \
--arch=x86_64 \
--pkg-config-flags="--static" \
--cc="${CC:-ccache gcc}" \
--cxx="${CXX:-ccache g++}" \
--ld="${CXX:-ccache g++}" \
--enable-gpl --enable-static \
--prefix="${PREFIX_DIR}" \
--enable-libaom \
--enable-libdav1d \
--enable-libsvtav1 \
--enable-libvmaf \
--enable-libvpx \
--disable-shared || {
less ffbuild/config.log
exit 1
}
- make -j $(sysctl -n hw.ncpu) install
- mv ./ffmpeg $CI_PROJECT_DIR
needs:
- 'macOS (Ninja, Static, Tests)'
artifacts:
untracked: false
expire_in: 30 days
paths:
- ffmpeg
#
# Window CI Jobs
#
.windows-ci-common:
image: registry.gitlab.com/aomediacodec/aom-testing/core1809
tags:
- svt-windows-docker
.windows-unpack-testdata: &windows-unpack-testdata |
Move-Item C:/*.zst .
zstd -d *.zst
Win64 (Release, GCC, FFmpeg):
extends: .windows-ci-common
stage: compile
variables:
CC: ccache gcc
CXX: ccache g++
CFLAGS: -pipe -O3
CXXFLAGS: -pipe -O3
LDFLAGS: -pipe -O3 -static -static-libgcc -static-libstdc++
CCACHE_DIR: $CI_PROJECT_DIR/.ccache
GIT_DEPTH: 0
cache:
key: ${CI_JOB_NAME}
paths:
- .ccache
policy: pull-push
before_script:
- ccache -s
# SVT-AV1 Here to prevent the -dirty suffix
- cmake -B svtav1-build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_APPS=OFF -DBUILD_DEC=OFF -DCMAKE_INSTALL_PREFIX=C:/msys64/mingw64
- cmake --build svtav1-build --config Release --target install
- git clone https://aomedia.googlesource.com/aom
- git clone https://chromium.googlesource.com/webm/libvpx
- git clone https://code.videolan.org/videolan/dav1d.git
- git clone https://github.com/Netflix/vmaf.git
- git clone https://github.com/FFmpeg/FFmpeg.git
script:
# aom
- cmake -S aom -B aom-build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DENABLE_TESTS=0 -DENABLE_EXAMPLES=0 -DENABLE_DOCS=0 -DENABLE_TESTDATA=0 -DENABLE_TOOLS=0 -DCMAKE_INSTALL_PREFIX=C:/msys64/mingw64
- cmake --build aom-build --config Release --target install
# libvpx
- New-Item -type Directory vpx-build
- Set-Location vpx-build
- |
dash ../libvpx/configure `
--disable-dependency-tracking `
--disable-docs `
--disable-examples `
--disable-libyuv `
--disable-postproc `
--disable-shared `
--disable-tools `
--disable-unit-tests `
--disable-webm-io `
--enable-postproc `
--enable-runtime-cpu-detect `
--enable-vp8 --enable-vp9 `
--enable-vp9-highbitdepth `
--enable-vp9-postproc `
--prefix=/mingw64
- make -j $((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors + 2) install
- cd ..
# dav1d
- |
meson setup `
--default-library static `
--buildtype release `
--libdir lib `
-Denable_tests=false `
-Denable_examples=false `
-Denable_tools=false `
--prefix C:/msys64/mingw64 `
dav1d-build dav1d
- meson install -C dav1d-build
# vmaf
- |
meson setup `
--default-library static `
--buildtype release `
--libdir lib `
-Denable_tests=false `
-Denable_docs=false `
-Dbuilt_in_models=true `
-Denable_float=true `
--prefix C:/msys64/mingw64 `
vmaf-build vmaf/libvmaf
- meson install -C vmaf-build
# FFmpeg
# Uses ld=CXX for libvmaf to autolink the stdc++ library
- New-Item -type Directory FFmpeg-build
- Set-Location FFmpeg-build
- |
dash ../FFmpeg/configure `
--arch=x86_64 `
--pkg-config-flags="--static" `
--cc="${env:CC}" `
--cxx="${env:CXX}" `
--ld="${env:CXX}" `
--enable-gpl --enable-static `
--enable-libaom `
--enable-libdav1d `
--enable-libsvtav1 `
--enable-libvmaf `
--enable-libvpx `
--disable-shared `
--prefix=/mingw64
- make -j $((Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors + 2) install
- Move-Item ffmpeg.exe ..
- ccache -s
artifacts:
untracked: false
expire_in: 30 day
paths:
- ffmpeg.exe
Win64 (Release, MSVC, Tests):
extends: .windows-ci-common
stage: compile
variables:
CFLAGS: /WX
CXXFLAGS: /WX
CMAKE_GENERATOR: Visual Studio 16 2019
script:
- cmake -B Build -DBUILD_TESTING=ON
- cmake --build Build --config Release
after_script:
- Move-Item Bin\Release\* .
artifacts:
untracked: false
expire_in: 1 day
paths:
- "*.exe"
- "*.dll"
- "*.pdb"
Win64 Unit Tests:
extends: .windows-ci-common
stage: test
parallel: 10
variables:
GTEST_TOTAL_SHARDS: 10
GTEST_OUTPUT: "xml:report.xml"
artifacts:
when: always
reports:
junit: report.xml
script:
- $env:GTEST_SHARD_INDEX = $env:CI_NODE_INDEX - 1
- ./SvtAv1UnitTests.exe --gtest_filter=-*FFT*'
needs:
- 'Win64 (Release, MSVC, Tests)'
Win64 Enc Test:
extends: .windows-ci-common
stage: test
script:
- *windows-unpack-testdata
- ./SvtAv1EncApp.exe --preset 0 -i "$env:SVT_ENCTEST_FILENAME" -n 3 -b "test-pr-${env:SVT_ENCTEST_BITNESS}bit-m0.ivf"'
- ./SvtAv1EncApp.exe --preset 8 -i "$env:SVT_ENCTEST_FILENAME" -n 120 -b "test-pr-${env:SVT_ENCTEST_BITNESS}bit-m8.ivf"'
parallel:
matrix:
- SVT_ENCTEST_FILENAME: "akiyo_cif.y4m"
SVT_ENCTEST_BITNESS: 8
- SVT_ENCTEST_FILENAME: "Chimera-Aerial_480x264_2997fps_10bit_420_150frames.y4m"
SVT_ENCTEST_BITNESS: 10
needs:
- 'Win64 (Release, MSVC, Tests)'
Win64 E2E Tests:
extends: .windows-ci-common
stage: test
parallel: 10
variables:
GTEST_TOTAL_SHARDS: 10
GTEST_OUTPUT: "xml:report.xml"
artifacts:
when: always
reports:
junit: report.xml
script:
- '[string]$env:SVT_AV1_TEST_VECTOR_PATH = New-Item -ItemType Directory -Force -Name "testdata"'
- cmake -B Build -DBUILD_TESTING=ON
- cmake --build Build --target TestVectors
- $env:GTEST_SHARD_INDEX = $env:CI_NODE_INDEX - 1
- ./SvtAv1E2ETests.exe --gtest_filter=-*DummySrcTest*'
needs:
- 'Win64 (Release, MSVC, Tests)'