Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default preset coding parameters not computed for unset values #84

Closed
planetmarshall opened this issue Feb 23, 2021 · 1 comment
Closed
Assignees
Labels

Comments

@planetmarshall
Copy link
Contributor

planetmarshall commented Feb 23, 2021

Default values for preset coding parameters are only calculated if all the parameters are set to zero.

From Annexe 3 in the spec:

For MAXVAL, T1, T2, T3 and RESET, a value of 0 indicates reverting to default values as given in Table C.2.

This behaviour actually causes conformance tests 9 and 10 to fail if compression behaviour is verified (the existing tests read the compression parameters from the header of the compressed images rather than setting them explicitly), as you have to set either all of the parameters or none of them.

Test 10 (t1=t2=t3=9, reset=31) will assert in compute_default because maximum_sample_value will be 0.

Will try and come up with a reproducible example, and possibly a patch if I have time.

@vbaderks vbaderks added the bug label Feb 23, 2021
@vbaderks
Copy link
Contributor

A reproducible example would be very helpful.

@vbaderks vbaderks self-assigned this Mar 17, 2021
vbaderks added a commit that referenced this issue Apr 24, 2021
If the reset value was not zero and not the default the maximum_sample_value was not calculated.
The validation of the preset_coding_parameters has been moved to the decode method to ensure the validation step uses all the correct values.
vbaderks added a commit that referenced this issue Apr 24, 2021
If the reset value was not zero and not the default the maximum_sample_value was not calculated.
The validation of the preset_coding_parameters has been moved to the decode method to ensure the validation step uses all the correct values.
vbaderks added a commit that referenced this issue Apr 24, 2021
If the reset value was not zero and not the default the maximum_sample_value was not calculated.
The validation of the preset_coding_parameters has been moved to the decode method to ensure the validation step uses all the correct values.
vbaderks added a commit that referenced this issue Apr 24, 2021
If the reset value was not zero and not the default the maximum_sample_value was not calculated.
The validation of the preset_coding_parameters has been moved to the decode method to ensure the validation step uses all the correct values.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Nov 14, 2022
Changes from CHANGELOG.md:

# Change Log
## [2.3.4] - 2021-2-12

### Changed

- Replaced legacy test images.

## [2.3.3] - 2021-2-5

### Fixed

- Fixed [#167](team-charls/charls#167),
  Decoding\Encoding fails on IBM s390x CPU (Big Endian architecture).

## [2.3.2] - 2021-1-29

### Fixed

- Fixed team-charls/charls#160,
  warning: cast from 'unsigned char*' to 'uint16_t*'
  increases required alignment of target type.
- Fixed team-charls/charls#161 ,
  warning: useless cast to type 'size_t' {aka 'unsigned int'}
  [-Wuseless-cast].

### Changed

- Updates to the CMakeLists.txt for Unix builds (except macOS)
  to hide more symbols from the shared library.
- C++14 is now the minimum version instead of explicitly required.
  This allows consuming applications more flexibility.
  Typically CMake will select the latest C++ standard version that
  the used C++ compiler supports.

## [2.3.1] - 2021-1-25

### Fixed

- Fixed team-charls/charls#155 ,
  charls::jpegls_decoder::decode: 2 overloads have similar conversions
  in v2.3.0

## [2.3.0] - 2022-1-24

### Added

- The encoder API has been extended with a rewind method that can be
  used to re-use a configured encoder to encode multiple images in a loop.
- Added support to decode JPEG-LS images that use restart markers
  team-charls/charls#92 .
- Added support to write and read comment (COM) segments
  team-charls/charls#113 .
- Added support to encode/decode oversized images
  (width or height larger then 65535).
- Extended the validation of the encoded JPEG-LS byte stream during decoding.
- Added support to encode JPEG-LS images with:
  - The option to ensure the output stream has an even size.
  - The option to write the CharLS version number as a comment (COM segment)
    to the output stream.
  - The option to write the coding parameters to the output stream if
    the bits per pixel are larger then 12 (enabled by default).
- Usage of compiler specific attributes on the public API as replacement for
  ``[[nodiscard]]`` (which is a C++17 feature).

### Fixed

- Fixed team-charls/charls#84 ,
  Default preset coding parameters not computed for unset values.
- Fixed team-charls/charls#102 ,
  CMake find_package(charls 2.2.0 REQUIRED) not working.

### Changed

- CMakeSettings.json has been replaced with CMakePresets.json.
- Non default coding parameters are explicitly stored in
  the output stream during encoding.
- GCC shared library release builds are now using LTO
  (Link Time Optimization).
- Some functions use compiler intrinsics for slightly better performance.

## [2.2.1] - 2022-2-3

### Fixed

- Backport of fix for team-charls/charls#167 ,
  Decoding\Encoding fails on IBM s390x CPU (Big Endian architecture).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants