Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
11f21070
Commit
11f21070
authored
2 months ago
by
Deucе
Browse files
Options
Downloads
Patches
Plain Diff
Do parallel JPEG XL decoding
With this, my fancy intro is quite usable...
parent
77376487
No related branches found
No related tags found
No related merge requests found
Pipeline
#7447
passed
2 months ago
Stage: build
Stage: test
Stage: cleanup
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/syncterm/CMakeLists.txt
+9
-0
9 additions, 0 deletions
src/syncterm/CMakeLists.txt
src/syncterm/term.c
+11
-0
11 additions, 0 deletions
src/syncterm/term.c
with
20 additions
and
0 deletions
src/syncterm/CMakeLists.txt
+
9
−
0
View file @
11f21070
...
@@ -30,6 +30,7 @@ INCLUDE (CheckIncludeFiles)
...
@@ -30,6 +30,7 @@ INCLUDE (CheckIncludeFiles)
find_package
(
PkgConfig
)
find_package
(
PkgConfig
)
if
(
NOT WITHOUT_JPEG_XL
)
if
(
NOT WITHOUT_JPEG_XL
)
pkg_check_modules
(
JPEG_XL libjxl
)
pkg_check_modules
(
JPEG_XL libjxl
)
pkg_check_modules
(
JPEG_XL_THREADS libjxl_threads
)
endif
()
endif
()
set
(
SOURCE
set
(
SOURCE
...
@@ -138,6 +139,14 @@ if(NOT WITHOUT_JPEG_XL)
...
@@ -138,6 +139,14 @@ if(NOT WITHOUT_JPEG_XL)
target_link_directories
(
syncterm PRIVATE
${
JPEG_XL_LIBRARY_DIRS
}
)
target_link_directories
(
syncterm PRIVATE
${
JPEG_XL_LIBRARY_DIRS
}
)
target_link_libraries
(
syncterm
${
JPEG_XL_LIBRARIES
}
)
target_link_libraries
(
syncterm
${
JPEG_XL_LIBRARIES
}
)
target_link_options
(
syncterm PRIVATE
${
JPEG_XL_LDFLAGS
}
)
target_link_options
(
syncterm PRIVATE
${
JPEG_XL_LDFLAGS
}
)
if
(
JPEG_XL_THREADS_FOUND
)
target_compile_definitions
(
syncterm PUBLIC WITH_JPEG_XL_THREADS
)
target_include_directories
(
syncterm PRIVATE
${
JPEG_XL_THREADS_INCLUDE_DIRS
}
)
target_compile_options
(
syncterm PRIVATE
${
JPEG_XL_THREADS_CFLAGS
}
)
target_link_directories
(
syncterm PRIVATE
${
JPEG_XL_THREADS_LIBRARY_DIRS
}
)
target_link_libraries
(
syncterm
${
JPEG_XL_THREADS_LIBRARIES
}
)
target_link_options
(
syncterm PRIVATE
${
JPEG_XL_THREADS_LDFLAGS
}
)
endif
()
endif
()
endif
()
endif
()
endif
()
...
...
This diff is collapsed.
Click to expand it.
src/syncterm/term.c
+
11
−
0
View file @
11f21070
...
@@ -46,6 +46,7 @@
...
@@ -46,6 +46,7 @@
#ifdef WITH_JPEG_XL
#ifdef WITH_JPEG_XL
#include
<jxl/decode.h>
#include
<jxl/decode.h>
#include
<jxl/encode.h>
#include
<jxl/encode.h>
#include
<jxl/resizable_parallel_runner.h>
#include
"xpmap.h"
#include
"xpmap.h"
#endif
#endif
...
@@ -3112,6 +3113,13 @@ read_jxl(const char *fn)
...
@@ -3112,6 +3113,13 @@ read_jxl(const char *fn)
xpunmap
(
map
);
xpunmap
(
map
);
return
NULL
;
return
NULL
;
}
}
void
*
rpr
=
JxlResizableParallelRunnerCreate
(
NULL
);
if
(
rpr
)
{
if
(
JxlDecoderSetParallelRunner
(
dec
,
JxlResizableParallelRunner
,
rpr
)
!=
JXL_DEC_SUCCESS
)
{
JxlResizableParallelRunnerDestroy
(
rpr
);
rpr
=
NULL
;
}
}
if
(
JxlDecoderSetInput
(
dec
,
map
->
addr
,
map
->
size
)
!=
JXL_DEC_SUCCESS
)
{
if
(
JxlDecoderSetInput
(
dec
,
map
->
addr
,
map
->
size
)
!=
JXL_DEC_SUCCESS
)
{
xpunmap
(
map
);
xpunmap
(
map
);
JxlDecoderDestroy
(
dec
);
JxlDecoderDestroy
(
dec
);
...
@@ -3136,6 +3144,7 @@ read_jxl(const char *fn)
...
@@ -3136,6 +3144,7 @@ read_jxl(const char *fn)
}
}
width
=
info
.
xsize
;
width
=
info
.
xsize
;
height
=
info
.
ysize
;
height
=
info
.
ysize
;
JxlResizableParallelRunnerSetThreads
(
rpr
,
JxlResizableParallelRunnerSuggestThreads
(
info
.
xsize
,
info
.
ysize
));
break
;
break
;
case
JXL_DEC_COLOR_ENCODING
:
case
JXL_DEC_COLOR_ENCODING
:
// TODO...
// TODO...
...
@@ -3187,6 +3196,8 @@ read_jxl(const char *fn)
...
@@ -3187,6 +3196,8 @@ read_jxl(const char *fn)
}
}
}
}
free
(
pbuf
);
free
(
pbuf
);
if
(
rpr
)
JxlResizableParallelRunnerDestroy
(
rpr
);
JxlDecoderReleaseInput
(
dec
);
JxlDecoderReleaseInput
(
dec
);
xpunmap
(
map
);
xpunmap
(
map
);
JxlDecoderDestroy
(
dec
);
JxlDecoderDestroy
(
dec
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment