Skip to content

Commit 3f56526

Browse files
committed
test(openexr): add HTJ2K compression tests for OpenEXR 3.4
Added HTJ2K compression tests when OpenEXR 3.4.0 or newer is available, and add expected output for the `htj2k32` and `htj2k256` compression modes. Created a new reference file `out-exr3.1.txt` for idiff when OpenEXR version is older than `3.4.0`. Signed-off-by: Abhirup Bhattacharyya <abhirup27022001@outlook.com>
1 parent 1c63df7 commit 3f56526

5 files changed

Lines changed: 55 additions & 0 deletions

File tree

‎src/cmake/testing.cmake‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,17 @@ macro (oiio_add_all_tests)
470470
URL http://github.com/AcademySoftwareFoundation/openexr-images)
471471
endif ()
472472

473+
# HTJ2K was introduced in OpenEXR v.3.4.0
474+
if (OpenEXR_VERSION VERSION_GREATER_EQUAL 3.4.0)
475+
if (TEST openexr-compression)
476+
set_property (TEST openexr-compression APPEND PROPERTY ENVIRONMENT
477+
"OIIO_OPENEXR_HTJ2K_SUPPORT=1")
478+
endif()
479+
if (TEST openexr-compression.core)
480+
set_property (TEST openexr-compression.core APPEND PROPERTY
481+
ENVIRONMENT "OIIO_OPENEXR_HTJ2K_SUPPORT=1")
482+
endif()
483+
endif()
473484
# New compression tests of zstd and lj2k require OpenEXR main branch,
474485
# or latest release or at least V3.5.0
475486
if (OpenEXR_VERSION VERSION_GREATER_EQUAL 3.5.0)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
out-none.exr compression none
2+
out-rle.exr compression rle
3+
out-zips.exr compression zips
4+
out-zip.exr compression zip
5+
out-piz.exr compression piz
6+
out-pxr24.exr compression pxr24
7+
out-b44.exr compression b44
8+
out-b44a.exr compression b44a
9+
out-dwaa.exr compression dwaa
10+
out-dwab.exr compression dwab
11+
Comparing "out-none.exr" and "ref/out-zip.exr"
12+
PASS
13+
Comparing "out-rle.exr" and "ref/out-zip.exr"
14+
PASS
15+
Comparing "out-zips.exr" and "ref/out-zip.exr"
16+
PASS
17+
Comparing "out-zip.exr" and "ref/out-zip.exr"
18+
PASS
19+
Comparing "out-piz.exr" and "ref/out-zip.exr"
20+
PASS
21+
Comparing "out-pxr24.exr" and "ref/out-zip.exr"
22+
PASS
23+
Comparing "out-b44.exr" and "ref/out-b44.exr"
24+
PASS
25+
Comparing "out-b44a.exr" and "ref/out-b44.exr"
26+
PASS
27+
Comparing "out-dwaa.exr" and "ref/out-dwaa.exr"
28+
PASS
29+
Comparing "out-dwab.exr" and "ref/out-dwaa.exr"
30+
PASS

‎testsuite/openexr-compression/ref/out-exr3.4.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ out-b44.exr compression b44
88
out-b44a.exr compression b44a
99
out-dwaa.exr compression dwaa
1010
out-dwab.exr compression dwab
11+
out-htj2k32.exr compression htj2k32
12+
out-htj2k256.exr compression htj2k256
1113
Comparing "out-none.exr" and "ref/out-zip.exr"
1214
PASS
1315
Comparing "out-rle.exr" and "ref/out-zip.exr"
@@ -28,3 +30,7 @@ Comparing "out-dwaa.exr" and "ref/out-dwaa.exr"
2830
PASS
2931
Comparing "out-dwab.exr" and "ref/out-dwaa.exr"
3032
PASS
33+
Comparing "out-htj2k32.exr" and "ref/out-zip.exr"
34+
PASS
35+
Comparing "out-htj2k256.exr" and "ref/out-zip.exr"
36+
PASS

‎testsuite/openexr-compression/ref/out.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ out-b44.exr compression b44
88
out-b44a.exr compression b44a
99
out-dwaa.exr compression dwaa
1010
out-dwab.exr compression dwab
11+
out-htj2k32.exr compression htj2k32
12+
out-htj2k256.exr compression htj2k256
1113
out-lj2k.exr compression lj2k
1214
out-zstd.exr compression zstd
1315
Comparing "out-none.exr" and "ref/out-zip.exr"
@@ -30,6 +32,10 @@ Comparing "out-dwaa.exr" and "ref/out-dwaa.exr"
3032
PASS
3133
Comparing "out-dwab.exr" and "ref/out-dwaa.exr"
3234
PASS
35+
Comparing "out-htj2k32.exr" and "ref/out-zip.exr"
36+
PASS
37+
Comparing "out-htj2k256.exr" and "ref/out-zip.exr"
38+
PASS
3339
Comparing "out-lj2k.exr" and "ref/out-lj2k.exr"
3440
PASS
3541
Comparing "out-zstd.exr" and "ref/out-zip.exr"

‎testsuite/openexr-compression/run.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
"dwab",
2222
]
2323

24+
if os.getenv("OIIO_OPENEXR_HTJ2K_SUPPORT") == "1":
25+
compressions += ["htj2k32", "htj2k256"]
2426
if os.getenv("OIIO_OPENEXR_LJ2K_ZSTD_SUPPORT") == "1":
2527
compressions += ["lj2k", "zstd"]
2628

0 commit comments

Comments
 (0)