Level calculation in HEVC

 

Levels have been introduced in the previous article Grades, Levels , and Levels . H.265 defines a total of 13 levels, 1 2 2.1 3 3.1 4 4.1 5 5.1 5.2 6 6.1 6.2. So how to choose level?

The configuration file of the official reference sequence has already written the level and other parameters for us. If we want to use our own sequence, how to set the level?

Level is used to constrain the resolution, frame rate and bit rate. As shown below:

Max Luma Picture Size (samples) represents the number of pixels of the luminance component of each frame.

Max Luma Sample Rate (samples/s) represents the number of brightness pixels per second.

How to infer level from resolution and frame rate?

Under each level, just the width and height of the image must be less than or equal \sqrt{8*Max Luma Picture Size}, to avoid causing too extreme the shape of the image decoding problem.

For example, for 480P (832x480) video, the number of pixels per frame of the brightness component=832x480=399360, and the above table shows that its level must be above 3. If the frame rate is 60, the number of brightness pixels per second=832x480x60=23961600, all its levels 3.1 or above.

For example, for 720P (1280x720) video, the number of pixels per frame of the brightness component = 1280x720 = 921600, and the above table shows that its level must be 3.1 or higher. When the level is 4, the frame rate is at least 66846720/921600=72.5. As you can see, the following configuration file meets this requirement.

#======== File I/O ===============InputFile                     : ../../origCfP/Johnny_1280x720_60.yuvInputBitDepth                 : 8           # Input bitdepthInputChromaFormat             : 420         # Ratio of luminance to chrominance samplesFrameRate                     : 60          # Frame Rate per secondFrameSkip                     : 0           # Number of frames to be skipped in inputSourceWidth                   : 1280        # Input  frame widthSourceHeight                  : 720         # Input  frame heightFramesToBeEncoded             : 600         # Number of frames to be codedLevel                         : 4

Maximum storage frame number, DPB

The maximum number of stored frames is related to DPB-DPB: decoded picture buffer, decoded picture buffer area. When doing video decoding, several recent reference frames need to be buffered. This buffer is called DPB. So the maximum number of stored frames is also the maximum number of reference frames (ref).

When the image in the DPB reaches the maximum size under this level, the DPB can only store 6 frames of images. If the image in the DPB is smaller than the maximum size under this level, the DPB can store at most 16 frames of images (depending on the image size).

level also limits the maximum number of tiles in the horizontal and vertical directions of each frame of image, and the maximum number of tiles per second.

If you are interested, please follow the WeChat public account Video Coding

Guess you like

Origin blog.csdn.net/Dillon2015/article/details/106293310