]> git.sesse.net Git - x264/blobdiff - common/mdate.c
x86 asm for high-bit-depth DCT
[x264] / common / mdate.c
index c57becbd9ace027ca517dd7c1de6cb58ea0cd196..702d44743f4b3ed2bee37411d567e7bb8c04ef59 100644 (file)
@@ -1,8 +1,7 @@
 /*****************************************************************************
- * mdate.c: h264 encoder
+ * mdate.c: time measurement
  *****************************************************************************
- * Copyright (C) 2003 Laurent Aimar
- * $Id: mdate.c,v 1.1 2004/06/03 19:27:07 fenrir Exp $
+ * Copyright (C) 2003-2010 x264 project
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  *
  * 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.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
+ *
+ * This program is also available under a commercial proprietary license.
+ * For more information, contact us at licensing@x264.com.
  *****************************************************************************/
 
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#else
-#include <inttypes.h>
-#endif
-
-#if !(defined(_MSC_VER) || defined(__MINGW32__))
+#ifndef __MINGW32__
 #include <sys/time.h>
 #else
 #include <sys/types.h>
 #endif
 #include <time.h>
 
+#include "common.h"
+#include "osdep.h"
+
 int64_t x264_mdate( void )
 {
-#if !(defined(_MSC_VER) || defined(__MINGW32__))
+#ifndef __MINGW32__
     struct timeval tv_date;
-
     gettimeofday( &tv_date, NULL );
-    return( (int64_t) tv_date.tv_sec * 1000000 + (int64_t) tv_date.tv_usec );
+    return (int64_t)tv_date.tv_sec * 1000000 + (int64_t)tv_date.tv_usec;
 #else
-    struct _timeb tb;
-    _ftime(&tb);
-    return ((int64_t)tb.time * (1000) + (int64_t)tb.millitm) * (1000);
+    struct timeb tb;
+    ftime( &tb );
+    return ((int64_t)tb.time * 1000 + (int64_t)tb.millitm) * 1000;
 #endif
 }