Skip to content

Commit

Permalink
ojph_decode_codeblock_avx2() implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
tszumski committed Sep 2, 2024
1 parent 1021cc8 commit cc8cec4
Show file tree
Hide file tree
Showing 4 changed files with 2,050 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ else()
if (MSVC)
set_source_files_properties(codestream/ojph_codestream_avx.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX")
set_source_files_properties(codestream/ojph_codestream_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2")
set_source_files_properties(coding/ojph_block_decoder_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2")
set_source_files_properties(coding/ojph_block_encoder_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2")
set_source_files_properties(coding/ojph_block_encoder_avx512.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX512")
set_source_files_properties(transform/ojph_colour_avx.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX")
Expand All @@ -97,6 +98,7 @@ else()
set_source_files_properties(codestream/ojph_codestream_avx.cpp PROPERTIES COMPILE_FLAGS -mavx)
set_source_files_properties(codestream/ojph_codestream_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2)
set_source_files_properties(coding/ojph_block_decoder_ssse3.cpp PROPERTIES COMPILE_FLAGS -mssse3)
set_source_files_properties(coding/ojph_block_decoder_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2)
set_source_files_properties(coding/ojph_block_encoder_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2)
set_source_files_properties(coding/ojph_block_encoder_avx512.cpp PROPERTIES COMPILE_FLAGS -mavx512cd)
set_source_files_properties(transform/ojph_colour_avx.cpp PROPERTIES COMPILE_FLAGS -mavx)
Expand Down
1 change: 1 addition & 0 deletions src/core/codestream/ojph_codeblock_fun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ namespace ojph {
tx_from_cb = avx2_irv_tx_from_cb;
}
encode_cb = ojph_encode_codeblock_avx2;
decode_cb = ojph_decode_codeblock_avx2;
}
#endif // !OJPH_DISABLE_AVX2

Expand Down
6 changes: 6 additions & 0 deletions src/core/coding/ojph_block_decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ namespace ojph {
ui32 missing_msbs, ui32 num_passes, ui32 lengths1, ui32 lengths2,
ui32 width, ui32 height, ui32 stride, bool stripe_causal);

// AVX2-accelerated decoder
bool
ojph_decode_codeblock_avx2(ui8* coded_data, ui32* decoded_data,
ui32 missing_msbs, ui32 num_passes, ui32 lengths1, ui32 lengths2,
ui32 width, ui32 height, ui32 stride, bool stripe_causal);

// WASM SIMD-accelerated decoder
bool
ojph_decode_codeblock_wasm(ui8* coded_data, ui32* decoded_data,
Expand Down
Loading

0 comments on commit cc8cec4

Please sign in to comment.