34

Why Experts Are Wrong About AV1 Being Slow

 4 years ago
source link: https://www.tuicool.com/articles/Rvaiu2E
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

maURfui.jpg!web

Imagine someone trying to convince you that English is too slow:

“A French journalist can write an article in less than a day, while some English authors have taken years to write a single book, clearly English is too slow.”

A Video Format is a Language

Video formats, like AV1 , HEVC or VVC , are languages to express video. Similar to how books are made up of chapters, pages, paragraphs and sentences, compressed video is made up of groups of pictures (GOPs), frames, tiles and macroblocks.

If I take 5 different individuals, show them the same scene and ask them to write a description of it; I will most likely get 5 descriptions of different lengths, that won’t be written in the same amount of time and that contain different words, yet all 5 will be valid English. The same is true for video encoders.

When you write a book or a post like this one, the time consuming task is not language-related, it is thinking of your content, breaking up your ideas into paragraphs and choosing the words in your sentences. The same applies for a video encoder, writing the bit stream is only a small fraction of the total encoding time, most of the time is spent choosing how to break the frame into blocks, choosing motion vectors, etc. We often refer to this as searching.

To recap, whether you write a book in French, English or Spanish, if you are fluent in that language, the language itself is probably not going to have a major impact on the time it will take. The same applies to video formats. Whether the bit stream is AV1, HEVC or VVC, most of the encoding time is spent searching.

New English Words Improve the Language but Don’t Slow it Down

Here’s where some experts go astray, commercial video encoders don’t need to search every coding tool. Just like I don’t need to consider the word pneumonoultramicroscopicsilicovolcanoconiosis when I usually write a post. Adding more words to the English language does not make it slower, the same is true for video formats.

Commercial video encoders rely on search algorithms, that only consider a small relevant subset of the search space. These algorithms are what take up most of the encoding time and are not even part of the video format. In other words, you can use the same search algorithm in an H.264 encoder, an HEVC encoder or an AV1 encoder.

That’s why encoders like SVT-AV1 from Intel and Netflix , Rav1e from Mozilla and Vimeo and Cisco’s real time AV1 implementation are so important. These encoders implement different search algorithms that tailor to different needs. They also drive competition which will result in better search algorithms. In order for the AV1 video format to be a solution for everyone, everyone needs to get involved in making it right for them .

Can I encode AV1 at H.264 speeds? YES!

Odds are, if you consider the same search space in two different video formats you will get a similar trade-off between visual quality and bit rate. That’s not because one codec is ripping off the other, it’s because of information entropy .

While writing this post, I attended Big Apple Video 2019 , it was awesome to see Thomas Davies from Cisco making a very similar point . He refers to this as the golden triangle between codecs.

2miANjQ.png!web

The golden triangle between codecs presented by Thomas Davies at Big Apple Video .

The golden triangle shows what happens to the compression efficiency (horizontal axis) of a video format as the search space decreases (vertical axis). Ideally, for a video format to be better than another video format, the better format must be above and to the left of the other format.

“We observe significant real-world gains over H.264 and better complexity performance trade-offs than HEVC ” — Thomas Davies at Big Apple Video 2019 talking about AV1

This quote is important to understand; when compared to HEVC, AV1 offers a better complexity to encoding performance trade-off. What that means is that given the same processing time, you get more compression out of AV1 than HEVC (i.e. AV1 is above and to the left of HEVC). The reason for this is that you have more coding tools to chose from, so you can make better use of your time.

But the AOM encoder is slow

What confuses experts is that even with default settings, the Alliance for Open Media (AOM) encoder is slow, but as we have seen, that does not mean that the AV1 format is too slow. The AOM encoder is just a small part of the golden triangle, as more AV1 encoders emerge, we will discover the true shape of the golden triangle.

Let’s go back to the example of an author taking years to write a book, in some situations this will make financial sense because the book will sell over 1 million copies. That’s exactly why the AOM encoder is slow in many settings, because for some companies, like Facebook, Amazon, Apple, Netflix and Google this makes financial sense.

In conclusion, those claiming that the AV1 format is slow aren’t considering all the facts. More coding tools don’t make formats slower, they have the potential to make them faster. Although we don’t know the exact shape of the golden triangle, current indicators show that AV1 is fast. Spoiler alert: when we have the exact shape of the golden triangle we won’t discover that AV1 is slow, but faster than what we thought possible (this already happened with x264).

Looking for more video codec talk? I strongly recommend checking out Thomas Davies talk and the other awesome talks from the Big Apple Video conference.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK