Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/rcanut/nhwcodec
Browse files Browse the repository at this point in the history
  • Loading branch information
rcanut committed Oct 23, 2022
2 parents f76e87a + c4550c0 commit 7b833eb
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
40 changes: 40 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
cmake_minimum_required(VERSION 3.10)

project(NHWCodec C)

# encoder
set(ENC_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/encoder/codec.h
${CMAKE_CURRENT_SOURCE_DIR}/encoder/tree.h
${CMAKE_CURRENT_SOURCE_DIR}/encoder/wavelets.h
)
set(ENC_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/encoder/colorspace.c
${CMAKE_CURRENT_SOURCE_DIR}/encoder/compress_pixel.c
${CMAKE_CURRENT_SOURCE_DIR}/encoder/filters.c
${CMAKE_CURRENT_SOURCE_DIR}/encoder/image_processing.c
${CMAKE_CURRENT_SOURCE_DIR}/encoder/wavelet_filterbank.c
)
add_library(nhw_enc ${ENC_SOURCES})

# decoder
set(DEC_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/decoder/codec.h
${CMAKE_CURRENT_SOURCE_DIR}/decoder/tables.h
${CMAKE_CURRENT_SOURCE_DIR}/decoder/wavelets.h
)
set(DEC_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/decoder/compress_pixel.c
${CMAKE_CURRENT_SOURCE_DIR}/decoder/filters.c
${CMAKE_CURRENT_SOURCE_DIR}/decoder/wavelet_filterbank.c
)
add_library(nhw_dec ${DEC_SOURCES})

# executables
add_executable(dec ${DEC_HEADERS} ${DEC_SOURCES} decoder/nhw_decoder.c)
target_link_libraries(dec nhw_dec)
install(TARGETS dec RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

add_executable(enc ${ENC_HEADERS} ${ENC_SOURCES} encoder/nhw_encoder.c)
target_link_libraries(enc nhw_enc)
install(TARGETS enc RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@ Another advantage of the NHW codec is that it has a high speed, making it suitab
How to compile?
============

1) With gcc

For Windows: gcc *.c -O3 -o nhw_en/decoder.exe

For Linux: gcc *.c -O3 -lm -o nhw_en/decoder.exe

2) With CMake

Using the CMake config file: mkdir build && cd build && cmake ../ && make




To encode an image (512x512 bitmap color image for now): nhw_encoder.exe imagename.bmp

encoder options: quality settings: -h1..3 or -l1..19
Expand Down

0 comments on commit 7b833eb

Please sign in to comment.