View Full Version : Number of reference frame for a compliant H264 decoder
trican
7th November 2008, 23:00
Hi all,
I was just wondering does a H.264 have to support 16 reference frames to be considered fully compliant? I looked through the H.264 docs but I can't seem to find out the details. Any pointers would be much appreciated.
thanks
Sagekilla
7th November 2008, 23:36
Any normal software decoder should decode a stream with 16 refs perfectly fine. It'll take an absurd amount of memory for high reoslution streams but the decoder should handle it fine. If it's a hardware based one, like the VP2 engine on nvidia cards, then they usually strictly comply to the blu-ray spec.
If you're concerned about making your video playable on standalones, you can calculate the number of refs by doing (8294400 / width / height) = refs. In other words, for a 1080p source you can use 8294400 / 1920 / 1080 = 4 refs. Or 9 refs for 720p. But realistically you won't need that many.
trican
8th November 2008, 11:09
Thanks for that. I was more wondering from the perspective of design a decoder rather than creating an encoded bitstream.
Where does the 8294400 in your calculations come from?
Also where could i find the blu-ray spec?
Thanks, your assistance is very much appreciated
Sagekilla
8th November 2008, 19:05
From the perspective of a decoder, they should (memory permitted) be able to handle up to 16 refs perfectly fine at any arbitrary resolution. That's in the case of software decoders anyway, since they have access to the huge store of main memory. Also, technically the number I pointed out should be 12441600 (8294400 * 1.5) and it's the number of bytes allocated for the DPB (decoded picture buffer).
Since each frame takes up width * height * 1.5 bytes (for 720x480 --> 518400 bytes) you just divide that into the DPB size for the given level (In the case of Blu-ray, level 4.1 = of 12441600) to get the max number of reference frames, capped at 16.
I don't know off hand where you can find the blu-ray specs, but I can tell you it uses level 4.1 + High Profile I believe.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.