Skip to content

Commit 6c98dea

Browse files
committed
Fix according to comments
1 parent 5b3b396 commit 6c98dea

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

cmake/Modules/LocalSvt.cmake

+5-4
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ else()
5757
set(CMAKE_OUTPUT_DIRECTORY_ORIG "${CMAKE_OUTPUT_DIRECTORY}")
5858
set(CMAKE_OUTPUT_DIRECTORY "${SVT_BINARY_DIR}" CACHE INTERNAL "")
5959

60-
# For now, this creates compilation issues:
61-
# _deps/svt-build/libSvtAv1Enc.a: error adding symbols: file format not recognized
62-
# clang: error: linker command failed with exit code 1 (use -v to see invocation)
63-
set(SVT_AV1_LTO OFF)
60+
if(CMAKE_INTERPROCEDURAL_OPTIMIZATION)
61+
set(SVT_AV1_LTO ON)
62+
else()
63+
set(SVT_AV1_LTO OFF)
64+
endif()
6465

6566
avif_fetchcontent_populate_cmake(svt)
6667

src/codec_svt.c

+1-15
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77

88
#include "svt-av1/EbSvtAv1Enc.h"
99

10+
#include <stdbool.h>
1011
#include <stdint.h>
1112
#include <string.h>
12-
#if SVT_AV1_CHECK_VERSION(3, 0, 0)
13-
#include <stdbool.h>
14-
#endif
1513

1614
// The SVT_AV1_VERSION_MAJOR, SVT_AV1_VERSION_MINOR, SVT_AV1_VERSION_PATCHLEVEL, and
1715
// SVT_AV1_CHECK_VERSION macros were added in SVT-AV1 v0.9.0. Define these macros for older
@@ -131,14 +129,6 @@ static avifResult svtCodecEncodeImage(avifCodec * codec,
131129
#if !SVT_AV1_CHECK_VERSION(0, 9, 0)
132130
svt_config->is_16bit_pipeline = image->depth > 8;
133131
#endif
134-
135-
#if !SVT_AV1_CHECK_VERSION(3, 0, 0)
136-
// Follow comment in svt header: set if input is HDR10 BT2020 using SMPTE ST2084 (PQ).
137-
svt_config->high_dynamic_range_input = (image->depth == 10 && image->colorPrimaries == AVIF_COLOR_PRIMARIES_BT2020 &&
138-
image->transferCharacteristics == AVIF_TRANSFER_CHARACTERISTICS_SMPTE2084 &&
139-
image->matrixCoefficients == AVIF_MATRIX_COEFFICIENTS_BT2020_NCL);
140-
#endif
141-
142132
svt_config->source_width = image->width;
143133
svt_config->source_height = image->height;
144134
#if SVT_AV1_CHECK_VERSION(3, 0, 0)
@@ -188,11 +178,7 @@ static avifResult svtCodecEncodeImage(avifCodec * codec,
188178

189179
// In order for SVT-AV1 to force keyframes by setting pic_type to
190180
// EB_AV1_KEY_PICTURE on any frame, force_key_frames has to be set.
191-
#if SVT_AV1_CHECK_VERSION(3, 0, 0)
192181
svt_config->force_key_frames = true;
193-
#else
194-
svt_config->force_key_frames = TRUE;
195-
#endif
196182

197183
// keyframeInterval == 1 case is handled when encoding each frame by
198184
// setting pic_type to EB_AV1_KEY_PICTURE. For keyframeInterval > 1,

0 commit comments

Comments
 (0)