[mythtv] Playback and yuv2rgb_init_mmx/yuv2rgb_init_mmxext ?

Michael J. Lynch mlynch at gcom.com
Thu Mar 17 18:51:15 UTC 2005


I've been poking around the myth source code to see if there are any
optimizations I could make to the playback code that would reduce
processor load so less powerful processors could be used.  I figured
the first place to start looking would be the recording playback code
and came down to a section of code that looks like the following from
function *PlaybackBox::updateVideo()* in *playbackbox.cpp* from
libmythtv (CVS from a day or two ago).

    if ((state == kPlaying) && nvp->IsPlaying() && !playingSomething)
    {
       Get current frame from Nuppel Video player
       Covert from YUV to 32 bit RGB
       Release the Frame
       Scale the frame
       Draw the frame
    }

Is it correct that this is the code used to draw the video frames?
If so, here is my question.  I noticed that *yuv2rgb_init_mmx* is always
used and *yuv2rbg_init_mmxext* is never used in this loop, is there a
reason for this?  I ask because I created a test application that tests the
performance of each of the underlying conversion functions and found
that the *mmxext* version is about twice as fast as the *mmx* version.
Below is output from my test program running on a 1G P3.

    Frame processing function tests

    Frame size 720x480
    Testing 330 iterations of mmx_argb32()...Done
    Total Time (s):  2.77773
    Avg time (ms):   8.41737

    Testing 330 iterations of mmxext_argb32()...Done
    Total Time (s):  1.47342
    Avg time (ms):   4.4649

With 1920x1080 frames the results are the following:

    Frame processing function tests

    Frame size 1920x1080
    Testing 330 iterations of mmx_argb32()...Done
    Total Time (s):  16.4107
    Avg time (ms):   49.7294

    Testing 330 iterations of mmxext_argb32()...Done
    Total Time (s):  10.3387
    Avg time (ms):   31.3293

As you can see from these results, the *mmxext* version of the conversion
function is significantly faster than the *mmx* version of the function.
Assuming a 30Hz frame rate, this seems to suggest that a 1G P3 could
*almost* (almost because scaling, etc take time too) do HD playback if
the mmxext yuv2rgb conversion function were used.

Am I missing something here, or have I stumbled across something
significant?


-- 
Michael J. Lynch

What if the hokey pokey IS what it's all about -- author unknown




More information about the mythtv-dev mailing list