Skip to content

Commit 50ba96b

Browse files
cary-ilmpalemieuxTodicaIonut
authored
merge htj2k-beta branch with main (#2041)
* Add HTJ2K Compressor (#1883) * Add HT256 compressor Signed-off-by: Pierre-Anthony Lemieux <[email protected]> * Update src/lib/OpenEXR/ImfCompression.h Co-authored-by: Cary Phillips <[email protected]> Signed-off-by: Pierre-Anthony Lemieux <[email protected]> Signed-off-by: Pierre-Anthony Lemieux <[email protected]> * Update src/lib/OpenEXR/ImfCompression.cpp Co-authored-by: Cary Phillips <[email protected]> Signed-off-by: Pierre-Anthony Lemieux <[email protected]> Signed-off-by: Pierre-Anthony Lemieux <[email protected]> * Update website/ReadingAndWritingImageFiles.rst Co-authored-by: Cary Phillips <[email protected]> Signed-off-by: Pierre-Anthony Lemieux <[email protected]> Signed-off-by: Pierre-Anthony Lemieux <[email protected]> * Add channel map Signed-off-by: Pierre-Anthony Lemieux <[email protected]> --------- Signed-off-by: Pierre-Anthony Lemieux <[email protected]> Signed-off-by: Pierre-Anthony Lemieux <[email protected]> Co-authored-by: Cary Phillips <[email protected]> * Bump OpenJPH (#1978) * Bump OpenJPH to 0.21.2 (#1994) Signed-off-by: Pierre-Anthony Lemieux <[email protected]> * Rebase htj2k-beta onto main (#2033) Signed-off-by: Cary Phillips <[email protected]> * Improve RGB channel detection heuristics for the HT256 encoder (#2029) * Allow lowercase r,g and b, and reg, greee and blue. Signed-off-by: Pierre-Anthony Lemieux <[email protected]> * Improved RGB channel detection heuristics Signed-off-by: Pierre-Anthony Lemieux <[email protected]> * Fix Windows build Signed-off-by: Pierre-Anthony Lemieux <[email protected]> * Improve RGB heuristics Add unit tests Signed-off-by: Pierre-Anthony Lemieux <[email protected]> * Removed unusued color channel abbreviations Signed-off-by: Pierre-Anthony Lemieux <[email protected]> --------- Signed-off-by: Pierre-Anthony Lemieux <[email protected]> * Fix HTJ2K Compressor python (#2038) * HT256 COMPRESSION Signed-off-by: Todica Ionut <[email protected]> * HT256 Compression fix Signed-off-by: Todica Ionut <[email protected]> --------- Signed-off-by: Todica Ionut <[email protected]> * resolve conflicts Signed-off-by: Cary Phillips <[email protected]> * OPENEXR_FORCE_INTERNAL_OPENJPH in pyproject.toml Signed-off-by: Cary Phillips <[email protected]> * POSITION_INDEPENDENT_CODE=ON for openjpg and OpenEXR.so Signed-off-by: Cary Phillips <[email protected]> * CMAKE_VERBOSE_MAKEFILE=ON Signed-off-by: Cary Phillips <[email protected]> * Disable macos universal2 cibuildwheel, doesn't work with openjph Signed-off-by: Cary Phillips <[email protected]> * add openjph to OpenEXR.pc Signed-off-by: Cary Phillips <[email protected]> * using ubuntu-latest for website.yml Signed-off-by: Cary Phillips <[email protected]> * website.1 Signed-off-by: Cary Phillips <[email protected]> --------- Signed-off-by: Pierre-Anthony Lemieux <[email protected]> Signed-off-by: Pierre-Anthony Lemieux <[email protected]> Signed-off-by: Cary Phillips <[email protected]> Signed-off-by: Todica Ionut <[email protected]> Co-authored-by: Pierre-Anthony Lemieux <[email protected]> Co-authored-by: Todica Ionut <[email protected]>
1 parent b66d0f2 commit 50ba96b

File tree

73 files changed

+1351
-42
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1351
-42
lines changed

.github/workflows/ci_steps.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ on:
4949
type: string
5050
OPENEXR_FORCE_INTERNAL_DEFLATE:
5151
type: string
52+
OPENEXR_FORCE_INTERNAL_OPENJPH:
53+
type: string
5254
BUILD_TESTING:
5355
type: string
5456
namespace:
@@ -84,6 +86,9 @@ jobs:
8486
if [ "${{ inputs.OPENEXR_FORCE_INTERNAL_DEFLATE }}" == "OFF" ]; then
8587
PACKAGES="$PACKAGES libdeflate:p"
8688
fi
89+
if [ "${{ inputs.OPENEXR_FORCE_INTERNAL_OPENJPH }}" == "OFF" && "${{ inputs.msystem }}" != "MINGW32" ]; then
90+
PACKAGES="$PACKAGES openjph:p"
91+
fi
8792
echo "PACBOY_PACKAGES=$PACKAGES" >> $GITHUB_ENV
8893
shell: bash
8994

@@ -108,11 +113,17 @@ jobs:
108113
run: share/ci/scripts/install_libdeflate.sh master
109114
shell: bash
110115

111-
- name: Set PATH for Imath/libdeflate DLLs
116+
- name: Install OpenJPH
117+
# Pre-install OpenJPH so the builds validate finding the external installation
118+
if: inputs.OPENEXR_FORCE_INTERNAL_OPENJPH == 'OFF' && inputs.msystem == ''
119+
run: share/ci/scripts/install_openjph.sh 0.21.2
120+
shell: bash
121+
122+
- name: Set PATH for Imath/libdeflate/OpenJPH DLLs
112123
# When building against external Imath/libdeflate shared objects, the tests need PATH to include the dll's.
113124
if: contains(inputs.os, 'windows') && inputs.msystem == ''
114125
run: |
115-
echo "$PATH;C:/Program Files (x86)/Imath/bin;C:/Program Files (x86)/Imath/lib;C:/Program Files (x86)/libdeflate/bin;C:/Program Files (x86)/libdeflate/lib" >> $GITHUB_PATH
126+
echo "$PATH;C:/Program Files (x86)/Imath/bin;C:/Program Files (x86)/Imath/lib;C:/Program Files (x86)/libdeflate/bin;C:/Program Files (x86)/libdeflate/lib;C:/Program Files (x86)/openjph/lib;C:/Program Files (x86)/openjph/bin" >> $GITHUB_PATH
116127
shell: bash
117128

118129
- name: Install help2man
@@ -144,6 +155,7 @@ jobs:
144155
cmake_args+=("-DOPENEXR_BUILD_TOOLS=${{ inputs.OPENEXR_BUILD_TOOLS }}")
145156
cmake_args+=("-DOPENEXR_FORCE_INTERNAL_IMATH=${{ inputs.OPENEXR_FORCE_INTERNAL_IMATH }}")
146157
cmake_args+=("-DOPENEXR_FORCE_INTERNAL_DEFLATE=${{ inputs.OPENEXR_FORCE_INTERNAL_DEFLATE }}")
158+
cmake_args+=("-DOPENEXR_FORCE_INTERNAL_OPENJPH=${{ inputs.OPENEXR_FORCE_INTERNAL_OPENJPH }}")
147159
cmake_args+=("-DBUILD_TESTING=${{ inputs.BUILD_TESTING }}")
148160
cmake_args+=("-DOPENEXR_RUN_FUZZ_TESTS=OFF")
149161
cmake_args+=("-DCMAKE_VERBOSE_MAKEFILE=ON")
@@ -226,4 +238,3 @@ jobs:
226238
share/ci/scripts/validate_install.py "_build/$INSTALL_MANIFEST" "share/ci/install_manifest/$INSTALL_MANIFEST"
227239
shell: bash
228240

229-

.github/workflows/ci_workflow.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
OPENEXR_BUILD_TOOLS: ${{ matrix.OPENEXR_BUILD_TOOLS || 'ON' }}
7979
OPENEXR_FORCE_INTERNAL_IMATH: ${{ matrix.OPENEXR_FORCE_INTERNAL_IMATH || 'OFF' }}
8080
OPENEXR_FORCE_INTERNAL_DEFLATE: ${{ matrix.OPENEXR_FORCE_INTERNAL_DEFLATE || 'OFF' }}
81+
OPENEXR_FORCE_INTERNAL_OPENJPH: ${{ matrix.OPENEXR_FORCE_INTERNAL_OPENJPH || 'OFF' }}
8182
BUILD_TESTING: ${{ matrix.BUILD_TESTING || 'ON' }}
8283
namespace: ${{ matrix.namespace }}
8384
validate_install: ${{ matrix.validate_install || 'ON' }}
@@ -110,6 +111,7 @@ jobs:
110111
OPENEXR_BUILD_TOOLS: 'OFF'
111112
OPENEXR_FORCE_INTERNAL_IMATH: 'ON'
112113
OPENEXR_FORCE_INTERNAL_DEFLATE: 'ON'
114+
OPENEXR_FORCE_INTERNAL_OPENJPH: 'ON'
113115
BUILD_TESTING: 'OFF'
114116

115117
- build: 6
@@ -144,6 +146,7 @@ jobs:
144146
OPENEXR_BUILD_TOOLS: ${{ matrix.OPENEXR_BUILD_TOOLS || 'ON' }}
145147
OPENEXR_FORCE_INTERNAL_IMATH: ${{ matrix.OPENEXR_FORCE_INTERNAL_IMATH || 'OFF' }}
146148
OPENEXR_FORCE_INTERNAL_DEFLATE: ${{ matrix.OPENEXR_FORCE_INTERNAL_DEFLATE || 'OFF' }}
149+
OPENEXR_FORCE_INTERNAL_OPENJPH: ${{ matrix.OPENEXR_FORCE_INTERNAL_OPENJPH || 'OFF' }}
147150
BUILD_TESTING: ${{ matrix.BUILD_TESTING || 'ON' }}
148151
validate_install: ${{ matrix.validate_install || 'ON' }}
149152

@@ -175,6 +178,7 @@ jobs:
175178
OPENEXR_BUILD_TOOLS: 'OFF'
176179
OPENEXR_FORCE_INTERNAL_IMATH: 'ON'
177180
OPENEXR_FORCE_INTERNAL_DEFLATE: 'ON'
181+
OPENEXR_FORCE_INTERNAL_OPENJPH: 'ON'
178182
BUILD_TESTING: 'OFF'
179183

180184
- build: 6
@@ -200,6 +204,7 @@ jobs:
200204
OPENEXR_BUILD_TOOLS: ${{ matrix.OPENEXR_BUILD_TOOLS || 'ON' }}
201205
OPENEXR_FORCE_INTERNAL_IMATH: ${{ matrix.OPENEXR_FORCE_INTERNAL_IMATH || 'OFF' }}
202206
OPENEXR_FORCE_INTERNAL_DEFLATE: ${{ matrix.OPENEXR_FORCE_INTERNAL_DEFLATE || 'OFF' }}
207+
OPENEXR_FORCE_INTERNAL_OPENJPH: ${{ matrix.OPENEXR_FORCE_INTERNAL_OPENJPH || 'OFF' }}
203208
msystem: ${{ matrix.msystem }}
204209
BUILD_TESTING: ${{ matrix.BUILD_TESTING || 'ON' }}
205210
validate_install: ${{ matrix.validate_install || 'ON' }}
@@ -232,6 +237,7 @@ jobs:
232237
OPENEXR_BUILD_TOOLS: 'OFF'
233238
OPENEXR_FORCE_INTERNAL_IMATH: 'ON'
234239
OPENEXR_FORCE_INTERNAL_DEFLATE: 'ON'
240+
OPENEXR_FORCE_INTERNAL_OPENJPH: 'ON'
235241
BUILD_TESTING: 'OFF'
236242

237243
- build: 6

.github/workflows/python-wheels-publish-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
output-dir: wheelhouse
6464
env:
6565
MACOSX_DEPLOYMENT_TARGET: 10.15
66-
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
66+
CIBW_ARCHS_MACOS: x86_64 arm64
6767
# Build Python 3.7 through 3.12.
6868
# Skip python 3.6 since scikit-build-core requires 3.7+
6969
# Skip 32-bit wheels builds on Windows

.github/workflows/python-wheels-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
output-dir: wheelhouse
5858
env:
5959
MACOSX_DEPLOYMENT_TARGET: 10.15
60-
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
60+
CIBW_ARCHS_MACOS: x86_64 arm64
6161
# Build Python 3.7 through 3.12.
6262
# Skip python 3.6 since scikit-build-core requires 3.7+
6363
# Skip 32-bit wheels builds on Windows

.github/workflows/python-wheels.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- name: Build wheel
7474
uses: pypa/[email protected]
7575
env:
76-
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
76+
CIBW_ARCHS_MACOS: x86_64 arm64
7777
# Build Python 3.7 through 3.12.
7878
# Skip python 3.6 since scikit-build-core requires 3.7+
7979
# Skip 32-bit wheels builds on Windows
@@ -89,4 +89,4 @@ jobs:
8989
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
9090
path: |
9191
./wheelhouse/*.whl
92-
./wheelhouse/*.tar.gz
92+
./wheelhouse/*.tar.gz

.github/workflows/website.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
runs-on: ${{ matrix.os }}
4747
strategy:
4848
matrix:
49-
os: [ubuntu-20.04, macos-latest, windows-latest]
49+
os: [ubuntu-latest, macos-latest, windows-latest]
5050

5151
env:
5252
# doxygen 1.10 causes sphinx to fail, so pin to 1.9 for now.
@@ -65,7 +65,7 @@ jobs:
6565
python3 -m venv _venv
6666
source _venv/*/activate
6767
pip3 install -r ../website/requirements.txt
68-
cmake .. -DBUILD_WEBSITE=ON -DCMAKE_VERBOSE_MAKEFILE=ON
68+
cmake .. -DBUILD_WEBSITE=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DSPHINX_OPTS=""
6969
working-directory: _build
7070
shell: bash
7171
- name: Build

BUILD.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ cc_library(
190190
"src/lib/OpenEXRCore/internal_dwa_simd.h",
191191
"src/lib/OpenEXRCore/internal_file.h",
192192
"src/lib/OpenEXRCore/internal_float_vector.h",
193+
"src/lib/OpenEXRCore/internal_ht.cpp",
194+
"src/lib/OpenEXRCore/internal_ht_common.h",
195+
"src/lib/OpenEXRCore/internal_ht_common.cpp",
193196
"src/lib/OpenEXRCore/internal_huf.c",
194197
"src/lib/OpenEXRCore/internal_huf.h",
195198
"src/lib/OpenEXRCore/internal_memory.h",
@@ -263,6 +266,7 @@ cc_library(
263266
visibility = ["//visibility:public"],
264267
deps = [
265268
"@imath",
269+
"@openjph",
266270
"@libdeflate//:deflate",
267271
],
268272
)
@@ -309,6 +313,7 @@ cc_library(
309313
"src/lib/OpenEXR/ImfGenericInputFile.cpp",
310314
"src/lib/OpenEXR/ImfGenericOutputFile.cpp",
311315
"src/lib/OpenEXR/ImfHeader.cpp",
316+
"src/lib/OpenEXR/ImfHTCompressor.cpp",
312317
"src/lib/OpenEXR/ImfHuf.cpp",
313318
"src/lib/OpenEXR/ImfIDManifest.cpp",
314319
"src/lib/OpenEXR/ImfIDManifestAttribute.cpp",
@@ -414,6 +419,7 @@ cc_library(
414419
"src/lib/OpenEXR/ImfGenericInputFile.h",
415420
"src/lib/OpenEXR/ImfGenericOutputFile.h",
416421
"src/lib/OpenEXR/ImfHeader.h",
422+
"src/lib/OpenEXR/ImfHTCompressor.h",
417423
"src/lib/OpenEXR/ImfHuf.h",
418424
"src/lib/OpenEXR/ImfIDManifest.h",
419425
"src/lib/OpenEXR/ImfIDManifestAttribute.h",
@@ -505,6 +511,7 @@ cc_library(
505511
":IlmThread",
506512
":OpenEXRCore",
507513
"@imath",
514+
"@openjph"
508515
],
509516
)
510517

MODULE.bazel

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module(
88

99
bazel_dep(name = "bazel_skylib", version = "1.7.1")
1010
bazel_dep(name = "imath")
11+
bazel_dep(name = "openjph")
1112
bazel_dep(name = "libdeflate")
1213
bazel_dep(name = "platforms", version = "0.0.11")
1314
bazel_dep(name = "rules_cc", version = "0.1.1")
@@ -31,3 +32,13 @@ archive_override(
3132
strip_prefix = "libdeflate-master",
3233
urls = ["https://github.com/ebiggers/libdeflate/archive/refs/heads/master.zip"],
3334
)
35+
36+
archive_override(
37+
module_name = "openjph",
38+
patches = [
39+
"//bazel:openjph_add_build_file.patch",
40+
"//bazel:openjph_module_dot_bazel.patch",
41+
],
42+
strip_prefix = "OpenJPH-0.21.2",
43+
urls = ["https://github.com/aous72/OpenJPH/archive/refs/tags/0.21.2.zip"],
44+
)

bazel/openjph_add_build_file.patch

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
--- /dev/null
2+
+++ BUILD.bazel
3+
@@ -0,0 +1,116 @@
4+
+load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
5+
+load("@rules_license//rules:license.bzl", "license")
6+
+
7+
+package(
8+
+ default_applicable_licenses = [":license"],
9+
+)
10+
+
11+
+exports_files([
12+
+ "LICENSE",
13+
+])
14+
+
15+
+license(
16+
+ name = "license",
17+
+ license_kinds = ["@rules_license//licenses/spdx:BSD-2-Clause"],
18+
+ license_text = "LICENSE",
19+
+)
20+
+
21+
+cc_binary(
22+
+ name = "ojph_compress",
23+
+ srcs = ["src/apps/ojph_compress/ojph_compress.cpp"],
24+
+ visibility = ["//visibility:public"],
25+
+ deps = [":ojph_expand"],
26+
+)
27+
+
28+
+cc_library(
29+
+ name = "ojph_expand",
30+
+ srcs = [
31+
+ "src/apps/ojph_expand/ojph_expand.cpp",
32+
+ "src/apps/others/ojph_img_io.cpp",
33+
+ ],
34+
+ hdrs = [
35+
+ "src/apps/common/ojph_img_io.h",
36+
+ ],
37+
+ includes = [
38+
+ "src/apps/common",
39+
+ ],
40+
+ visibility = ["//visibility:public"],
41+
+ deps = [":openjph"],
42+
+)
43+
+
44+
+cc_library(
45+
+ name = "openjph",
46+
+ srcs = [
47+
+ "src/core/codestream/ojph_bitbuffer_read.h",
48+
+ "src/core/codestream/ojph_bitbuffer_write.h",
49+
+ "src/core/codestream/ojph_codeblock.cpp",
50+
+ "src/core/codestream/ojph_codeblock.h",
51+
+ "src/core/codestream/ojph_codeblock_fun.cpp",
52+
+ "src/core/codestream/ojph_codeblock_fun.h",
53+
+ "src/core/codestream/ojph_codestream.cpp",
54+
+ "src/core/codestream/ojph_codestream_gen.cpp",
55+
+ "src/core/codestream/ojph_codestream_local.cpp",
56+
+ "src/core/codestream/ojph_codestream_local.h",
57+
+ "src/core/codestream/ojph_params.cpp",
58+
+ "src/core/codestream/ojph_params_local.h",
59+
+ "src/core/codestream/ojph_precinct.cpp",
60+
+ "src/core/codestream/ojph_precinct.h",
61+
+ "src/core/codestream/ojph_resolution.cpp",
62+
+ "src/core/codestream/ojph_resolution.h",
63+
+ "src/core/codestream/ojph_subband.cpp",
64+
+ "src/core/codestream/ojph_subband.h",
65+
+ "src/core/codestream/ojph_tile.cpp",
66+
+ "src/core/codestream/ojph_tile.h",
67+
+ "src/core/codestream/ojph_tile_comp.cpp",
68+
+ "src/core/codestream/ojph_tile_comp.h",
69+
+ "src/core/coding/ojph_block_common.cpp",
70+
+ "src/core/coding/ojph_block_common.h",
71+
+ "src/core/coding/ojph_block_decoder.h",
72+
+ "src/core/coding/ojph_block_decoder32.cpp",
73+
+ "src/core/coding/ojph_block_decoder64.cpp",
74+
+ "src/core/coding/ojph_block_encoder.cpp",
75+
+ "src/core/coding/ojph_block_encoder.h",
76+
+ "src/core/coding/table0.h",
77+
+ "src/core/coding/table1.h",
78+
+ "src/core/common/ojph_arch.h",
79+
+ "src/core/common/ojph_base.h",
80+
+ "src/core/common/ojph_codestream.h",
81+
+ "src/core/common/ojph_defs.h",
82+
+ "src/core/common/ojph_file.h",
83+
+ "src/core/common/ojph_message.h",
84+
+ "src/core/common/ojph_params.h",
85+
+ "src/core/common/ojph_version.h",
86+
+ "src/core/others/ojph_arch.cpp",
87+
+ "src/core/others/ojph_file.cpp",
88+
+ "src/core/others/ojph_mem.cpp",
89+
+ "src/core/others/ojph_message.cpp",
90+
+ "src/core/transform/ojph_colour.cpp",
91+
+ "src/core/transform/ojph_colour.h",
92+
+ "src/core/transform/ojph_colour_local.h",
93+
+ "src/core/transform/ojph_transform.cpp",
94+
+ "src/core/transform/ojph_transform.h",
95+
+ "src/core/transform/ojph_transform_local.h",
96+
+ ],
97+
+ hdrs = [
98+
+ "src/core/common/ojph_arg.h",
99+
+ "src/core/common/ojph_mem.h",
100+
+ ],
101+
+ defines = [
102+
+ "OJPH_DISABLE_SIMD",
103+
+ #"OJPH_DISABLE_SSE2",
104+
+ #"OJPH_DISABLE_SSSE3",
105+
+ #"OJPH_DISABLE_SSE4",
106+
+ #"OJPH_DISABLE_AVX",
107+
+ #"OJPH_DISABLE_AVX2",
108+
+ #"OJPH_DISABLE_AVX512",
109+
+ #"OJPH_DISABLE_NEON",
110+
+ ],
111+
+ includes = [
112+
+ "src/core/codestream",
113+
+ "src/core/coding",
114+
+ "src/core/common",
115+
+ "src/core/others",
116+
+ "src/core/transform",
117+
+ ],
118+
+ visibility = ["//visibility:public"],
119+
+)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- MODULE.bazel
2+
+++ MODULE.bazel
3+
@@ -0,0 +1,8 @@
4+
+module(
5+
+ name = "openjph",
6+
+ version = "0.21.2",
7+
+ compatibility_level = 1,
8+
+)
9+
+
10+
+bazel_dep(name = "rules_cc", version = "0.1.1")
11+
+bazel_dep(name = "rules_license", version = "1.0.0")

0 commit comments

Comments
 (0)