Skip to content

Commit 31d83e6

Browse files
committed
first commit
0 parents  commit 31d83e6

Some content is hidden

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

54 files changed

+14517
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
test/*
3+
others/*

CMakeLists.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
cmake_minimum_required(VERSION 3.10.0)
2+
3+
project (openjph VERSION 0.1.0 DESCRIPTION "Open source implementation of JPH" LANGUAGES CXX)
4+
# set(CMAKE_CXX_STANDARD 11)
5+
if (MSVC)
6+
set(CMAKE_CXX_FLAGS "/EHsc")
7+
else()
8+
set(CMAKE_CXX_FLAGS "-std=c++11 -O3 -g")
9+
endif()
10+
11+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin)
12+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin)
13+
14+
include_directories(src/core/common)
15+
file(GLOB SOURCES "src/core/*/*.cpp")
16+
add_library(openjph SHARED ${SOURCES})
17+
18+
add_executable(ojph_expand src/apps/ojph_expand/ojph_expand.cpp src/apps/others/ojph_img_io.cpp)
19+
target_link_libraries(ojph_expand openjph)
20+
include_directories(src/apps/common)
21+
22+
add_executable(ojph_compress src/apps/ojph_compress/ojph_compress.cpp src/apps/others/ojph_img_io.cpp)
23+
target_link_libraries (ojph_compress openjph)
24+
include_directories(src/apps/common)
25+

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Readme #
2+
3+
Open source implementation of High-throughput JPEG2000 (HTJ2K), also known as JPH or JPEG2000 Part 15. Here, we are interested in implementing the HTJ2K only, supporting features that are defined in JPEG2000 Part 1 (for example, for wavelet transform, only reversible 5/3 and irreversible 9/7 are supported).
4+
5+
# Status #
6+
7+
The code is written entirely in C++, but it conceivable that at some point in the future, SIMD instructions are employed to improve coding speed. As it stands, on the quad core i7-6700, the code can encode 4K 4:4:4 HDR images losslessly in around 0.4-0.5s; for lossy compression, performance depends on the quantization step size (qstep), and it is between 0.25-0.55s for a similar image.
8+
9+
In the folder OpenJPH/src/core/coding, some files are part of the HTJ2K software verification model. Prof. David Taubman is the license holder for these files; he has given me permission to include them with this distribution. Replacing these files with my own implementation is a task of highest priority for me.
10+
11+
The OpenJPH library is almost complete, except for the above files. However, documentation is needed, and more propor handling of errors.
12+
13+
The provided command line tools ojph\_compress and ojph\_expand accepts and generated .pgm, .ppm, and .yuv. See the usage examples below.
14+
15+
# Usage Example #
16+
**Note**: in Kakadu, pairs of data in command line arguments represent columns,rows. Here, a pair represents x,y information. Also, in reversible compression, quantization is not supported.
17+
18+
ojph_compress -i input_file.ppm -o output_file.j2c -num_decomps 5 -block_size {64,64} -precincts {128,128},{256,256} -prog_order CPRL -colour_trans true -qstep 0.05
19+
ojph_compress -i input_file.yuv -o output_file.j2c -num_decomps 5 -reversible true -dims {3840,2160} -num_comps 3 -signed false -bit_depth 10 -downsamp {1,1},{2,2}
20+
21+
ojph_expand -i input_file.j2c -o output_file.ppm
22+
ojph_expand -i input_file.j2c -o output_file.yuv
23+
24+

bin/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
*

build/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
*

license.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
This software is released under the 2-Clause BSD license, included below.
2+
3+
Copyright (c) 2019, Aous Naman\
4+
Copyright (c) 2019, Kakadu Software Pty Ltd, Australia\
5+
Copyright (c) 2019, The University of New South Wales, Sydney, Australia
6+
7+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
10+
11+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
12+
13+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

license.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
This software is released under the 2-Clause BSD license, included below.
2+
3+
Copyright (c) 2019, Aous Naman
4+
Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
5+
Copyright (c) 2019, The University of New South Wales, Sydney, Australia
6+
7+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
10+
11+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
12+
13+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)