ChallengesAs the live broadcast industry is developing rapidly, users' requirements for video experience are also rising. The key elements of basic video experience include clarity, smoothness, low latency, etc., and the "first principle" of these elements is the encoding efficiency of the video itself, that is, the compression rate. The importance of video coding efficiency is self-evident, but further improvement is not easy, especially in live broadcast scenarios, which have high requirements for coding speed, delay, bit rate control, etc. How to significantly improve the compression rate while ensuring the same image quality, while meeting the requirements of real-time and low latency, is an ongoing technical challenge. How to complete the challengeAdoption of a new generation of encodersDouyin, based on the BVC encoder, has brought the ultimate video experience to hundreds of millions of viewers during the World Cup. In this Asian Games, the new generation of BVC encoder developed by the Volcano Engine Multimedia Laboratory has been fully supported by Douyin live broadcast for the first time and used in live broadcast. The BVC encoder has won the first place in many indicators in the industry encoder competition MSU. It has industry-leading encoding and computing performance and is still being continuously optimized and iterated. Compared with the previous generation, the new generation of BVC encoder can significantly reduce the bit rate, improve user experience, and reduce bandwidth costs without changing the image quality. Optimization of the new generation BVC encoder in live broadcast scenariosAs a new generation of encoder, it introduces a large number of new encoding tools and algorithms, which significantly reduce the bit rate while also having a very high computational complexity. In the live broadcast scenario, the latest BVC encoding needs to be significantly optimized in terms of computational complexity to achieve real-time and low latency requirements. More extreme and simple engineering architecture First, the new generation of BVC encoders tested all encoding tools and algorithms in the live broadcast scenario, and selected a set of tools and algorithms that can be put into use under the encoding speed requirements of live broadcast according to the cost performance. Redesigning a lightweight architecture based on this set can minimize the loss of computing processes. The new encoder architecture reorganized the entire encoding process, removed the original complex situation coupling, designed a separate process for special tools, and simplified the encoding process. At the same time, the data structure was optimized to a greater extent, significantly reducing the amount of data and improving memory access efficiency. In addition, a large number of calculation result caching and reuse mechanisms were used to reduce repeated calculations, and an efficient data exchange mechanism was designed to reduce data copying. In the optimization of the computing module, more computing processes were discovered and organized into SIMD implementations, and the original SIMD implementation was further optimized to reduce the number of instructions. The encoder architecture optimization based on the live broadcast scenario saves more than 30% of the complexity for the new generation of BVC encoders while the algorithm remains basically unchanged. Flexible and sophisticated parallel framework In order to achieve real-time encoding while increasing computational complexity, it is crucial to fully utilize the capabilities of multi-core processors. The new generation of BVC encoders redesigns the parallel framework for live broadcast scenarios. First, the pre-processing, pre-analysis, encoding and other processes are parallelized, and appropriate priorities are assigned to task scheduling to minimize the waiting time before encoding. For thread waiting in the encoding process, the waiting conditions are accurately calculated and the condition restrictions are reduced to a minimum, thereby reducing the waiting delay. In addition, based on the model of intra-frame and inter-frame parallel encoding, the thread priority weight of each encoding task is accurately assigned according to the dependency relationship during encoding, and the threads are flexibly and finely scheduled. After optimization, the CPU utilization of the new generation of BVC encoders has increased by more than 50%. Hundreds of fast algorithms In addition to the engineering architecture, the new generation of BVC encoders has also added a large number of fast algorithms to achieve real-time encoding at high resolution, high bit rate and high frame rate. The new generation of BVC encoders has reconstructed the framework of coding block division, and adaptively decided the range of division depth based on surrounding blocks and historical division information, greatly reducing invalid division attempts, thereby reducing encoding complexity. In mode decision-making, a large number of sophisticated preliminary fast algorithms are designed for each module, thereby greatly reducing the number of modes finally attempted. In addition, a lot of simplifications have been made to the pre-processing and pre-analysis modules. The new generation of BVC encoders have added hundreds of fast algorithms for live broadcast scenarios, which has increased the overall encoding speed by more than 2 times with little loss in compression rate. Targeted Optimization for the Asian Games In addition to the optimization of the encoder core itself, the new generation of BVC encoders has also been specially optimized for the Asian Games. In addition to traditional sports events, the Asian Games have also added e-sports events that have attracted much attention. The new generation of BVC encoders has also been optimized for sports and games. The R&D team has conducted a large number of tests, adapted the encoding gears under different video resolutions and complexities, and adjusted dozens of encoding parameters to control the cost-effectiveness of different encoding algorithms in sports and game scenes, achieving encoding acceleration while increasing the compression rate. In addition, the bit rate control has been optimized to reduce the blurring of the picture in high-motion complex scenes. Optimize resultsThe new generation of BVC encoders achieves 1080P 50FPS real-time encoding in live broadcast scenarios, and saves about 20% of the bit rate compared to the previous generation of encoders without changing the image quality. The actual effect is as follows: (Comparison display, the above is the previous generation of BVC encoded video, and the following is the new generation of BVC encoded video) picture picture Compared with the widely used open source encoder x265 (v3.5), the new generation BVC encoder also has significant advantages. The following figure shows the performance comparison data. It can be seen that when the encoding settings are aligned (frame structure, code control method, lookahead length, etc.), the new generation BVC encoder can achieve an average of more than 40% bit rate savings for sports and game video content in the Asian Games, while encoding faster. picture |
<<: Compose-Multiplatform Practice on Android and iOS
>>: The practice of optimizing image quality for large-scale live broadcasts on Douyin
On May 6, according to the Korea Times, industry ...
Recently, scientists have created News about &quo...
(Public Domain) Recently, a media article stated ...
[[163324]] 1. About runtime I have used runtime t...
Xi'an high-end WeChat arranges the whole city ...
Recently, Silicon Valley high-precision map servi...
Why should you be an agent for WeChat Mini Progra...
This article was reviewed by Dr. Tao Ning, Associ...
"I heard that eating too much MSG is not goo...
Thump! Thump! Thump! Do you also sit and do nothi...
What types of apps are the most popular in 2017? ...
If a title cannot attract people to click on it w...
Yesterday afternoon, the Meizu MX5 mobile phone h...
Text | Gan Xiao, reporter of China Science News I...