]> git.sesse.net Git - vlc/blobdiff - modules/video_chroma/i420_rgb_mmx.h
- Fix segfault when doing RTSP DESCRIBE (trunk-only bug from [11811])
[vlc] / modules / video_chroma / i420_rgb_mmx.h
index 998e96f8b5a221b62fa81bbe5555e9cffeea8c15..ef03260ac1cb1465a1bcb94c65ad16c1ac720a67 100644 (file)
@@ -1,45 +1,49 @@
 /*****************************************************************************
  * transforms_yuvmmx.h: MMX YUV transformation assembly
  *****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: i420_rgb_mmx.h,v 1.3 2003/08/29 18:58:05 fenrir Exp $
+ * Copyright (C) 1999-2004 the VideoLAN team
+ * $Id$
  *
  * Authors: Olie Lho <ollie@sis.com.tw>
  *          GaĆ«l Hendryckx <jimmy@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This library is distributed in the hope that it will be useful,
+ * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
 /* hope these constant values are cache line aligned */
-#define UNUSED_U64(foo) \
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
+#define USED_U64(foo) \
+    static const uint64_t foo __asm__ (#foo) __attribute__((used))
+#else
+#define USED_U64(foo) \
     static const uint64_t foo __asm__ (#foo) __attribute__((unused))
-UNUSED_U64(mmx_80w)     = 0x0080008000800080ULL;
-UNUSED_U64(mmx_10w)     = 0x1010101010101010ULL;
-UNUSED_U64(mmx_00ffw)   = 0x00ff00ff00ff00ffULL;
-UNUSED_U64(mmx_Y_coeff) = 0x253f253f253f253fULL;
+#endif
+USED_U64(mmx_80w)     = 0x0080008000800080ULL;
+USED_U64(mmx_10w)     = 0x1010101010101010ULL;
+USED_U64(mmx_00ffw)   = 0x00ff00ff00ff00ffULL;
+USED_U64(mmx_Y_coeff) = 0x253f253f253f253fULL;
 
-UNUSED_U64(mmx_U_green) = 0xf37df37df37df37dULL;
-UNUSED_U64(mmx_U_blue)  = 0x4093409340934093ULL;
-UNUSED_U64(mmx_V_red)   = 0x3312331233123312ULL;
-UNUSED_U64(mmx_V_green) = 0xe5fce5fce5fce5fcULL;
+USED_U64(mmx_U_green) = 0xf37df37df37df37dULL;
+USED_U64(mmx_U_blue)  = 0x4093409340934093ULL;
+USED_U64(mmx_V_red)   = 0x3312331233123312ULL;
+USED_U64(mmx_V_green) = 0xe5fce5fce5fce5fcULL;
 
-UNUSED_U64(mmx_mask_f8) = 0xf8f8f8f8f8f8f8f8ULL;
-UNUSED_U64(mmx_mask_fc) = 0xfcfcfcfcfcfcfcfcULL;
-#undef UNUSED_U64
+USED_U64(mmx_mask_f8) = 0xf8f8f8f8f8f8f8f8ULL;
+USED_U64(mmx_mask_fc) = 0xfcfcfcfcfcfcfcfcULL;
+#undef USED_U64
 
 #define MMX_INIT_16 "                                                       \n\
 movd      (%1), %%mm0       # Load 4 Cb       00 00 00 00 u3 u2 u1 u0       \n\