[mythtv] MacOS X MMX yuv420_2vuy Patch

MythTV mythtv at taoyama.com
Wed Sep 6 23:16:58 UTC 2006


On Sep 6, 2006, at 4:03 PM, MythTV wrote:

>
> On Sep 6, 2006, at 2:54 PM, Nigel Pearson wrote:
>
>>> I'm no longer seeing a crash but I'm seeing a problem on startup  
>>> or a
>>> channel change with HDTV.
>>>
>>> The live TV freezes and I get a constant "NVP: Timed out waiting for
>>> free video buffers."
>>
>> 	Todd and Paul are. Paul's tests seem to indicate
>> some strange problem in the MMX function itself? See:
>> http://svn.mythtv.org/trac/ticket/2312
>>
>>
>> 	Mino, you mentioned some sort of harness that you used
>> to test the MMX code. If it is standalone, could you please
>> send me a copy?
>>
>> 	Otherwise, is there any chance of getting you to check
>> for buffer overruns in the function? Having some dummy data
>> (say a few hundred bytes of 0xF00F0FF0) either side of both
>> the source and destination buffers should be enough to show
>> any errant writes.
>>
>>
>> 	And if any of you could provide -v playback output that
>> shows the problem, it may help us.
>>
>> --
>> Nigel Pearson, nigel at ind.tansu.com.au|  "Let's see how Spike is  
>> going"
>> Telstra Net. Eng., Sydney, Australia |              ...
>> Office: 9202 3900    Fax:  9261 3912 |"I'd like to keep Spike as my
>> pet."
>> Mobile: 0408 664435  Home: 9792 6998 |        Illyria - Angel
>> _______________________________________________
>> mythtv-dev mailing list
>> mythtv-dev at mythtv.org
>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>>
>
> Nigel,
>
> Here's a quick patch that will revert to the non-vectorized code for
> the conditions that will create a buffer overrun. This is similar to
> what the Altivec code does.
>
> Looking at the log posted in Trac the video size is 720x576 which the
> MMX routine should be able to handle.  The only other thing I can
> think of in the MMX code would be if the buffers aren't aligned but I
> believe that would create a Machine Check exception.
>
> I'm not at my Myth machine so I haven't had a chance to try this
> patch.  If it doesn't work, let me know.
>
> Mino
>
>
>
> Index: yuv2rgb.cpp
> ===================================================================
> --- yuv2rgb.cpp (revision 11068)
> +++ yuv2rgb.cpp (working copy)
> @@ -711,6 +711,7 @@
>
>       int x,y;
>
> +    if (!((h_size % 16) | (v_size % 2))) {
>       for(y = v_size/2; y--; )
>       {
>           ibuf1 = ibuf2;
> @@ -779,6 +780,13 @@
>           ubuf += uv_stride;
>           vbuf += uv_stride;
>       }
> +    }
> +    else
> +    {
> +        // Fall back to C version
> +        non_vec_2vuy_yuv420(image, py, pu, pv, h_size, v_size,
> +                            vuy_stride, y_stride, uv_stride);
> +    }
> }
> #endif // MMX
>
> Mino
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>

Ooops...A cut and paste error.  I had the wrong C version routine  
called.

Mino


Index: yuv2rgb.cpp
===================================================================
--- yuv2rgb.cpp (revision 11068)
+++ yuv2rgb.cpp (working copy)
@@ -711,6 +711,7 @@

      int x,y;

+    if (!((h_size % 16) | (v_size % 2))) {
      for(y = v_size/2; y--; )
      {
          ibuf1 = ibuf2;
@@ -779,6 +780,13 @@
          ubuf += uv_stride;
          vbuf += uv_stride;
      }
+    }
+    else
+    {
+        // Fall back to C version
+        non_vec_yuv420_2vuy(image, py, pu, pv, h_size, v_size,
+                            vuy_stride, y_stride, uv_stride);
+    }
}
#endif // MMX



More information about the mythtv-dev mailing list