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