I'm using Intel MSS 2015 R6 on Windows 7 64bit, Core i5 4590 processor with very recent driver. And latest Intel Media Samples 184.108.40.206.
When I tried to modify sample_encode to enable QP adjustment per-frame, I found it success when encoding with H.264 but failure when encoding with HEVC - no matter using HEVC SW plugin or HEVC HW plugin (i.e. GAcc mode).
My test case was like this:
I used Const QP mode with -qpi 25 -qpp 28 -qpb 29, and then encoded a yuv to a bitstream (A).
Then in the same conditions, I added a few code to enable mfxEncodeCtrl parameter to the EncodeFrameAsync() function calls, e.g. I set the "QP" parameter to 22 and encoded the same yuv to a bitstream (B).
By byte-to-byte comparison, I found bitstream A and B are exactly the same, which suggests that the QP adjustment in mfxEncodeCtrl doesn't work at all with HEVC encoding! -In contrast, if switching my command line to corresponding H.264 cases, it can be proved that per-frame QP does work.
Please correct me if anything wrong, and let me know in case per-frame QP adjustment is possible with HEVC?
I have an update for you.
- For the software and GPU accelerated HEVC codec plugins mfxEncodeCtrl .QP settings are not used, so the behavior you've described is expected.
- However, if you can update your hardware to 6th generation (Skylake architecture) the hardware accelerated HEVC does support setting QP via mfxEncodeCtrl. This is the recommended path for your scenario.