GNOME Bugzilla – Bug 747505
vp8 decoding deadline should be specified in us instead of ms
Last modified: 2015-04-08 13:47:32 UTC
Just noticed something in gstvp8dec.c: deadline = gst_video_decoder_get_max_decode_time (decoder, frame); if (deadline < 0) { decoder_deadline = 1; } else if (deadline == G_MAXINT64) { decoder_deadline = 0; } else { decoder_deadline = MAX (1, deadline / GST_MSECOND); } status = vpx_codec_decode (&dec->decoder, minfo.data, minfo.size, NULL, decoder_deadline); I am assuming the decoder_deadline is in milliseconds here, given the division. The libvpx docs mention the following: deadline: Soft deadline the decoder should attempt to meet, in us. Set to zero for unlimited. Also see http://www.webmproject.org/docs/vp8-sdk/group__decoder.html This basically implies that the deadline is a factor of 1000 off. Could anyone verify this?
Created attachment 301126 [details] [review] Passes vp8 decode deadline in us instead of ms Attaching a patch for good measure.
gst_video_decoder_get_max_decode_time returns a GstClockTimeDiff which is a gint64 of nanoseconds. If you want that in milliseconds you need to divide by 10^6 which is what GST_MSECOND is. Alternatively you can think of these GST time constants as the amount of nanoseconds for that unit, then it becomes nanoseconds / (nanoseconds / millisecond) = milliseconds. So I think the code is correct as it is.
Alright. It isn't exactly clear from the documentation. Guess this one can be closed then.