#1423 closed enhancement (fixed)
native jpeg encoder and decoder
Reported by: | Antoine Martin | Owned by: | alas |
---|---|---|---|
Priority: | major | Milestone: | 2.0 |
Component: | encodings | Version: | trunk |
Keywords: | Cc: |
Description
This will speed things up as we can use zero copy upload to the opengl backend directly as YUV data.
The Python Pillow module just doesn't give us YUV...
Attachments (2)
Change History (11)
Changed 4 years ago by
Attachment: | dec_jpeg.patch added |
---|
comment:1 Changed 4 years ago by
Status: | new → assigned |
---|---|
Summary: | native jpeg encode and decoder → native jpeg encoder and decoder |
Decoder added in r14863 + r14864, including build file updates and packaging.
It paints directly using YUV if the opengl backend is present (otherwise it is unused).
The new module should build out of the box on Fedora and centos. (opensuse will need a specfile update). It builds and runs fine on win32 as mingw-w64 already included everything we need.
OSX has the libturbojpeg.dylib
but not the matching pkgconfig file. I've created one by hand, it builds with warnings (probably an older version of libjpeg-turbo that we should update) - but the packaging step forgets it?
The encoder shouldn't be too difficult to add.
I don't think we want to go through the pain of hooking our own CSC module so we'll use the built-in libjpeg-turbo version, which is probably plenty fast already.
We should be getting zero-copy transfers from the XSHM, and we will be able to choose the subsampling based on the speed setting (which pillow did not do for us).
comment:2 Changed 4 years ago by
Owner: | changed from Antoine Martin to alas |
---|---|
Status: | assigned → new |
Lots of fixes and related changes:
- encoder added, decoder re-written using turbojpeg (much nicer): r14886, later improved in r14895 + r14897
- zero copy in network layer: r14885
Also found a big bug in opengl backend: r14898 (not sure why it didn't bite before..)
Somewhat related:
Ready for testing: the jpeg decoder and encoder should now be faster. BUT, we were previously always using YUV420P with the pillow based encoder whereas now we choose the pixel subsampling based on the quality setting. So this may actually be slower at higher quality settings.
Changed 4 years ago by
Attachment: | no-background-colour.png added |
---|
wiki rendered using the jpeg encoder
comment:3 Changed 4 years ago by
Owner: | changed from alas to Antoine Martin |
---|---|
Status: | new → assigned |
Found some visual artifacts as part of testing for #1426: the xpra wiki loses its background colour:
.
comment:4 Changed 4 years ago by
I suspect that the YUV output uses a different range than what we are used to with the avcodec and vpx output, so r14974 disables the YUV jpeg decoder until I can figure this out.
comment:5 Changed 4 years ago by
comment:6 Changed 4 years ago by
Owner: | changed from Antoine Martin to alas |
---|---|
Status: | assigned → new |
I give up on decoding to YUV: moved to #1438.
As of r15061 + r15062, we use this new decoder to RGB with both opengl and pixmap backings.
@afarr: this is mostly a FYI. This new codec is faster, that is all.
You can see the compression performance server side with "-d compress", client side with:
XPRA_JPEG_LOG_PERF=1 xpra attach --encodings=jpeg -d jpeg
I get:
decompress_to_rgb: size=694x244, subsampling=444, colorspace=YCbCr decompress jpeg to BGRX: 869 MB/s ( 677344 bytes in 0.7ms) decompress_to_rgb: size=694x244, subsampling=444, colorspace=YCbCr decompress jpeg to BGRX: 461 MB/s ( 677344 bytes in 1.4ms)
~400 to 900 MB/s is quite impressive.
comment:7 Changed 4 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Noted that it's speedier and closing.
comment:8 Changed 4 years ago by
r16228 fixes the python3 / cairo rendering which was broken by this change (jpeg decoder code should have been added to the superclass)
comment:9 Changed 4 days ago by
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1423
decode jpeg to RGB24