@@ -678,7 +678,11 @@ struct heif_error svt_encode_image(void* encoder_raw, const struct heif_image* i
678
678
EbSvtAv1EncConfiguration svt_config;
679
679
memset (&svt_config, 0 , sizeof (EbSvtAv1EncConfiguration));
680
680
681
+ #if SVT_AV1_CHECK_VERSION(3, 0, 0)
682
+ res = svt_av1_enc_init_handle (&svt_encoder, &svt_config);
683
+ #else
681
684
res = svt_av1_enc_init_handle (&svt_encoder, nullptr , &svt_config);
685
+ #endif
682
686
if (res != EB_ErrorNone) {
683
687
// goto cleanup;
684
688
return heif_error_codec_library_error;
@@ -698,7 +702,9 @@ struct heif_error svt_encode_image(void* encoder_raw, const struct heif_image* i
698
702
auto nclx_deleter = std::unique_ptr<heif_color_profile_nclx, void (*)(heif_color_profile_nclx*)>(nclx, heif_nclx_color_profile_free);
699
703
700
704
if (nclx) {
705
+ #if !SVT_AV1_CHECK_VERSION(3, 0, 0)
701
706
svt_config.color_description_present_flag = true ;
707
+ #endif
702
708
#if SVT_AV1_VERSION_MAJOR >= 1
703
709
svt_config.color_primaries = static_cast <EbColorPrimaries>(nclx->color_primaries );
704
710
svt_config.transfer_characteristics = static_cast <EbTransferCharacteristics>(nclx->transfer_characteristics );
@@ -712,20 +718,28 @@ struct heif_error svt_encode_image(void* encoder_raw, const struct heif_image* i
712
718
#endif
713
719
714
720
721
+ #if !SVT_AV1_CHECK_VERSION(3, 0, 0)
715
722
// Follow comment in svt header: set if input is HDR10 BT2020 using SMPTE ST2084.
716
723
svt_config.high_dynamic_range_input = (bitdepth_y == 10 && // TODO: should this be >8 ?
717
724
nclx->color_primaries == heif_color_primaries_ITU_R_BT_2020_2_and_2100_0 &&
718
725
nclx->transfer_characteristics == heif_transfer_characteristic_ITU_R_BT_2100_0_PQ &&
719
726
nclx->matrix_coefficients == heif_matrix_coefficients_ITU_R_BT_2020_2_non_constant_luminance);
727
+ #endif
720
728
}
721
729
else {
730
+ #if !SVT_AV1_CHECK_VERSION(3, 0, 0)
722
731
svt_config.color_description_present_flag = false ;
732
+ #endif
723
733
}
724
734
725
735
726
736
svt_config.source_width = encoded_width;
727
737
svt_config.source_height = encoded_height;
738
+ #if SVT_AV1_CHECK_VERSION(3, 0, 0)
739
+ svt_config.level_of_parallelism = encoder->threads ;
740
+ #else
728
741
svt_config.logical_processors = encoder->threads ;
742
+ #endif
729
743
730
744
// disable 2-pass
731
745
svt_config.rc_stats_buffer = SvtAv1FixedBuf {nullptr , 0 };
0 commit comments