[Libva] [PATCH v1 0/9]Encoder Architecture Changes (Primarily AVC)

Mark Thompson sw at jkqxz.net
Thu Jan 19 00:24:56 UTC 2017


On 13/01/17 09:24, Pengfei Qu wrote:
> Encoder architecture restructuring for H.264 (with some impact to HEVC now) on HSW+
> * Improvements to the shaders
> * Improvements to the B frame efficiency
> * Improvements to the low bit rate mode
> * Improved features in two stage VME/PAK pipeline
> 
> v1:
> Reduce the patch number and re org for VME and MFX related patches.
> Patch re org for VME pipeline
> Patch re org for MFX pipeline
> keep assert for internal logic and replace assert for input validation function.
> Remove unnecessary comments and enum value.
> Use the 64bit version OUT_BCS_RELOC64.
> Move kernel binary into header file.
> use misc parameter from encoder_context structure.

I've had a go with this on Skylake.  In general, I see significant gains in quality with similar performance (yay), however I found some issues as well.

CQP mode seems to have regressed significantly in speed - it is maybe 25% slower than CBR/VBR now (though indeed higher quality, particularly on B-frames).  Is this expected?  I would have thought it should be the "easiest" (and therefore fastest) mode.

Also, there seems to be something funny going on in the VBR rate controller.  Sometimes (nondeterministically, with the same parameters) the beginning of the stream gets stuck at a very high QP / low bitrate for a long period, making the output video terrible quality.  After some time (maybe a few thousand frames) it recovers and thereafter acts normally.  It seems to happen entirely randomly with low probability (less than 10%, maybe?), with no obvious connection to the encoding parameters.

I found some things which might be related (but equally could just be perturbing something else, for example by changing the timing):
* It never seems to happen if the encoder input comes directly from a decoder - I have only seen it when there is a VPP instance in between them (though it need not do anything to the video - it can just copy to a new surface of the same size).
* I tested on two different machines and it only seems to happen on one of them: it happens on a 6260U (GT3), but not on a 6300 (GT2).

Can you offer any thoughts on what might be relevant which I could test for?  (Currently my reproduction method is just "transcode videos between sizes repeatedly until it happens", which I realise is not very helpful.  I am happy to try to narrow that down a bit if I could have any idea what I can look for.)

Thanks,

- Mark


More information about the Libva mailing list