-
Notifications
You must be signed in to change notification settings - Fork 616
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
Add dwa support to core #1402
Add dwa support to core #1402
Conversation
0fb9ab9
to
1fc866e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noted some place where you left "throw Iex" commented out from the original cpp, do you want to clean that up or is it helpful to leave in?
Also, I may have missed some discussion, but you seem to have merged in @meshula's commits from #1385, was that intentional? That PR hasn't been committed yet, should it be closed in favor of this?
Otherwise, I've looked this over and it looks good to me, thanks!
|
||
if (*size <= 3) return EXR_ERR_CORRUPT_CHUNK; | ||
|
||
//throw IEX_NAMESPACE::InputExc ("Error uncompressing DWA data" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dead code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left them to note the error string, intending to produce a similar message via report error at some point...
if (out->_cscIdx < -1 || out->_cscIdx >= 3) | ||
{ | ||
return EXR_ERR_CORRUPT_CHUNK; | ||
//throw IEX_NAMESPACE::InputExc ("Error uncompressing DWA data" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dead, and a few below as well
// the C++ classes used to have one buffer size for compress / uncompress | ||
// but here we want to do zero-ish copy... | ||
uint8_t* outBufferEnd = me->_decode->unpacked_buffer; | ||
//if (outBufferSize > me->_decode->unpacked_alloc_size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dead?
if (version > 2) | ||
{ | ||
return EXR_ERR_BAD_CHUNK_LEADER; | ||
//throw IEX_NAMESPACE::InputExc ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
I didn't expect that my PR would chain on to Kimball's PR like that. I'll try closing my PR in expectation of reopening versus the main repo. |
Ok, closing my PR didn't do it, I guess those changes are actually committed into Kimball's tree. I have follow up work to those commits which I can open on the main repo. after this is landed. My preference would be to not land openexr-c.c and h though as they are not ready for review or distribution. I have follow up work to complete what's in that interface. |
We'd like to include the dwa support in a 3.1.8 release, but the single-file openexr-c.c seems better suited to a 3.2/4.0 release, doesn't it? @kdt3rd , don't you think you should back those commits out of this PR? |
@cary-ilm yes, I did not actually accept Nick's PR on my branch, it's interesting that it is chaining up to here... ah, the vagaries of github PRs... |
Well it's even weirder because my PR was on the main repo, not yours! I have a different PR on your repo, but that has commits not appearing here. I've closed both of them in hopes of untangling things. |
fyi, have confirmed Nick's commits are not in my local branch at all. I need to rebase onto a branch that removes the old mac os build that keeps timing out, so that should process should re-clean the history. I have one pending fix to push in the dwa support, and another difference in the decoder side to track down, then I think this will be ready to go |
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
… headers Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
… C++ Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Older versions of MSVC have issues with specifying C11 for use of stdalign.h and alignas macro. Work around this by targeting the lower level macros / declspec Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
ae10652
to
7d6a12a
Compare
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Core should now compile with -Weverything -Wno-reserved-identifier -Wno-covered-switch-default -Wno-cast-align -Wno-overlength-strings Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Looks like you hit all the structural points I bumped into when I put openexr-c.c together. I'll start work to bounce it off our internal build system on the assumption that this is ready to land. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good ~ I've already run your previous iteration through our internal build system, and got it working loading textures and sent 'em to gpu. I had a pile of "pedantic" and other clean ups, seems like you've hit the lot, with luck I can strip my clean ups in favor of using these commits "raw". I think it's ready to land, on the basis of the passing unit tests, and on the basis of my local exr reader working properly with your previous iteration.
* Fix nodiscard warning on gcc 13 * Add buffer range checks to huf code * Refactor cpuid code for use in dwa * Fix issue with big endian deep encoding of chunk table * refactor to expose byte reordering zip compression uses for dwa * expose option flag to enable headers to be more easily like old style headers * fix potential issue with piz and not able to compress data small enough * Restore piz tests * Initial implementation of DWAA/B compression for Core * write with legacy header during tests to make comparing bytes in files easier * Initial support for validating exact match in file output between C / C++ * Enable DWAA/DWAB tests * Older versions of MSVC have issues with specifying C11 for use of stdalign.h and alignas macro. Work around this by targeting the lower level macros / declspec instead of using C11 stdalign.h * Add unit test for x86 cpu id checks * Add alignment helper utility * Add missing include guards * Fix pedantic warnings * Fix compile warnings. Core should now compile with -Weverything -Wno-reserved-identifier -Wno-covered-switch-default -Wno-cast-align -Wno-overlength-strings Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
* Add dwa support to core (#1402) * Fix nodiscard warning on gcc 13 * Add buffer range checks to huf code * Refactor cpuid code for use in dwa * Fix issue with big endian deep encoding of chunk table * refactor to expose byte reordering zip compression uses for dwa * expose option flag to enable headers to be more easily like old style headers * fix potential issue with piz and not able to compress data small enough * Restore piz tests * Initial implementation of DWAA/B compression for Core * write with legacy header during tests to make comparing bytes in files easier * Initial support for validating exact match in file output between C / C++ * Enable DWAA/DWAB tests * Older versions of MSVC have issues with specifying C11 for use of stdalign.h and alignas macro. Work around this by targeting the lower level macros / declspec instead of using C11 stdalign.h * Add unit test for x86 cpu id checks * Add alignment helper utility * Add missing include guards * Fix pedantic warnings * Fix compile warnings. Core should now compile with -Weverything -Wno-reserved-identifier -Wno-covered-switch-default -Wno-cast-align -Wno-overlength-strings Signed-off-by: Kimball Thurston <kdt3rd@gmail.com> * Add #include <cmath> for isnan (#1414) Signed-off-by: Cary Phillips <cary@ilm.com> * Fix initialization after merge Signed-off-by: Kimball Thurston <kdt3rd@gmail.com> --------- Signed-off-by: Kimball Thurston <kdt3rd@gmail.com> Signed-off-by: Cary Phillips <cary@ilm.com> Co-authored-by: Cary Phillips <cary@ilm.com>
Seems to work, although am noticing a small number of ULPs difference in the dct coding between C/C++ for some numbers, can't tell if I should be worried, or if it's just different math ops ordering causing slightly different rounding
This includes a few other (internal) refactors and fixes noticed along the way