7
7
8
8
#include "svt-av1/EbSvtAv1Enc.h"
9
9
10
+ #include <stdbool.h>
10
11
#include <stdint.h>
11
12
#include <string.h>
12
13
@@ -114,7 +115,11 @@ static avifResult svtCodecEncodeImage(avifCodec * codec,
114
115
// See https://gitlab.com/AOMediaCodec/SVT-AV1/-/issues/1697.
115
116
memset (svt_config , 0 , sizeof (EbSvtAv1EncConfiguration ));
116
117
118
+ #if SVT_AV1_CHECK_VERSION (3 , 0 , 0 )
119
+ res = svt_av1_enc_init_handle (& codec -> internal -> svt_encoder , svt_config );
120
+ #else
117
121
res = svt_av1_enc_init_handle (& codec -> internal -> svt_encoder , NULL , svt_config );
122
+ #endif
118
123
if (res != EB_ErrorNone ) {
119
124
goto cleanup ;
120
125
}
@@ -124,15 +129,13 @@ static avifResult svtCodecEncodeImage(avifCodec * codec,
124
129
#if !SVT_AV1_CHECK_VERSION (0 , 9 , 0 )
125
130
svt_config -> is_16bit_pipeline = image -> depth > 8 ;
126
131
#endif
127
-
128
- // Follow comment in svt header: set if input is HDR10 BT2020 using SMPTE ST2084 (PQ).
129
- svt_config -> high_dynamic_range_input = (image -> depth == 10 && image -> colorPrimaries == AVIF_COLOR_PRIMARIES_BT2020 &&
130
- image -> transferCharacteristics == AVIF_TRANSFER_CHARACTERISTICS_SMPTE2084 &&
131
- image -> matrixCoefficients == AVIF_MATRIX_COEFFICIENTS_BT2020_NCL );
132
-
133
132
svt_config -> source_width = image -> width ;
134
133
svt_config -> source_height = image -> height ;
134
+ #if SVT_AV1_CHECK_VERSION (3 , 0 , 0 )
135
+ svt_config -> level_of_parallelism = encoder -> maxThreads ;
136
+ #else
135
137
svt_config -> logical_processors = encoder -> maxThreads ;
138
+ #endif
136
139
svt_config -> enable_adaptive_quantization = 2 ;
137
140
// disable 2-pass
138
141
#if SVT_AV1_CHECK_VERSION (0 , 9 , 0 )
@@ -175,7 +178,7 @@ static avifResult svtCodecEncodeImage(avifCodec * codec,
175
178
176
179
// In order for SVT-AV1 to force keyframes by setting pic_type to
177
180
// EB_AV1_KEY_PICTURE on any frame, force_key_frames has to be set.
178
- svt_config -> force_key_frames = TRUE ;
181
+ svt_config -> force_key_frames = true ;
179
182
180
183
// keyframeInterval == 1 case is handled when encoding each frame by
181
184
// setting pic_type to EB_AV1_KEY_PICTURE. For keyframeInterval > 1,
0 commit comments