|
_wb_
|
2021-10-12 08:12:38
|
I hope we can get the Working Draft of 18181-1-Ed.2 out as a result of it
|
|
2021-10-12 08:12:53
|
So we finally have a decent publicly available spec
|
|
2021-10-12 08:17:55
|
I will also be arguing in favor of hosting the draft on a public git repo (github or gitlab), so we can allow anyone to report spec bugs and even propose fixes or editorial improvements there
|
|
2021-10-12 08:18:50
|
We are working in TeX+git now, thanks to <@179701849576833024>'s hard work
|
|
|
spider-mario
|
2021-10-12 08:33:00
|
oh, so it’s confirmed?
|
|
|
|
veluca
|
2021-10-12 08:49:02
|
What's *not* confirmed is what it is ISO will want from us
|
|
2021-10-12 08:49:26
|
But writing that conversion is likely by far less work, and more fun and more useful, than working in word
|
|
|
spider-mario
|
2021-10-12 08:59:16
|
ah, so even assuming that they still want a word doc, we still prefer converting one way and then back?
|
|
|
|
veluca
|
2021-10-12 09:20:55
|
I certainly do
|
|
|
_wb_
|
2021-10-12 10:05:18
|
So do I
|
|
2021-10-12 10:06:26
|
We will try to get them to accept an XML version instead, which is what they need anyway (they just happen to have software to convert Word to XML)
|
|
2021-10-12 10:07:15
|
In the end, the only difference between the draft and the thing ISO publishes will be the boilerplate stuff
|
|
2021-10-12 10:07:56
|
And it doesn't matter much in practice how long ISO will take to publish the 2nd edition
|
|
2021-10-12 10:08:14
|
(everyone will use the draft anyway)
|
|
|
Fraetor
|
2021-10-12 11:34:44
|
Especially as no one can see the ISO publication, due to the paywall...
|
|
|
lithium
|
|
lithium
Update gaborish=0 result, nonphoto_separation branch.
> denoise-png 414,581 => jxl 756,760
> denoise-png 962,047 => jxl 851,624
> denoise-png 4,050,574 => jxl 3,226,185
> cjxl -d 1.0 -e 8 --separate=1 --gaborish=0 --num_threads=12
|
|
2021-10-12 02:59:11
|
Update lossy modular result, nonphoto_separation branch.
> denoise-png 414,581 => jxl 1,750,254
> denoise-png 962,047 => jxl 2,119,818
> denoise-png 4,050,574 => jxl 3,756,559
> cjxl -m -Q 90 -e 8 --num_threads=12
|
|
|
Cool Doggo
|
2021-10-12 04:36:43
|
Does this mean denoised png to jxl, or denoised png compared to jxl
|
|
|
lithium
|
|
Cool Doggo
Does this mean denoised png to jxl, or denoised png compared to jxl
|
|
2021-10-12 04:43:21
|
denoised png compress to(=>) jxl
|
|
|
Cool Doggo
|
|
_wb_
|
2021-10-12 05:21:27
|
Seems strange that the jxl is larger than the png
|
|
|
lithium
|
|
lithium
Update lossy modular result, nonphoto_separation branch.
> denoise-png 414,581 => jxl 1,750,254
> denoise-png 962,047 => jxl 2,119,818
> denoise-png 4,050,574 => jxl 3,756,559
> cjxl -m -Q 90 -e 8 --num_threads=12
|
|
2021-10-13 08:36:40
|
Update mozjpeg and webp-lossy result,
look like only avif and jxl --separate(have some issue) can correct process those image.
(denoised png compress to(=>) <lossy-format>)
> denoise-png 414,581 => jpg 6,269,979
> denoise-png 962,047 => jpg 6,749,052
> denoise-png 4,050,574 => jpg 7,381,455
> mozjpeg-cjpeg -optimize -progressive -quality 90 -sample 1x1
> denoise-png 414,581 => webp-lossy 4,296,090
> denoise-png 962,047 => webp-lossy 4,533,530
> denoise-png 4,050,574 => webp-lossy 5,006,958
> cwebp -mt -m 6 -q 90 -sharp_yuv -pre 4 -af
|
|
|
Cool Doggo
|
2021-10-13 11:28:49
|
What sources are you using?
|
|
|
lithium
|
|
Cool Doggo
What sources are you using?
|
|
2021-10-13 11:32:41
|
manga,comic content(black and white or grayscale).
> https://discord.com/channels/794206087879852103/794206170445119489/895950366837981234
> https://discord.com/channels/794206087879852103/794206087879852106/889546375208005653
|
|
|
diskorduser
|
|
lithium
manga,comic content(black and white or grayscale).
> https://discord.com/channels/794206087879852103/794206170445119489/895950366837981234
> https://discord.com/channels/794206087879852103/794206087879852106/889546375208005653
|
|
2021-10-13 11:38:43
|
Could you provide the source image?
|
|
|
Cool Doggo
|
2021-10-13 11:48:19
|
I find it very strange that none of them would beat png
|
|
2021-10-13 11:48:33
|
Especially lossy webp <:Thonk:805904896879493180>
|
|
|
lithium
|
2021-10-13 11:51:03
|
> https://discord.com/channels/794206087879852103/794206087879852106/885516651657822219
// and new test page.
|
|
2021-10-13 12:00:09
|
nonphoto_separation branch cjxl-windows-AVX2-mingw64
|
|
|
fab
|
2021-10-13 01:14:45
|
this requires libgcc
|
|
2021-10-13 01:15:45
|
or try with this
|
|
2021-10-13 01:15:46
|
https://artifacts.lucaversari.it/libjxl/libjxl/2021-10-10T22%3A46%3A20Z_8e0e89a1072731c6b3dea4d11dd9bf58f20912fa/
|
|
2021-10-13 01:15:58
|
input
|
|
2021-10-13 01:15:59
|
for %i in (C:\Users\Utente\Documents\88we8\*.jpg) do cjxloctober9 -j -s 9 -d 1 %i %i.jxl
for %i in (C:\Users\Utente\Documents\322\*.jpg) do cjxloctober9 -j -d 0.538 --faster_decoding=6 -I 0.768 -s 8 --use_new_heuristics %i %i.jxl
|
|
2021-10-13 01:16:23
|
the second will be far better for high bitrate re encoding
|
|
2021-10-13 01:18:22
|
no it output 6,5 mb
|
|
|
lithium
nonphoto_separation branch cjxl-windows-AVX2-mingw64
|
|
2021-10-13 01:20:27
|
Try Just to increase distance try 2.81
|
|
2021-10-13 01:25:11
|
I'll try to report some bench
|
|
|
lithium
|
2021-10-13 01:53:30
|
Look like my build don't have libgcc static link...
I don't want increase distance to 2.81, that distance is too risk for keep quality.
|
|
|
fab
|
2021-10-13 02:11:07
|
for %i in (C:\Users\Utente\Documents\test\*.png) do cjxloctober9 -s 7 --epf=3 -q 28.99 -I 0.283 --use_new_heuristics --faster_decoding=5 %i %i.jxl
|
|
2021-10-13 02:11:40
|
|
|
2021-10-13 02:12:26
|
|
|
2021-10-13 02:14:23
|
or just use lossless
|
|
2021-10-13 02:16:37
|
to me it looks like 45.6 jpeg
|
|
2021-10-13 02:16:47
|
it looks like bad the image
|
|
2021-10-13 02:17:22
|
how it looks in avif with more effort?
|
|
2021-10-13 02:19:42
|
total bytes 1,21 MB (1.275.581 byte)
|
|
|
lithium
|
2021-10-13 02:33:03
|
Update avif result for this image.
> test02-denoise-pin-s9
> https://discord.com/channels/794206087879852103/794206170445119489/897813687962845204
> avif-q7-s4 962,047 => 328,772
>
> avifenc --min 0 --max 63 --minalpha 0 --maxalpha 0 -d 10 -s 4 -j 12 -a end-usage=q -a cq-level=7
> -a color:enable-dnl-denoising=0 -a color:denoise-noise-level=5 -a color:enable-chroma-deltaq=1
> -a color:sharpness=3 -a color:qm-min=0 -a color:enable-qm=1
|
|
|
fab
|
2021-10-13 02:33:23
|
really quality 7 avif?
|
|
2021-10-13 02:33:41
|
what are the command
|
|
2021-10-13 02:37:18
|
ah cq level 7
|
|
2021-10-13 02:37:30
|
can you send the avif file?
|
|
|
lithium
|
|
fab
|
2021-10-13 02:44:45
|
lee
|
|
2021-10-13 02:44:46
|
for %i in (C:\Users\Utente\Documents\test2\*.png) do cjxloctober9 -s 7 --epf=3 -q 21.59 -I 0.283 --use_new_heuristics --faster_decoding=6 --dots=0 --patches=0 %i %i.jxl
|
|
2021-10-13 02:44:51
|
if you s0mething like this
|
|
2021-10-13 02:44:59
|
you can't recover detail
|
|
2021-10-13 02:45:08
|
jxl isn't meant to recover detail
|
|
2021-10-13 02:48:49
|
|
|
2021-10-13 02:48:51
|
only here i find jxl disturbing
|
|
2021-10-13 02:49:01
|
the rest they are on par
|
|
2021-10-13 02:49:35
|
that's the current file i have
|
|
2021-10-13 02:49:36
|
|
|
2021-10-13 02:50:01
|
it's all disabled and speed 7 so i'm breaking the rules
|
|
2021-10-13 02:50:11
|
and also faster decoding 6
|
|
2021-10-13 02:50:18
|
maybe if i remove i will try
|
|
|
lithium
|
2021-10-13 02:50:32
|
`-q 21.59`
I only use d 0.5 ~ 1.0 and d 1.45 ~ 2.5.
|
|
|
fab
|
2021-10-13 03:12:26
|
|
|
2021-10-13 03:13:06
|
My 4 GB RAM PC can't execute this command
|
|
2021-10-13 03:13:32
|
Does it's better with photon noise Just for curiosity
|
|
2021-10-13 03:13:51
|
Without it at same quality is 5 mb
|
|
|
lithium
Update mozjpeg and webp-lossy result,
look like only avif and jxl --separate(have some issue) can correct process those image.
(denoised png compress to(=>) <lossy-format>)
> denoise-png 414,581 => jpg 6,269,979
> denoise-png 962,047 => jpg 6,749,052
> denoise-png 4,050,574 => jpg 7,381,455
> mozjpeg-cjpeg -optimize -progressive -quality 90 -sample 1x1
> denoise-png 414,581 => webp-lossy 4,296,090
> denoise-png 962,047 => webp-lossy 4,533,530
> denoise-png 4,050,574 => webp-lossy 5,006,958
> cwebp -mt -m 6 -q 90 -sharp_yuv -pre 4 -af
|
|
2021-10-13 03:15:45
|
How the separate jxl weight
|
|
|
lithium
|
2021-10-13 03:19:32
|
jxl weight? you mean file size?🤔
|
|
|
fab
|
2021-10-13 03:29:17
|
Yes
|
|
2021-10-13 03:29:36
|
How is the weight of the jxl separate fole
|
|
|
lithium
|
2021-10-13 03:31:21
|
> https://discord.com/channels/794206087879852103/794206170445119489/896840028024631346
|
|
|
diskorduser
|
2021-10-13 04:30:15
|
Lossless is smaller than vardct.... 🤔
|
|
2021-10-13 04:33:27
|
May be these images dont like dct at all
|
|
2021-10-13 04:43:09
|
Heif is also big with that 4bit grayscale manga
|
|
|
_wb_
|
2021-10-13 04:55:50
|
dct is designed for continuous-tone images
|
|
2021-10-13 04:56:24
|
not for bi-level or halftone images
|
|
2021-10-13 04:57:15
|
in fact such halftone patterns are kind of a worst-case scenario for dct
|
|
2021-10-13 04:57:49
|
I hope in the future we can make an encoder that detects cases like that, and switches automatically to a different approach
|
|
|
lithium
|
|
_wb_
I hope in the future we can make an encoder that detects cases like that, and switches automatically to a different approach
|
|
2021-10-13 06:27:13
|
libjxl is best lossy photo encoder for now, 🙂
a little curious, libjxl have plan improve graphics quality and feature in this year?
(quality: contrast sharp edges or line ringing, red color gradient tiny artifacts)
(feature: no-dct lossy mode for graphics, like av1 automatically local palette feature)
|
|
|
_wb_
|
2021-10-13 06:41:30
|
This year, I dunno, but it is something I want to work on, just need to get green light from cloudinary to start working on it on company time. I'm convinced the bitstream can do a lot better than what current cjxl produces, but it's a little research project to actually find out how to do better and in particular how to effectively mix dct and non-dct automatically
|
|
|
lithium
|
|
_wb_
This year, I dunno, but it is something I want to work on, just need to get green light from cloudinary to start working on it on company time. I'm convinced the bitstream can do a lot better than what current cjxl produces, but it's a little research project to actually find out how to do better and in particular how to effectively mix dct and non-dct automatically
|
|
2021-10-13 06:44:18
|
I understand, thank you very much, 🙂
I believe libjxl will be a best still image encoder.
|
|
|
Cool Doggo
|
2021-10-13 06:52:49
|
are there any stats of how much libjxl has improved since its introduction
|
|
|
_wb_
|
2021-10-13 07:01:45
|
What do you call 'introduction'?
|
|
|
improver
|
2021-10-13 07:02:14
|
some could say it's not "introduced" yet
|
|
|
_wb_
|
2021-10-13 07:03:46
|
When we compared FDIS cjxl (Oct 2020) to DIS cjxl (Jan 2020), it had improved quite nicely - of course that also involved bitstream changes
|
|
2021-10-13 07:06:43
|
For lossless, not much has changed since then (there is still room for encoder improvements there, it just hasn't been a big priority). For lossy, I think there have been quite some further encoder improvements in the past year, maybe overall 7-8% better now than half a year ago?
|
|
|
fab
|
2021-10-13 08:02:39
|
though s 4 new heuristics changed from 0.3.7 to 0.6.0
|
|
2021-10-13 08:03:21
|
it hasn't got no changes in many time it output same file for me in most builds
|
|
2021-10-13 08:05:35
|
now it got the third change (maybe) i did not test it other than s 7 and no animation
|
|
2021-10-13 08:07:23
|
avif got some changes on 29 september than libaom 3.1.3 i think
|
|
2021-10-13 08:08:09
|
i see some improvements at d 6 s 6 now with current test
|
|
2021-10-13 08:08:26
|
though quality goes worse on other lower distances
|
|
2021-10-13 08:08:38
|
very much macroblocking
|
|
2021-10-13 08:09:43
|
and also s 6 hasn't patches so for animations is useless
|
|
|
novomesk
|
2021-10-14 05:56:37
|
Maybe someone want to help reviewing PR for darktable:
https://github.com/darktable-org/darktable/pull/10044
|
|
|
_wb_
|
2021-10-14 07:08:58
|
Commented a bit there
|
|
2021-10-14 07:10:05
|
<@768090355546587137> or <@604964375924834314> maybe you want to take a look at the code of that darktable plugin to check if it is using the libjxl api correctly?
|
|
|
monad
|
2021-10-15 09:34:22
|
If you have high quality JPEGs (say, quality 99) as sources, is it fair to compare lossy compression between JXL and WebP?
|
|
|
|
veluca
|
2021-10-15 09:51:11
|
Not really
|
|
2021-10-15 09:51:36
|
You might want to do some downsampling to get rid of the JPEG weirdnesses
|
|
|
fab
|
2021-10-15 10:30:37
|
for %i in (C:\Users\Utente\Documents\w832\*.jpg) do cjxloctober9 -j --faster_decoding=1 --dots=0 -d 1.623 -s 7 %i %i.jxl
|
|
2021-10-15 10:30:43
|
does well
|
|
2021-10-15 10:31:24
|
though i will wait for better encoders
|
|
2021-10-15 10:31:39
|
jxl is weak in some things dev care
|
|
2021-10-15 10:31:42
|
bug free
|
|
2021-10-15 10:32:11
|
animation sizes
|
|
2021-10-15 10:32:22
|
album arts
|
|
|
w
|
2021-10-15 10:32:41
|
<:thinkraging:427900399027093506>
|
|
|
fab
|
2021-10-15 10:33:00
|
though i'm thinking of an use where 30 kb images are important
|
|
2021-10-15 10:33:06
|
and is there
|
|
2021-10-15 10:33:16
|
it was something related to games
|
|
2021-10-15 10:34:42
|
is a type of image where 24 mpx of fake resolution is important
|
|
2021-10-15 10:34:57
|
and matters more than getting pixels working
|
|
2021-10-15 10:39:19
|
i think i care about new heuristics when i can get a photo smaller like from 69 kb to 59000
|
|
2021-10-15 10:45:00
|
i think -d 4.364 -s 8 --gaborish=0 should be the minimum to use for a photo shoot with a phone
|
|
2021-10-15 10:45:19
|
if you're aiming with space saving in mind
|
|
2021-10-15 10:45:51
|
phone camera usually are not good
|
|
2021-10-15 10:46:00
|
i have samsung gn1 from xiaomi
|
|
2021-10-15 10:46:03
|
bad
|
|
2021-10-15 10:46:32
|
even motion cam 5.0.4 at iso 600 1/5 aperture unless i can do iso 600 isn't gonna save the photos
|
|
2021-10-15 10:47:07
|
you have photon camera from github that can do multi hdr but the image are noisy overrall and the processing lacks even if there is good noise reduction
|
|
2021-10-15 10:47:25
|
freedcam can shoot full resolution in jpg but it hasn't hdr
|
|
2021-10-15 10:48:00
|
THIS IS NOT ABOUT CODEC
|
|
2021-10-15 10:50:02
|
or monad you can try this
|
|
2021-10-15 10:50:03
|
for %i in (C:\Users\Utente\Documents\322*.jpg) do cjxloctober9 -j -d 0.538 --faster_decoding=6 -I 0.768 -s 8 --use_new_heuristics %i %i.jxl
the second will be far better for high bitrate re encoding
https://artifacts.lucaversari.it/libjxl/libjxl/2021-10-10T22%3A46%3A20Z_8e0e89a1072731c6b3dea4d11dd9bf58f20912fa/
|
|
2021-10-15 10:50:16
|
but it will be far worse quality in printing
|
|
2021-10-15 10:50:56
|
i recommend lossless jpg transcode
|
|
2021-10-15 10:51:44
|
i think youtube thumbnails you can start to re encode at s 7 d 1 if you have the cpu
|
|
2021-10-15 10:52:16
|
problem no application recognize images as i am so i need to put them in folders and they are 695 pngs only in one folder
|
|
2021-10-15 01:03:48
|
wb
|
|
2021-10-15 01:03:53
|
i'll express my opinion
|
|
2021-10-15 01:04:31
|
this is good enough quality for me
|
|
2021-10-15 01:04:33
|
|
|
2021-10-15 01:04:53
|
https://jon.lucaversari.it/comparison3/after_adjusted2/index.jxl_d2.html
|
|
2021-10-15 01:05:25
|
|
|
2021-10-15 01:09:08
|
though i like the lines better here
|
|
2021-10-15 01:09:09
|
https://jon.lucaversari.it/comparison3/after_adjusted3/index.jxl_d3.html
|
|
2021-10-15 01:10:17
|
best quality photographic like microsoft photos seems this
|
|
2021-10-15 01:10:18
|
https://jon.lucaversari.it/comparison3/after_adjusted2/index.jxl_d1.html
|
|
2021-10-15 01:10:30
|
though the lines aren't sharp
|
|
2021-10-15 01:10:44
|
i think they are all 3 good
|
|
2021-10-15 01:27:12
|
this bad
|
|
2021-10-15 01:27:12
|
|
|
2021-10-15 01:27:13
|
https://jon.lucaversari.it/comparison3/after_adjusted2/index.jxl_d1.html
|
|
2021-10-15 01:28:05
|
though at d2 it looks better
|
|
2021-10-15 01:28:56
|
|
|
2021-10-15 01:29:00
|
this good
|
|
2021-10-15 01:29:01
|
https://jon.lucaversari.it/comparison3/after_adjusted3/index.jxl_d2.html
|
|
2021-10-15 01:29:29
|
looks like a new heuristics
|
|
2021-10-15 01:29:56
|
https://jon.lucaversari.it/comparison3/after_adjusted3/index.jxl_d1.html
|
|
2021-10-15 01:30:03
|
horrible
|
|
2021-10-15 01:30:14
|
just the smearing of cottage
|
|
2021-10-15 01:31:22
|
|
|
2021-10-15 01:31:32
|
interesting this at d4 https://jon.lucaversari.it/comparison3/after_adjusted3/index.jxl_d4.html
|
|
2021-10-15 01:33:04
|
https://jon.lucaversari.it/comparison2/before/wollerau.png.jxl_d2.5.png
|
|
2021-10-15 01:33:08
|
i like this image
|
|
2021-10-15 01:38:50
|
i like also this
|
|
2021-10-15 01:38:52
|
https://jon.lucaversari.it/comparison2/before/index.jxl_d2.html
|
|
2021-10-15 01:38:54
|
|
|
2021-10-15 01:39:11
|
only that part of that distance, other distance not
|
|
2021-10-15 01:39:22
|
though d4 is decent
|
|
2021-10-15 01:58:04
|
honestly At kAcQuant=0.84 with d 1.369 -s 6 --faster_decoding=4 could be good
|
|
2021-10-15 01:58:30
|
if someone can compile it with sse4 like scope i can look
|
|
2021-10-15 01:58:59
|
|
|
2021-10-15 01:59:06
|
in general it seems more realistic in the flowers
|
|
2021-10-15 02:07:43
|
try with -q 83.174 --epf=1 --gaborish=0 -s 7 --use_new_heuristics --faster_decoding=1
|
|
2021-10-15 02:07:52
|
and see which look better
|
|
2021-10-15 02:07:57
|
no unfair
|
|
2021-10-15 02:08:06
|
in this way i think the second gonna win
|
|
2021-10-15 02:11:12
|
|
|
2021-10-15 02:11:59
|
after adjusted 4 is horrible
|
|
2021-10-15 02:13:23
|
is looks like denoised and micro granularing in the pink flowerr
|
|
2021-10-15 02:13:37
|
https://jon.lucaversari.it/comparison3/after_adjusted2/red-flowers.png.jxl_d1.png
|
|
2021-10-15 02:13:46
|
this look like stretched
|
|
2021-10-15 02:13:51
|
ok
|
|
2021-10-15 02:14:16
|
need to see original
|
|
2021-10-15 02:16:04
|
|
|
2021-10-15 02:16:40
|
this is afteradjusted3
|
|
2021-10-15 02:19:47
|
|
|
2021-10-15 02:19:47
|
this is where afteradjusted2 appears sharper to me
|
|
2021-10-15 02:19:49
|
https://jon.lucaversari.it/comparison3/after_adjusted2/index.jxl_d2.html
|
|
2021-10-15 02:20:01
|
i would use it at -q 70.579 -s 2 --faster_decoding=1 --photon_noise=ISO360 --epf=0
|
|
2021-10-15 02:20:30
|
not sure if i can use photon noise at s 2 wasn't only for SPEED 8
|
|
|
_wb_
|
2021-10-18 03:26:41
|
93rd JPEG meeting has started, fun times
|
|
|
|
veluca
|
2021-10-18 03:28:31
|
"fun"
|
|
|
_wb_
|
2021-10-18 05:26:43
|
Tomorrow we'll discuss in depth if we can do the spec drafting in TeX on public git, but so far it looks like it's still on the table
|
|
|
Nova Aurora
|
2021-10-19 12:39:35
|
|
|
2021-10-19 07:47:25
|
Anything interesting come out of the JPEG meeting <:Thonk:805904896879493180>
|
|
|
_wb_
|
2021-10-19 07:48:17
|
Final plenary is on Friday
|
|
2021-10-19 07:48:46
|
So nothing I can share already I think
|
|
2021-10-19 07:49:00
|
But we had good discussions today
|
|
|
Nova Aurora
|
2021-10-19 07:49:04
|
Ok, keep being awesome 😎
|
|
|
_wb_
|
2021-10-19 07:49:07
|
3 more days to go
|
|
|
Jyrki Alakuijala
|
|
_wb_
did that in https://github.com/libjxl/libjxl/pull/691 (also further tweaked the deadzone thresholds themselves)
|
|
2021-10-20 04:03:30
|
this is submitted now
|
|
|
Traneptora
|
2021-10-20 04:03:42
|
anyone have some JPEG XL animations I can use for testing?
|
|
2021-10-20 04:03:57
|
trying to cjxl this one fails: `https://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png`
|
|
|
|
veluca
|
2021-10-20 04:04:25
|
https://github.com/libjxl/conformance/tree/master/testcases/animation_icos4d
|
|
|
Traneptora
|
2021-10-20 04:04:55
|
any particular reason for this tho?
|
|
2021-10-20 04:04:58
|
```
$ cjxl -d 0 Animated_PNG_example_bouncing_beach_ball.png Animated_PNG_example_bouncing_beach_ball.jxl
JPEG XL encoder v0.7.0 116326a [AVX2]
Failed to read image Animated_PNG_example_bouncing_beach_ball.png.
```
|
|
|
|
veluca
|
2021-10-20 04:05:14
|
no clue... pls file an issue? 😄
|
|
|
Traneptora
|
2021-10-20 04:05:25
|
ah, okay, it's not supposed to do that
|
|
2021-10-20 04:05:40
|
renaming to `.apng` didn't help
|
|
|
|
veluca
|
2021-10-20 04:05:56
|
nah, we ignore extensions on the input anyway IIRC
|
|
|
Traneptora
|
2021-10-20 04:32:29
|
<@!179701849576833024> https://github.com/libjxl/libjxl/issues/756
|
|
|
|
veluca
|
|
_wb_
|
2021-10-20 05:48:27
|
It's probably the dispose mode thing
|
|
2021-10-20 05:48:48
|
We don't implement everything there out of laziness
|
|
2021-10-20 05:50:06
|
We should probably make the apng input accept all valid apngs, and also add an apng output option
|
|
|
Traneptora
|
2021-10-20 06:36:41
|
yea, it should just not implement what it can't
|
|
2021-10-20 06:36:46
|
rather than fail
|
|
2021-10-20 06:37:32
|
anyyway <@!794205442175402004> so the `0xFF0A` magic on a JXL codestream file is apparently not sufficient for FFmpeg to autodetect. Well, it works, but the maintainers don't like it since it's only 16 bits. Is there some sort of data validation that comes after `0xFF0A`
|
|
2021-10-20 06:37:43
|
like, say, not "these bits are identical"
|
|
2021-10-20 06:37:43
|
but
|
|
2021-10-20 06:45:44
|
you know, a way to check if it's actually in that format
|
|
2021-10-20 07:03:13
|
I'm aware the library provides a function but I'd prefer if the demuxer doesn't have a libjxl dependency, just the decoder
|
|
|
|
veluca
|
2021-10-20 07:03:35
|
Mhhh so decoding the first few headers and seeing if they make sense may be an option
|
|
|
_wb_
|
2021-10-20 07:06:11
|
i've had a few people complain about the 2-byte magic not being enough
|
|
2021-10-20 07:06:23
|
haven't seen a single false positive yet though
|
|
2021-10-20 07:07:29
|
(and at least two magic-db maintainers have been looking for false positives in their corpuses already)
|
|
2021-10-20 07:09:17
|
so as far as I know, yes, it's short, but it's also long enough to be unique given the set of file formats that currently exists in the world
|
|
|
Traneptora
|
2021-10-20 07:10:05
|
```Oct 20 14:54:54 <michaelni> "tools/probetest 256 4096" fails with Failure of jpegxl_pipe probing code with score=51 type=2 p=5A3 size=2```
<@!794205442175402004>
|
|
|
_wb_
|
2021-10-20 07:10:22
|
what does that mean?
|
|
|
Traneptora
|
2021-10-20 07:10:52
|
it means it gets a false positive
|
|
|
_wb_
|
2021-10-20 07:11:02
|
ok, that's interesting
|
|
2021-10-20 07:11:05
|
what is the false positive?
|
|
2021-10-20 07:11:44
|
what kind of file is it?
|
|
2021-10-20 07:14:55
|
or is that test just going through random bitstreams and fails when that causes a match?
|
|
|
Traneptora
|
2021-10-20 07:15:16
|
I think maybe that
|
|
2021-10-20 07:15:30
|
and FFmpeg does not want to match streams if the decoder is likely to throw an error
|
|
2021-10-20 07:15:38
|
two bytes not being enough does make sense
|
|
|
improver
|
2021-10-20 07:16:21
|
should a bit more validation be done?
|
|
2021-10-20 07:16:24
|
and is that possible
|
|
|
_wb_
|
2021-10-20 07:16:25
|
well there are only 65536 combinations of 2 bytes so yes, random files will have a 1/65536 chance of matching
|
|
|
improver
|
2021-10-20 07:16:54
|
how other jpeg formats handle that
|
|
|
Traneptora
|
2021-10-20 07:17:30
|
Does `JxlDecoderReset` purge the parallel runners
|
|
2021-10-20 07:17:35
|
forcing me to re-add them
|
|
|
_wb_
|
2021-10-20 07:18:35
|
well the old jpeg starts with `0xFFD8`, but that marker always gets followed by another marker so you can match with `0xFFD8FF`
|
|
|
Traneptora
|
2021-10-20 07:19:05
|
and you can match against the type
|
|
2021-10-20 07:19:16
|
like PNG has a magic but you can check to see if the next one starts with IHDR for example
|
|
|
_wb_
|
2021-10-20 07:20:28
|
the point of the "compact header" layout of jxl is not too waste bytes on things that are redundant, and a long signature is part of that
|
|
2021-10-20 07:20:57
|
but I suppose you could try to do some parsing of the headers and reject most invalid ones
|
|
|
Traneptora
|
2021-10-20 07:21:05
|
that's fine, but I need to be able to scan the file past the first two bytes to determine if it's actually a JXL codestream
|
|
|
improver
|
2021-10-20 07:21:08
|
that'd be helpful
|
|
|
Traneptora
|
2021-10-20 07:21:09
|
even a primitive way of doing this is okay
|
|
2021-10-20 07:21:14
|
but I don't now the format of the JXL codestream
|
|
|
_wb_
|
2021-10-20 07:21:36
|
the first thing after the 0xFF0A is the size header, which unfortunately is a bit tricky to parse and has a variable length so you cannot just skip over it
|
|
|
Traneptora
|
2021-10-20 07:21:58
|
what's the format of it?
|
|
|
_wb_
|
|
improver
|
2021-10-20 07:22:21
|
tbh libjxl should have some sort of function to validate given small buffer of bytes
|
|
|
Traneptora
|
2021-10-20 07:22:33
|
is it bitpacked
|
|
2021-10-20 07:22:43
|
or is Bool() equivalent to u(1)
|
|
|
_wb_
|
2021-10-20 07:22:45
|
everything in the headers is bitpacked
|
|
|
Traneptora
|
2021-10-20 07:22:49
|
little-endian?
|
|
|
_wb_
|
2021-10-20 07:22:52
|
bool is u(1)
|
|
|
Traneptora
|
2021-10-20 07:23:00
|
is oh `u` is unsigned bits?
|
|
|
_wb_
|
2021-10-20 07:23:15
|
u(n) is n unsigned bits
|
|
2021-10-20 07:23:31
|
U32() is u(2) to select which of the four options it is
|
|
|
Traneptora
|
2021-10-20 07:23:50
|
so little-endian bitpacked?
`small == header[0] & 0x01` or `small == header[0] & 0x80`
|
|
|
improver
|
2021-10-20 07:24:37
|
wait how default values work
|
|
|
_wb_
|
2021-10-20 07:25:40
|
defaults you can ignore here since this bundle cannot be default
|
|
2021-10-20 07:26:10
|
things are only signalled if the condition holds though
|
|
|
improver
|
2021-10-20 07:26:16
|
also id think more than just SizeHeader should be read, because it looks pretty hard to validate that given how well packed it is
|
|
|
_wb_
|
2021-10-20 07:26:42
|
anyway, libjxl does have an event for "basicinfo decoded" or something like that
|
|
|
Traneptora
|
2021-10-20 07:26:52
|
so `U32(u(9), u(13), u(18), u(30)` means
```c
switch(u(2)){
case 0: u(9)
case 1: u(13)
case 2: u(18)
case 3: u(30)
}
```
|
|
2021-10-20 07:26:55
|
is that correct?
|
|
|
_wb_
|
2021-10-20 07:27:01
|
that is correct
|
|
|
Traneptora
|
|
_wb_
anyway, libjxl does have an event for "basicinfo decoded" or something like that
|
|
2021-10-20 07:27:11
|
I don't want to incur a libjxl dependency in the demuxer, only the decoder
|
|
2021-10-20 07:27:38
|
since it's optional and I'd like ffmpeg to still be able to understand jpegxl and copy the stream even if you don't have the decoder built
|
|
|
_wb_
|
2021-10-20 07:27:46
|
right
|
|
|
Traneptora
|
2021-10-20 07:28:00
|
that's the whole issue
|
|
2021-10-20 07:28:03
|
libjxl *had* a validate function
|
|
|
improver
|
2021-10-20 07:28:15
|
dig it up in history\
|
|
2021-10-20 07:28:19
|
and copy :--DDD
|
|
|
_wb_
|
2021-10-20 07:28:25
|
anyway the size header doesn't help much because pretty much anything is a valid size
|
|
|
improver
|
2021-10-20 07:28:46
|
yuh id think rest of stuff would make more sense
|
|
2021-10-20 07:29:10
|
so.. what comes after that could be used to validate it?
|
|
|
_wb_
|
2021-10-20 07:29:22
|
|
|
2021-10-20 07:29:29
|
that's the next thing that comes after
|
|
|
Traneptora
|
2021-10-20 07:29:47
|
what is the size header the size of?
|
|
|
_wb_
|
2021-10-20 07:29:55
|
the size of the image
|
|
|
Traneptora
|
2021-10-20 07:29:55
|
the entire codestream, except itself and the 0xFF0A?
|
|
|
improver
|
2021-10-20 07:30:07
|
was it really hard to have some sort of 1 or 2 byte checksum :<
|
|
|
_wb_
|
2021-10-20 07:30:07
|
it's the width and height of the image in pixels
|
|
|
Traneptora
|
2021-10-20 07:30:09
|
oh
|
|
2021-10-20 07:31:11
|
and `height == (height_div8_minus_1 + 1) * 8`
|
|
2021-10-20 07:31:17
|
I take it?
|
|
|
_wb_
|
2021-10-20 07:31:26
|
hm I don't see much in the imagemetadata either that could be used to disqualify bitstreams
|
|
2021-10-20 07:31:47
|
|
|
|
Traneptora
|
2021-10-20 07:32:11
|
what does ratio start at if `small == 1`
|
|
2021-10-20 07:32:53
|
oh, wait, I see, the condition doesn't go over
|
|
2021-10-20 07:32:54
|
thanks
|
|
|
_wb_
|
2021-10-20 07:34:04
|
I must admit that the size header is a somewhat overengineered thing that adds quite some complication in order to save one or two bytes at best
|
|
|
Traneptora
|
2021-10-20 07:34:26
|
considering that you have `uint32_t` for the container sequence number
|
|
2021-10-20 07:34:28
|
yea
|
|
|
_wb_
|
2021-10-20 07:34:38
|
the container is optional though
|
|
2021-10-20 07:34:49
|
if you go minimal, you don't use the container 🙂
|
|
|
improver
|
2021-10-20 07:35:03
|
its kinda fine as it doesn't have too many fields
|
|
|
Traneptora
|
2021-10-20 07:35:03
|
it also looks like the size header does not necessarily end on a byte boundary
|
|
|
improver
|
2021-10-20 07:35:16
|
so any complexity is kinda self-contained and isolated
|
|
|
_wb_
|
2021-10-20 07:35:52
|
everything in the image header is not byte aligned
|
|
|
Traneptora
|
2021-10-20 07:36:12
|
so the next header just starts immediately
|
|
|
_wb_
|
2021-10-20 07:36:17
|
only after the image header do you get a byte alignment before the frame header starts
|
|
|
Traneptora
|
2021-10-20 07:36:38
|
are there *any* invalid image headers lmao
|
|
|
_wb_
|
2021-10-20 07:36:42
|
so that's one first opportunity to check for invalid bitstreams: the padding bits have to be zero
|
|
2021-10-20 07:37:04
|
(but if you're unlucky, there are no padding bits or they are accidentally zero)
|
|
|
Traneptora
|
2021-10-20 07:37:55
|
oh, btw, I had a question earlier, does `JxlDecoderReset()` also reset the parallel runners? If I don't destroy them, do I have to re-assign them?
|
|
|
_wb_
|
2021-10-20 07:38:45
|
I think the only way to be relatively sure that the bitstream is really a jxl and not a random file, is to decode all the way to the end of the TOC of the first frame, wdyt <@!179701849576833024> ?
|
|
|
Traneptora
oh, btw, I had a question earlier, does `JxlDecoderReset()` also reset the parallel runners? If I don't destroy them, do I have to re-assign them?
|
|
2021-10-20 07:39:15
|
no idea, I'm not that familiar with the API. <@!768090355546587137> probably knows
|
|
|
|
Hello71
|
2021-10-20 07:39:38
|
is that likely to fall within the first few thousand bytes? i think in most cases (http, local files) that's reasonably cheap
|
|
2021-10-20 07:40:15
|
currently ffmpeg still returns "unsure" about jpeg without file extension up until EOI
|
|
|
_wb_
|
2021-10-20 07:40:39
|
yes that is likely to fall within the first hundred bytes
|
|
|
Traneptora
|
2021-10-20 07:41:02
|
perhaps, but if I'm trying to parse it, I'd like to at least, know the format
|
|
|
_wb_
|
2021-10-20 07:41:02
|
it's just a bit painful to have to include a parser for all that stuff
|
|
|
Traneptora
|
2021-10-20 07:41:15
|
I don't need to parse it all, just parse the length tbh
|
|
|
|
veluca
|
2021-10-20 07:41:27
|
You could also decode the first whatever headers, up to size header say, and check if image dimensions make any sense
|
|
|
Traneptora
|
2021-10-20 07:41:34
|
yea, that's the plan
|
|
|
_wb_
|
2021-10-20 07:42:18
|
question is how likely it is that image dimensions don't make sense
|
|
|
|
veluca
|
2021-10-20 07:42:26
|
probably likely enough
|
|
|
_wb_
|
2021-10-20 07:42:27
|
if first bit is 1 they will make sense
|
|
|
Traneptora
|
2021-10-20 07:42:42
|
how so?
|
|
|
|
veluca
|
2021-10-20 07:42:44
|
will they? we have an all_default for sizeheader?
|
|
|
_wb_
|
2021-10-20 07:42:47
|
if first bits are 00 they will also make sense
|
|
|
Traneptora
|
2021-10-20 07:42:52
|
they'll be *parseable*
|
|
2021-10-20 07:42:54
|
but will they be sane
|
|
|
_wb_
|
2021-10-20 07:42:57
|
no but any small size is sane
|
|
|
|
veluca
|
2021-10-20 07:42:59
|
ah because that's "small"
|
|
2021-10-20 07:43:00
|
right
|
|
|
_wb_
|
2021-10-20 07:43:15
|
also 9-bit heights are always sane
|
|
|
|
veluca
|
2021-10-20 07:43:20
|
how well can you digest Rust?
|
|
|
_wb_
|
2021-10-20 07:43:24
|
13-bit heights probably are sane too
|
|
|
Traneptora
|
2021-10-20 07:43:57
|
it sounds like the strategy here is to parse the headers as much as i need to determine how big they are and nothing else
|
|
2021-10-20 07:44:15
|
and then check the next few bytes for a frame header chunk ID
|
|
2021-10-20 07:44:49
|
the first few bytes of a frame header are probably much less permissive
|
|
|
|
veluca
|
2021-10-20 07:46:32
|
our image headers have *very* few ways they can fail (unfortunately?)
|
|
|
_wb_
|
2021-10-20 07:48:34
|
In FLIF I considered it a density bug if any bit was redundant, i.e. if random bitstreams didn't decode
|
|
2021-10-20 07:48:55
|
Jxl luckily doesn't go that extreme
|
|
|
Traneptora
|
2021-10-20 07:50:03
|
is there a standard frame header?
|
|
|
_wb_
|
2021-10-20 07:50:46
|
Frame header will also not likely fail, except if padding bits before it are nonzero
|
|
|
Traneptora
|
2021-10-20 07:50:56
|
like, I'm just looking for some heuristic to check if a file is a valid Jxl file without incurring a dependency on libjxl
|
|
|
_wb_
|
2021-10-20 07:51:40
|
I think in practice, 0xFF0A should not be the first two bytes of any actual non-jxl file
|
|
|
|
veluca
|
|
_wb_
|
2021-10-20 07:52:32
|
I don't know how often people try to decode /dev/random and if the 1/65536 chance that it gets mistaken for jxl is a problem
|
|
|
|
veluca
|
2021-10-20 07:52:49
|
if you want more, I really don't know how you'd do that without some significant effort
|
|
2021-10-20 07:53:52
|
where "significant effort" might even require you to implement ANS, because there are files that are not too unlikely where you can't tell unless you decode the whole ICC profile, I think...
|
|
2021-10-20 07:54:07
|
(ANS+Huffman+LZ77)
|
|
|
Traneptora
|
|
_wb_
I think in practice, 0xFF0A should not be the first two bytes of any actual non-jxl file
|
|
2021-10-20 07:56:29
|
this might be true but the goal is adoption, and ffmpeg's rejecting the decoder patch for this exact reason
|
|
|
|
veluca
|
2021-10-20 07:57:09
|
if you want like 2x extra accuracy for small effort, you can implement reading the sizeheader (https://github.com/libjxl/jxl-rs/blob/main/src/headers/size.rs#L28) and I think that there's at least a 50% chance that random garbage will be detectable as such
|
|
2021-10-20 07:57:18
|
maybe 25%
|
|
2021-10-20 07:58:10
|
it *may* be less effort to point them towards the analysis that some people did on a large database related to mimetypes... <@!794205442175402004> do you still have a link to that?
|
|
|
Traneptora
|
2021-10-20 08:00:09
|
the size header still has to exist tho
|
|
2021-10-20 08:00:14
|
what's the smallest size header there is?
|
|
2021-10-20 08:00:16
|
1 byte?
|
|
|
|
Hello71
|
2021-10-20 08:13:12
|
on a separate topic, how much space could be saved by a theoretical "jpeg pixel-identical recompression" mode, as opposed to byte-identical? i guess the primary difference in this mode compared to first stripping metadata with exiftool or similar would be that the quantization tables and JFIF headers would not be stored. how much does that work out to?
|
|
|
_wb_
|
2021-10-20 08:16:25
|
You can try with cjxl --strip, which strips also the jbrd
|
|
|
Traneptora
|
2021-10-20 08:18:51
|
are you able to put garbage after a JXL file?
|
|
|
|
Hello71
|
2021-10-20 08:20:34
|
ah, i didn't see that option. will it work around https://github.com/libjxl/libjxl/pull/359?
|
|
|
|
veluca
|
|
Traneptora
are you able to put garbage after a JXL file?
|
|
2021-10-20 08:33:15
|
Yup, although we may want to disallow it
|
|
|
Traneptora
|
2021-10-20 08:33:38
|
the issue I'm experiencing is that if you conatenate two JXL files together it just looks like the first one
|
|
2021-10-20 08:33:53
|
I think it's a good idea to disallow it cause it creates issues where you can have a JXL file that is also a valid MP3 file
|
|
|
|
veluca
|
|
Traneptora
1 byte?
|
|
2021-10-20 08:33:57
|
I believe you can get away with 1 + 5 bits + 3 non-000 bits
|
|
|
Traneptora
I think it's a good idea to disallow it cause it creates issues where you can have a JXL file that is also a valid MP3 file
|
|
2021-10-20 08:34:10
|
How?
|
|
|
Traneptora
|
2021-10-20 08:34:53
|
MP3 allows crap *at the beginning*
|
|
2021-10-20 08:35:41
|
I've done it with jpeg and mp3
|
|
2021-10-20 08:35:59
|
another issue is that concatenating two JXL files together should be something that the library can work with
|
|
2021-10-20 08:36:14
|
i.e. it should only consume up until the end of the file
|
|
2021-10-20 08:36:48
|
so like, if I concatenate a JXL file with something else, `JxlDecoderReleaseInput` should always tell me that it did not consume the remaining after emitting `JxLDecSuccess`
|
|
2021-10-20 08:37:19
|
and sometimes this is legal, butsometimes it's extra info
|
|
2021-10-20 08:37:34
|
attempting to set it again should produce an error other than `JXL_DEC_ERROR`
|
|
2021-10-20 08:37:49
|
like `JXL_DEC_INVALID_TAIL`
|
|
2021-10-20 08:38:28
|
which you would have to subscribe to. alternatively, it could just return JXL_DEC_ERROR and you could add a function `JxlDecoderGetLastError()` wihich would return something like `enum JxlError {}`
|
|
2021-10-20 08:38:57
|
different from JxlDecoderStatus since that's a bitwise thing
|
|
2021-10-20 08:39:02
|
this would just be a table
|
|
|
|
Hello71
|
2021-10-20 08:50:23
|
<@!853026420792360980> minor nit, i think you don't need to heap allocate LibJxlDecodeContext.{manager,jxl_pixfmt}. they are documented to be copied internally. it's only 44 bytes though
|
|
|
Traneptora
|
|
Hello71
<@!853026420792360980> minor nit, i think you don't need to heap allocate LibJxlDecodeContext.{manager,jxl_pixfmt}. they are documented to be copied internally. it's only 44 bytes though
|
|
2021-10-20 08:53:10
|
I asked about that but I was told "just make it a nonpointer member of your context"
|
|
2021-10-20 08:53:10
|
so I did
|
|
|
|
Hello71
|
2021-10-20 08:53:23
|
hm, ok.
|
|
|
Traneptora
|
|
_wb_
|
|
2021-10-20 10:01:44
|
wow, and are *all* of these headers varlength? so does that mean I need to parse *all* of them to parse the codestream before I can start getting to the size?
|
|
|
|
Hello71
|
2021-10-20 11:54:41
|
https://github.com/exiftool/exiftool/blob/master/lib/Image/ExifTool/Jpeg2000.pm#L1093 seems enough to get width and height. roughly 50 LOC including the GetBits function. so it's pretty annoying but it doesn't look *that* bad
|
|
2021-10-20 11:55:40
|
also i guess this code is needed if ffmpeg wants to have a native decoder, so it's not exclusively for validating file contents
|
|
2021-10-20 11:57:16
|
50 LOC moderately dense perl, but it's mostly bit twiddling so i think 70 LOC C should be sufficient
|
|
|
|
veluca
|
|
Traneptora
wow, and are *all* of these headers varlength? so does that mean I need to parse *all* of them to parse the codestream before I can start getting to the size?
|
|
2021-10-21 12:04:06
|
luckily the size is the first thing at all, so not *too* bad
|
|
|
Traneptora
|
|
veluca
luckily the size is the first thing at all, so not *too* bad
|
|
2021-10-21 06:02:09
|
isn't that the image size, not the header size?
|
|
|
_wb_
|
2021-10-21 06:06:37
|
Yes, it's the image size
|
|
2021-10-21 06:07:56
|
You can exclude images larger than 2^20 pixels in either dimension, for example
|
|
2021-10-21 06:09:22
|
ah actually 2^18 is the max dimension allowed for a naked codestream
|
|
2021-10-21 06:09:47
|
since naked codestream has to conform to level 5 of the Main profile
|
|
2021-10-21 06:10:33
|
|
|
2021-10-21 06:11:24
|
images larger than that should be using the container format (since at that point who cares about minimal headers)
|
|
2021-10-21 06:12:01
|
width and height both smaller than 2^18, width * height smaller than 2^28
|
|
|
Traneptora
|
2021-10-21 06:12:29
|
and padding is required to be zero, right?
|
|
|
_wb_
|
2021-10-21 06:12:51
|
yes but the first padding is only after the whole image header
|
|
2021-10-21 06:12:59
|
not after the size header
|
|
|
Traneptora
|
2021-10-21 06:13:43
|
but I mean, if `b` is the first image byte, then `(b & 0x01) && (b != 0x01)` is an illegal state, for example
|
|
|
_wb_
|
2021-10-21 06:13:56
|
(and parsing a whole image header to figure out where it ends is not worth it)
|
|
|
Traneptora
|
2021-10-21 06:14:07
|
it lets me immediately rule out some garbage tho
|
|
2021-10-21 06:14:21
|
since I'm thinking that there's only one legal header with the first bit set
|
|
2021-10-21 06:14:27
|
and that's `0x01`
|
|
|
_wb_
|
2021-10-21 06:15:09
|
uh why?
|
|
|
Traneptora
|
2021-10-21 06:15:20
|
er, wait
|
|
2021-10-21 06:15:36
|
I'm thinking `all_default == true` would zero out the whole hader
|
|
2021-10-21 06:15:45
|
but I forgot that there's still `default_transform`
|
|
2021-10-21 06:15:57
|
what is `F16()` btw?
|
|
2021-10-21 06:17:31
|
is that just, a 16-bit float?
|
|
2021-10-21 06:18:28
|
are `NaN` permitted for the `up_weight` headers?
|
|
2021-10-21 06:19:17
|
it does look like the shortest possible header tho is `0x03`
|
|
2021-10-21 06:19:54
|
one byte <:laugh:501235422479908864>
|
|
2021-10-21 06:23:24
|
what's the default size, btw?
|
|
2021-10-21 06:26:11
|
either way <@!794205442175402004> I'm running into some issues with jxl files concatenated together, since libjxl apparently allows garbage after the file and it not only permits it with no error but it consumes it as part of the file
|
|
2021-10-21 06:26:39
|
at the very least if the decoder is going to allow crap, then it should not consume it, and instead report the crap as unconsumed when you do `JxlDecoderReleaseInput()`
|
|
2021-10-21 06:27:40
|
or at the very least, after basic info is ready, there should be a function `JxlDecoderGetStreamSize()`
|
|
2021-10-21 06:27:50
|
or something like that, to tell you how much it's going to try to read
|
|
2021-10-21 06:27:59
|
(which may be larger than the buffer you feed it)
|
|
2021-10-21 06:29:00
|
perhaps it won't be possible, but IMO once `JXL_DEC_SUCCESS` is emitted, the next call to `JxlDecoderReleaseInput` should tell you how much input in the buffer you provided that it did not read
|
|
2021-10-21 06:29:22
|
currently it reports zero, even if you concat garbage at the end of the jxl file
|
|
2021-10-21 06:29:35
|
since it reads it to see if there's anything of note there
|
|
|
_wb_
|
2021-10-21 06:47:18
|
Agreed
|
|
2021-10-21 06:48:29
|
A function to get info from the toc would be useful to know not just how much is needed to decode the frame, but also for just the dc and other progressive steps
|
|
2021-10-21 06:48:46
|
It only has info about the first frame though
|
|
2021-10-21 06:49:22
|
In the multiframe case, there is no way to know the full size unless you parse all frame headers
|
|
2021-10-21 06:50:09
|
The releaseinput reporting tail bytes left, does it already have a github issue?
|
|
|
Traneptora
|
2021-10-21 06:50:12
|
also, do you think it might be worth it to wait until friday to learn if the spec is going to be a bit more public than it is today 🙂
|
|
|
_wb_
The releaseinput reporting tail bytes left, does it already have a github issue?
|
|
2021-10-21 06:50:43
|
I don't know, I discovered it by accident
|
|
2021-10-21 06:50:54
|
release input is supposed to report tail bytes that it did not consume
|
|
2021-10-21 06:51:08
|
but in the case of jxl_dec_success it appears to report 0 no matter what
|
|
|
_wb_
|
2021-10-21 06:51:39
|
Likely we will make a private spec repo to work on the draft, and I will try to make sure that people like you will be allowed access because you can help us with the drafting
|
|
|
Traneptora
|
2021-10-21 06:51:59
|
ah, okay. this is a draft of the TeX version of the spec?
|
|
|
_wb_
|
2021-10-21 06:52:08
|
The CD of the 2nd edition can be made public but it will take time until we reach that stage
|
|
|
Traneptora
|
2021-10-21 06:52:23
|
or is this 2nd edition right here
|
|
|
_wb_
|
2021-10-21 06:52:37
|
The 2nd edition is tex, yes
|
|
2021-10-21 06:52:49
|
At least in the drafting stages
|
|
|
Traneptora
|
2021-10-21 06:52:56
|
good thing my profession is mathematics <:kek:857018203640561677>
|
|
|
|
veluca
|
2021-10-21 08:00:34
|
The first header is not ImageMetadata, the first header is SizeHeader - I suggest you give a look at the Rust code
|
|
2021-10-21 08:00:55
|
(or the C++ one, but that's not exactly readable...)
|
|
|
Traneptora
|
2021-10-21 09:23:44
|
I'm trying to parse the size header of a JXL that starts like this
|
|
2021-10-21 09:23:51
|
```00000000 ff 0a ba 21 e8 df 81 95 0c 28 a9 9c 12 00 aa d8 |...!.....(......|```
|
|
2021-10-21 09:23:56
|
ff 0a -> skip
|
|
2021-10-21 09:24:33
|
BA gives you, in little endian order, `0 1 0 1 1 1 0 1`
|
|
2021-10-21 09:26:27
|
so you have
all_default -> false
extra_fields -> true
orientation_minus_1 -> `0 1 1` so orientation=7
have_intr_size -> true
|
|
2021-10-21 09:26:35
|
and now we have `0 1` and the next bits carrying over
|
|
2021-10-21 09:28:22
|
`21 ea df 81` -> `1 0 0 0 0 1 0 0 0 1 0 1 0 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 0 0 0 1`
|
|
2021-10-21 09:28:27
|
so the bitstream now looks like
|
|
2021-10-21 09:28:55
|
`0 1` `1 0 0 0 0 1 0 0` `0 1 0 1 0 1 1 1` `1 1 1 1 1 0 1 1` `1 0 0 0 0 0 0 1`
|
|
2021-10-21 09:29:22
|
so now we look at the size header
|
|
2021-10-21 09:29:34
|
small -> false
|
|
2021-10-21 09:30:04
|
`U32(u(9), u(13), u(18), u(30)` -> 11 -> u30
|
|
2021-10-21 09:30:20
|
`0 0 0 0 1 0 0 0 1 0 1 0 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 0 0 0 1` this is not the height.
|
|
|
|
veluca
|
2021-10-21 09:30:39
|
the first header is not ImageMetadata
|
|
|
Traneptora
|
2021-10-21 09:30:43
|
oh
|
|
2021-10-21 09:30:46
|
what's the first header
|
|
|
|
veluca
|
2021-10-21 09:31:17
|
signature first, then SizeHeader, then ImageMetadata
|
|
|
Traneptora
|
2021-10-21 09:31:27
|
SizeHeader is part of Imagemetadata tho, isn't it?
|
|
|
|
veluca
|
|
Traneptora
|
2021-10-21 09:31:44
|
why is there a sizeheader inside
|
|
2021-10-21 09:31:47
|
`have_intr_size`
|
|
2021-10-21 09:31:49
|
what's that
|
|
|
|
veluca
|
2021-10-21 09:32:41
|
that's "intrinsic size", i.e. size in screen pixels
|
|
|
Traneptora
|
2021-10-21 09:32:48
|
ah, okay
|
|
|
|
veluca
|
2021-10-21 09:32:50
|
aka how viewers should rescale it
|
|
|
Traneptora
|
2021-10-21 09:32:58
|
signature being just `0xFF0a` right?
|
|
|
|
veluca
|
|
|
Deleted User
|
2021-10-21 09:41:25
|
https://tenor.com/view/matric-matrix-i-dont-see-the-code-gif-8390287
|
|
|
Fraetor
|
2021-10-21 01:29:39
|
What is even in Part 4 of the Spec? I thought the reference implementation was libjxl, but in that case what is the £45, 4 page PDF on the ISO website?
https://www.iso.org/standard/80619.html
|
|
|
diskorduser
|
|
https://tenor.com/view/matric-matrix-i-dont-see-the-code-gif-8390287
|
|
2021-10-21 01:38:10
|
🤔🤔🤔
|
|
|
|
veluca
|
2021-10-21 01:44:23
|
Part 4 is basically a one-page document that says "here is a zip version of the libjxl repo"
|
|
|
Eugene Vert
|
2021-10-21 01:53:54
|
Why does lossless modular JXL with XYB colorspace take up significantly more space than lossless in RGB? (e.g. when `uses_original_profile = false;`)
|
|
|
_wb_
|
|
Eugene Vert
Why does lossless modular JXL with XYB colorspace take up significantly more space than lossless in RGB? (e.g. when `uses_original_profile = false;`)
|
|
2021-10-21 02:20:46
|
Because XYB is at higher bit depth
|
|
|
|
Deleted User
|
2021-10-21 02:34:08
|
Would near lossless work better with XYB than RGB?
|
|
|
_wb_
|
2021-10-21 02:42:55
|
Well squeeze based lossy modular does that by default. The delta palette based lossy palette modular is atm working in RGB (the default deltas are designed for RGB). Possibly an XYB version could be better, but it would require custom deltas.
|
|
|
Traneptora
|
|
_wb_
Because XYB is at higher bit depth
|
|
2021-10-21 05:59:56
|
what bit depth is XYB at by default?
|
|
2021-10-21 06:00:17
|
and if you used RGB at that depth, would you get similar results?
|
|
|
_wb_
|
2021-10-21 06:24:22
|
XYB in modular is effectively around 11 bit per component, roughly speaking (it's not really a nice power of two because the range is a bit weird)
|
|
2021-10-21 06:25:06
|
If you would use RGB at that _actual_ bit depth, it would likely compress about the same, yes
|
|
2021-10-21 06:27:21
|
(but just taking an 8 bit image, scaling everything to a higher bit depth, and encoding that will not result in a much larger file - the encoder will notice that only a fraction of the values are actually used, and it will use channel palette to effectively reduce things back to 8-bit)
|
|
|
Traneptora
|
2021-10-21 09:27:12
|
<@!794205442175402004> looks like I got the prober working, it only fails the fuzzer on 32-byte sizes
|
|
2021-10-21 09:27:18
|
I suspect those might actually just be valid JXL files though
|
|
2021-10-21 09:27:49
|
when you have 27-byte beauties like these, I think it's decently possible that these fuzzing false positives are not actually false positives but true positives https://0x0.st/-dBq.jxl
|
|
|
_wb_
|
2021-10-22 03:40:43
|
Nice!!
|
|
2021-10-22 03:58:01
|
how much are you parsing for that?
|
|
|
Jyrki Alakuijala
|
|
Would near lossless work better with XYB than RGB?
|
|
2021-10-22 07:15:29
|
Yes
|
|
|
Traneptora
|
|
_wb_
how much are you parsing for that?
|
|
2021-10-22 10:25:06
|
the size header in full, but without info on what the rest of the file looks like it's mostly just `all_default` and `extra_field` bits
|
|
2021-10-22 10:26:02
|
knowing what the bitstream would look like too would be nice
|
|
2021-10-22 10:29:58
|
in this particular failure, it parses 16 bits from the signature, 25 bits from the size header, (all zero), and another 10 bits, which is the minimum size metadata header with `all_default == false`
|
|
2021-10-22 10:30:53
|
which yields a 6-byte (48 bit) header with padding
|
|
2021-10-22 10:36:51
|
looks like this is what causes it to fail tho
|
|
2021-10-22 10:36:54
|
`ff0ae5dd62a2feb0fb7047ef2fa5f8fd70b17ee7d30c0aae0`
|
|
2021-10-22 10:37:23
|
it is not a JXL file, since djxl just says failed
|
|
|
|
Hello71
|
2021-10-23 12:50:34
|
that's 49 characters, did you miss some?
|
|
|
Traneptora
|
2021-10-23 03:39:33
|
Yes
|
|
2021-10-23 03:41:42
|
`ff0ae5dd62a2feb0fb7047ef2fa5f8fd70b17ee7d30c0aae00000000`
|
|
|
yurume
|
2021-10-23 12:32:35
|
```
Signature
11111111 ff = 255
00001010 type = 10
SizeHeader
1 small = true
10010 height_div8_minus_1 = 18
height = (18 + 1) * 8 = 152
11
1 ratio = 7
width = floor(height * 2) = 304
ImageMetadata
0 all_default = false
1 extra_fields = true
011 orientation_minus_1 = 3
orientation = 4
1 have_intr_size = true
intrinsic_size (SizeHeader)
1 small = true
00010 height_div8_minus_1 = 2
height = (2 + 1) * 8 = 24
011 ratio = 3
width = floor(height * 4 / 3) = 32
0 have_preview = false
1 have_animation = true
animation (AnimationHeader)
00 tps_numerator = 100
1010
111110 tps_denominator = 251
11
10110000
11111011
01110000
01000111 num_loops = 1198586800
1 have_timecodes = true
bit_depth (BitDepth)
1 float_sample = true
111011
11 bits_per_sample = 63
1011 exp_bits_minus_one = 11
exp_bits = 12
0 modular_16bit_buffers = false
0
00101 num_extra_channels = 4
extra_channel_info[0] (ExtraChannelInfo)
1 all_default = true
type = kAlpha (etc...)
extra_channel_info[1] (ExtraChannelInfo)
0 all_default = false
1
0 type = kDepth
bit_depth (BitDepth)
0 float_sample = false
10 bits_per_sample = 12
1111
1 dim_shift = 8
1111110 name_len = 47
01110000
10110001
01111110
11100111
11010011
00001100
00001010
10101110
00000000
00000000
00000000
00000000 name = (truncated)
```
|
|
|
Traneptora
`ff0ae5dd62a2feb0fb7047ef2fa5f8fd70b17ee7d30c0aae00000000`
|
|
2021-10-23 12:32:59
|
I've tried to parse it by hand, it fails at the extra channel name
|
|
|
_wb_
|
2021-10-23 01:14:46
|
A hand parsed <#824000991891554375> bitstream would make a nice infographic
|
|
2021-10-23 01:19:45
|
|
|
2021-10-23 01:20:32
|
Like that, but with bits instead of bytes
|
|
2021-10-23 01:21:50
|
Could also put the MA tree in jxl_from_tree syntax and as a tree on it, and what the image decodes to
|
|
|
Traneptora
|
|
yurume
I've tried to parse it by hand, it fails at the extra channel name
|
|
2021-10-23 01:31:08
|
I don't know the format of those various metadata headers
|
|