summaryrefslogtreecommitdiff
path: root/vp8/common/x86
diff options
context:
space:
mode:
authorJohann <johannkoenig@google.com>2014-06-12 19:16:59 -0700
committerJohann <johannkoenig@google.com>2014-06-12 19:57:25 -0700
commit79afb5eb416ff7adc862bfe28aac3c69f173efdd (patch)
tree094ceef7443e94f38e5d50db9ce72f828dece1aa /vp8/common/x86
parent7336903545091a8bf29d7f341e3681f45ab35fc2 (diff)
downloadlibvpx-79afb5eb416ff7adc862bfe28aac3c69f173efdd.tar
libvpx-79afb5eb416ff7adc862bfe28aac3c69f173efdd.tar.gz
libvpx-79afb5eb416ff7adc862bfe28aac3c69f173efdd.tar.bz2
libvpx-79afb5eb416ff7adc862bfe28aac3c69f173efdd.zip
Use lrand48 on Android
When building x86 assembly use lrand48 instead of the undocumented inlined _rand function. Android now supports rand() https://android-review.googlesource.com/97731 but only for new versions. Original workaround: https://gerrit.chromium.org/gerrit/15744 Change-Id: I130566837d5bfc9e54187ebe9807350d1a7dab2a
Diffstat (limited to 'vp8/common/x86')
-rw-r--r--vp8/common/x86/postproc_mmx.asm3
-rw-r--r--vp8/common/x86/postproc_sse2.asm3
-rw-r--r--vp8/common/x86/postproc_x86.c24
3 files changed, 2 insertions, 28 deletions
diff --git a/vp8/common/x86/postproc_mmx.asm b/vp8/common/x86/postproc_mmx.asm
index 8be3431f9..a2b16327f 100644
--- a/vp8/common/x86/postproc_mmx.asm
+++ b/vp8/common/x86/postproc_mmx.asm
@@ -246,7 +246,6 @@ sym(vp8_mbpost_proc_down_mmx):
; unsigned char whiteclamp[16],
; unsigned char bothclamp[16],
; unsigned int Width, unsigned int Height, int Pitch)
-extern sym(rand)
global sym(vp8_plane_add_noise_mmx) PRIVATE
sym(vp8_plane_add_noise_mmx):
push rbp
@@ -258,7 +257,7 @@ sym(vp8_plane_add_noise_mmx):
; end prolog
.addnoise_loop:
- call sym(rand) WRT_PLT
+ call sym(LIBVPX_RAND) WRT_PLT
mov rcx, arg(1) ;noise
and rax, 0xff
add rcx, rax
diff --git a/vp8/common/x86/postproc_sse2.asm b/vp8/common/x86/postproc_sse2.asm
index f53daa7e5..fed4ee5cc 100644
--- a/vp8/common/x86/postproc_sse2.asm
+++ b/vp8/common/x86/postproc_sse2.asm
@@ -660,7 +660,6 @@ sym(vp8_mbpost_proc_across_ip_xmm):
; unsigned char whiteclamp[16],
; unsigned char bothclamp[16],
; unsigned int Width, unsigned int Height, int Pitch)
-extern sym(rand)
global sym(vp8_plane_add_noise_wmt) PRIVATE
sym(vp8_plane_add_noise_wmt):
push rbp
@@ -672,7 +671,7 @@ sym(vp8_plane_add_noise_wmt):
; end prolog
.addnoise_loop:
- call sym(rand) WRT_PLT
+ call sym(LIBVPX_RAND) WRT_PLT
mov rcx, arg(1) ;noise
and rax, 0xff
add rcx, rax
diff --git a/vp8/common/x86/postproc_x86.c b/vp8/common/x86/postproc_x86.c
deleted file mode 100644
index 3ec0106a8..000000000
--- a/vp8/common/x86/postproc_x86.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-/* On Android NDK, rand is inlined function, but postproc needs rand symbol */
-#if defined(__ANDROID__)
-#define rand __rand
-#include <stdlib.h>
-#undef rand
-
-extern int rand(void)
-{
- return __rand();
-}
-#else
-/* ISO C forbids an empty translation unit. */
-int vp8_unused;
-#endif