Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > (HD) DVD, Blu-ray & (S)VCD > (HD) DVD & Blu-ray authoring

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th March 2008, 11:15   #1  |  Link
moviefan
Registered User
 
Join Date: Jul 2005
Posts: 438
Blu-ray compliancy (x264): Number of B-frames?

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?
moviefan is offline   Reply With Quote
Old 25th March 2008, 12:30   #2  |  Link
meisterlee
Registered User
 
meisterlee's Avatar
 
Join Date: Nov 2007
Location: Germany
Posts: 7
Max. B-frames 3 (H.264)
Max ref frames 4
meisterlee is offline   Reply With Quote
Old 25th March 2008, 12:32   #3  |  Link
moviefan
Registered User
 
Join Date: Jul 2005
Posts: 438
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)?
moviefan is offline   Reply With Quote
Old 25th March 2008, 12:56   #4  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
Quote:
Originally Posted by meisterlee View Post
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
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9
Sagittaire is offline   Reply With Quote
Old 25th March 2008, 16:31   #5  |  Link
moviefan
Registered User
 
Join Date: Jul 2005
Posts: 438
That's easy to understand, thanks Sagittaire! Comparing the variants you suggested, when should I use the first and when the second settings?
moviefan is offline   Reply With Quote
Old 25th March 2008, 18:14   #6  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
--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.
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9
Sagittaire is offline   Reply With Quote
Old 25th March 2008, 23:52   #7  |  Link
moviefan
Registered User
 
Join Date: Jul 2005
Posts: 438
@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...
moviefan is offline   Reply With Quote
Old 26th March 2008, 03:35   #8  |  Link
bigotti5
Spielberger
 
bigotti5's Avatar
 
Join Date: Feb 2005
Posts: 838
Quote:
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)
bigotti5 is offline   Reply With Quote
Old 26th March 2008, 10:43   #9  |  Link
moviefan
Registered User
 
Join Date: Jul 2005
Posts: 438
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?
moviefan is offline   Reply With Quote
Old 26th March 2008, 16:51   #10  |  Link
blizzbit
Registered User
 
Join Date: Mar 2008
Posts: 16
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?
blizzbit is offline   Reply With Quote
Old 26th March 2008, 17:36   #11  |  Link
Trahald
Wewkiee
 
Trahald's Avatar
 
Join Date: Feb 2002
Location: kashyyyk
Posts: 2,269
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.
__________________
...yeah...but...why on earth would I compare apples with apples?
Trahald is offline   Reply With Quote
Old 26th March 2008, 18:58   #12  |  Link
blizzbit
Registered User
 
Join Date: Mar 2008
Posts: 16
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.

Quote:
Originally Posted by XolocoTuxmaster View Post
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)
blizzbit is offline   Reply With Quote
Old 26th March 2008, 19:31   #13  |  Link
Trahald
Wewkiee
 
Trahald's Avatar
 
Join Date: Feb 2002
Location: kashyyyk
Posts: 2,269
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

Code:
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
__________________
...yeah...but...why on earth would I compare apples with apples?
Trahald is offline   Reply With Quote
Old 26th March 2008, 19:46   #14  |  Link
bigotti5
Spielberger
 
bigotti5's Avatar
 
Join Date: Feb 2005
Posts: 838
Quote:
... 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
bigotti5 is offline   Reply With Quote
Old 26th March 2008, 19:57   #15  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
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.
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9
Sagittaire is offline   Reply With Quote
Old 26th March 2008, 20:01   #16  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by Sagittaire View Post
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.
Dark Shikari is offline   Reply With Quote
Old 26th March 2008, 20:17   #17  |  Link
blizzbit
Registered User
 
Join Date: Mar 2008
Posts: 16
Hmmm... one noob question... where is difference between the MaxDPB (max decoded picture buffer) and MaxCPB (max VBV buffer)?
blizzbit is offline   Reply With Quote
Old 26th March 2008, 20:24   #18  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
Quote:
Originally Posted by Dark Shikari View Post
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
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9
Sagittaire is offline   Reply With Quote
Old 26th March 2008, 20:49   #19  |  Link
Trahald
Wewkiee
 
Trahald's Avatar
 
Join Date: Feb 2002
Location: kashyyyk
Posts: 2,269
oops.. i copied the MaxDPB value wrong from the table.. here is the revised calc
Code:
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?
__________________
...yeah...but...why on earth would I compare apples with apples?

Last edited by Trahald; 26th March 2008 at 20:53.
Trahald is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:17.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.