[vlc-devel] [PATCH] Intel Video QuickSync encoder support

Julien 'Lta' BALLET elthariel at gmail.com
Mon Jun 10 12:15:40 CEST 2013


Hi Rafael,

On Fri, Jun 7, 2013 at 5:06 PM, Rafaël Carré <funman at videolan.org> wrote:
>> +static void qsv_set_block_flags(block_t *block, uint16_t frame_type)
>> +{
>> +    if ((frame_type & MFX_FRAMETYPE_IDR) || (frame_type & MFX_FRAMETYPE_REF))
>> +        block->i_flags = BLOCK_FLAG_TYPE_I;
>> +    else if ((frame_type & MFX_FRAMETYPE_P) || (frame_type & MFX_FRAMETYPE_I))
>
> Hmm what is MFX_FRAMETYPE_I ?
> It looks weird that it represents a P-frame

This behavior has been copied from x264.c, i thought this was weird
too, but felt like the x264 guys knew better than me.

>> +    /* HW encoder (with old driver versions) and some parameters
>> +       combinations doesn't set the DecodeTimeStamp field so we warn
>> +       the user about it */
>> +    if (!bs->DecodeTimeStamp || bs->DecodeTimeStamp > bs->TimeStamp)
>> +        msg_Warn(enc, "Encode returning empty DTS or DTS > PTS. Your stream will be invalid. "
>> +                 " Please double-check they weren't any warning at encoder initialization "
>> +                 " and that you have the last version of Intel's drivers installed.");
>> +}

This one has been rate-limited.

>> +    sts = MFXVideoENCODE_EncodeFrameAsync(sys->session, 0, frame, &task->bs, &task->syncp);
>> +    while (sts == MFX_WRN_DEVICE_BUSY) {
>> +        msg_Info(enc, "Device is busy, let's wait and retry");
>
> BTW, if this message is very frequent it could be rate-limited: smth
> like: if (counter++ % 16 == 0) msg_Dbg...

This message is not very frequent, but i've rate limited the previous
one, since it was.

>> +    else if (sts < MFX_ERR_NONE) {
>> +        msg_Err(enc, "Encoder not ready or error (%d), trying a reset...", sts);
>> +        MFXVideoENCODE_Reset(sys->session, &sys->params);
>
> Shouldn't it return NULL here?

It should not. This is a problem with the encoder's feeding and
doesn't mean the SyncOperation phase before didn't returned any
interesting data.
`return block;` will allready return NULL if the SyncOperation fails.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Adds-Intel-QuickSync-Video-encoder.patch
Type: application/octet-stream
Size: 33776 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20130610/3d71937d/attachment.obj>


More information about the vlc-devel mailing list