diff --git a/CMakePresets.json b/CMakePresets.json index 00126903484..ac99334b849 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -37,7 +37,7 @@ "WITH_OpenJPEG_ENCODER" : "ON", "WITH_OpenJPEG_ENCODER_PLUGIN" : "ON", "WITH_FFMPEG_DECODER" : "ON", - "WITH_FFMPEG_DECODER_PLUGIN" : "ON" + "WITH_FFMPEG_DECODER_PLUGIN" : "ON", } }, { diff --git a/README.md b/README.md index faf4d9f3877..e5252a89858 100644 --- a/README.md +++ b/README.md @@ -155,7 +155,7 @@ For each codec, there are two configuration variables: * `WITH_{codec}_PLUGIN`: when enabled, the codec is compiled as a separate plugin. In order to use dynamic plugins, also make sure that `ENABLE_PLUGIN_LOADING` is enabled. -The placeholder `{codec}` can have these values: `LIBDE265`, `X265`, `AOM_DECODER`, `AOM_ENCODER`, `SvtEnc`, `DAV1D`, `FFMPEG_DECODER`, `JPEG_DECODER`, `JPEG_ENCODER`, `KVAZAAR`, `OpenJPEG_DECODER`, `OpenJPEG_ENCODER`. +The placeholder `{codec}` can have these values: `LIBDE265`, `X265`, `AOM_DECODER`, `AOM_ENCODER`, `SvtEnc`, `DAV1D`, `FFMPEG_DECODER`, `JPEG_DECODER`, `JPEG_ENCODER`, `KVAZAAR`, `OpenJPEG_DECODER`, `OpenJPEG_ENCODER`, `OPENJPH_ENCODER` Further options are: diff --git a/examples/heif_enc.cc b/examples/heif_enc.cc index a1c91e56214..41696e119a9 100644 --- a/examples/heif_enc.cc +++ b/examples/heif_enc.cc @@ -164,7 +164,7 @@ void show_help(const char* argv0) << " -A, --avif encode as AVIF (not needed if output filename with .avif suffix is provided)\n" << " --jpeg encode as JPEG\n" << " --jpeg2000 encode as JPEG 2000 (experimental)\n" - << " --htj2k encode as High Throughput JPEG 2000 (even more experimental)\n" + << " --htj2k encode as High Throughput JPEG 2000 (experimental)\n" #if WITH_UNCOMPRESSED_CODEC << " -U, --uncompressed encode as uncompressed image (according to ISO 23001-17) (EXPERIMENTAL)\n" #endif diff --git a/libheif/plugins/encoder_openjph.cc b/libheif/plugins/encoder_openjph.cc index 1f036fc84f3..9a500739fcd 100644 --- a/libheif/plugins/encoder_openjph.cc +++ b/libheif/plugins/encoder_openjph.cc @@ -81,9 +81,9 @@ static const int OJPH_PLUGIN_PRIORITY = 80; struct encoder_struct_ojph { + // We do this for API reasons. Has no effect at this stage. int quality = 70; heif_chroma chroma = heif_chroma_undefined; - bool reversible = false; // Context ojph::codestream codestream; @@ -231,16 +231,12 @@ void ojph_cleanup_plugin() //////////// Integer parameter setters -// Note quality is part of the plugin API +// Note quality is part of the plugin API. struct heif_error ojph_set_parameter_quality(void* encoder_raw, int quality) { auto* encoder = (struct encoder_struct_ojph*) encoder_raw; - if (quality < 0 || quality > 100) { - return heif_error_invalid_parameter_value; - } - encoder->quality = quality; return heif_error_ok; @@ -309,7 +305,7 @@ struct heif_error ojph_get_parameter_integer(void *encoder_raw, const char *name struct heif_error ojph_set_parameter_lossless(void* encoder_raw, int lossless) { auto* encoder = (struct encoder_struct_ojph*) encoder_raw; - encoder->reversible = lossless; + encoder->codestream.access_cod().set_reversible(lossless); return heif_error_ok; } @@ -337,7 +333,7 @@ struct heif_error ojph_set_parameter_boolean(void *encoder_raw, const char *name struct heif_error ojph_get_parameter_lossless(void* encoder_raw, int* lossless) { auto* encoder = (struct encoder_struct_ojph*) encoder_raw; - *lossless = encoder->reversible; + *lossless = encoder->codestream.access_cod().is_reversible(); return heif_error_ok; } @@ -745,8 +741,6 @@ void build_COD(encoder_struct_ojph *encoder) { ojph::param_cod cod = encoder->codestream.access_cod(); cod.set_color_transform(false); - // TODO: don't set here - just set on codestream - cod.set_reversible(encoder->reversible); } struct heif_error ojph_encode_image(void *encoder_raw, const struct heif_image *image, enum heif_image_input_class image_class)