compressonator icon indicating copy to clipboard operation
compressonator copied to clipboard

BC7 encoding with Compressonator SDK prints "Err: requantized_image_err"

Open ShukantPal opened this issue 2 years ago • 8 comments

If I use the Compressonator CLI, BC7 encoding works perfectly fine. However, I'm now using the Compressonator SDK with JNI bindings to Java. When I run CMP_ProcessTexture with BC7 encoding, the following is printed for almost 100K times.

Err: requantized_image_err

ShukantPal avatar Aug 15 '21 02:08 ShukantPal

Note that the output is perfectly fine and the destination texture gets saved successfully.

ShukantPal avatar Aug 15 '21 02:08 ShukantPal

@ShukantPal This build setup is new and never tested with JNI. Interesting that this error is generated, its indicating that a large number of 4x4 processed blocks are not been re-quantized in (shake() call) for better quality.

You say "Note that the output is perfectly fine and the destination texture gets saved successfully." is the PSNR high when compared to the original file?

NPCompress avatar Aug 18 '21 17:08 NPCompress

Not sure, but the files did have lots of "errors" (solid color pixels that looked like they had the wrong value)

ShukantPal avatar Aug 18 '21 17:08 ShukantPal

@ShukantPal That is the expected result for this type of err, something failed in processing the block in either the shake() or initial setting in BC7 options like errorThreshold value is not set to a valid range.

NPCompress avatar Aug 18 '21 18:08 NPCompress

I didn't set any errorThreshold value in my code. Are you talking about the kernel options?

ShukantPal avatar Aug 18 '21 18:08 ShukantPal

@ShukantPal Yes, ref framework_example2.cpp for a BC7 example

NPCompress avatar Aug 18 '21 18:08 NPCompress

Will look into it - I would suggest to have sensible defaults in this case (in the constructor?)

ShukantPal avatar Aug 18 '21 18:08 ShukantPal

@NPCompress It has defaults, but can be overwritten by user setting passed down in CMP_ProcessTexture. Will add additional parameter check for valid ranges. This however may not be the root cause of the issue reported and calls inside the code for BC7 shake() needs to be debugged using your setup environment.

Can you provide details as to how you have "Compressonator SDK with JNI bindings to Java" setup

NPCompress avatar Aug 18 '21 18:08 NPCompress

Please review your JNI with latest release

NPCompress avatar Jul 19 '23 20:07 NPCompress