The Video encoder field has been a complex problem: MPEG2, DivX, XviD, MPEG4, VP8, VP9, x264, openh264, x265 and so on, which of these series of encoders is good? And for the same video encoder, but also includes a variety of parameter configuration, what are the effects of these configurations on the video encoder? In order to study this problem, my brother and I in the spare time to develop a software system, specifically for the evaluation of video encoder performance.
This paper records the system Videocodecrank of the performance evaluation of the video encoder. The system can evaluate and contrast the performance of the video encoder by adjusting the parameters of several different dimensions-video content, resolution, encoder presets, and bitrate. For each encoder, the system can traverse the above-mentioned parameters to encode, and record the encoded video image quality and encoding speed. Through the system, can be a full range of comparison of video encoders in various conditions performance advantages and disadvantages. Thanks to the participation of two brothers. At present in the cooperation of all the basic functions of the system has just been developed, the next step intends to continue testing and improvement.
Test System Address: http://www.velab.com.cn:8080/vcr/
The current state
At present, the system calculates the following encoders:
X264-faster
X264-medium
X264-ultrafast
X264-superfast
X264-veryfast
X264-fast
X264-slow
X264-slower
X264-veryslow
X265-faster
X265-medium
X265-ultrafast
X265-superfast
X265-veryfast
X265-fast
X265-slow
X265-slower
X265-veryslow
F265-quality10
F265-quality20
Divx265-aqo2
Divx265-aqo3
Divx265-aqo4
vp8-good-0
Vp8-good-1
Vp8-good-2
Vp8-good-3
Vp8-good-4
Vp8-good-5
Vp8-realtime
Divx265-aqo1
Openh264-rc0
Openh264-rc1
Mpeg4
Mpeg1
Mpeg2
XviD
h263p
Theora
Vc1-adv0
Vc1-adv1
Vc1-adv2
Vc1-adv3
Vc1-adv4
Vc1-adv5
vp9-good-0
Vp9-good-1
Vp9-good-2
Vp9-good-3
Vp9-good-4
Vp9-good-5
Vp9-realtime
Intel-h264-speed
Intel-h264-quality
intel-h264-balanced
Intel-mpeg2-speed
Intel-mpeg2-quality
intel-mpeg2-balanced
A test video with the following types of content is used:
Src01
Src02
Src04
Src05
Src06
Src08
Src11
Src12
Src14
Ducks
Park
Ped
Riverbed
Station2
Sunflower
Tractor
The test video for each content is scaled to the following resolution:
640x360
848x480
1280x720
1920x1080 (Raw)
Each test video is set up with the following BPP (which can be converted to bitrate):
0.025
0.05
0.075
0.1
0.15
0.2
The following video image quality indicators are statistically:
Psnr
Ssim
The parameters involved in the system this chapter mainly introduces the parameters of this video encoder performance evaluation system. These parameters can be divided into input parameters and evaluation parameters. Input parameters are used to simulate different coding environments. The evaluation parameters are used to statistic the coding performance after the coding is completed.
Input parameters This section describes the input parameters of the system. The change of these parameters will usually significantly affect the performance of the video encoder. These parameters include: video content, resolution, encoder presets, bitrate.
Video content in the same video quality premise, the picture content is complex, the motion is intense, the requirement rate is high, the picture content is simple, the scenery is stationary, the requirement rate is low. In this system, we choose the time complexity (TI) and Space complexity (SI) proposed in the itu-bt.1788 standard to measure the complexity of the video respectively.
Time Information (TI)
Ti reflects the extent to which a sequence of images changes over time. The sequence in which the content of the screen moves violently will usually have a higher TI value. It is calculated by calculating the frame difference between each frame of the sequence and the previous frame image, and then calculating the standard deviation for the frame difference image. Select the maximum value for these standard deviations is ti. It calculates the formula as follows:
Spatial information (SI)
Si reflects the spatial complexity of a sequence of images. A sequence with more detail will usually have a higher SI value. It is calculated by Sobel filtering each frame of the video and then calculating the standard deviation of the filtered image. Select the maximum value for these standard deviations is SI. It calculates the formula as follows:
Resolution resolution refers to the size of the video. For example, common resolutions are 3840x2160 (4K), 1920x1080 (HD), 1280x720 (720P), 640x360 (360P), etc.
Encoders and encoders preset different encoder encoding effects vary greatly. In addition, the preset (preset) of the same encoder has a greater effect on the image quality of the output. This system will also look at the different presets of the same encoder as different "encoders". Presets refer to a predefined set of encoder parameters. The encoder's presets generally seek a balance between speed and image quality: Fast presets are generally at the expense of video quality, and video quality presets are generally slower to encode. For example, the x264 encoder contains 10 presets in terms of encoding speed from fast to slow: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo.
Code rate is one of the most important parameters affecting video quality. In the case of other conditions, the larger the bitrate, the better the video quality. For example a 640x360 1Mbps video quality is certainly better than a 640x360 500kbps video. However, the video code rate of different resolutions varies greatly. For example, it is difficult to determine whether a 1280x720 1Mbps video is of higher quality than a 640x360 500kbps video. In order to remove the influence factor of resolution, we introduced a new variable--bpp (bits per pixel) in the system of this article. The BPP is calculated as follows:
bpp=bitrate/(framerate*reso_w*reso_h)among them, bitrate is the video bitrate, framerate is the video frame rate, reso_w and reso_h respectively represent the width and height of the video.
The meaning of BPP is the amount of data in a pixel in a video. For example, if we assume a frame rate of 25fps, the BPP of the 1Mbps video in 1280x720 above is given the BPP value of 0.043,640x360 500kbps video with a value of 0.087. The following table lists the corresponding relationships between BPP, bitrate, and common resolution.
the correspondence between BPP and bitrate
|
corresponding bitrate (Kbps) |
Number of bits per pixel (Bits/pixel) |
640x360 |
848x480 |
1280x720 |
1920x1080 |
0.025 |
144 |
< P align= "left" >254 |
576 |
1296 |
0.05 |
288 |
508 |
1152 |
2592 |
0.075 |
432 |
< P align= "left" >763 |
1728 |
3888 |
0.1 |
576 |
1017 |
2304 |
5184 |
0.15 |
864 |
1526 |
3456 |
7776 |
0.2 |
1152 |
2035 |
4608 |
10368 |
Evaluation parameters are used to evaluate the quality of the coding after the coding is completed. Evaluation parameters can be divided into two categories: quality evaluation parameters and speed evaluation parameters.
Quality Evaluation parameter Coding quality assessment is mainly achieved through the full reference video quality evaluation algorithm. The full reference video quality evaluation algorithm obtains the video quality evaluation result by comparing the original video and the damaged video before encoding and decoding. The most common full reference video quality evaluation models are PSNR and SSIM.
PSNR
PSNR (peak signal-to-noise ratio) is the most widely used video quality evaluation method. It is calculated as:
where L is the image gray value range, for 8bit bit depth image l=2^8-1=255;m*n Image block MSE (mean square error) formula is:
The Psnr value is usually between 20-40, and the larger the value, the better the image quality. Although the Psnr calculation is simple, the evaluation result and subjective feeling are often different because the human visual perception is not taken into account.
Ssim
Ssim (structural similarity) is a common method of video quality evaluation presented by Zhou Wang and others. The method considers the characteristics of human visual perception, and synthetically considers the effects of brightness, contrast and structure. It calculates the formula as follows.
where L (x, y) is the luminance comparison function, C (x, y) is the contrast function, and s (x, y) is the structure comparison function. The specific calculation methods of these three functions can refer to relevant literatures.
Ssim value is between 0-1, the larger the value, the better the image quality. Ssim is more in line with the subjective feelings of the human eye than Psnr, so it is also a widely used video quality evaluation method.
Speed Evaluation Parameters
Encoding speed evaluation is achieved mainly through the time-consuming (in milliseconds) of statistical coding and decoding.
System operation principle the system will traverse the input parameter values described above according to the configuration information, and combine them into different commands for coding and evaluation. After the system has started running, the following steps are performed in sequence:
(1)For each input video test sequence, its size is scaled to generate a series of video sequences of different resolutions.
(2)For each resolution of the original video sequence, choose a different encoder to prepare the encoding.
(3)For each encoder, set different bitrate to encode and generate a stream file. The generated stream file is then decoded, resulting in a corrupted video sequence.
(4)For each damaged video sequence, the quality score is obtained by using different video quality evaluation methods.
As shown in the above logic. It can be seen that the order of the system traversal parameters is as follows:
Video Content--resolution--encoders---rate--Objective quality evaluation method
Once the system has completed the calculation of an objective quality evaluation, a record is generated that holds the current experimental parameters, and the record is stored in the database.
Site Description The structure of the Videocodecrank site is as shown. The entire site contains "result set", "Encoder", "Video sequence", "System Configuration" and "about" pages in addition to the home page. The relationships between these pages are as shown.
The home page contains a comprehensive comparison chart of the encoder. The blue bars represent the encoded image quality, while the yellow bars represent the encoding time. You can drag the slider bar above the chart to adjust the following parameters to select different data to sort the performance of the encoder.
Speed Weight: Currently only support time/weight is set to 1 or 0. The mass weight of 1 is sorted according to the encoder output video quality, and the time weight of 1 is sorted according to the encoder consumption time.
Resolution: This option allows you to choose the size of the input video.
Bitrate: This option allows you to choose the bitrate of the input video. Note that the bitrate is in terms of BPP (bit per Pixel, bits per pixel).
Content complexity: This option allows you to select the input test video sequence. Note that the input video content is based on the time complexity of TI or the spatial complexity of SI (these two indicators are taken from the ITU bt.1788 Standard) to be sorted to facilitate selection.
The contents of the homepage are shown below.
The result set page results set page contains the results of all objective video quality evaluations in the system. Each experiment record contains the following information:
Encoder Device
Video sequences
Resolution
Number of bits per pixel
Encoding time
Decoding time
Video Quality evaluation algorithm
Objective quality
Subjective quality
The contents of the result set page are as shown. You can filter the results by adjusting the "encoder", "Video sequence", "Resolution", "bits per pixel", "Objective quality evaluation algorithm" in the drop-down box.
The Encoder Page Encoder page contains all the encoders that participate in the evaluation in the system (note: For encoders with multiple presets, each preset counts as an encoder). Each of these records contains the following information:
Encoder Name
Standard of ownership
Manufacturers
Version
The contents of the encoder page are as shown. Click the name of the encoder to enter the encoder details page.
The Encoder Details Page Encoder Details page contains 3 sections: Introduction to Encoders, encoder detail quality and encoder time-quality trade-offs.
The encoder Introduction section is shown below. You can see that the list lists the basic information for the encoder.
The contents of the encoder detailed quality section are as shown. By selecting parameters (Encoder, video sequence, resolution, bitrate), the image quality information (objective algorithm PSNR, SSIM, etc.) is listed for each frame of the test video sequence under specific conditions. The horizontal axis of the chart is the frame ordinal of the video sequence, and the ordinate is the value of the video objective quality evaluation algorithm.
Encoder time-The content of the quality tradeoff chart is as shown. Each point in the time/quality trade-off chart represents an encoder with the horizontal axis being the encoding time and the ordinate being the encoded image quality. It is found that the encoder on the left side of the chart is faster, while the encoder image on the top of the chart is of better quality. The "Fast and good" encoders are located at the top left of the chart. This chart can be used to list the time-consuming information and image quality information of the video encoder under specific conditions by selecting parameters (video sequence, bitrate, resolution, objective evaluation method).
The list of video sequence page video sequences shows the original video sequence information for all participating tests in the system. Each of these records contains the following information:
Video sequence Name
Original resolution
Pixel sampling format
Frame rate
Number of frames
The contents of the video sequence page are as shown. Click the name of the video sequence to enter the video sequence details page.
Video sequence details page The video sequence details page contains 3 items: Video sequence preview, video sequence detail features, and video sequence time/space complexity comparison chart.
The video Sequence preview section reads as follows. You can preview the contents of the test video through this feature.
The detail features section of the video sequence is shown in. This feature allows you to view ti (temporal perceptual information) information and SI (Spatial perceptual information) information for each frame image in the video. Ti and SI two indicators are taken from the ITU bt.1788 Standard. The larger the TI, the more dramatic the video movement (the change in time); the larger the SI, the more complex the video content (more space texture). The horizontal axis of the chart is the frame ordinal of the video sequence, and the ordinate is the video attribute value.
The video sequence time/space complexity comparison chart is shown below. Each point in the figure represents a video sequence, with a horizontal axis of Si and an ordinate of ti. The video sequence at the top of the chart is more dramatic, while the content texture of the video sequence on the right side of the chart is more complex. The simplest video sequence is in the upper-right corner of the chart, and the simplest video sequence is in the lower-left corner of the chart.
The contents of the System Configuration page of the System configuration page are as shown. The parameter information for the system configuration is listed in this page. For example, shows the input video will be stretched to what kind of resolution, the code will choose which BPP, the objective quality evaluation algorithm and so on.
Lei Huawei
[Email protected]
http://blog.csdn.net/leixiaohua1020
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Self-made Video Encoder evaluation system: Videocodecrank