[regression] gstreamer-vaapi AVC CBR and VBR tests are failing with iHD driver since commit 6669a7fc
Since following commit AVC CBR and VBR tests are failing.
libs: Change the parameter setting order when encode picture. The order in gst_vaapi_enc_picture_encode when encoding one picture is not very correct. The misc parameters are set before the picture parameters. Some of the misc parameters such as ROI may change the current picture parameters. But the later setting of picture parameter will re-init all picture related parameters and clear the previous setting. The right order should be picture parameter first and then misc parameters. Signed-off-by: He Junyan's avatarHe Junyan junyan.he@hotmail.com
Steps to reproduce: GST_VAAPI_ALL_DRIVERS=1 LIBVA_DRIVER_NAME=iHD gst-launch-1.0 -vf filesrc location=test.yuv num-buffers=300 ! rawvideoparse format=i420 width=352 height=288 framerate=25 ! videoconvert ! video/x-raw,format=NV12 ! vaapih264enc rate-control=cbr keyframe-period=30 num-slices=1 max-bframes=0 bitrate=500 ! video/x-h264,profile=main ! h264parse ! filesink location=test.h264
-
The output file "test.h264" size increased around 40x times after this patch.
-
Following formula used for calculating CBR value. encsize = sizeof(test.h264) bitrate_actual = encsize8fps/1024.0/total_frames (total_frames = frames in test.yuv) bitrate_gap = abs(bitrate_actual - bitrate)/bitrate
The bitrate_gap should be less than 0.1 for tests to pass but with this patch it is coming around 39 to 47 for different test streams.