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

DDS: speed up reading of uncompressed images #3463

Merged
merged 1 commit into from Jul 4, 2022
Merged

DDS: speed up reading of uncompressed images #3463

merged 1 commit into from Jul 4, 2022

Conversation

aras-p
Copy link
Contributor

@aras-p aras-p commented Jul 4, 2022

Description

Previous code was doing ioread one pixel at a time. Change it to read one scanline at a time, similar to e.g. how BMP reader does it.

On a 8192x8192 rgba8 image (256MB), on Apple M1 Max iinfo --hash time goes from 2.19s down to 0.65s, and is now similar to the time it takes on an uncompressed TIF (0.52s) or BMP (0.71s) image.

Tests

No need for new tests, existing DDS test coverage should be fine.

Checklist:

  • I have read the contribution guidelines.
  • If this is more extensive than a small change to existing code, I
    have previously submitted a Contributor License Agreement
    (individual, and if there is any way my
    employers might think my programming belongs to them, then also
    corporate).
  • I have updated the documentation, if applicable.
  • I have ensured that the change is tested somewhere in the testsuite
    (adding new test cases if necessary).
  • My code follows the prevailing code style of this project.

@aras-p aras-p marked this pull request as draft July 4, 2022 08:38
Previous code was doing ioread one pixel at a time. Change it to
read one scanline at a time, similar to e.g. how BMP reader does it.

On a 8192x8192 rgba8 image (256MB), on Apple M1 Max "iinfo --hash"
time goes from 2.19s down to 0.65s, and is now similar to the time
it takes on an uncompressed TIF or BMP image.
@aras-p aras-p marked this pull request as ready for review July 4, 2022 09:04
lgritz
lgritz approved these changes Jul 4, 2022
@lgritz lgritz merged commit 62400c3 into OpenImageIO:master Jul 4, 2022
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants