diff --git a/libheif/heif.cc b/libheif/heif.cc index c21ea19d8e7..c62d23a6458 100644 --- a/libheif/heif.cc +++ b/libheif/heif.cc @@ -2748,14 +2748,16 @@ static void set_default_options(heif_encoding_options& options) options.color_conversion_options.preferred_chroma_upsampling_algorithm = heif_chroma_upsampling_bilinear; options.color_conversion_options.only_use_preferred_chroma_algorithm = false; - options.prefer_minimised = false; + options.prefer_minimised_boxes_everywhere = false; + options.prefer_uncC_short_form = false; } static void copy_options(heif_encoding_options& options, const heif_encoding_options& input_options) { switch (input_options.version) { case 7: - options.prefer_minimised = input_options.prefer_minimised; + options.prefer_minimised_boxes_everywhere = input_options.prefer_minimised_boxes_everywhere; + options.prefer_uncC_short_form = input_options.prefer_uncC_short_form; // fallthrough case 6: options.color_conversion_options = input_options.color_conversion_options; diff --git a/libheif/heif.h b/libheif/heif.h index ab5cb0051bf..2f5144b87f8 100644 --- a/libheif/heif.h +++ b/libheif/heif.h @@ -2094,7 +2094,10 @@ struct heif_encoding_options // version 7 options // Set this to true to used minimised versions of boxes where possible - uint8_t prefer_minimised; + uint8_t prefer_minimised_boxes_everywhere; + + // Set this to true to use compressed form of uncC where possible + uint8_t prefer_uncC_short_form; }; LIBHEIF_API diff --git a/libheif/uncompressed_image.cc b/libheif/uncompressed_image.cc index 42a468722db..5c3f0282d91 100644 --- a/libheif/uncompressed_image.cc +++ b/libheif/uncompressed_image.cc @@ -1191,7 +1191,7 @@ Error UncompressedImageCodec::encode_uncompressed_image(const std::shared_ptr& out_image) { std::shared_ptr uncC = std::make_shared(); - if (options.prefer_minimised) { + if (options.prefer_uncC_short_form) { maybe_make_minimised_uncC(uncC, src_image); } if (uncC->get_version() == 1) { diff --git a/tests/uncompressed_encode.cc b/tests/uncompressed_encode.cc index 714fd1773f9..b3326dc4d49 100644 --- a/tests/uncompressed_encode.cc +++ b/tests/uncompressed_encode.cc @@ -565,7 +565,7 @@ struct heif_image *createImage_RGBA_planar() return image; } -static void do_encode(heif_image* input_image, const char* filename, bool check_decode, uint8_t preferMinimised = 0) +static void do_encode(heif_image* input_image, const char* filename, bool check_decode, uint8_t prefer_uncC_short_form = 0) { REQUIRE(input_image != nullptr); @@ -580,7 +580,7 @@ static void do_encode(heif_image* input_image, const char* filename, bool check_ options->macOS_compatibility_workaround = false; options->macOS_compatibility_workaround_no_nclx_profile = true; options->image_orientation = heif_orientation_normal; - options->prefer_minimised = preferMinimised; + options->prefer_uncC_short_form = prefer_uncC_short_form; heif_image_handle *output_image_handle; err = heif_context_encode_image(ctx, input_image, encoder, options, &output_image_handle);