summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohann <johannkoenig@google.com>2014-06-12 19:16:59 -0700
committerPatrick Tjin <pattjin@google.com>2015-01-21 13:23:37 -0800
commit69f5594ef6a4a13fac8b001421b302a9a0b4a009 (patch)
treea77c09b7aac286349baf0584ba5258cd6258b395
parent470ef077237c82c7ab7ba2def07241a6a1f9349c (diff)
downloadandroid_external_libvpx-69f5594ef6a4a13fac8b001421b302a9a0b4a009.tar.gz
android_external_libvpx-69f5594ef6a4a13fac8b001421b302a9a0b4a009.tar.bz2
android_external_libvpx-69f5594ef6a4a13fac8b001421b302a9a0b4a009.zip
Cherry-pick "Use lrand48 on Android" [DO NOT MERGE]
Also remove from x86/libvpx_srcs.txt Original change: https://gerrit.chromium.org/gerrit/70494/ 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 (cherry-picked from 614a6a21483b59b4ab557785c160c8ca4722b062) Change-Id: I3c17cf37c40623f8353d8836fb4ac02c35a4d8b8
-rw-r--r--libvpx/vp8/common/x86/postproc_mmx.asm3
-rw-r--r--libvpx/vp8/common/x86/postproc_sse2.asm3
-rw-r--r--libvpx/vp8/common/x86/postproc_x86.c24
-rw-r--r--libvpx/vp8/vp8_common.mk1
-rw-r--r--libvpx/vp9/common/x86/vp9_postproc_mmx.asm3
-rw-r--r--libvpx/vp9/common/x86/vp9_postproc_sse2.asm3
-rw-r--r--libvpx/vpx_ports/x86_abi_support.asm11
-rw-r--r--x86/libvpx_srcs.txt1
8 files changed, 15 insertions, 34 deletions
diff --git a/libvpx/vp8/common/x86/postproc_mmx.asm b/libvpx/vp8/common/x86/postproc_mmx.asm
index 8be3431..a2b1632 100644
--- a/libvpx/vp8/common/x86/postproc_mmx.asm
+++ b/libvpx/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/libvpx/vp8/common/x86/postproc_sse2.asm b/libvpx/vp8/common/x86/postproc_sse2.asm
index f53daa7..fed4ee5 100644
--- a/libvpx/vp8/common/x86/postproc_sse2.asm
+++ b/libvpx/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/libvpx/vp8/common/x86/postproc_x86.c b/libvpx/vp8/common/x86/postproc_x86.c
deleted file mode 100644
index 3ec0106..0000000
--- a/libvpx/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
diff --git a/libvpx/vp8/vp8_common.mk b/libvpx/vp8/vp8_common.mk
index dfb54a5..8b49eff 100644
--- a/libvpx/vp8/vp8_common.mk
+++ b/libvpx/vp8/vp8_common.mk
@@ -108,7 +108,6 @@ VP8_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/variance_impl_ssse3.asm
VP8_COMMON_SRCS-$(HAVE_SSE4_1) += common/x86/sad_sse4.asm
ifeq ($(CONFIG_POSTPROC),yes)
-VP8_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64) += common/x86/postproc_x86.c
VP8_COMMON_SRCS-$(HAVE_MMX) += common/x86/postproc_mmx.asm
VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/mfqe_sse2.asm
VP8_COMMON_SRCS-$(HAVE_SSE2) += common/x86/postproc_sse2.asm
diff --git a/libvpx/vp9/common/x86/vp9_postproc_mmx.asm b/libvpx/vp9/common/x86/vp9_postproc_mmx.asm
index c2118db..5b8deef 100644
--- a/libvpx/vp9/common/x86/vp9_postproc_mmx.asm
+++ b/libvpx/vp9/common/x86/vp9_postproc_mmx.asm
@@ -464,7 +464,6 @@ sym(vp9_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(vp9_plane_add_noise_mmx) PRIVATE
sym(vp9_plane_add_noise_mmx):
push rbp
@@ -476,7 +475,7 @@ sym(vp9_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/libvpx/vp9/common/x86/vp9_postproc_sse2.asm b/libvpx/vp9/common/x86/vp9_postproc_sse2.asm
index 858fc99..ec8bfdb 100644
--- a/libvpx/vp9/common/x86/vp9_postproc_sse2.asm
+++ b/libvpx/vp9/common/x86/vp9_postproc_sse2.asm
@@ -629,7 +629,6 @@ sym(vp9_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(vp9_plane_add_noise_wmt) PRIVATE
sym(vp9_plane_add_noise_wmt):
push rbp
@@ -641,7 +640,7 @@ sym(vp9_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/libvpx/vpx_ports/x86_abi_support.asm b/libvpx/vpx_ports/x86_abi_support.asm
index eccbfa3..3814ef4 100644
--- a/libvpx/vpx_ports/x86_abi_support.asm
+++ b/libvpx/vpx_ports/x86_abi_support.asm
@@ -393,3 +393,14 @@ section .note.GNU-stack noalloc noexec nowrite progbits
section .text
%endif
+; On Android platforms use lrand48 when building postproc routines. Prior to L
+; rand() was not available.
+%if CONFIG_POSTPROC=1
+%ifdef __ANDROID__
+extern sym(lrand48)
+%define LIBVPX_RAND lrand48
+%else
+extern sym(rand)
+%define LIBVPX_RAND rand
+%endif
+%endif ; CONFIG_POSTPROC
diff --git a/x86/libvpx_srcs.txt b/x86/libvpx_srcs.txt
index 0c59ce9..0d43a86 100644
--- a/x86/libvpx_srcs.txt
+++ b/x86/libvpx_srcs.txt
@@ -80,7 +80,6 @@ vp8/common/x86/loopfilter_x86.c
vp8/common/x86/mfqe_sse2.asm
vp8/common/x86/postproc_mmx.asm
vp8/common/x86/postproc_sse2.asm
-vp8/common/x86/postproc_x86.c
vp8/common/x86/recon_mmx.asm
vp8/common/x86/recon_sse2.asm
vp8/common/x86/recon_wrapper_sse2.c