Hi, it's HandyAndy Tech Tips here.
And today I'm going to tell you why H.265 HEVC, the latest video compression standard,
is so awesome!
Now, you know, video encoding has evolved a lot through the years.
From the very early MPEG-2, which was used on DVDs way back in 1996, to the most recent
H.264.
But every new standard seems to promise the same thing: identical quality to the previous
one, but at half the bitrate.
So how does H.265 achieve this?
Well, there's two main methods used in video compression.
One is called "interframe", which means that the previous and future frames are compared
to the current one, and we only encode what's changed.
To do this, we start on an I-frame, which is stored as a full image, much like a JPEG.
Then, we divide it into small 16 x 16 pixel areas - which, in the previous standard, were
called "macroblocks".
Now, we're going to advance to the next frame, and compare its macroblocks with that of the
I-frame.
If there are several blocks which are roughly the same, then we give the new frame the status
of a P-frame: that is, a predicted frame.
This means that what we can easily do is intercode block A - so, because it's identical, we can
just bring the pixel values directly across - and then we can intracode block B. In other
words, give it entirely unique pixel values that are only for this frame.
Now here is the H.265 difference.
Macroblocks have now been renamed to "coding tree units", and they can range from the original
16 x 16 size way up to 64 x 64.
Now, why is this such a big improvement?
Well, you've got to remember that, when H.264 was first standardized back in 2003, 1080p
video was the height of technology!
Now, of course, we've got 4K, and more efficient encoding is needed.
And this is exactly what larger macroblocks give you.
Now, the second big improvement has to do with intra-frame compression - in other words,
comparing areas within the same frame and looking for redundancy.
And the improvement is... wait for it... the increase in prediction directions!
What?
Well, remember these things?
Coding tree units, also called macroblocks?
They can actually be split further, into things called coding units, which can go down to
8 x 8 pixels.
And these - get this - they can be partitioned even further, cut up different ways into prediction
units.
Why would we bother doing this?
So we can mathematically generate pixel values in a block, instead of storing them.
And, therefore, we can massively reduce the size of each frame.
Here's how it works - I've got my tiny little prediction unit here, a little 4 x 4, and
it's surrounded by two groups of pixels, which I'll call Block A and Block B. Now, I can
actually use various intra-prediction modes on this structure.
I can use, for example, DC, which will basically fill this with the average of the surrounding
pixels.
This would be good on an outdoor scene, with a blue sky, where there's no real pattern
to it, it's more of a, just a single colour.
Alternatively, I can use an angular function.
So, say for example, if I have a line coming down here, and I want to continue it through
the block.
Using my angular function, I simply point to the direction where the line is coming
from, and it will extrapolate, or continue, that trend.
Now, here again, there is a difference with H.265, and it's a good one.
Back in the old days, I only had 9 prediction modes, but now I have access to - wait for
it - 35 different modes!
Now, the advantages to this are many, including far greater accuracy when larger block sizes
are used - say, for example, in 4K video - and generally much better quality compression.
So, they are the main reasons why H.265 is better.
Bit exhausting, hey?
But they're all theoretical, and what you might want to know is: when can you use it?
And the answer to that, unfortunately, is "not as often as you'd like".
I mean, you can't upload videos encoded with it to YouTube, and most web browsers don't
support playing H.265 natively.
But, it's been adopted as the default codec on 4K Blu-Ray, and, of course, you can play
it back on your PC, but you might need to use software decoding.
Anyway, I'm HandyAndy and thank you very much for watching my video on H.265.
Please subscribe to my channel for more tech videos.