View Full Version : Blu-ray compliancy (x264): Number of B-frames?
moviefan
25th March 2008, 11:15
Hi everyone,
I've had a look at the Blu-ray profile in meGUI and saw that the max. number of B-frames is set to 3 as well as the max. number of reference frames. Is this the absolute limitation for a 1080p Blu-ray video?
meisterlee
25th March 2008, 12:30
Max. B-frames 3 (H.264)
Max ref frames 4
moviefan
25th March 2008, 12:32
OK, when already talking of this, do you know the specs for the said settings for 720x576p/i (whether p is possible is discussed in another thread)?
Sagittaire
25th March 2008, 12:56
Max. B-frames 3 (H.264)
Max ref frames 4
For 4.1 level it's:
1/2/3 bframes without pyramidal bframe: 4 pref and 3 bref
3 bframes with pyramidal bframes: 3 pref and 2 bref
--bframe 1/2/3 --ref 3
--bframe 3 --b-pyramid --ref 2
moviefan
25th March 2008, 16:31
That's easy to understand, thanks Sagittaire! Comparing the variants you suggested, when should I use the first and when the second settings?
Sagittaire
25th March 2008, 18:14
--bframe 3 --b-pyramid --b-rdo --ref 2
really efficient for clean source and/or low motion
--bframe 1 --ref 3
3 bframes with noise/grain is useless
Anyway if bframe decision is good the encoder will never use in practice 3 pyramidal bframes with grainy/noisy source.
moviefan
25th March 2008, 23:52
@Sagittaire: Hm, weird, is it definitely fact that using pyramidal bframes limits the number of reference frames to 2? You always talk of a number of reference frames less than 4, while meisterlee says it was 4. I want to get the most out of x264 and thus don't care about encoding time. The source is pretty clean...
bigotti5
26th March 2008, 03:35
is it definitely fact that using pyramidal bframes limits the number of reference frames to 2
No (Level 4.1 does not, dont know for x264)
moviefan
26th March 2008, 10:43
So I could use
--bframe 3 --b-pyramid --ref 4
for a clean source and should get best quality as for these settings + Blu-ray compliancy?
blizzbit
26th March 2008, 16:51
Here are the settings of Elecard Converter Studio full quality profiles:
Blu-Ray:
B-frames: 1
Ref. frames: 4
Blu-Ray HD:
B-frames: 2
Ref. frames: 4
Use B-frames as reference/Pyramid coding is disabled for Blu-Ray SD and HD.
How about these settings?
Trahald
26th March 2008, 17:36
For some reason when I use ref = 4 i get jumpiness (thats with x264 or cinevision), but thats only with cyberlink and my 8500 (dont have standalone) ref = 3 works better. having said that...
bluray spec is max 3 b-frames and b-pyramid (in conjunction is 3 b-frames) is allowed. ref = 4 is correct to L4.1 w/1080p.
so in spec.. yes.
blizzbit
26th March 2008, 18:58
Thanks, Trahald.
Does this mean that...
with Pyramid coding
B-frames: 3
Ref. frames: 3 (for more compatibility, otherwise 4)
without Pyramid coding
B-frames: 1
Ref. frames: 3 (for more compatibility, otherwise 4)
If I set 2 or 3 B-frames here, I get the following AVC encoder message (Elecard Converter Studio):
2 B-frames: "It is recommended to use one B-frame or three B-frames with the following options for encoding: 'Adaptive B-frames', 'Use reference B-frames' and 'Pyramid coding'"
3 B-frames: "For encoding with three B-frames the following options must be enabled: 'Adaptive B-frames', 'Use reference B-frames' and 'Pyramid coding'"
What amazes me is that XolocoTuxmaster recommends 3 B-frames and 3 Ref. frames for Blu-ray encoding without B-Pyramids.
Preparing the video
With the nal_hrd patched x264 version, we use our favourite line/profile to encode the video, not forgetting these parameters in the final line:
--keyint 24 --min-keyint 1 --vbv-maxrate 38000 --vbv-bufsize 30000 --nal-hrd --mvrange 511 --level 4.1 --bframe 3 --ref 3 --aud --sar 1:1
And forgetting:
--b-pyramid
Source: Quick Blu-ray content (BD, BD-5 and BD-9) authoring guide (PS3+PowerDVD) (http://forum.doom9.org/showthread.php?t=134402)
Trahald
26th March 2008, 19:31
you know what.. i did the math using the spec.. and i may be wrong.. but i get that 3 would be max... here is the math
min( 1024 * MaxDPB/(PicWidthInMbs * FrameHeightInMbs * 384), 16)
1024 * (11288) / (120 * (( 2 – frame_mbs_only_flag ) * PicHeightInMapUnits) * 384)
1024 * 11288 / (120 * (( 2 - 1 ) * 68 ) * 384 )
1024 * 11288 / (120 * ( 68 ) * 384 )
11558912 / (3133440)
3.688888888888
min(3.6888,16) = 3.368888
so 3 would be max (num ref frames / max dec frame buffering).. weird
bigotti5
26th March 2008, 19:46
... here is the math
something wrong...
Specification lists for Level 4.1:
Picture Buffer 12288 kB (12582912 Bytes)
Max MBs 8192 (1920x1088 -> 8160 Macroblocks)
so
8192 (=Macroblocks) x 256 (=pixel per macroblock) x 1.5 (= 4:2:0 video uses 12 bit per pixel = 1.5 Byte)
8192 x 256 x 1.5 = 3145728
12582912 / 3145728 = 4
Level 4.1 certified Decoder can hold 4 Ref. Frames
Sagittaire
26th March 2008, 19:57
Well in fact it's 4 pref and 3 bref for level 4.1 but x264 use the same value for pref and bref. If you use pyramidal bframe you must use 3 pref and 2 bref.
imply for x264
--bframe 1/2/3 --ref 3
--bframe 3 --b-pyramid --ref 2
Other setting are not BluRay compliant.
Dark Shikari
26th March 2008, 20:01
Well in fact it's 4 pref and 3 bref for level 4.1 but x264 use the same value for pref and bref.No it doesn't. It hasn't done this for months. If you set --ref 4, it'll use 4 Prefs and 3 Brefs.
blizzbit
26th March 2008, 20:17
Hmmm... one noob question... where is difference between the MaxDPB (max decoded picture buffer) and MaxCPB (max VBV buffer)?
Sagittaire
26th March 2008, 20:24
No it doesn't. It hasn't done this for months. If you set --ref 4, it'll use 4 Prefs and 3 Brefs.
good news ... so it's:
imply for x264
--bframe 1/2/3 --ref 4
--bframe 3 --b-pyramid --ref 3
Trahald
26th March 2008, 20:49
oops.. i copied the MaxDPB value wrong from the table.. here is the revised calc
min( 1024 * MaxDPB/(PicWidthInMbs * FrameHeightInMbs * 384), 16)
1024 * (12288) / (120 * (( 2 – frame_mbs_only_flag ) * PicHeightInMapUnits) * 384)
1024 * 12288 / (120 * (( 2 - 1 ) * 68 ) * 384 )
1024 * 12288 / (120 * ( 68 ) * 384 )
11558912 / (3133440)
4.0156862745098039215686274509804
so 4
but weird i see pro streams (streams that have are tweaked out different PPS settings per picture and adaptive inloop filter levels per frame etc) using 2 and 3 refs. i suppose its knowledge the hardware that should be able to handle it cant?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.