[mythtv-commits] Ticket #10984: Improve closed caption performance

MythTV noreply at mythtv.org
Thu Sep 5 22:03:43 UTC 2013


#10984: Improve closed caption performance
-------------------------------+-----------------------------
 Reporter:  stichnot           |          Owner:  stichnot
     Type:  Developer Task     |         Status:  closed
 Priority:  minor              |      Milestone:  0.28
Component:  MythTV - Captions  |        Version:  Master Head
 Severity:  medium             |     Resolution:  Fixed
 Keywords:                     |  Ticket locked:  0
-------------------------------+-----------------------------
Changes (by stichnot):

 * status:  new => closed
 * resolution:   => Fixed


Comment:

 Closing this as fixed, because I can't see any more to do.  Description of
 experiments and results follows.

 Adding timing to the subtitle creation pipeline showed that the dominant
 stage is the painting of the text chunks, in MythPainter::DrawTextPriv().
 This is invoked for a new string that is not already in the string image
 cache.  This was sped up by 3325c09 when drawing outlines.

 If MythPainter::DrawTextPriv() can't be sped up further, the next approach
 is to try to spread the work over multiple frames where possible, to
 minimize stuttering.  One approach is to use a background helper thread.
 However, the helper thread is limited to non-MythUI work, so it's only
 marginally helpful in reducing the latency.  Therefore the helper thread
 idea was abandoned.

 Another approach is to pipeline the work across multiple Pulse() calls in
 the UI thread.  A cost model can be used to throttle the amount of work
 done each Pulse().  The benefit is that if a subtitle includes multiple
 chunks, the drawing of the chunks can be spread across time.
 Unfortunately, this approach led to flashing and other visual artifacts on
 rapid "real-time" captioning, despite lots of experimentation to try to
 tune and synchronize the delay timing.  As a result, this approach was
 also abandoned (especially after it didn't improve stuttering on an ION
 system).

 One more approach was tried.  It was observed that for these real-time
 paint-on captions, each caption is usually almost identical to the
 previous caption, with just 2 characters added to the bottom line.  The
 idea is to try, if possible, to create the same set of chunks as the last
 caption, with one extra chunk for the (two) new characters, thereby using
 the string image cache as much as possible.  Unfortunately, this also did
 not actually help in reducing the stuttering.

 In the end, the only thing that reliably eliminated the stuttering was to
 decrease the excessive amount of VB_VBI logging output, particular for
 cc708 captions.

--
Ticket URL: <http://code.mythtv.org/trac/ticket/10984#comment:13>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list