In this article, some experiments are done to verify the capability of i.MX6DQ on video playback under different VPU clocks.
Board: i.MX6DQ SD
Bitstream: 1080p sunflower with 40Mbps, it is considered as the toughest H264 clip. The original clip is copied 20 times to generate a new raw video (repeat 20 times of sun-flower clip) and then encapsulate into a mp4 container. This is to remove and minimize the influence of startup workload of gstreamer compared to vpu unit test.
Kernels: Generate different kernel with different VPU clock setting: 270MHz, 298MHz, 329MHz, 352MHz, 382MHz.
test setting: 1080p content decoding and display with 1080p device. (no resize)
2. Test command for VPU unit test and Gstreamer
The tiled format video playback is faster than NV12 format, so in below experiment, we choose tiled format during video playback.
Unit test command: (we set the frame rate -a 70, higher than 1080p 60fps HDMI refresh rate)
/unit_tests/mxc_vpu_test.out -D "-i /media/65a78bbd-1608-4d49-bca8-4e009cafac5e/sunflower_2B_2ref_WP_40Mbps.264 -f 2 -y 1 -a 70"
Gstreamer command: (free run to get the highest playback speed)
gst-launch filesrc location=/media/65a78bbd-1608-4d49-bca8-4e009cafac5e/sunflower_2B_2ref_WP_40Mbps.mp4 typefind=true ! aiurdemux ! vpudec framedrop=false ! queue max-size-buffers=3 ! mfw_v4lsink sync=false
3. Video playback framerate measurement
During test, we enter command "echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor" to make sure the CPU always work at highest frequency, so that it can respond to any interrupt quickly.
For each testing point with different VPU clock, we do 5 rounds of tests. The max and min values are removed, and the remaining 3 data are averaged to get the final playback framerate.
Note: Dec column means the vpu decoding fps, while Playback column means overall playback fps.
Why does the Gstreamer performance data still improve while unit test is more flat? On Gstreamer, there is a vpu wrapper which is used to make the vpu api more intuitive to be called. So at first, the overall GST playback performance is constrained by vpu (vpu dec 57.8 fps). And finally, as vpu decoding performance goes to higher than 60fps when vpu clock increases, the constraint becomes the display refresh rate 60fps.
The video display overhead of Gstreamer is only about 1 fps, similar to unit test.
Based on the test result, we can see that for 352MHz, the overall 1080p video playback on 1080p display can reach ~60fps.
Or if time sharing by two pipelines with two displays, we can do 2 x 1080p @ 30fps video playback.
However, this experiment is valid for 1080p video playback on 1080p display. If for interlaced clip and display with size not same as 1080p, the overall playback performance is limited by some postprocessing like de-interlacing and resize.