[mythtv-commits] Ticket #2312: New MMX code for YUV420 conversion causes issues

MythTV mythtv at cvs.mythtv.org
Wed Sep 6 12:33:26 UTC 2006


#2312: New MMX code for YUV420 conversion causes issues
--------------------------------+-------------------------------------------
 Reporter:  pdbailey at gmail.com  |        Owner:  nigel   
     Type:  defect              |       Status:  assigned
 Priority:  minor               |    Milestone:  0.20    
Component:  mythtv              |      Version:  head    
 Severity:  medium              |   Resolution:          
--------------------------------+-------------------------------------------
Comment (by nigel):

 1) OK. At least we can easily work around it. [[BR]]
 2) Bummer. That seems to indicate more complex problems. [[BR]]
 I will try to work out the problem with the routine, but if that doesn't
 get sorted before 0.20, I will commit something like:
 {{{
 % svn diff yuv2rgb.h yuv2rgb.cpp videoout_quartz.cpp
 Index: yuv2rgb.h
 ===================================================================
 --- yuv2rgb.h   (revision 11063)
 +++ yuv2rgb.h   (working copy)
 @@ -54,6 +54,13 @@

  yuv2vuy_fun get_yuv2vuy_conv(void);

 +extern void non_vec_yuv420_2vuy(uint8_t, uint8_t,
 +                                uint8_t, uint8_t,
 +                                int, int, int, int, int);
 +
 +
 +// Conversion in the other direction, currently unused
 +
  typedef void (* vuy2yuv_fun) (uint8_t * image, uint8_t * py,
                                uint8_t * pu, uint8_t * pv,
                                int h_size, int v_size,
 Index: yuv2rgb.cpp
 ===================================================================
 --- yuv2rgb.cpp (revision 11063)
 +++ yuv2rgb.cpp (working copy)
 @@ -784,10 +784,10 @@
  #endif // MMX


 -static void non_vec_yuv420_2vuy (uint8_t * image, uint8_t * py,
 -                                 uint8_t * pu, uint8_t * pv,
 -                                 int h_size, int v_size,
 -                                 int vuy_stride, int y_stride, int
 uv_stride)
 +void non_vec_yuv420_2vuy (uint8_t * image, uint8_t * py,
 +                          uint8_t * pu, uint8_t * pv,
 +                          int h_size, int v_size,
 +                          int vuy_stride, int y_stride, int uv_stride)
  {
      uint8_t *pi1, *pi2 = image;
      uint8_t *py1, *py2 = py;
 Index: videoout_quartz.cpp
 ===================================================================
 --- videoout_quartz.cpp (revision 11063)
 +++ videoout_quartz.cpp (working copy)
 @@ -1341,7 +1341,13 @@
      if (gContext->GetNumSetting("MacYuvConversion", 1))
          data->yuvConverter = get_yuv2vuy_conv();
      else
 +#ifdef WORDS_BIGENDIAN
 +        // It is safe on PPC to let QuickTime convert YUV420:
          data->yuvConverter = NULL;
 +#else
 +        // ... but on Intel it crashes, so we always pre-convert:
 +        data->yuvConverter = non_vec_yuv420_2vuy;
 +#endif

      if (!CreateQuartzBuffers())
      {
 @@ -1453,11 +1459,7 @@
      ImageDescription *desc = *data->imgDesc;

      desc->idSize = sizeof(ImageDescription);
 -#ifdef WORDS_BIGENDIAN
      desc->cType = kYUV420CodecType;
 -#else
 -    desc->cType = kComponentVideoCodecType;  // Wrong, but prevents Intel
 crash
 -#endif
      desc->version = 1;
      desc->revisionLevel = 0;
      desc->spatialQuality = codecNormalQuality;
 }}}

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/2312#comment:7>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list