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 > VP9 and AV1

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th January 2023, 18:57   #2481  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 697
GCC 11.3.1 20221229 without _GLIBCXX_HAS_GTHREADS,
libavif 0.11.1.0-93035c1 / libwebp2avif b80553d (aom v3.5.0-305db30, svt-av1 1.4.1-91832ee)
https://www.sendspace.com/file/l0acha
Jamaika is offline   Reply With Quote
Old 16th January 2023, 14:51   #2482  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Quote:
Originally Posted by BlueSwordM View Post
There actually is an interesting reason for why aside from the usual encoding speed reasons, HW decoding support(for DRM purposes) and MPEG inertia: current encoders don't have deep psycho-visual pipelines outside of a few specific cases.

That means you can't use AV1 encoders to completely replace all use cases of previous most used encoders(x264, x265).
It's disappointing that re-inventing the wheel every generation seems to be de rigueur for every new encoder, and only some codecs ever get to that point at all. Alas.
foxyshadis is offline   Reply With Quote
Old 17th January 2023, 19:07   #2483  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,752
Quote:
Originally Posted by BlueSwordM View Post
There actually is an interesting reason for why aside from the usual encoding speed reasons, HW decoding support(for DRM purposes) and MPEG inertia: current encoders don't have deep psycho-visual pipelines outside of a few specific cases.

That means you can't use AV1 encoders to completely replace all use cases of previous most used encoders(x264, x265).
x264 was very unique in encoder history. It was the first broadly-used open source encoder, written and optimized by many eyeballs in the piracy scene. No encoder ever had a fraction of the test corpus or focus on real-world scenarios like x264 had, resulting in some decade-ahead-of-its-time psychovisual optimizations. One other encoder vendors saw what x264 could do, they could they reverse engineer from it. x265 inherited that psychovisual foundation, which other HEVC vendors were also able to reverse engineer from.

Porting those algorithms to an VPx derived codec was not straightforward due to some fundamental differences in how the codecs worked (the downside of all the oddnesses of that series to get around existing patents). Some of the learnings from x264 are applicable and have been applied, but others don't have a direct equivalent.

So a lot of work will need to get done over that, say, VVC, can inherit a lot more of.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 17th January 2023, 20:54   #2484  |  Link
nhw_pulsar
Registered User
 
Join Date: Apr 2017
Posts: 171
Compression bodies final goal/quest seems to ever and ever increase PSNR/SSIM, they seem to figure out that if you increase PSNR for example of +0.5dB then you automatically increase visual quality, but I also think that if you make psychovisual development, you can decrease PSNR of -0.5dB or more but you'll have an even better visual quality.

(Disclaimer: I speak for image compression, and I am tired that experts told me that my work is bad because it has bad PSNR...)
nhw_pulsar is offline   Reply With Quote
Old 17th January 2023, 22:14   #2485  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,752
Quote:
Originally Posted by nhw_pulsar View Post
Compression bodies final goal/quest seems to ever and ever increase PSNR/SSIM, they seem to figure out that if you increase PSNR for example of +0.5dB then you automatically increase visual quality, but I also think that if you make psychovisual development, you can decrease PSNR of -0.5dB or more but you'll have an even better visual quality.

(Disclaimer: I speak for image compression, and I am tired that experts told me that my work is bad because it has bad PSNR...)
I think the thought is that if you have good PSNR, you can add psychovisual tweaks easily enough. But if you can't do good PSNR as a baseline, it'd be hard to make psychovisual optimizations catch up. Which is sorta kinda true, with lots of caveats.

For example, the codec needs to have well-tuned features to enable that kind of psychovisual optimization. It's easy to have some promising-sounding features to improve psychovisually, but they need to be really tested at tuned to make sure they work well.

My classic example of a failure of this is VC-1 adaptive quantization. Like a lot of things, adaptive quantization in VC-1 is handled by a RLE bitmask. Each frame has a frame QP, and then any offset from the frame QP is handled as a PCM. 0 is same a frame QP, -2 would be two lower, +3 would be three higher. Then that gets run length encoded, imagining that there would be long runs of 0. But in a case where every macroblock gets its own QP, there's no RLE, and one can easily wind up with 4 bits of overhead per macro block. A 1080p frame has 8100 macro blocks, which would be about 4 Kbps per frame. 1080p60 could have up to 240 Kbps of QP offset, which can be enough that just using a fixed frame QP would result in better quality on net. It didn't matter for a VC-1 HD DVD or Blu-ray, but sure could at then-web bitrates.

So you wound up with tricks like using Adaptive Quant on just I frames, and never on B frames. Or adaptive quant algorithms that minimize QP variations below what would be psychovisually optimal in order to get better improvements on net. And there never was a VC-1 encoder that included all the best tools, so different encoder implementations got used for different use cases. It was a mess.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 17th January 2023, 22:43   #2486  |  Link
nhw_pulsar
Registered User
 
Join Date: Apr 2017
Posts: 171
Quote:
Originally Posted by benwaggoner View Post
I think the thought is that if you have good PSNR, you can add psychovisual tweaks easily enough. But if you can't do good PSNR as a baseline, it'd be hard to make psychovisual optimizations catch up. Which is sorta kinda true, with lots of caveats.
Ok, you're certainly right.But personally I only develop for visual quality from the start and I don't use PSNR at all... to the point that I think I have invented the anti-PSNR codec..., that has extremely low PSNR but very better visual quality than it however suggests...

Cheers,
Raphael
nhw_pulsar is offline   Reply With Quote
Old 18th January 2023, 00:06   #2487  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Quote:
Originally Posted by nhw_pulsar View Post
Compression bodies final goal/quest seems to ever and ever increase PSNR/SSIM, they seem to figure out that if you increase PSNR for example of +0.5dB then you automatically increase visual quality, but I also think that if you make psychovisual development, you can decrease PSNR of -0.5dB or more but you'll have an even better visual quality.

(Disclaimer: I speak for image compression, and I am tired that experts told me that my work is bad because it has bad PSNR...)
VMAF has taken over as the base metric for all major tool decisions, with PSNR relegated micro-optimizations of internal decisions (like selecting the best of a bunch of similar candidate blocks for the motion vector) because that's where it actually works. It took Netflix's clout to change old engineering attitudes. VMAF is still not perfect, it has its own severe failure modes, but it's at least a lot less imperfect than PSNR for overall picture perception.
foxyshadis is offline   Reply With Quote
Old 18th January 2023, 02:28   #2488  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
VC-1...Good work and I still value it. The VC-1 blu-rays I have dont fall behind their AVC counterparts.
Just for fun I installed Silverlight and encoded under a slightly starving scenario (50% of what would be appropriate):
A normally grainy 213Mbps M8Y0 FHD restored Film source (playing duration 1h48m)
into a 15Mbps VC-1 Blu-ray Stream, 12,3GB, so 1/2 BD-25. Parameters all-in, no shortcuts allowed.
Took quite long, like 6x realtime, very well threaded, saturated all cores of i9-11900K 100%.
Quality awesome, the minor compression artifacts were slightly increased grain patches,
eye-friendly and only to spot if I stopped and pixelpeeped the frame.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."

Last edited by Emulgator; 18th January 2023 at 02:36.
Emulgator is offline   Reply With Quote
Old 18th January 2023, 20:40   #2489  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,752
Quote:
Originally Posted by Emulgator View Post
VC-1...Good work and I still value it. The VC-1 blu-rays I have dont fall behind their AVC counterparts.
Just for fun I installed Silverlight and encoded under a slightly starving scenario (50% of what would be appropriate):
A normally grainy 213Mbps M8Y0 FHD restored Film source (playing duration 1h48m)
into a 15Mbps VC-1 Blu-ray Stream, 12,3GB, so 1/2 BD-25. Parameters all-in, no shortcuts allowed.
Took quite long, like 6x realtime, very well threaded, saturated all cores of i9-11900K 100%.
Quality awesome, the minor compression artifacts were slightly increased grain patches,
eye-friendly and only to spot if I stopped and pixelpeeped the frame.
The VC-1 PEP/CineVision PSE (sic?) toolchain was really good for it's time. The Adaptive Quant overhead issue wasn't that material; only about ~100 Kbps for 24p with ABR >15 Mbps. VC-1 had a quite advanced adaptive deadzone algorithm for its time, in part to get similar value to adaptive quant without the signaling overhead. HD DVD was limited to 14 frame GOPs, so there was a lot of smartness around I-frame placement and rate control. Blu-ray was a lot easier, with 24 frame GOPs and 40 Mbps peak.

The xscalar utility provided with the tools was also a big boost to the whole product. It supported excellent and configurable dithering modes back when truncation was the default. This really helped prevent banding with the 8-bit only Blu-ray. I'd say xscalar was the single biggest reason VC-1 discs often looked better than H.264 discs in the early days.

XScaler was written by Spears and Munsil, later purveyors of fine video test materials.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 20th January 2023, 21:24   #2490  |  Link
nhw_pulsar
Registered User
 
Join Date: Apr 2017
Posts: 171
Quote:
Originally Posted by foxyshadis View Post
VMAF has taken over as the base metric for all major tool decisions, with PSNR relegated micro-optimizations of internal decisions (like selecting the best of a bunch of similar candidate blocks for the motion vector) because that's where it actually works. It took Netflix's clout to change old engineering attitudes. VMAF is still not perfect, it has its own severe failure modes, but it's at least a lot less imperfect than PSNR for overall picture perception.
Hi @foxyshadis,

Thank you for your information.This confirmed what I noticed recently, as I downloaded the latest build of AVIF and compared it to a previous version from 5/6 months ago.I quickly tested and measured on 5 images and apparently it seems that the last version has worse PSNR, but better visual quality.I was still however surprised that AOM published a new version with worse PSNR, but thank you for letting me know that they develop for VMAF, hence the visual quality improvement despite PSNR drop.

When you say VMAF has become the reference metric in the industry, you speak for AOMedia? Because it seems that MPEG with VVC, ECM for example, still develop for PSNR?
nhw_pulsar is offline   Reply With Quote
Old 21st January 2023, 00:25   #2491  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,752
Quote:
Originally Posted by nhw_pulsar View Post
When you say VMAF has become the reference metric in the industry, you speak for AOMedia? Because it seems that MPEG with VVC, ECM for example, still develop for PSNR?
I see VMAF used a lot in encode tuning (picking the right encoder settings), some in encoder development (implementation of a given codec), and not much in codec development itself.

VMAF really isn't an "objective metric" in the classic sense. VMAF is a collection of machine learning models trained to predict subjective ratings using ground truth of a bunch of x264 encoded variations. The training data is a set of simple objective metrics paired with the objective scores for clips with those values.

Thus there is no "one right way" to calculate VMAF like there is like PSNR and SSIM. There have been many different versions of the models, and there are different ones for different output resolutions. So the same file could have substantially different VMAF scores depending on which VMAF version is being used, and which model of each version has been selected.

Also, VMAF is only as accurate as the training data. It hasn't been trained on still images or HDR content or VVC style motion artifacts or AV1 grain sythesis, so it's more luck than a natural property if it winds up being a useful metric for those out-of-scenario uses.

Which is why I get really nervous about tools being overly tuned towards VMAF, because VMAF absolutely has areas it's not good at. For example, it only looks at luma, not chroma, so content could have U and V flipped and still get a good VMAF score! A fully automated encoder tuning using just VMAF would naturally jack chroma QPs up to the maximum to lower luma QP a little, for a much worse subjective experience.

I've seen other in-development metrics approach that combine bitstream analysis and full reference to provide much higher correlation to subjective quality than VMAF, especially for HDR, so VMAF isn't some sort of theoretical maximum. It was revolutionary and the least-bad metric we'd had to date.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 21st January 2023, 11:48   #2492  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 697
GCC 11.3.1 20221229 without _GLIBCXX_HAS_GTHREADS, SIMD AVX
libavif 0.11.1.0-62f8095 / libwebp-->avif b80553d (aom v3.5.0-9c91575, svt-av1 1.4.1-ad82cde) / libheif-->avif 96a114f (aom v3.5.0-9c91575, svt-av1 1.4.1-ad82cde)
https://www.sendspace.com/file/4kd4ud
Jamaika is offline   Reply With Quote
Old 21st January 2023, 20:09   #2493  |  Link
nhw_pulsar
Registered User
 
Join Date: Apr 2017
Posts: 171
Quote:
Originally Posted by benwaggoner View Post
It hasn't been trained on still images or HDR content or VVC style motion artifacts or AV1 grain synthesis
As I am only trained on still image artifacts, I am rather fascinated by people who talk about motion artifacts, as I have no knowledge on it.

So VVC has its own style of motion artifacts? If you have time, could you or another expert let us know if VVC style motion artifacts are visually more pleasant than AV1 motion artifacts for example?

Cheers,
Raphael
nhw_pulsar is offline   Reply With Quote
Old 23rd January 2023, 03:58   #2494  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,752
Quote:
Originally Posted by nhw_pulsar View Post
As I am only trained on still image artifacts, I am rather fascinated by people who talk about motion artifacts, as I have no knowledge on it.

So VVC has its own style of motion artifacts? If you have time, could you or another expert let us know if VVC style motion artifacts are visually more pleasant than AV1 motion artifacts for example?
VVC has some really great tools to keep high QP inter prediction from revealing underlying block structure, which keeps highly compressed motion looking a lot more natural.

AV1 has some nice features in the same area as well, which provide good visible benefits at high compression ratios. I've not compared AV1 and VVC them in depth in this regard. It's kind of hard to separate any one tool out of the general codec and encoder alchemy*. Bit-for-bit, VVC is clearly a stronger codec than either AV1 or HEVC, although the ecosystem is still 1-2 years from broad deployment.

*A good 20+ years ago Touradj Ebrahimi told me that making a codec is "10% science, 20% alchemy, and 70% SUN worship."

In that we start with some good theory about how to get improvements with new tools, kind of mash them together in different ways and see what seems to work, and then simulate the heck of it to tune quant tables and symbols for optimum entropy coding and all that.

Obviously, that was from a post MPEG-4 part 2, pre H.264, SPARC for high performance compute era. But still some deep truths in there. Today it'd be machine learning instead of SUN worship.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 29th January 2023, 10:49   #2495  |  Link
megalol
Registered User
 
Join Date: Jan 2023
Posts: 2
Quote:
Originally Posted by Jamaika View Post
GCC 11.3.1 20221229 without _GLIBCXX_HAS_GTHREADS, SIMD AVX
libavif 0.11.1.0-62f8095 / libwebp-->avif b80553d (aom v3.5.0-9c91575, svt-av1 1.4.1-ad82cde) / libheif-->avif 96a114f (aom v3.5.0-9c91575, svt-av1 1.4.1-ad82cde)
https://www.sendspace.com/file/4kd4ud
Hi, thanks, useful tools but its has very big problem that converted to avif webp images with av1enc_avx.exe looks much darker (tried with older version posted here also and different settings). If I do the same with libvips or imagemagick for example then it has the same brightness.

Last edited by megalol; 29th January 2023 at 10:56.
megalol is offline   Reply With Quote
Old 30th January 2023, 09:39   #2496  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Quote:
Originally Posted by megalol View Post
Hi, thanks, useful tools but its has very big problem that converted to avif webp images with av1enc_avx.exe looks much darker (tried with older version posted here also and different settings). If I do the same with libvips or imagemagick for example then it has the same brightness.
av1enc is a gstreamer test application that assumes a number of properties that often don't apply to images. If you think it should, report the error to gstreamer. (But I'm pretty sure I've seen this in their tracker.) I wouldn't touch it with a six-foot pole for avif, even if it's great for streaming and playback.

avifenc or heifenc are proper image encoders that offer the full suite of detection and override options. libvips and ImageMagick both use libheif, though in a different way than these command-line tools.
foxyshadis is offline   Reply With Quote
Old 30th January 2023, 11:13   #2497  |  Link
megalol
Registered User
 
Join Date: Jan 2023
Posts: 2
Quote:
Originally Posted by foxyshadis View Post
av1enc is a gstreamer test application that assumes a number of properties that often don't apply to images. If you think it should, report the error to gstreamer. (But I'm pretty sure I've seen this in their tracker.) I wouldn't touch it with a six-foot pole for avif, even if it's great for streaming and playback.

avifenc or heifenc are proper image encoders that offer the full suite of detection and override options. libvips and ImageMagick both use libheif, though in a different way than these command-line tools.
I wouldn't use av1enc either if there would be direct webp->avif support in avifenc because I agree that its best tool for avif.
megalol is offline   Reply With Quote
Old 23rd February 2023, 01:01   #2498  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
New uploads: (MSYS2; MinGW32 / MinGW64: GCC 12.2.0)

AOM _v3.6.0-252-gdfbaa9891

rav1e 0.6.1-4-gf178e97

dav1d 1.1.0-0-g9593e62

SVT-AV1 v1.4.1-79-gaef9ee9e

avif 0.11.1-86d66f0
dav1d [dec]:1.1.0-0-g9593e62, aom [enc/dec]:3.6.0-252-gdfbaa9891, rav1e [enc]:0.6.1 (p20230214-4-gf178e97)
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 29th March 2023, 08:46   #2499  |  Link
hajj_3
Registered User
 
Join Date: Mar 2004
Posts: 1,120
Youtube is adding AV1 livestream uploading using RTMP+ - https://www.tomshardware.com/news/av...ing-to-youtube
hajj_3 is offline   Reply With Quote
Old 2nd April 2023, 00:33   #2500  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Eh, for streamers, not for those who actually watch those streams, which is my use case...
This means that although you'll be able to stream in AV1 and save some bitrate yourself instead of streaming in H.264, unfortunately YouTube will still re-encode to VP9...
In other words, although it's a good thing for streamers, it's not really going to affect viewers that much... at least not in my use case.
This is because my use case is pretty peculiar: we stream a 20 Mbit/s H.264 FULL HD 25p 8bit live feed containing news which Google re-encodes to a crappy low bitrate VP9, thus nullifying the whole thing.
I'm sure this is the case for plenty of other news broadcasters who picked YouTube to stream their contents for free.
What I'd like to see is AV1 actually being served to viewers in live streams so that they'll be able to enjoy a much better quality.
Anyway, allowing streamers to actually stream in AV1 is a first step...

Quote:
The only side-effect of YouTube's implementation is that videos will still get transcoded to VP9. This means AV1 live streams will be re-coded to YouTube's VP9 codec.
FranceBB 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 02:08.


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