X264 rev1198 MB-tree ratecontrol

Source: Internet
Author: User

The rest, as they say, is the history.

This is not too much.
The GIT repository link is in this http://git.videolan.org/gitweb.cgi? P = x264.git; A = commit; H = bb66c482242a0747823661b212114c1a2f015fe3

DS adults are also excited to write an EP article
A tree of thought
Well, of course, I won't bother you with the mentality of installing wenqing...

However, I am interested in the implementation principle of the MB-tree. Let's look at the original DS text.

About a year and a half ago, I had an idea: what if we made a graph of how each block of the video referenced other blocks temporally and used this graph to increase quality on blocks which are referenced a lot and lower it on those which are referenced less?

Here, if we can record and sort out the frequency of MB referenced in each frame, we may be able to optimize the bit allocation policy for each MB Encoding Based on the feedback of this frequency, to improve the quality.
This is not hard to understand. If a biased (such as carrying incorrect image information) encoded MB is frequently used as a reference frame, then the error of this reference frame will be transmitted to all the MB used for the estimation, so the cumulative deterioration effect is formed, which is also the reason for DS's propagation.

My guess was it had a simple 2-pass heuristic for I-frame quantizers; low-motion scenes wocould get higher quality I-frames and high-motion scenes wocould get lower quality I-frames; it seemed pretty straightforward. the way I decided to do it was via a concept I called "propagation."

This is a progressive Quantization Algorithm Used in mainconcept for I frames. In Low Motion scenarios, high-quality I frames are obtained. On the contrary, low quality I frames are obtained in high motion scenarios.
The advantage of this strategy is not hard to understand. A large amount of MB in Low Motion scenarios will be repeatedly applied to the prediction of subsequent encoding blocks. This method ensures that the error of these blocks is relatively small, this reduces the speed at which errors accumulate and deteriorate. For Large Dynamic scenarios, the movement is often the prediction block within the frame. (Of course, this is determined by MSE)
In addition, the advantage of this strategy comes from the human eye. The human eye's recognition capability for motion scenes decreases with the frequency of motion, however, due to the temporary influence of vision, this decreasing rate will accelerate with the gradual acceleration of motion scenes. Therefore, it is difficult for human eyes to identify errors in Large Dynamic scenarios, low Bit Rate is used to encode Large Dynamic scenarios, which is also in line with the subjective quality of people.

Clearly, the propagation method is just another way of implementing the basic concept of qcomp: frames whose data doesn't propagate far are basically high complexity, and frames whose data does propagate far are basically low complexity. as a result, I disabled qcomp when testing this idea. and the tests bore me out: there was a significant improvement extends SS most test clips! But on a few clips, especially anime, there was a very significant loss of quality.

As one might Except CT, in anime, the vast majority of complexity is usually confined to a small portion of the frame-for example, a character walking should SS an otherwise-static frame. furthermore, the sharp lines making up the character are much more "complex" than the static background. thus, it can appear to the propagation algorithm that a series of frames is complex, when in reality only the char Acter's motion is complex, while the rest of the frame is static. the algorithm then lowers the quality of all the frames, including the background, greatly decreasing quality, despite the fact that it shoshould only have lowered quality on the moving character instead. if only we cocould apply this propagation algorithm to individual blocks instead of the whole frame...

Well, we should be familiar with the qcomp parameter used to select the quantization degree to obtain the optimized quality. It is consistent with the above mainconcept spirit, that is, it gives a lower dynamic and higher bit rate. However, if some frames are roughly set to qcomp = 1 based on this principle, it would be very bad for the animations with different complexity in the foreground background.
So the MB-tree idea is reproduced.
What's the matter? It seems like a simple principle, but no one has ever thought of it before.-Maybe the discussion on mailist in last November has given DS a lot of inspiration.
Http://mailman.videolan.org/pipermail/x264-devel/2008-November/005116.html

DS finally gave an example of the spirit temple. The complexity difference between the front and back of the bullet screen game is too great. Of course, the MB-tree completes this well, and the SSIM increases by 60%.
As for subjective testing, it's too late today. Try it on weekends.

Article: http://airness.hjlp.org/html/y2009/441.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.