JPEG XL

Info

rules 57
github 35276
reddit 647

JPEG XL

tools 4225
website 1655
adoption 20712
image-compression-forum 0

General chat

welcome 3810
introduce-yourself 291
color 1414
photography 3435
other-codecs 23765
on-topic 24923
off-topic 22701

Voice Channels

General 2147

Archived

bot-spam 4380

libjxl

Demiurge
2023-12-16 11:40:12
So I dunno if that's what's wrong
2023-12-16 11:42:06
I will investigate and post an example image later today
sklwmp
2023-12-16 12:41:09
I don't think linking with system libjpeg is the issue
2023-12-16 12:41:23
I don't install the jpegli libjpeg anyway and everything works as usual
Demiurge
2023-12-16 12:48:34
I am also using gcc but yeah I doubt that's the issue either. Maybe it's just me or my image viewer
2023-12-16 12:49:11
I tested both v0.9.x branch and the main branch
jonnyawsom3
2023-12-16 12:51:48
There's an issue with images that have an alpha channel, even if completely transparent. Not sure if it's been fixed yet
Quackdoc
2023-12-16 12:53:16
completely transparent or completely opaque?
Demiurge
2023-12-16 01:06:05
Maybe that's the issue. I thought the alpha channel would be discarded.
jonnyawsom3
Quackdoc completely transparent or completely opaque?
2023-12-16 01:25:10
Right, Opaque, for some reason I was thinking "See through the Alpha to the image" haha
2023-12-16 01:25:48
But either way, the mere presence of the channel was corrupting encoding
2023-12-16 01:26:44
https://github.com/libjxl/libjxl/issues/2671
Demiurge
2023-12-16 01:54:05
That's what it looks like. I tried with two different png files.
2023-12-16 01:54:43
I know at least one has an alpha channel
Traneptora
Demiurge The tools are linked with the system libjpeg according to ldd
2023-12-16 02:58:22
iirc they're linked with system libjpeg for the non-jpegli side of it
2023-12-16 02:58:46
like you can cjpegli anything that cjxl accepts, and if it happens to be a jpeg, it'll use system libjpeg to decode to pixels, before using jpegli to encode to jpeg
2023-12-16 03:00:27
ideal behavior? no
2023-12-16 03:00:34
but iirc it's the same behavior as cjxl/djxl
Demiurge
2023-12-16 03:01:32
It still confuses me why there are 3 different jpeg encoders in the lib/enc tree. sjpeg, libjpeg and jpegli
Traneptora
2023-12-16 03:02:15
they haven't spliced jpegli into the tree as an encoder the other parts of the toolchain can use
2023-12-16 03:03:07
sjpeg iirc is like skcms, it's a lightweight alternative to `/usr/lib/libwhatever.so`
2023-12-16 03:04:02
once they do I'd imagine they'd use it by default if possible
Demiurge
2023-12-16 03:04:13
The libjxl tree isn't very lightweight...
Traneptora
2023-12-16 03:04:32
no, it's not, and embedding everything as a submodule despite being able to link to the system libs is actually pretty annoying
2023-12-16 03:04:41
but that's how all the google projects are set up
2023-12-16 03:06:48
IMO there's no reason for it to pull in zlib in a submodule, but I didn't make that decision
Demiurge
2023-12-16 03:10:50
Maybe I'll try to prune this heavy tree sometime. I believe it materially hurts adoption that the reference library is so much chonkier than all other codec libraries typically are.
Traneptora
2023-12-16 03:12:42
that actual library's not that heavyweight if you link to system libraries instead of chunking it all together
Demiurge
2023-12-16 03:14:16
All similar libraries have little to no dependencies, MIT license with no CLA and can usually be built with any C89 compliant compiler
Traneptora
2023-12-16 03:14:49
C99 is more portable than c89 but yea
2023-12-16 03:15:03
usually it requires a C99-compliant compiler because C89 lacks stdint.h and the like
2023-12-16 03:15:23
C89 also lacks // comments, the inline keyword, etc.
Demiurge
2023-12-16 03:20:37
Yeah, the newer versions are better, but basically everyone goes out of their way as much as possible to make it as accessible as possible for anyone to adopt, contribute, port to new platforms, etc
2023-12-16 03:26:48
Legal/corporate reasons might prevent that but in that case it might be a good idea to foster development and adoption of third party implementations that no one is "responsible" for in a reputation or legal sense, and have the reference implementation merely try to be a good reference.
2023-12-16 03:29:09
The more implementations there are, the better IMO, as long as they are all bitstream compatible.
w
2023-12-16 03:39:32
can't build libjxl with less than 1gb ram per core
lonjil
2023-12-16 04:35:55
who actually uses C89 these days? Even Linux is C11.
spider-mario
2023-12-16 04:43:46
didn’t Microsoft ignore C99 for the longest time?
2023-12-16 04:43:57
pretty much went straight to C11 from what I recall
Traneptora
lonjil who actually uses C89 these days? Even Linux is C11.
2023-12-16 05:08:24
FFmpeg is C90 with a few features from C99
2023-12-16 05:08:43
IMO C99 is the gold standard because it's the most portable version of C
2023-12-16 05:09:11
`uint64_t` is pretty important for portability because `sizeof(long)` is not specified
spider-mario didn’t Microsoft ignore C99 for the longest time?
2023-12-16 05:12:39
sorta, they decided to start supporting C99 about 10 years ago
2023-12-16 05:12:49
with MSVC
2023-12-16 05:13:09
however, many C99 features are also in C++, so those were also supported
2023-12-16 05:13:14
like `//` comments
lonjil
2023-12-16 06:01:12
msvc doesn't even support C++ correctly on fairly basic stuff
gomer
2023-12-16 06:08:02
<@853026420792360980> wouldn't disabling the container format in libjxl\_anim mean ffmpeg would have to implement a jxl muxer as well?
Traneptora
gomer <@853026420792360980> wouldn't disabling the container format in libjxl\_anim mean ffmpeg would have to implement a jxl muxer as well?
2023-12-16 06:12:30
No, you can use image2pipe
2023-12-16 06:12:37
Muxer
gomer
2023-12-16 06:12:46
oh
2023-12-16 06:12:52
that's neat then
Traneptora
2023-12-16 06:14:07
That said implementing a dummy muxer is a good idea
2023-12-16 06:14:20
It makes it easier to tweak later
gomer
2023-12-16 06:17:20
by dummy muxer, do you mean a bare bones jpeg xl muxer?
spider-mario
lonjil msvc doesn't even support C++ correctly on fairly basic stuff
2023-12-16 06:27:25
eh, it’s not the VC6 era anymore
2023-12-16 06:27:31
support up to C++20 is quite good
2023-12-16 06:27:35
https://en.cppreference.com/w/cpp/compiler_support#cpp20
2023-12-16 06:28:38
(remember when variables declared in the init statement of a `for` loop would outlive the loop?)
lonjil
2023-12-16 06:34:04
there's a bug in how it handles utf-8 string literals which makes them completely unusable. this violates both C++ and C standards. I find this annoying! (specifically, `u8"foo"` should always result in a UTF-8 string. If the file encoding is something other than UTF-8, then the compiler should do the appropriate conversion. However, MSVC instead reads each byte in the string and pretends it's a code point, which it then encodes into UTF-8. UTF-16 and UTF-32 string literals OTOH work fine, it's only the UTF-8 ones that are broken)
spider-mario
2023-12-16 06:42:05
ah, that does sound annoying
2023-12-16 06:42:15
out of curiosity, how is the encoding of the file supposed to be known by the compiler?
2023-12-16 06:42:36
I think I’d find it more reliable to use regular strings while ensuring that the file is UTF-8 encoded itself
2023-12-16 06:43:02
I see little reason to use any other encoding
lonjil
2023-12-16 06:43:24
Of course your file is probably UTF-8, but that's not assumed in the standards.
2023-12-16 06:44:19
But compilers do document what they expect, or have options for using different encodings. E.g. MSVC has a switch for telling it that source files are UTF-8.
2023-12-16 06:47:34
The important part is that however the compiler interprets the file, every *character* in the string literal should be converted to Unicode and encoded with UTF-8. Note that if you're not sure what encoding your file will be in, you can use Unicode sequences like `\u0123`. But even when you do that, MSVC fails. Unicode escapes work fine in regular, UTF-16, and UTF-32 string literals.
spider-mario I think I’d find it more reliable to use regular strings while ensuring that the file is UTF-8 encoded itself
2023-12-16 06:51:22
note that regular strings use whatever encoding is specified by your locale, even if the file is UTF-8. The point of having Unicode string literals and Unicode character types (i.e. `char8_t` and friends) is to allow guaranteed Unicode behavior even when the system is using Codepage 437 or whatever. C2y/C3x is also going to have some actually good character conversion functions to make it even easier. But it's only useful for portability if it works correctly everywhere 🙁
Traneptora
gomer by dummy muxer, do you mean a bare bones jpeg xl muxer?
2023-12-16 09:10:23
yes
lonjil there's a bug in how it handles utf-8 string literals which makes them completely unusable. this violates both C++ and C standards. I find this annoying! (specifically, `u8"foo"` should always result in a UTF-8 string. If the file encoding is something other than UTF-8, then the compiler should do the appropriate conversion. However, MSVC instead reads each byte in the string and pretends it's a code point, which it then encodes into UTF-8. UTF-16 and UTF-32 string literals OTOH work fine, it's only the UTF-8 ones that are broken)
2023-12-16 09:11:52
y would you use anything else tho
gomer
2023-12-16 09:12:02
ah, yeah it's probably a good idea long term, but one would need to have access to a copy of ISO 18181-2
Traneptora
gomer ah, yeah it's probably a good idea long term, but one would need to have access to a copy of ISO 18181-2
2023-12-16 09:14:50
there's a draft in <#1021189485960114198>
gomer
2023-12-16 09:15:05
oh, nice
2023-12-16 09:15:13
i only searched arxiv and the usual places
Demiurge
2023-12-17 12:04:49
Is there a way to build libjxl using the system-installed libjpeg headers instead of in the third_party folder?
2023-12-17 12:05:22
I have all of the header files installed so I don't understand why I have to download it again in the third_party folder
2023-12-17 12:08:48
`-- Found Brotli: /usr/include` But why doesn't it do this for libjpeg as well?
2023-12-17 12:12:49
The problem is in `lib/jpegli.cmake` in the `configure_file` lines
2023-12-17 02:47:12
You know, it won't take that long to replace all `jpeg_` with `jpegli_`...
Traneptora
Demiurge I have all of the header files installed so I don't understand why I have to download it again in the third_party folder
2023-12-18 05:33:03
Many google projects bundle all dependencies in a single repo, it's a common annoyance with them. I don't see any way around it atm
Demiurge
2023-12-18 05:42:51
Well in this case it's literally just 3 configure_file lines in jpegli.cmake
2023-12-18 05:45:15
It wouldn't take that long to fix it... I might even get around to it myself if it isn't done by the time I get my computer set up...
Quackdoc
2023-12-19 02:12:21
on one hand, I do see the annoyance, on the other vendoring really does help work around a lot of package management issues
Demiurge
2023-12-19 02:24:33
It's able to use system libs for everything else except skcms
2023-12-19 02:26:04
Jpeg is the one odd and obnoxious exception and only due to copying 3 header files it could and should easily get from the system
2023-12-19 02:26:22
And only for jpegli
2023-12-19 02:26:57
If you don't enable jpegli then there's no issue either as far as I can tell
vtorri
2023-12-21 12:08:52
hey
2023-12-21 12:09:01
will there be a new release soon ?
Demiurge
2023-12-21 03:02:58
No. Just check out the v0.9.x branch. It's more lulzy to not actually release it.
vtorri
2023-12-22 02:38:39
i've just received mail for a new release 🙂
2023-12-22 02:38:57
according to the changelog :
2023-12-22 02:39:21
JxlDecoderSetCms to enable decoding to desired colorspace
2023-12-22 02:40:10
so it's possible to have as output BGRA (B lower byte, A higher byte) ?
2023-12-22 02:41:27
if i'm not mistaken, by default libjxl uses RGBA colorspace
HCrikki
2023-12-22 03:05:02
no prebuilt libraries?
veluca
vtorri so it's possible to have as output BGRA (B lower byte, A higher byte) ?
2023-12-22 03:21:40
probably, if your cms can do that
HCrikki no prebuilt libraries?
2023-12-22 03:21:56
those should appear after some time
vtorri
2023-12-22 04:03:23
i would prefer something inside libjxl itself, it's just another way to fill the output
2023-12-22 04:03:32
swapping 2 channels
2023-12-22 04:04:05
<@179701849576833024> can you tell me where in the code i can do that (swapping the2 channels) ?
veluca
2023-12-22 04:55:06
Not sure, you'd have to request an output ICC profile that swaps B and R
vtorri
2023-12-22 05:07:40
why not having an api which tells that output is BGRA or RGBA ?
veluca
2023-12-22 06:34:28
we never felt it was useful, I guess
spider-mario
2023-12-22 06:50:36
yeah, it’s not clear that this added convenience warrants the repetitive code that this would require (which may still not cover what everyone would want) and this potential new source of bugs
vtorri
2023-12-22 11:20:25
i doubt it will be error prone
2023-12-22 11:20:51
just tell me where it is in the code
jonnyawsom3
veluca those should appear after some time
2023-12-23 12:19:40
I'm rather late, but it seems the binaries failed to upload <https://github.com/libjxl/libjxl/actions/runs/7300997957/job/19897617556#step:14:11>
veluca
2023-12-23 12:28:15
ugh
2023-12-23 12:28:26
well, looks like we'll need a 0.9.1 anyway...
jonnyawsom3
2023-12-23 12:56:08
Only real way to test is by letting the public get their hands on it, at least now any serious issues are obvious and can be fixed quickly
vtorri
2023-12-23 05:39:18
on windows with msys2, i downloaded the 0.9 release, but running deps.sh, i have this error:
2023-12-23 05:39:38
Downloading third_party/libjpeg-turbo version TURBO...
2023-12-23 05:39:40
...
2023-12-23 05:39:59
gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now
2023-12-23 05:40:44
I have all the necessary libraries, why must i run this script ?
2023-12-23 05:41:28
this is completely useless
2023-12-23 05:42:24
add a requirements section and ask people to install them via their package manager if necessary
2023-12-23 05:44:33
and honestly zlib libpng and libjpeg are certainly already installed in all the linux/bsd/solaris distro
2023-12-23 05:50:15
zlib is even installed by default on msys2...
jonnyawsom3
2023-12-23 07:06:47
https://github.com/libjxl/libjxl/issues/3069#issuecomment-1867857652
2023-12-23 07:08:04
May be related
sklwmp
vtorri I have all the necessary libraries, why must i run this script ?
2023-12-23 07:15:51
well, some deps are tied to submodules, which you would get if you ran git clone --recursive, deps.sh is there for if you download the zip source code but idk if it's still maintained very much
vtorri
2023-12-23 08:09:37
<@557099078337560596> it seems it is not
2023-12-23 08:14:39
i'm still convinced that it is a bad idea
2023-12-23 08:14:55
let people install the required deps
2023-12-23 08:15:42
and again, zlib, libpng and libjpeg are so used that they are certainly installed in all unix distro
DZgas Ж
2023-12-23 09:43:21
0.9.0 windows build where
2023-12-23 09:45:59
I certainly know that I can take them here: https://artifacts.lucaversari.it/libjxl/libjxl/latest/ but why is this not on github, what is the reason - since it's already been the day since the release
vtorri on windows with msys2, i downloaded the 0.9 release, but running deps.sh, i have this error:
2023-12-23 09:52:43
fun
2023-12-23 09:57:38
wait, but if there are problems with the build of the latest version, then how did it happen...
spider-mario
2023-12-23 09:59:06
a problem with deps.sh downloading a .tar.gz wouldn’t imply a problem with git submodules
2023-12-23 10:01:09
``` $ cat TURBO.tar.gz.tmp 404: Not Found ```
2023-12-23 10:01:13
presumably, we need to update an URL
DZgas Ж
2023-12-23 10:05:12
still fun
spider-mario
2023-12-23 10:08:42
found the issue, I’ll submit a fix
2023-12-23 10:10:57
https://github.com/libjxl/libjxl/pull/3071
DZgas Ж
2023-12-23 11:07:22
ooooh ! now can compress the image 60000x120000 ...... or have not solved the problem with eating all the memory yet? :)
2023-12-23 11:10:01
in fact, it is a very incomprehensible parameter, so it also has so many options to choose from. It is not written which specific methods are disabled for encoding. There is not even an approximate percentage increase in decode speed... The developers clearly did tests on each of the parameters and know what the percentage increase in decoding speed is -- could write it in the parameters
veluca
2023-12-23 11:14:52
that parameter has been there for some time 🙂
DZgas Ж
veluca that parameter has been there for some time 🙂
2023-12-23 11:42:31
where is the article, large image decoding tests, speed comparisons with jpeg webp avif where AVG decoding speeds of 1000 images on each parameter <:AngryCry:805396146322145301> should I do myself
diskorduser
DZgas Ж where is the article, large image decoding tests, speed comparisons with jpeg webp avif where AVG decoding speeds of 1000 images on each parameter <:AngryCry:805396146322145301> should I do myself
2023-12-23 12:18:37
https://tenor.com/view/do-it-what-are-you-waiting-for-determined-angry-gif-5247874
DZgas Ж
2023-12-23 12:45:53
😈
2023-12-23 01:01:57
**libavif **does not have ready-made builds on github 😤 will have to use avif in ffmpeg, and jpeg. perhaps the same is possible with webp. I'm not sure about JXL. I think ffmpeg just doesn't have all the parameters like cjxl
w
2023-12-23 01:08:43
There are for jpeg
2023-12-23 01:08:48
<https://github.com/libjpeg-turbo/libjpeg-turbo/releases>
fab
DZgas Ж **libavif **does not have ready-made builds on github 😤 will have to use avif in ffmpeg, and jpeg. perhaps the same is possible with webp. I'm not sure about JXL. I think ffmpeg just doesn't have all the parameters like cjxl
2023-12-23 03:28:36
Libavif uses appveyor
DZgas Ж
2023-12-23 03:39:11
🧐
2023-12-23 03:39:53
I tested 500 images of random sizes and contents of e7 d1
2023-12-23 03:41:41
first of all, well, there is a small difference. secondly, the real difference on One large image when decoding in 1 thread is about 10-30% of the decoding time (fast0 vs fast4)
2023-12-23 03:50:26
it's not even 2 times faster. it doesn't even make sense to compare, webp will be ten times faster for decoding
DZgas Ж 🧐
2023-12-23 03:52:56
judging by the uneven distribution, it is obvious that some functions were turned off and some were turned on for use on each parameter separately. Since I have no idea what these functions are, I can only say that, looking at what I see from the numbers, I absolutely do not understand why to do a Gradation into 4 levels of fast decoding. It doesn't have a rational.
2023-12-23 03:57:43
one big image (4 threads)
2023-12-23 04:00:39
well, that is, in my opinion, it is quite obvious that there is no point in making 4 different keys to disable different encoding parameters. need to do only one (fast-decode) where everything that is possible is disabled, As I understand it fast4
2023-12-23 04:02:26
e3
2023-12-23 04:05:27
I want to make an clarification that all images after decoding are recorded in PNG and this is included in time. but since I can just open the image to view it, I can say that this does not greatly affect the test results. Generally a disappointment
Quackdoc
2023-12-23 04:06:15
I found `faster_decoding=2` (or maybe it was 1?) to help my use case a decent amount, anything beyond that and I got no difference
veluca
2023-12-23 04:06:58
FWIW that flag does little for lossless
2023-12-23 04:07:04
it has a bit more effect on lossy
DZgas Ж
2023-12-23 04:07:59
images with all fast decode parameters become larger by about the same amount, about 5%
Quackdoc
2023-12-23 04:08:43
for my testing I was using `cjxl.exe -e 6 -d 0.5` and then added `--faster_decoding=2` (didnt test 1 for thhis specific test) and gained about 100fps for my decode times
2023-12-23 04:08:53
from 110 to 210 rougly
2023-12-23 04:09:26
1080p video
veluca
2023-12-23 04:09:38
yup makes sense, I don't remember exactly which level turns off EPF, but that's where you'll see most speed gains
2023-12-23 04:09:51
(arguably at d0.5 you don't need epf at all, but still)
Quackdoc
2023-12-23 04:11:50
I did also test `cjxl -e 3 -d 1` and found a similar speed increase. but the video I used as a source is relatively simple, I did want to try netflix's chimera test clip, but my PC would OOM when encoding it in parallel to somewhat fast speeds and never had the time to keep the storage space in use to do it in serial
DZgas Ж
2023-12-23 04:16:17
the only observation I can make is that the e7 fast4 has become like a regular e3 in terms of decoding speed - but this is still a very long time in single-threaded testing. The difference in the fast-decode parameter is completely invisible with multi threaded decoding, 10% of the plus performance is dissipated.... In general, it's even strange why do that the quality will not change at all from fast decoding. All the codecs that I know, and these are video codecs that have FastDecode, have very large differences in quality, and it's WORTH it that decoding becomes 50-100% faster
veluca that parameter has been there for some time 🙂
2023-12-23 04:17:58
<:Thonk:805904896879493180> in general, the parameter is also insignificant, so bad that it cannot be compared even with other codecs, because there is no magical advantage
2023-12-23 04:20:38
it can be by default for images larger than 10 megapixels or something like that
Quackdoc
2023-12-23 04:21:15
I use `faster_decoding=2` on all of my video sequences myself since it helps me a lot, for a 1920x1080p video https://cdn.discordapp.com/attachments/673202643916816384/1182221277776314398/image.png https://cdn.discordapp.com/attachments/673202643916816384/1182221278430634014/image.png https://cdn.discordapp.com/attachments/673202643916816384/1182221413357195276/image.png https://cdn.discordapp.com/attachments/673202643916816384/1182221413856313384/image.png
2023-12-23 04:21:49
when I load these into a video editor, it's a night and day difference
2023-12-23 04:23:33
I would like faster_decoding=3 and faster_decoding=4 to do more since for this video there was zero difference for me
DZgas Ж
2023-12-23 04:25:53
my tests also show that there is almost no difference between fast4 and fast2.
Quackdoc
2023-12-23 04:26:27
T.T
DZgas Ж
2023-12-23 04:27:37
it is difficult for me to say how the tests were performed by the one who made this parameter
2023-12-23 04:27:48
some kind of roller coaster
Quackdoc
2023-12-23 04:28:21
I just need like 20-40 more fps for the clips I use T.T
DZgas Ж
2023-12-23 04:29:37
I did tests on 4 cores. But judging by your tests, I can make an assumption that with fast 2, some kind of decoding function is disabled - which is a bottleneck for more multicore system . Which gives you much more performance
Quackdoc
2023-12-23 04:30:14
yeah my tests had pretty much unconstrained accsess to my 2600 via ffmpeg
DZgas Ж
2023-12-23 04:31:38
but still, opening a giant jxl image waiting 7 seconds. And then opening webp for ~200 ms. There is nothing to compare
veluca
2023-12-23 05:44:13
IIRC 3 and 4 mostly make a difference on arm
eddie.zato
2023-12-23 05:52:41
So, `JPEGXL_STATIC` is gone in v0.9.0, and now I can't figure out how to build standalone exes in `msys2/clang64`.
veluca
2023-12-23 05:56:36
`-DBUILD_SHARED_LIBS=OFF`
eddie.zato
2023-12-23 05:59:25
Yeah, that's what I did. Now the exes are asking all these libpng, libhwy, libz, etc. I build it with system hwy. Trying to link with '-lhwy'. Getting `ld.lld: error: hwy::SupportedTargets() was replaced`.
veluca
2023-12-23 06:17:23
ah I see
2023-12-23 06:17:39
does msys2 even install static libs?
spider-mario
2023-12-23 06:17:59
yes
2023-12-23 06:18:01
``` mingw-w64-x86_64-highway /mingw64/lib/libhwy.a mingw-w64-x86_64-highway /mingw64/lib/libhwy.dll.a ```
2023-12-23 06:18:07
maybe we could revive `JPEGXL_STATIC`
veluca
2023-12-23 06:18:12
huh that's different from arch then
spider-mario maybe we could revive `JPEGXL_STATIC`
2023-12-23 06:18:29
I guess
2023-12-23 06:19:56
I don't like it, but apparently cmake doesn't really have a way to make static executables, so...
spider-mario
2023-12-23 06:33:31
``` $ ldd tools/cjxl.exe ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffa1c1b0000) KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ffa1a4d0000) KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7ffa19c60000) apphelp.dll => /c/WINDOWS/SYSTEM32/apphelp.dll (0x7ffa16df0000) msvcrt.dll => /c/WINDOWS/System32/msvcrt.dll (0x7ffa1ac30000) libOpenEXR-3_2.dll => /mingw64/bin/libOpenEXR-3_2.dll (0x7ff9afa30000) libgcc_s_seh-1.dll => /mingw64/bin/libgcc_s_seh-1.dll (0x7ff9ef780000) libwinpthread-1.dll => /mingw64/bin/libwinpthread-1.dll (0x7ff9fc500000) libstdc++-6.dll => /mingw64/bin/libstdc++-6.dll (0x7ff9af800000) libImath-3_1.dll => /mingw64/bin/libImath-3_1.dll (0x7ff9ef720000) libIex-3_2.dll => /mingw64/bin/libIex-3_2.dll (0x7ff9e2180000) libIlmThread-3_2.dll => /mingw64/bin/libIlmThread-3_2.dll (0x7ff9fc3b0000) libOpenEXRCore-3_2.dll => /mingw64/bin/libOpenEXRCore-3_2.dll (0x7ff9af5b0000) libdeflate.dll => /mingw64/bin/libdeflate.dll (0x7ff9f76f0000) ```
2023-12-23 06:33:34
still not super static
2023-12-23 06:45:55
on Linux, it is
Quackdoc
veluca huh that's different from arch then
2023-12-23 06:48:36
Arch disables both compiling static when possible, but also just out right disabled packaging them, butit's easy enough to enable it for repackagers https://gitlab.archlinux.org/archlinux/packaging/packages/pacman/-/blob/main/makepkg.conf?ref_type=heads#L95
2023-12-23 06:49:16
simply remove the ! to enable it, and ofc make sure the package enables building it
MSLP
2023-12-24 04:20:01
will libjxl-0.8.x be receiving any security updates, now that 0.9 is out? I'm asking in the context of possible jxl support removal from cromite browser https://github.com/uazo/cromite/issues/627 if upgrading chromium code for compatibility with libjxl-0.9 will pose a problem.
veluca
2023-12-24 08:24:08
I believe <@795684063032901642> is working on getting 0.9 running on Chromium 🙂 (API is the same, but there's a few snags with hwy)
Moritz Firsching
2023-12-24 08:28:04
Yes, this is wip
vtorri
2023-12-24 11:07:55
no 0.9.1 soon ? the build is broken
Yari-nyan
2023-12-24 01:47:41
> The current reference software libjxl is quite optimized for the lossy case, but still has some room for improvement for the lossless case — in particular it does not have fast paths yet for the common case where the full precision of 32-bit per sample is not required. <https://news.ycombinator.com/item?id=33448192> has there been any progress towards this? libjxl has fantastic decoding performance for 16 bit lossless images compared to PNG (especially with fast_lossless), and recompressed JPEGs compared to libjpeg-turbo, and great performance for lossy when the image size isn't too big. however, 8 bit per channel tend to be significantly slower in my tests compared to PNG and WebP. decoding speed is however much better with fast_lossless, but for the standard `-e 7` setting it gives oftentimes (not always!) better filesizes with typically much slower decodes, compared to fast_lossless as it stands right now, i can't have my cake and eat it too with good filesizes and decoding speed at the same time for most files. i have an 8 core 16 threads CPU (ryzen 7 6800HS).
2023-12-24 01:49:42
if you need some benchmarks, i can provide, but i'm mostly curious how optimized libjxl currently is with 8 bit per channel images
DZgas Ж
w <https://github.com/libjpeg-turbo/libjpeg-turbo/releases>
2023-12-24 01:58:45
it does not support PNG decoding lol
Traneptora
2023-12-24 05:21:05
There's an API/ABI break from 0.8 to 0.9
2023-12-24 05:21:26
We had to #ifdef around it in FFmpeg
2023-12-24 05:23:27
fwiw, Hydrium also depends on spng for png decoding but it's not in-tree
2023-12-24 05:23:41
it uses a meson.wrap
veluca
Traneptora There's an API/ABI break from 0.8 to 0.9
2023-12-24 11:24:38
uhhhhm that ought not to happen, what is it?
Traneptora
veluca uhhhhm that ought not to happen, what is it?
2023-12-24 11:28:57
you removed an unused argument from the middle of a function, lemme pull up specifics
2023-12-24 11:31:57
https://github.com/FFmpeg/FFmpeg/blob/f5f414d9c4bef90cb8986c0b71abd3c87a68fe4d/libavcodec/libjxldec.c#L216
veluca
Traneptora you removed an unused argument from the middle of a function, lemme pull up specifics
2023-12-24 11:33:55
that should not have happened... do you mind filing a bug?
2023-12-24 11:34:11
we'll probably revert it in 0.9.1, I think
2023-12-24 11:34:34
we probably should also have tests for this 👀 but they are kind of a pain
Traneptora
veluca that should not have happened... do you mind filing a bug?
2023-12-24 11:35:24
Yea, though im on vacation so it may or may not come for a few days
veluca
2023-12-24 11:36:08
fair enough
2023-12-24 11:36:12
so are we 😛
_wb_
veluca that should not have happened... do you mind filing a bug?
2023-12-25 07:41:21
If not now, then when are we going to remove that deprecated unused argument? Or do you want to keep it also in 1.0?
veluca
2023-12-25 07:43:14
we can break API/ABI for 1.0
2023-12-25 07:43:25
and then 2.0, ...
Tirr
2023-12-25 07:46:39
if libjxl follows semantic versioning, it's ok to break public API compatibility in every 0.x release
veluca
2023-12-25 09:38:44
that is technically true, but there's also no real good reason to do it
spider-mario
2023-12-25 09:39:41
if it were C++, we could have both versions of the function
Kleis Auke
2023-12-25 09:40:50
FWIW, libvips had a similar issue, but I was able to fix it before v0.9.0 was released - <https://github.com/libvips/libvips/pull/3774>.
veluca
2023-12-25 10:15:06
I guess we could also leave it as is...
Yari-nyan
2023-12-25 11:38:03
anyone know how to have `libjxl-git` and `ffmpeg-git` AUR packages installed at the same time?
2023-12-25 11:40:04
when installing `libjxl-git`: ``` :: libjxl-git and libjxl are in conflict. Remove libjxl? [y/N] y error: failed to prepare transaction (could not satisfy dependencies) :: removing libjxl breaks dependency 'libjxl.so=0.8-64' required by ffmpeg-git```
novomesk
2023-12-25 11:48:31
We also prepared for the API change few months ago: https://gitlab.gnome.org/GNOME/gimp/-/commit/a4f02398188bc36d1808ef802082b3856cc73741
2023-12-25 11:54:38
Also in kimageformats: https://invent.kde.org/frameworks/kimageformats/-/commit/3cb6519dcc24563fcf60f80ec7265ecb487d155a
_wb_
veluca we can break API/ABI for 1.0
2023-12-25 01:23:31
I prefer breaking it now rather than later. Having a 0.x release that is already compatible with 1.0 is convenient, otherwise the 1.0 release will also cause inconvenience.
veluca
2023-12-25 01:25:00
I mean, if people already fixed things up...
Demiurge
2023-12-25 01:40:01
It would help a lot with stabilizing the API, if someone responsible for designing it would take a look at the way the libjxl API is being used in ffmpeg and libvips and graphicksmagick, and in this way, see how people are actually using the API in practice.
2023-12-25 01:47:26
https://sourceforge.net/p/graphicsmagick/code/ci/default/tree/coders/jxl.c https://github.com/ImageMagick/ImageMagick/blob/main/coders/jxl.c https://github.com/libvips/libvips/blob/master/libvips/foreign/jxlload.c https://github.com/libvips/libvips/blob/master/libvips/foreign/jxlsave.c https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/libjxldec.c https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/libjxlenc.c
spider-mario
Yari-nyan anyone know how to have `libjxl-git` and `ffmpeg-git` AUR packages installed at the same time?
2023-12-25 04:34:32
you’ll probably need to temporarily remove ffmpeg-git, install libjxl-git, then rebuild and reinstall ffmpeg-git
2023-12-25 04:35:32
(alternatively, you could do something like `pacman -Rdd libjxl`, install libjxl-git with ffmpeg-git still installed but broken, and then rebuild/reinstall the latter, but afaict, you don’t gain much by doing that)
Yari-nyan
2023-12-25 04:49:49
thanks, `pacman -Rdd libjxl` works
2023-12-25 05:03:23
it was of course necessary to compile ffmpeg without libjxl support as it currently expects 0.8
spider-mario
Traneptora We had to #ifdef around it in FFmpeg
2023-12-25 05:13:58
it shouldn’t, according to ^
Yari-nyan
2023-12-25 05:43:10
it gets linked with 0.8
Traneptora
Yari-nyan anyone know how to have `libjxl-git` and `ffmpeg-git` AUR packages installed at the same time?
2023-12-25 05:43:38
install libjxl-git but when you do `pacman -U` pass the command `pacman -U --assume-installed=libjxl.so=0.8-64`
Yari-nyan it gets linked with 0.8
2023-12-25 05:44:32
if you install libjxl-git first, it uses whatever your system libraries/headers are, which you can do
2023-12-25 05:44:48
so you have to install libjxl-git first, and then build ffmpeg-git
Quackdoc
2023-12-25 05:45:50
I just `-Sdd` (install while ignoring dependancy breakages) then rebuild ffmpeg
Yari-nyan
2023-12-25 06:02:18
ooh thank you!
vtorri
2023-12-26 07:57:21
[100%] Built target jxl_dec C:/Documents/msys2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/jxl.dir/objects.a(encode.cc.obj):encode.cc:(.text+0x7124): undefined reference to `JxlGetDefaultCms'
2023-12-26 07:59:10
git repo
spider-mario
2023-12-26 10:32:10
hm, how did that happen / how did you build? I don’t encounter this
2023-12-26 10:32:53
I build with clang, though – let me try gcc
2023-12-26 10:35:29
seems to work
2023-12-26 10:35:31
``` [490/490] Linking CXX executable lib\tests\decode_test.exe ```
2023-12-26 10:36:36
might there be some stale stuff in the build directory (including maybe in CMakeCache.txt)?
vtorri
2023-12-26 10:59:54
<@604964375924834314> https://pastebin.com/0DqFFUBE
2023-12-26 11:01:57
after a clone
Kampidh
2023-12-26 11:16:04
ah, I get about the same error when trying to call `JxlGetDefaultCms`: ``` ld.lld: error: undefined symbol: __declspec(dllimport) JxlGetDefaultCms ```
qdwang
2023-12-28 11:20:14
Hi guys, what kinds of information will lose in a **distance = 0 with VarDCT** encoding progress?
jonnyawsom3
2023-12-28 12:52:33
I'll do a quick test, assuming you mean visual quality rather than metadata
qdwang
2023-12-28 01:33:57
no, for command line `cjxl`, 0 means modular. But by calling `libjxl`, one can use **distance = 0** in VarDCT mode and produce smaller file size than the **lossless mode**
jonnyawsom3
2023-12-28 01:43:11
Surprisingly, VarDCT did rather well. 2.5x larger than real lossless, with 1 value (8bit, so 1 out of 255 per channel) color differences along edges in the main area of the image. In the corner with an FPS reading, the max value difference is 15 in the Red channel and the highest difference in the image Original, VarDCT 'Lossless', Difference, Difference extrapolated (the 15 max value mapped to 255)
Tirr
2023-12-28 01:44:26
maybe it uses default distance value in that case
2023-12-28 01:45:04
uh maybe no
jonnyawsom3
2023-12-28 01:45:07
I just did `-d 0.0000001` to get close enough with cjxl
2023-12-28 01:45:24
0 does force on Modular even with `-m 0`
2023-12-28 01:49:34
Looks like it gets clamped to `-d 0.01`
veluca
2023-12-28 02:16:37
I believe the API does the same clamping
2023-12-28 02:17:05
in fact I am fairly sure, everything would break with an actual 0 for distance in vardct
qdwang
2023-12-28 07:18:04
Is it normal to have a smaller result file with `effort: 3` than `effort: 7`?
2023-12-28 07:18:53
My test on a 6100M pixels photo: ``` effort: // 1 -> 15.4mb // 2 -> 15.4mb // 3 -> 14.2mb // 4 -> 14.3mb // 5 -> 19.1mb // 6 -> 19mb // 7 -> 18.6mb ```
damian101
2023-12-28 07:21:19
depending on the content, it is
2023-12-28 07:21:41
that's quite size and quality difference, though
2023-12-28 07:21:52
whatkind ofimage was encoded?
qdwang
2023-12-28 07:30:39
a linear data from 14bit raw file
damian101
2023-12-28 07:32:21
oh
2023-12-28 07:32:27
yeah, that makes sense then
2023-12-28 07:33:00
5 6 7 should be much closer in quality to the target quality
qdwang
2023-12-28 07:33:17
I noticed that linear image contains a lot of low value data, so I have to set the transfer function to linear.
2023-12-28 07:33:39
I have to use effort: 7 with distance: 0.2 to get visually lossless
2023-12-28 07:34:12
if I want to increase the brightness of low value parts after the convertion
2023-12-28 07:35:18
larger than d0.2 will produce some artifact in low light parts like this: https://discord.com/channels/794206087879852103/794206170445119489/1189992488195334277
damian101
I have to use effort: 7 with distance: 0.2 to get visually lossless
2023-12-28 07:38:23
yeah, that should not be
2023-12-28 07:38:37
is color metadata set correctly?
larger than d0.2 will produce some artifact in low light parts like this: https://discord.com/channels/794206087879852103/794206170445119489/1189992488195334277
2023-12-28 07:39:03
is brightness boosted or not?
qdwang
2023-12-28 07:39:21
since the data is directly from uncompressed rgb dng, i set JxlPrimaries to 2100 and JxlTransferFunction to Linear
is brightness boosted or not?
2023-12-28 07:39:48
no, just raw uncompressed rgb values
2023-12-28 07:40:01
not even white balanced
damian101
no, just raw uncompressed rgb values
2023-12-28 07:40:15
but correctly decoded
2023-12-28 07:40:36
or just linear interpreted as a gamma transfer
qdwang
2023-12-28 07:40:56
In fact, I'm test the DNG spec 1.7
damian101
2023-12-28 07:41:12
displaying linear on a normal display without transfer curve conversion is just incorrect
qdwang
2023-12-28 07:41:55
I replace the RGB part in the DNG with the encoded JXL data. Now it's a JXL DNG.
2023-12-28 07:42:33
Then I put the dng to lightroom, the color and birghtness display correctly.
2023-12-28 07:49:52
As I know, JXL will reduce the quality in darker area. Since a linear data are darker in value, so I guess JXL will reduce the quality averagely. Maybe that's the reason why I need to set distance to a smaller value to keep the darker area quality.
jonnyawsom3
2023-12-28 07:52:57
You could also try Adobe's DNG converter which I experimented with fairly recently
damian101
As I know, JXL will reduce the quality in darker area. Since a linear data are darker in value, so I guess JXL will reduce the quality averagely. Maybe that's the reason why I need to set distance to a smaller value to keep the darker area quality.
2023-12-28 07:56:57
no, JXL uses its own brightness curve internally, if the encoder knows the transfer curve during encoding, transfer curve does not make a difference for quality
qdwang
You could also try Adobe's DNG converter which I experimented with fairly recently
2023-12-28 08:21:55
I've tried that, but adobe dng converter has a poor jxl encoding quality.
no, JXL uses its own brightness curve internally, if the encoder knows the transfer curve during encoding, transfer curve does not make a difference for quality
2023-12-28 08:22:33
But why changing the transfer curve metadata can affect the final result file size?
damian101
But why changing the transfer curve metadata can affect the final result file size?
2023-12-28 08:23:24
only change the color metadata if it's incorrect of course, or missing
2023-12-28 08:27:33
if source metadata is missing, you can do something like this instead: `-x color_space=RGB_D65_DCI_Rel_Lin`
2023-12-28 08:28:57
or also add intended target luminance: `-x color_space=RGB_D65_DCI_Rel_Lin --intensity_target 250`
qdwang
since the data is directly from uncompressed rgb dng, i set JxlPrimaries to 2100 and JxlTransferFunction to Linear
2023-12-28 08:37:20
I already said that I set the transfer function
damian101
I already said that I set the transfer function
2023-12-28 08:39:19
well, but I did not understand that sentence...
2023-12-28 08:39:25
no idea what a DNG is...
2023-12-28 08:39:45
Setting JxlPrimaries to 2100?
2023-12-28 08:39:51
what does that mean?
2023-12-28 08:40:13
why 2100
Quackdoc
2023-12-28 08:40:25
jxl uses 2100 instead of 2020 for gamut
damian101
2023-12-28 08:40:32
ah
2023-12-28 08:40:35
why though
2023-12-28 08:40:37
that's dumb
2023-12-28 08:40:44
literally the same
Quackdoc
2023-12-28 08:40:51
yeah it felt weird to me too,
2023-12-28 08:41:04
damian101
2023-12-28 08:41:27
just lemme use my cicp numbers...
Quackdoc
2023-12-28 08:43:34
iirc they align with the cicp numbers, it just doesnt have the full support for them
2023-12-28 08:45:16
~~oh wait maybe not~~ no it does
damian101
2023-12-28 08:51:13
but, where do you set that "JxlPrimaries" value
Quackdoc
2023-12-28 08:58:14
maybe an 3rd party tool linking to libjxl
jonnyawsom3
I've tried that, but adobe dng converter has a poor jxl encoding quality.
2023-12-28 09:14:56
You can use it in the command line and specify quality and effort
2023-12-28 09:17:04
https://helpx.adobe.com/content/dam/help/en/camera-raw/digital-negative/jcr_content/root/content/flex/items/position/position-par/download_section/download-1/dng_converter_commandline.pdf
2023-12-28 09:17:19
https://discord.com/channels/794206087879852103/803574970180829194/1187038265795149914
Traneptora
literally the same
2023-12-29 02:38:48
it doesn't particularly matter what it's called, BT.2100 though specifies HDR and BT.2020 specifies an SDR space
damian101
2023-12-29 02:39:20
right
2023-12-29 02:40:29
But the oldest specification, unless older than BT.709, is usually the one that is named.
Traneptora
2023-12-29 02:40:59
I mean sRGB and BT.709 have the same primaries
2023-12-29 02:41:04
and BT.709 is older
2023-12-29 02:41:25
should it say BT.709 instead?
VcSaJen
2023-12-29 07:15:17
It seems like people don't like unstable API and poor error handling, judging by github issues and comments in open source projects, some even opt to use cjxl/djxl executables instead of libjxl API. Will those problems go away in 1.0?
qdwang
You can use it in the command line and specify quality and effort
2023-12-29 10:43:26
thanks for mentioning this. I'll have a try
2023-12-29 10:57:46
<@238552565619359744> quite weird. I'm trying Adobe DNG converter cmd with this ARW photo: https://www.dpreview.com/sample-galleries/0740273820/sony-a7cr-sample-gallery/8613531963 by using this parameters: `converter -jxl -jxl_distance 0.25 -jxl_effort 7 20230813-0187.ARW`. The original arw file size is: 79MB The generated dng file size is: 65.3MB <- it shouldn't be this large
2023-12-29 10:59:35
I manually created a DNG with `distance 0.25` and `effort 7`from the same ARW, it's only 14MB. There must be something wrong with the Adobe DNG converter
jonnyawsom3
2023-12-29 11:00:00
Try `-lossyMosaicJXL`
qdwang
2023-12-29 11:00:10
Great. That makes sense.
Try `-lossyMosaicJXL`
2023-12-29 11:00:51
I knew, `-lossyMosaicJXL` keeps the bayer pattern and lossless, it's about 23.7MB
2023-12-29 11:01:30
What I mean is, `-jxl` doesn't work right in Adobe DNG converter
2023-12-29 11:02:41
For example, if you try this on an Apple ProRAW(which is RGB linear dng), it works poorly.
2023-12-29 11:03:12
I tested on one ProRAW dng, only 61.5MB to 59.2MB
jonnyawsom3
2023-12-29 11:03:37
Oh, wait
<@238552565619359744> quite weird. I'm trying Adobe DNG converter cmd with this ARW photo: https://www.dpreview.com/sample-galleries/0740273820/sony-a7cr-sample-gallery/8613531963 by using this parameters: `converter -jxl -jxl_distance 0.25 -jxl_effort 7 20230813-0187.ARW`. The original arw file size is: 79MB The generated dng file size is: 65.3MB <- it shouldn't be this large
2023-12-29 11:04:37
I think you need to specify `-lossy` or `-lossyJXL` along with those arguments, the command line is very cursed for the converter
qdwang
I think you need to specify `-lossy` or `-lossyJXL` along with those arguments, the command line is very cursed for the converter
2023-12-29 11:06:13
`-lossy` works
jonnyawsom3
2023-12-29 11:06:15
In my brief testing it required specific ordering of arguments, complete file paths and redundant commands (Such as `-lossy` and `-jxl_distance` at the same time)
2023-12-29 11:06:44
Sometimes it would throw a missing file error, sometimes it would do nothing at all
qdwang
2023-12-29 11:06:47
Thank you~
jonnyawsom3
2023-12-29 11:07:47
No problem, just remember to throw the results in here somewhere
qdwang
2023-12-29 11:30:09
Now the result size are normal. But since it's small tile based, it's still a littlbe big larger than a file from an whole image JXL encoding process.
2023-12-29 11:36:28
I have a question about JXL. Will JXL encoder treat all dark image differently to a high dynamic range image? For example: I have two 1000x1000 linear RGB 16bit images. One is all dark colors like values below 50. The other contains colors across the whole 16bit range from 0 - 65535. Assume these is a same 50 * 50 square in the center of both images, the RGB values in it are below 50. Will JXL treat the two squares differently? (I mean with the same parameters, will the image quality for these two squares different from each other?)
damian101
I have a question about JXL. Will JXL encoder treat all dark image differently to a high dynamic range image? For example: I have two 1000x1000 linear RGB 16bit images. One is all dark colors like values below 50. The other contains colors across the whole 16bit range from 0 - 65535. Assume these is a same 50 * 50 square in the center of both images, the RGB values in it are below 50. Will JXL treat the two squares differently? (I mean with the same parameters, will the image quality for these two squares different from each other?)
2023-12-29 11:47:17
since the high dynamic range square will be way brighter, it will of course take much more bits to store at the same perceptual quality
2023-12-29 11:47:56
I wonder how much cjxl takes global contrast into account...
2023-12-29 11:48:29
probably depends on pixel distance
qdwang
2023-12-29 02:13:48
<@238552565619359744> it seems i cannot set `-jxl_distance` when using `-lossyMosaicJXL`
jonnyawsom3
2023-12-29 02:14:17
I shared everything I had tried and found out, sorry
qdwang
I shared everything I had tried and found out, sorry
2023-12-29 02:17:30
anyway, thank you~
afed
2024-01-02 01:04:06
up to 5% is noticeable, is it worth it? https://github.com/libjxl/libjxl/pull/3084
2024-01-02 01:04:36
any plans to add support for streaming png at least for input? maybe not the most important for server use, but for users it would be beneficial as the most used lossless format to avoid additional conversion steps
veluca
2024-01-02 01:26:23
I think a 5% difference between streaming and non-streaming is pretty reasonable
afed
2024-01-02 01:36:55
i thought it was a 5% difference for streaming before and after these changes
2024-01-02 02:00:32
<@179701849576833024> <@794205442175402004> this ssimulacra2 implementation uses "true" gaussian blur is there any reason why libjxl uses recursive? for optimizations that can't be implemented for the "true" one and recursive can always be performed faster and for less memory consumption? or accuracy is enough for jxl, but still might be useful for ssimulacra? <https://github.com/dnjulek/vapoursynth-ssimulacra2>
2024-01-02 02:00:36
veluca
afed i thought it was a 5% difference for streaming before and after these changes
2024-01-02 02:05:24
ehhh old streaming mode was pretty much the same as non-streaming anyway 🙂
afed
veluca ehhh old streaming mode was pretty much the same as non-streaming anyway 🙂
2024-01-02 02:47:35
even this one? https://discord.com/channels/794206087879852103/803645746661425173/1184615338319548538
veluca
2024-01-02 02:49:30
at least on my test set
_wb_
afed <@179701849576833024> <@794205442175402004> this ssimulacra2 implementation uses "true" gaussian blur is there any reason why libjxl uses recursive? for optimizations that can't be implemented for the "true" one and recursive can always be performed faster and for less memory consumption? or accuracy is enough for jxl, but still might be useful for ssimulacra? <https://github.com/dnjulek/vapoursynth-ssimulacra2>
2024-01-02 03:34:47
In my experience the accuracy of the blur (or even the sigma and kernel size) don't matter that much for the accuracy of the ssim/ssimulacra2 metrics...
Quackdoc
2024-01-02 09:16:33
hmm for ssimulacra2rs it seemed to have a fairly important accuracy hit when I tried to use a simple 2 pass box blur
Moritz Firsching
MSLP will libjxl-0.8.x be receiving any security updates, now that 0.9 is out? I'm asking in the context of possible jxl support removal from cromite browser https://github.com/uazo/cromite/issues/627 if upgrading chromium code for compatibility with libjxl-0.9 will pose a problem.
2024-01-03 03:05:44
I made a patch so that chrome compiles with current v0.9.0 libjxl version here: https://chromium-review.googlesource.com/c/chromium/src/+/5163728
afed
2024-01-03 04:15:55
<@179701849576833024> what about blue noise? <https://github.com/libjxl/libjxl/pull/1362#issuecomment-1242313023>
veluca
2024-01-03 04:18:18
I just wrote the code
2024-01-03 04:18:30
<@532010383041363969> can deal with figuring out the best matrix 😛
Jyrki Alakuijala
2024-01-03 10:32:43
photon noise is blue noise (or violet, dunno) -- noise that has a minimal low frequency part
2024-01-03 10:33:53
since we are at the edge of what can be observed we probably don't want to spend a lot of computation for the dithering, and probably don't need blue noise kind of approaches for the usual dithering from 24 bits to 30 or more
Moritz Firsching
2024-01-04 08:48:18
Do you mean stable chrome releases? The patch shouldn't be much different, I suppose? Considering that there are a few downstream projects that patch back libjxl into flavours of chromium, I think it would make much sense to have this behind a build flag which is disabled by default, to avoid having to deal with these patches
jonnyawsom3
2024-01-05 07:42:10
Not sure how that happened https://github.com/libjxl/libjxl/issues/3111
spider-mario
2024-01-05 10:05:54
sounds like a regression, so should be bisectable
yoochan
2024-01-06 08:41:30
Went for the bug, stayed for the dancing banana 🍌
Traneptora
2024-01-06 08:51:24
`libjxl/lib/extras/dec/pnm.cc` contains the follwing function: ```cpp StatusOr<ChunkedPNMDecoder> ChunkedPNMDecoder::Init(const char* path) { ChunkedPNMDecoder dec; // stuff return std::move(dec); } ``` Something about this doesn't make sense to me, namely that (1) `dec` is stack-allocated, which means it is de-allocated when the stack frame disappears, regardless of `std::move` (2) `std::move`, as far as I understand, invalidates the previous reference, so strings, etc. don't need to be duplicated when, say, pushed back onto a vector. However, I don't understand what it accomplishes here, because as soon as the function call returns, the local variable `dec` falls out of scope, and since `std::move` explicitly prevents duplication of objects, it won't duplicate `dec` before it falls out of scope. That said, i'm not a C++ programmer, I'm a C programmer, so might be misunderstanding something here. Can someone enlighten me?
lonjil
2024-01-06 08:59:04
I think this is like returning a struct in C. The object will be returned in registers, or on the stack, according to the ABI rules. This may involve the data being copied to another location. The move would make the previous location of the data invalid, but I think that's moot because returning makes previous location of the data inaccessible anyway.
Traneptora
lonjil I think this is like returning a struct in C. The object will be returned in registers, or on the stack, according to the ABI rules. This may involve the data being copied to another location. The move would make the previous location of the data invalid, but I think that's moot because returning makes previous location of the data inaccessible anyway.
2024-01-06 09:05:20
Returning a struct in C passes the entire value of the struct, well, by value.
lonjil
2024-01-06 09:05:46
which is what is being done in that code snippet
Traneptora
2024-01-06 09:05:55
yea, but `std::move` prevents that copy, iirc.
lonjil
2024-01-06 09:06:00
no
spider-mario
2024-01-06 09:06:17
`return std::move` is now useless (https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1579) but not for the reasons stated
2024-01-06 09:06:32
`std::move` doesn’t intrinsically move anything or invalidate any reference
Traneptora
2024-01-06 09:06:57
well "invalidate" no but it tells the complier that it can move const things (e.g. strings) without copying, right?
spider-mario
2024-01-06 09:07:02
all it does is convert its argument to an rvalue reference, causing the moving constructor/assignment operators to be called instead of the usual copy one
Traneptora well "invalidate" no but it tells the complier that it can move const things (e.g. strings) without copying, right?
2024-01-06 09:07:11
it doesn’t
Traneptora
2024-01-06 09:07:19
hm?
2024-01-06 09:07:29
I'm not really sure what an "rvalue" reference is cause I'm not a C++ programmer
spider-mario
2024-01-06 09:08:04
``` std::string b = std::move(a); ``` will initialise `b` with an rvalue reference to `a` and cause it to “steal” `a`’s buffer instead of creating a new one
2024-01-06 09:08:21
but it still copies the pointer in the struct, so to speak
2024-01-06 09:08:26
(the pointer to said buffer)
lonjil
2024-01-06 09:08:27
I don't speak C++ so I'll write this in C. Say you have something like ```c struct { char *str; size_t len; } ``` A move constructor would create a new struct of the same type, copy over the pointer and length, and then "invalidate" the original to a valid but defunct value, like setting the length to 0 and the pointer to NULL.
spider-mario
2024-01-06 09:08:39
it then leaves `a` in a “valid but unspecified” state
Traneptora
spider-mario ``` std::string b = std::move(a); ``` will initialise `b` with an rvalue reference to `a` and cause it to “steal” `a`’s buffer instead of creating a new one
2024-01-06 09:09:08
the reason I'm confused ig is cause I don't know how strings work in C++. If you did `const char *b = a;` in C, that's exactly what would happen unless you explicitly called `strdup`
lonjil
2024-01-06 09:09:58
C++'s string type is a struct that has a pointer and stuff inside of it.
Traneptora
lonjil I don't speak C++ so I'll write this in C. Say you have something like ```c struct { char *str; size_t len; } ``` A move constructor would create a new struct of the same type, copy over the pointer and length, and then "invalidate" the original to a valid but defunct value, like setting the length to 0 and the pointer to NULL.
2024-01-06 09:10:16
oh, so a class has to *declare* a move construct, which explicitly specifies how it interacts with `std::move`?
lonjil
2024-01-06 09:10:29
I think there's a default?
Traneptora
2024-01-06 09:10:39
sure, but you see what I mean, right?
lonjil
2024-01-06 09:11:04
yes, but when implementing it you do have to follow the rules as to what a move constructor is supposed to do
2024-01-06 09:11:18
initialize a new object, invalidate the old object
2024-01-06 09:11:32
as opposed to a copy constructor which leaves the old object valid
Traneptora
2024-01-06 09:11:44
ye, I see. there's a specific type of constructor called a "move constructor" that is called when someone calls `std::move` and it must behave in specific ways or the class is noncompliant
lonjil
2024-01-06 09:11:52
yeah
Traneptora
2024-01-06 09:11:56
I didn't realize that was a thing
2024-01-06 09:12:23
but *that being said* what does `return std::move(foo);` at the end of a function do, if `foo` falls out of scope immediately? How is it different from `return foo;`
lonjil
2024-01-06 09:12:28
In Rust, they decided that moves should not have constructors, and that instead, all moveable objects must be memcpy-able.
Traneptora but *that being said* what does `return std::move(foo);` at the end of a function do, if `foo` falls out of scope immediately? How is it different from `return foo;`
2024-01-06 09:17:28
I'm pretty sure at least in theory `return std::move(foo)` is always redundant.
spider-mario
Traneptora but *that being said* what does `return std::move(foo);` at the end of a function do, if `foo` falls out of scope immediately? How is it different from `return foo;`
2024-01-06 09:18:31
in the absence of https://en.cppreference.com/w/cpp/language/copy_elision, I guess `return foo;` would return the value by copy
lonjil I'm pretty sure at least in theory `return std::move(foo)` is always redundant.
2024-01-06 09:19:21
it used not to, if it called a conversion operator that could take the value by rvalue reference
2024-01-06 09:20:38
prior to the defect report above, if a function had `StatusOr<T>` as its return type and did `return t;`, it would call `StatusOr<T>`’s constructor that takes `t` by value even if `t` was a local variable that was going to be immediately destroyed anyway
2024-01-06 09:21:07
you had to use `return std::move(t);` for it to call `StatusOr<T>::StatusOr(T&&)`
lonjil
2024-01-06 09:21:53
aha
spider-mario
2024-01-06 09:22:41
2024-01-06 09:24:29
(also, it’s not redundant if `foo` is not a local variable, for example it could be a class member being “given away” by a method, especially a method declared `&&`)
lonjil
2024-01-06 09:29:58
oh, yeah, I meant when it's a local variable
kkourin
spider-mario in the absence of https://en.cppreference.com/w/cpp/language/copy_elision, I guess `return foo;` would return the value by copy
2024-01-06 10:23:00
you mean in general? or in this case with the conversion?
spider-mario
2024-01-06 10:23:20
in general
kkourin
2024-01-06 10:23:32
I thought it was move (in general)
2024-01-06 10:25:17
I don't recall the exact language mechanism, but I believe it will try to move before it makes it a copy
veluca
lonjil In Rust, they decided that moves should not have constructors, and that instead, all moveable objects must be memcpy-able.
2024-01-06 10:25:40
best decision ever
kkourin
2024-01-06 10:26:12
for example, try returning a std::unique_ptr, but disable copy elision
veluca
2024-01-06 10:26:35
I believe that's not guaranteed to compile without a `std::move` before some version of C++
2024-01-06 10:27:41
there's also some version that does this "guaranteed return value optimization" thing, where returning a local *doesn't even move it*, but just directly constructs it into the local of the caller (I believe... <@604964375924834314> can you confirm? xD)
kkourin
2024-01-06 10:28:57
that guaranteed copy elision is from C++17. I don't know the exact specification but I think it mainly applies to if you do somehthihng like `return MakeMyThing(args);`
spider-mario
kkourin I don't recall the exact language mechanism, but I believe it will try to move before it makes it a copy
2024-01-06 10:31:47
right, I wasn’t fully sure so I kind of meant my “in the absence of” to encompass “if it currently applies, then in a hypothetical world where it wouldn’t”
Traneptora
spider-mario (also, it’s not redundant if `foo` is not a local variable, for example it could be a class member being “given away” by a method, especially a method declared `&&`)
2024-01-07 02:42:16
in either case I ask because gcc is warning me about `-Wredundant-move`
kkourin
2024-01-07 03:25:01
It looks to me this is because GCC fixes the issue spider-mario made a screenshot of, despite it technically not being part of the original C++11 spec
Traneptora in either case I ask because gcc is warning me about `-Wredundant-move`
2024-01-07 03:25:39
see the second half of
Pieter
2024-01-07 03:28:15
I remember reading that in some cases, `return std::move(t);` where `t` is a local variable may interfere with optimizations. But maybe since C++17 that is no longer the case?
kkourin
2024-01-07 03:31:23
I think that's still right. I think there are still many normal uses which are not covered by mandatory copy elision
Pieter I remember reading that in some cases, `return std::move(t);` where `t` is a local variable may interfere with optimizations. But maybe since C++17 that is no longer the case?
2024-01-07 03:40:50
Actually looking closer, I don't think mandatory copy elision will affect expressions of the form `return std::move(t)` Not really sure if there's anything else in C++17 either
Pieter
kkourin Actually looking closer, I don't think mandatory copy elision will affect expressions of the form `return std::move(t)` Not really sure if there's anything else in C++17 either
2024-01-07 03:53:08
Does mandatory copy elision still apply to such expressions?
2024-01-07 03:56:45
Hmm, apparently not based on some searching. Ok, so in case `t` is a local variable, using `return std::move(t)` is not merely redundant, it is actually worse as it interferes with elision (and even if elision wasn't applicable, a move would still be used without `std::move`).
kkourin
Pieter Hmm, apparently not based on some searching. Ok, so in case `t` is a local variable, using `return std::move(t)` is not merely redundant, it is actually worse as it interferes with elision (and even if elision wasn't applicable, a move would still be used without `std::move`).
2024-01-07 04:01:21
Yeah I believe that's the general guidance. It looks like GCC even separates between the two cases with different warnings: `-Wno-pessimizing-move` for when copy elision was missed due to `std::move`, and `-Wno-redundant-move` for when copy elision could not be done but `std::move` is pointless anyways because C++ says to fallback to moving even without `std::move`
yoochan
2024-01-07 05:10:04
(sidequest : does someone knows how to pass explicit flags to the compiler ? I would like to compile for my cpu, like with `-march=native` on gcc/g++ but libjxl recommend clang, and I'm not sure how to do, nor if it would change anything)
2024-01-07 05:11:06
(does someone have a CPU which supports AVX512 ?!)
Oleksii Matiash
yoochan (does someone have a CPU which supports AVX512 ?!)
2024-01-07 05:39:36
I have
yoochan
2024-01-07 05:45:12
does libjxl works really better on it ? 😄
Oleksii Matiash
yoochan does libjxl works really better on it ? 😄
2024-01-07 05:52:07
Don't think so: JPEG XL encoder v0.9.0 6768ea8 [AVX2,SSE4,SSSE3,SSE2], so no AVX512 🤷‍♂️
yoochan
2024-01-07 05:53:23
is it a version you recompiled ? or the one distributed on github ?
Oleksii Matiash
2024-01-07 05:55:07
Distributed on github. I did not and will not compile it myself, sorry
yoochan
2024-01-07 05:55:58
what cpu do you have ? just curious ?
Oleksii Matiash
2024-01-07 05:57:13
Ryzen 7950X
jonnyawsom3
Oleksii Matiash Don't think so: JPEG XL encoder v0.9.0 6768ea8 [AVX2,SSE4,SSSE3,SSE2], so no AVX512 🤷‍♂️
2024-01-07 06:57:11
AVX512 was removed by default because of binary size, build times and low overall support for the extension IIRC
_wb_
2024-01-07 10:10:56
Correct. There are also several variants of it, so if you can compile for the specific variant you have if you want. For general-purpose builds, it's not really worth the binary bloat at this point (given overall support) so it's disabled by default, but if you want to make a specific build for your cpu, by all means check what the latest hwy can do and build for just the best target (that should result in a smaller binary size and be faster than default, at the cost of only working on your cpu).
veluca
2024-01-07 11:35:17
I'll try it out once I update my computer
yoochan
AVX512 was removed by default because of binary size, build times and low overall support for the extension IIRC
2024-01-08 08:32:02
the initial question was, how to pass an equivalent of -march=native to clang ? with the cmake/make process ?
veluca
2024-01-08 09:47:36
-DCMAKE_CXX_FLAGS=-march=native
2024-01-08 09:47:42
but you don't need that
2024-01-08 09:47:55
you just need to disable the code that turns off AVX3 in hwy
yoochan
2024-01-08 09:50:26
By default gcc, if you don't specify otherwise, will compile with x86_64 as a target (to be precise : `-mtune=generic -march=x86-64`), which may skip some vectorization/optimizations
2024-01-08 09:51:12
won't it ?
veluca
2024-01-08 09:51:57
most of the performance-intensive code in libjxl is manually vectorized, and it tells gcc/clang to enable the appropriate vectorization targets in these functions
yoochan
2024-01-08 09:52:29
ok, I get it
2024-01-08 09:57:26
thank you for the answer 🙂 I'll test with and without, just to see if it change the perf 😄
Traneptora
yoochan (sidequest : does someone knows how to pass explicit flags to the compiler ? I would like to compile for my cpu, like with `-march=native` on gcc/g++ but libjxl recommend clang, and I'm not sure how to do, nor if it would change anything)
2024-01-09 11:09:59
you can also tweak cflags after running cmake by running `ccmake` in your build directory
2024-01-09 11:10:44
it gives you a curses UI that lets you change settings
2024-01-09 11:10:51
might have to push `t` to enable advanced mode
yoochan
2024-01-10 06:09:51
Oooh, i'm learning something!
fab
Traneptora you can also tweak cflags after running cmake by running `ccmake` in your build directory
2024-01-10 10:33:12
Don't tweak. We wants bug to be fixed
2024-01-10 10:33:33
Se this: [libjxl/libjxl] Issue opened: #3123 Visible artifacts on the blue channel
Moritz Firsching
2024-01-11 11:59:14
new release: https://github.com/libjxl/libjxl/releases/tag/v0.9.1 artifacts should appear shortly...
fab
2024-01-11 12:15:44
2024-01-11 01:31:38
Demiurge
2024-01-11 03:08:16
congrats on adding dithering to libjxl!
2024-01-11 03:08:26
It's too bad that it happened AFTER the 0.9 release
veluca
2024-01-11 03:16:17
wait for the next one 😛
Demiurge
2024-01-11 03:50:01
Things like color banding, which noticeably stick out and can make or break someone's first impression of a new format... it would be nice to rush that out to a release build...
2024-01-11 03:51:48
otherwise people will get the wrong impression that the format is bad at handling dark gradients or something
2024-01-11 03:52:37
Oh, also, someone offered a really great suggestion of using a blue noise pattern for dithering instead of the "ordered" pattern
2024-01-11 03:53:10
And there's a great website that has a python script useful for generating matrices of any size with the blue noise pattern
fab
2024-01-11 03:55:48
2024-01-11 04:00:54
Other Release: Save to Jon computer
afed
2024-01-11 04:03:31
https://discord.com/channels/794206087879852103/804324493420920833/1192234113223102535
fab
2024-01-11 04:03:40
I'm annoying WhatsApp
Oleksii Matiash
2024-01-11 04:05:29
Guys, do somebody have admin rights here?
fab
2024-01-11 04:08:34
Jon i'm sorry but my hearing sucks.
Oleksii Matiash Guys, do somebody have admin rights here?
2024-01-11 04:09:56
I finished
2024-01-11 04:11:20
Encoding ready
Oleksii Matiash Guys, do somebody have admin rights here?
2024-01-11 04:11:30
Jon is the Admin.
Demiurge
2024-01-11 04:13:08
Blue noise needs a larger matrix than 8x8 though, otherwise tiling in the noise pattern will be more noticeable.
fab
2024-01-11 04:25:50
2024-01-11 04:26:11
<@1028567873007927297> pleasE Help
Demiurge
2024-01-11 04:34:17
Weirdo.
fab
2024-01-11 04:44:31
Last libJpg encoder
2024-01-11 04:45:06
2024-01-11 04:49:05
After 17 releases
2024-01-11 05:04:18
My voice encoded
spider-mario
2024-01-11 05:14:22
<@416586441058025472> could you please keep off-topic content to <#806898911091753051> ?
fab
2024-01-11 05:14:40
I did a 26900hz SINGING
spider-mario <@416586441058025472> could you please keep off-topic content to <#806898911091753051> ?
2024-01-11 05:14:46
Sure
spider-mario
2024-01-11 05:14:57
thanks
fab
2024-01-11 05:49:26
do better
2024-01-11 06:09:37
For the original tag me
2024-01-11 06:10:05
spider-mario
2024-01-11 06:18:17
<@416586441058025472> I think that this would count as off-topic, since this channel is <#804324493420920833> and this content does not appear to be related to libjxl
fab
2024-01-11 06:19:39
<@604964375924834314> Done.
jonnyawsom3
2024-01-11 06:42:18
Fab is an enigma
afed https://discord.com/channels/794206087879852103/804324493420920833/1192234113223102535
2024-01-11 06:43:19
<@318186133320237058> That was in response to your blue noise mention by the way, if Fab made you miss it
veluca
2024-01-11 07:10:24
I'm not convinced that blue noise would give so significant benefits when dithering to 8 bits... but I am willing to be proven wrong 🙂
vtorri
2024-01-11 07:31:17
C:/Documents/msys2/home/vincent.torri/ewpi_64/share/ewpi/packages/libjxl/libjxl-0.9.1/lib/jxl/cms/jxl_cms.cc:1327:39: error: function 'const JxlCmsInterface* jxl::JxlGetDefaultCms()' definition is marked dllimport 1327 | JXL_CMS_EXPORT const JxlCmsInterface* JxlGetDefaultCms() { | ^~~~~~~~~~~~~~~~
Demiurge
2024-01-11 09:10:24
Then again maybe a bayer matrix is better since the dither noise is kinda predictable and slightly easier to compress for most compression algorithms
2024-01-11 09:11:04
And yeah when dithering to 8 bits it doesn't matter much if it's a bayer matrix or a void-and-cluster matrix
2024-01-11 09:11:33
But still theoretically it's cooler and visually at lower bit depths it does preserve more detail