Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th December 2014, 03:39   #1  |  Link
xooyoozoo
Registered User
 
Join Date: Dec 2012
Posts: 197
BPG Image Format (HEVC subset for browsers)

Website

There's a bundled javascript decoder so you can look at examples:

Base bitstream is a subset of Main 4:4:4 16 Still Picture, and when present, an alpha plane is simply a separate monochrome bitstream. The key difference is that header syntax is changed to reduce filesize overhead. However, the list of allowed coding tools is rather permissive, so almost every present and future HEVC intra-frame should be "remuxable" into this format.

On the site, there are links to the source files and Windows binary. The code by default link to the HM for HEVC encode. You can get it to link to x265, though CQP usage is hardcoded into the glue file, and I'm not sure how developed x265's 12/14-bit and 422/444 code paths are.

Edit: there's a discussion thread for this on HN.

Last edited by xooyoozoo; 6th December 2014 at 04:03.
xooyoozoo is offline   Reply With Quote
Old 6th December 2014, 07:17   #2  |  Link
gamebox
Registered User
 
Join Date: Nov 2011
Posts: 66
It seems rather powerful (it has a good base technology, anyway), but I can't seem to be able to find the list of command line parameters to test the encoder/decoder myself.

Is this a one-man-effort to promote a novel use for HEVC, or is it something being considered as a potential new, worldwide, universal format to replace JPG or co-exist with it (as happened with PNG and GIF before)?
gamebox is offline   Reply With Quote
Old 6th December 2014, 07:28   #3  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,351
Thanks for the info *THUMBS UP*

Yes, the thing seems to work

And since the application is actually slow, a progress indicator would be nice

Quote:
Originally Posted by gamebox
but I can't seem to be able to find the list of command line parameters to test the encoder/decoder myself.
Code:
BPG Image Encoder version 0.9
usage: bpgenc [options] infile.[jpg|png]

Main options:
-h                   show the full help
-o outfile           set output filename (default = out.bpg)
-q qp                set quantizer parameter (smaller gives better quality,
                     range: 0-51, default = 28)
-f cfmt              set the preferred chroma format (420, 422, 444,
                     default=420)
-c color_space       set the preferred color space (ycbcr, rgb, ycgco,
                     default=ycbcr)
-b bit_depth         set the bit depth (8 to 12, default = 10)
-lossless            enable lossless mode
filler56789 is offline   Reply With Quote
Old 6th December 2014, 09:47   #4  |  Link
easyfab
Registered User
 
Join Date: Jan 2002
Posts: 332
Are there others ( hidden) options ?
Because in readme :

x265 is used when the compression level ('-m' option of bpgenc) is < 9

I suppose I must read source code .
easyfab is offline   Reply With Quote
Old 6th December 2014, 13:17   #5  |  Link
xkinn123
Registered User
 
Join Date: Mar 2014
Posts: 27
it would be a great codec this year for sharing secret pictures
i'm surprised with that transparent ability
xkinn123 is offline   Reply With Quote
Old 6th December 2014, 13:57   #6  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 729
If anybody is interested in knowing how this compares in lossless mode, I quickly tried compressing some screencaps (mostly old or new animation).

Apparently it beats PNG, but similarly to webp and jpeg-xr, it falls short of jpeg2000 in this usage (lossless, I repeat).



Filesizes for some random images I tried:
(the numbers go like this: (1) PNG level9 through Xnview - (2) BPG via the binary from the original site - (3) Jpeg2000 through Xnview/Lura plugin):
(Here they are in a gallery, refer to picture order to see what results are for which one)


489 KB - 395 KB - 352 KB
2,41 MB - 1,94 MB - 1,85 MB
479 KB - 382 KB - 348 KB
2,28 MB - 1,83 MB - 1,63 MB
943 KB - 705 KB - 734 KB (win for BPG - seems the format favours smooth images... or naughty ones?)
mandarinka is offline   Reply With Quote
Old 6th December 2014, 15:47   #7  |  Link
Bloax
The speed of stupid
 
Bloax's Avatar
 
Join Date: Sep 2011
Posts: 317
The program silently dies on indexed PNGs and crashes hard on certain JPEG images for some reason.
Bloax is offline   Reply With Quote
Old 6th December 2014, 16:56   #8  |  Link
gamebox
Registered User
 
Join Date: Nov 2011
Posts: 66
Quite limited in resolution in my case, too. Won't encode 1920*3206 pixel JPEG. I guess the problem is caused by high RAM requirements for large images, or the reference HEVC encoder itself.
gamebox is offline   Reply With Quote
Old 6th December 2014, 17:08   #9  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 729
Hmm, it seems it does substantially better than J2K in lossless compression of computer screenshots (I tested on a printscreen image of the hacker news thread, 1920x1080), but both are far from competitive with PNG in this case.

JPEG2K: 815 KB
BPG: 331 KB
PNG: 145 KB (still massively better for this usercase).
mandarinka is offline   Reply With Quote
Old 6th December 2014, 17:45   #10  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
Why such a big difference ? It seems that need to look at working with a bit depth (to save bitrate; use different methods to select more profitable).
Gravitator is offline   Reply With Quote
Old 6th December 2014, 17:57   #11  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 729
Large part of the sample image (I already deleted it, but just open the hacker news thread in browser, maximize it, and you have the idea) is just repeat of the same color.

I guess PNG's deflate coding might be more suited to this, whereas HEVC has trouble due to the transforming architecture? (I have no idea if the BPG encoder used the lossless and transform bypass tools of the format properly.)
mandarinka is offline   Reply With Quote
Old 6th December 2014, 20:12   #12  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by xooyoozoo View Post
Website

There's a bundled javascript decoder so you can look at examples:
It's not that difficult to beat JPEG nowadays. Did anybody make an in-depth comparison against WebP yet?
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 6th December 2014 at 20:15.
LoRd_MuldeR is offline   Reply With Quote
Old 6th December 2014, 21:19   #13  |  Link
xooyoozoo
Registered User
 
Join Date: Dec 2012
Posts: 197
Quote:
Originally Posted by easyfab View Post
x265 is used when the compression level ('-m' option of bpgenc) is < 9
Oh, maybe the official binary links to both encoders.

It's also weird that the HM is used as the default 'high-quality' option. x265's intra prediction is supposed to be superior to HM by now, and adaptive quant is too good a perceptual-tool to pass up. Perhaps the guy made his judgement before the recent spate of 10bit and 422+ bugfix commits.

Quote:
Originally Posted by mandarinka View Post
Apparently it beats PNG, but similarly to webp and jpeg-xr, it falls short of jpeg2000 in this usage (lossless, I repeat).
HEVC Lossless performance for Intra will be relatively "non-state-of-the-art" until the Screen Content extension and profiles are completed. Most of the new tools there are meant for computer content (where they work REALLY well), but adaptive color transform in particular is extremely useful for lossless photos.

Quote:
Originally Posted by LoRd_MuldeR View Post
It's not that difficult to beat JPEG nowadays. Did anybody make an in-depth comparison against WebP yet?
The guy referenced Mozilla's study on image codec performance. Assuming that the HEVC intra-test page I linked above still applies, x265 with AQ should do even better here.
xooyoozoo is offline   Reply With Quote
Old 6th December 2014, 23:24   #14  |  Link
Nintendo Maniac 64
Registered User
 
Nintendo Maniac 64's Avatar
 
Join Date: Nov 2009
Location: Northeast Ohio
Posts: 447
What I'm interested in is how it compares with Daala currently...
Nintendo Maniac 64 is offline   Reply With Quote
Old 7th December 2014, 00:10   #15  |  Link
Tommy Carrot
Registered User
 
Tommy Carrot's Avatar
 
Join Date: Mar 2002
Posts: 863
Quote:
Originally Posted by LoRd_MuldeR View Post
It's not that difficult to beat JPEG nowadays. Did anybody make an in-depth comparison against WebP yet?
WebP has the same problem these new image formats have: it's superior at high compression rates, where jpeg starts to fall apart to blocks. But image sizes are no big deal anymore, so nobody uses that high compression on images. At sane compression levels, these new and advanced image formats are not better at all, in fact they look smoother and blurrier than jpeg (partly because jpeg's ringing makes the image look sharper and more detailed, but hey, it looks better). This BPG format is probably the first one that doesn't really have this issue, while being undoubtedly much better at high compression rates.

Quote:
Originally Posted by Nintendo Maniac 64 View Post
What I'm interested in is how it compares with Daala currently...
Daala is nowhere near ready for action. It's improving quite rapidly, that's what makes it interesting, but in its current form it's not competitive yet. It has rather noticeable ringing artifacts, and at higher compression rates, chroma artifacts. But i think it has the potential to improve quite a lot in the future, maybe even beyond HEVC.

Last edited by Tommy Carrot; 7th December 2014 at 01:59. Reason: typo
Tommy Carrot is offline   Reply With Quote
Old 7th December 2014, 01:03   #16  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 729
Quote:
Originally Posted by Nintendo Maniac 64 View Post
What I'm interested in is how it compares with Daala currently...
One place where the news was discussed had this comparison uploaded:
Bild "1417868877483q5jbq.png" anzeigen.

Looks that at the ridiculously small bitrate used, HEVC currently smokes WEBP as well as current Daala quite handily.

Edit: you can also look at this demo: http://people.xiph.org/~xiphmont/dem...1-tool2b.shtml and compare x265 to Daala. The encodes probably aren't current though.

Last edited by mandarinka; 7th December 2014 at 01:08.
mandarinka is offline   Reply With Quote
Old 7th December 2014, 01:59   #17  |  Link
xooyoozoo
Registered User
 
Join Date: Dec 2012
Posts: 197
The x265_glue file is easily modified to get more sane x265 settings. Here's a diff with defaults set to my own tastes.

Edit: Diff changed to version compatible with libbpg 0.9.1. Setting names were also changed, and both deblocking & chroma offsets now also apply to HM encoder.

Last edited by xooyoozoo; 9th December 2014 at 04:07.
xooyoozoo is offline   Reply With Quote
Old 8th December 2014, 00:22   #18  |  Link
Nintendo Maniac 64
Registered User
 
Nintendo Maniac 64's Avatar
 
Join Date: Nov 2009
Location: Northeast Ohio
Posts: 447
Quote:
Originally Posted by mandarinka View Post
The encodes probably aren't current though.
You can find recent Daala builds here:
https://www.dropbox.com/sh/e1xnuxga4...qdReMWbka?dl=0
Nintendo Maniac 64 is offline   Reply With Quote
Old 9th December 2014, 00:54   #19  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Quote:
Originally Posted by mandarinka View Post
One place where the news was discussed had this comparison uploaded:
Bild "1417868877483q5jbq.png" anzeigen.

Looks that at the ridiculously small bitrate used, HEVC currently smokes WEBP as well as current Daala quite handily.

Edit: you can also look at this demo: http://people.xiph.org/~xiphmont/dem...1-tool2b.shtml and compare x265 to Daala. The encodes probably aren't current though.
I've tested lots of complex patterned images, and HEVC's (or at least x265's) intra prediction is hands down far better than AVC, VP8, VP9, or Daala. (Never played with VP10 alpha.) It's easily the best in the field today, and other designs have a long way to go to catch up.

For screenshots and the like, always turn --cu-lossless and --tskip on for x265, so that you're not wasting bits fighting the DCT when you don't have to. x265 can already switch DCT on and off adaptively at RDO 3 and up, so even without the screen coding tools it can be a worthy competitor to PNG.

At this point it's kind of pointless to use HM for anything but rExt (12+ bits), now x265 that has full 4:4:4 10-bit support. I like the file format, and the fact that he went to the effort of completely specifying the format using the same semantics as the HEVC spec is a big plus, though "can be supported in hardware" is pretty optimistic.

The only thing missing is basic matrix descriptions, YCbCr is always 601 and RGB just is. You have to include a full ICC profile instead of having a few standards to pick from (601, 709, 2020, sRGB, Adobe RGB, Adobe Wide RGB). That would save a bit of space, so I'll hit him up about it.

Edit: Looks like you can easily compile it without HM support and it'll just use x265 for everything.

Last edited by foxyshadis; 9th December 2014 at 01:18.
foxyshadis is offline   Reply With Quote
Old 9th December 2014, 03:54   #20  |  Link
xooyoozoo
Registered User
 
Join Date: Dec 2012
Posts: 197
Testing, testing.

This is mostly me playing around and trying to graft bpgdec.js and libwebp.js into a copy of xiph.org page linked above. It's a freshman attempt at that (I knew exactly zero html/javascript before this) so expect compatibility errors, especially on mobile.

Note that only Safari can currently decode jpeg2000 images.
xooyoozoo is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:35.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.