[FFmpeg-devel] [PATCH 4/5] vaapi_encode: Add ROI support

Mark Thompson sw at jkqxz.net
Tue Mar 5 02:26:21 EET 2019


On 28/02/2019 06:33, Guo, Yejun wrote:>> -----Original Message-----
>> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf
>> Of Mark Thompson
>> Sent: Thursday, February 28, 2019 6:00 AM
>> To: ffmpeg-devel at ffmpeg.org
>> Subject: [FFmpeg-devel] [PATCH 4/5] vaapi_encode: Add ROI support
>>
>> ---
>>  libavcodec/vaapi_encode.c       | 129
>> ++++++++++++++++++++++++++++++++
>>  libavcodec/vaapi_encode.h       |   9 +++
>>  libavcodec/vaapi_encode_h264.c  |   2 +
>>  libavcodec/vaapi_encode_h265.c  |   2 +
>>  libavcodec/vaapi_encode_mpeg2.c |   2 +
>>  libavcodec/vaapi_encode_vp8.c   |   2 +
>>  libavcodec/vaapi_encode_vp9.c   |   2 +
>>  7 files changed, 148 insertions(+)
> 
> I tried this patch with below command, but do not see any quality change with my eyes. 
> I debugged in gdb and  found the ROI data are correct in function vaapi_encode_issue.
> 
> I do not investigate deeper, and just want to first confirm if you see the quality change or not. I might did something basic wrong.
> 
> ffmpeg_g -hwaccel vaapi -vaapi_device /dev/dri/renderD128  -s 1920x1080 -i ../video
> /1080P_park_joy_1920x1080_500frames.yuv   -vf format=nv12,hwupload    -c:v h264_vaapi  -b:v 3M  -y tmp.264
> (my trick code in vf_scale.c is called with the above command)
> 
> I tried the similar option with libx264 and found obvious video quality changes.

If you are using the i965 driver then you might need <https://github.com/intel/intel-vaapi-driver/pull/447> to make it work.  The iHD driver worked for me with no changes.

In CQP mode with H.264 it's straightforward to verify the output directly, too - any stream analyser or other tool which can show the QP on each macroblock will make it very obvious, since you will see exactly the offset you set in your regions of interest.  (The reference decoder with trace enabled shows it as mb_qp_delta as well.)

Thanks,

- Mark


More information about the ffmpeg-devel mailing list