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

Julien 'Lta' BALLET elthariel at gmail.com
Wed Jun 5 14:21:36 CEST 2013


Hello Raphael,

>> +        sys->params.mfx.CodecProfile = qsv_params_get_value((const char * const*)profile_mpeg2_text,
>
> If you have a warning about const char * const * versus const char[]
> const* you can use &profile_mpeg2_text[0] instead of casting.

There's no warning without, my bad. I just removed these useless casts.

>
>> +        block->i_pts = qsv_timestamp_to_mtime(bs->TimeStamp) + sys->offset_pts;
>> +        if (bs->DecodeTimeStamp && bs->DecodeTimeStamp <= bs->TimeStamp)
>> +            block->i_dts = qsv_timestamp_to_mtime(bs->DecodeTimeStamp) + sys->offset_pts;
>> +        else {
>> +            /* HW encoder (sometimes) doesn't set the DecodeTimeStamp field
>> +               so we give decoder some (100ms) headroom. */
>
> Not sure I understand what you are doing here, if you set the h264 dts,
> shouldn't it take in account p / b frames ? Isn't it going to conflict
> with the dts that were set correctly ?

This handles an edge case occuring when you got buggy or outdated
drivers. This branch will never be executed if you have correct
hw/driver/parameters. Since this code is actually trying to fix bad
drivers behaviors, we could just remove it and assumes it's not our
problem. On the other hand, on some drivers/hw/paramters combinations,
we have totally broken dts, so i supposed it was an acceptable
solution to compute a new dts from the pts. Any suggestion for a
better behavior is welcomed.
There's also a chance murphy's was against me the day i experienced
these issues and that they'll almost never happen on real life (i was
actually woking on a 'beta cpu/chipset')

>
>> +            msg_Dbg(enc, "Encode returning empty DTS or DTS > PTS");
>> +            if (block->i_pts <= 100 * 1000)
>> +                block->i_dts = 0;
>> +            else
>> +                block->i_dts = block->i_pts - 100 * 1000;
>> +        }
>> +    }
>> +}

Regards,
Julien 'Lta' BALLET.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Adds-Intel-QuickSync-Video-encoder.patch
Type: application/octet-stream
Size: 33565 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20130605/9050d0e0/attachment.obj>


More information about the vlc-devel mailing list