mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
theoradec: Set telemetry options only if they are nonzero
Setting telemetry options, even to zero, causes libtheora to enable an expensive code path. For large enough videos (e.g. 1920x1080) this can increase the time to decode each frame by 30-40 ms, which can be enough to cause noticeable stutter. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/887>
This commit is contained in:
parent
c9d15fec7e
commit
e999318fd7
1 changed files with 8 additions and 4 deletions
|
@ -471,19 +471,23 @@ theora_handle_type_packet (GstTheoraDec * dec)
|
|||
/* done */
|
||||
dec->decoder = th_decode_alloc (&dec->info, dec->setup);
|
||||
|
||||
if (th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_MV,
|
||||
if (dec->telemetry_mv &&
|
||||
th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_MV,
|
||||
&dec->telemetry_mv, sizeof (dec->telemetry_mv)) != TH_EIMPL) {
|
||||
GST_WARNING_OBJECT (dec, "Could not enable MV visualisation");
|
||||
}
|
||||
if (th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_MBMODE,
|
||||
if (dec->telemetry_mbmode &&
|
||||
th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_MBMODE,
|
||||
&dec->telemetry_mbmode, sizeof (dec->telemetry_mbmode)) != TH_EIMPL) {
|
||||
GST_WARNING_OBJECT (dec, "Could not enable MB mode visualisation");
|
||||
}
|
||||
if (th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_QI,
|
||||
if (dec->telemetry_qi &&
|
||||
th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_QI,
|
||||
&dec->telemetry_qi, sizeof (dec->telemetry_qi)) != TH_EIMPL) {
|
||||
GST_WARNING_OBJECT (dec, "Could not enable QI mode visualisation");
|
||||
}
|
||||
if (th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_BITS,
|
||||
if (dec->telemetry_bits &&
|
||||
th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_BITS,
|
||||
&dec->telemetry_bits, sizeof (dec->telemetry_bits)) != TH_EIMPL) {
|
||||
GST_WARNING_OBJECT (dec, "Could not enable BITS mode visualisation");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue