]> git.sesse.net Git - ffmpeg/blobdiff - libswscale/swscale_template.c
make arguments to ssd_int8_vs_int16() const
[ffmpeg] / libswscale / swscale_template.c
index 21fb4e8f165590d0d83956b4fae21f36fe4d77c2..c90662f6b91b2b6c5186edec19f3afed925ea8ad 100644 (file)
@@ -15,7 +15,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  *
  * the C code (not assembly, mmx, ...) of this file can be used
  * under the LGPL license too
@@ -1513,7 +1513,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t *
     }
 
 #ifdef HAVE_MMX
-    if ( uvalpha < 2048 ) // note this is not correct (shifts chrominance by 0.5 pixels) but its a bit faster
+    if ( uvalpha < 2048 ) // note this is not correct (shifts chrominance by 0.5 pixels) but it is a bit faster
     {
         switch(dstFormat)
         {
@@ -2229,13 +2229,10 @@ static inline void RENAME(rgb16ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1
         int d0= ((uint32_t*)src1)[i];
 
         int dl= (d0&0x07E0F81F);
-        int dh= ((d0>>5)&0x07C0F83F);
+        int d= dl + (((d0>>16) + (d0<<16))&0x07E0F81F);
 
-        int dh2= (dh>>11) + (dh<<21);
-        int d= dh2 + dl;
-
-        int r= d&0x7F;
-        int b= (d>>11)&0x7F;
+        int r= d&0x3F;
+        int b= (d>>11)&0x3F;
         int g= d>>21;
         dstU[i]= ((2*RU*r + GU*g + 2*BU*b)>>(RGB2YUV_SHIFT+1-2)) + 128;
         dstV[i]= ((2*RV*r + GV*g + 2*BV*b)>>(RGB2YUV_SHIFT+1-2)) + 128;
@@ -2546,7 +2543,7 @@ static inline void RENAME(hyscale)(uint16_t *dst, long dstWidth, uint8_t *src, i
     }
 
 #ifdef HAVE_MMX
-    // use the new MMX scaler if the mmx2 can't be used (its faster than the x86asm one)
+    // use the new MMX scaler if the mmx2 can't be used (it is faster than the x86 ASM one)
     if (!(flags&SWS_FAST_BILINEAR) || (!canMMX2BeUsed))
 #else
     if (!(flags&SWS_FAST_BILINEAR))
@@ -2763,7 +2760,7 @@ inline static void RENAME(hcscale)(uint16_t *dst, long dstWidth, uint8_t *src1,
     }
 
 #ifdef HAVE_MMX
-    // use the new MMX scaler if the mmx2 can't be used (its faster than the x86asm one)
+    // use the new MMX scaler if the mmx2 can't be used (it is faster than the x86 ASM one)
     if (!(flags&SWS_FAST_BILINEAR) || (!canMMX2BeUsed))
 #else
     if (!(flags&SWS_FAST_BILINEAR))