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. |
![]() |
#1 | Link | ||
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 6,914
|
How to calculating max ref for level,....
Wanting to calculate the max number of refs allowed for a specific avc level I searched the forum and then based my calculation on http://forum.doom9.org/showthread.php?t=102048
which gave me Quote:
MaxDPB >= (bytes in a frame) * min(16, ref + (pyramid ? 2 : bframes ? 1 : 0)) as basis I rearranged it to Min(this->maxDPB(level)/bytesPerFrame - bframeModifier, 16) where: maxDPB = 12582912 (for Level 4.1) bytesPerFrame = (pixel width)*(pixel height)*1.5 (since x264 only support 4:2:0 atm) = 1920*1080*1.5 bframeModifier = 0 when no bframes are used, 1 when bframes are enabled and 2 when bframes&pyramid are enabled. using this I get: with bframes: Min(this->maxDPB(level)/bytesPerFrame - bframeModifier, 16) maxDPB = 12582912 bytesPerFrame = 3110401 maxDPB/bytesPerFrame = 4 bframeModifier = 0 -> maxRef = 4 with bframes: Min(this->maxDPB(level)/bytesPerFrame - bframeModifier, 16) maxDPB = 12582912 bytesPerFrame = 3110401 maxDPB/bytesPerFrame = 4 bframeModifier = 1 -> maxRef = 3 with bframes&pyramid: Min(this->maxDPB(level)/bytesPerFrame - bframeModifier, 16) maxDPB = 12582912 bytesPerFrame = 3110401 maxDPB/bytesPerFrame = 4 bframeModifier = 2 -> maxRef = 2 Trahald&Co nutzen die Formel: min( 1024 * MaxDPB/(PicWidthInMbs * FrameHeightInMbs * 384), 16) 1024 * (12288) / (120 * (( 2 – frame_mbs_only_flag ) * PicHeightInMapUnits) * 384) maxDPB / (Width/16 * ( 2 – frame_mbs_only_flag ) * Height/16 * 384) wobei frame_mbs_only_flag = 0 heißt man encoded interlaced But looking at http://forum.doom9.org/showthread.php?t=136258 Trahald uses a different formula. Quote:
and frame_mbs_only_flag = 1 assuming the material is progressive (iiirc frame_mbs_only_flag = 0 means material is interlaced) 1st thing about this formula that I registered was that: a. it doesn't care about B-Frames b. it cares about interlacing Thanks for reading up to here. ![]() Now here's my question/problem: How does one calculate the maximum number of frames? (I suspect that the 'real' formula is a mix of the two above. ![]() ![]() Cu Selur |
||
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|