Fix NDArrayInfo setting in ColorConvert#586
Open
gustavosr8 wants to merge 5 commits into
Open
Conversation
The dimensions are already being set in NDArrayPool::alloc [1], using the given dims for each specific case. Remove the copy() overwriting by setting to false the copyDimensions flag. This also makes it unnecessary to set dimensions afterwards in most cases. [1] ADApp/ADSrc/NDArrayPool.cpp, lines 193-199
Already done in NDArrayPool::copy [1]. [1] ADApp/ADSrc/NDArrayPool.cpp, lines 283-285
Changing compressed size is only relevant when copying the data - i.e. copyData==true. Otherwise, if we are only interested in copying the metadata, unconditionally setting it could be not accurate - e.g. when resizing or changing the array dimensions.
Left behind in e788121 (Remove parameter counting (LAST_xxx_PARAM, NUM_xxx_PARAMS; add maxThreads argument to constructor, 2017-03-23)
The tests converts a Mono image into each one of the RGB color modes, and checks if the uniqueId and timeStamp remains the same, if the compressedSize remains equal to the image size, and if the dimensions are as expected according to the desired output color mode.
ericonr
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was motivated after seeing different values of compressed and uncompressed size after performing a mono to RGB1 conversion.
Tested with ADSim converting its mono image to RGB1, 2 and 3. Inspecting the data end metadata with PVA plugin. The dimensions and the data size (compressed and uncompressed) are correct.