[mythtv-commits] Ticket #2984: Enhancement for finding MPEG2 startcodes

MythTV mythtv at cvs.mythtv.org
Wed Jan 24 17:01:43 UTC 2007

#2984: Enhancement for finding MPEG2 startcodes
 Reporter:  gnome42 at gmail.com  |       Owner:  ijr    
     Type:  enhancement        |      Status:  new    
 Priority:  minor              |   Milestone:  unknown
Component:  mythtv             |     Version:  0.20   
 Severity:  medium             |  
 Two patches to speed up finding start codes in MPEG2 streams. One patch
 for recording (dtvrecorder) and one for playback (avformatdecoder).

 I did some micro benchmarks comparing three scanning methods; the current
 one-byte-at-a-time approach, memchr(), and this three-btyes-at-a-time
 approach. I was expecting the memchr() to be the fastest but three-bytes-
 at-a-time always seemed to be quicker.

 Sample output from a run on an old celeron:[[BR]]
 Found 13437824 matches in 42.4915 seconds (three-bytes ...)[[BR]]
 Found 13437824 matches in 54.9326 seconds (memchr())[[BR]]
 Found 13437824 matches in 96.6009 seconds (one-byte ... current)

 Problem: These patches both use nothl() for endian issues, this is
 undesireable. :/  But Janne says he has a way around this? :)

 Also, I think danielk has said that these scanning methods are 'naive' and
 could be improved. If anyone has some pointers or hints on how to do that
 I would be interested.

Ticket URL: <http://cvs.mythtv.org/trac/ticket/2984>
MythTV <http://www.mythtv.org/>

More information about the mythtv-commits mailing list