Skip to content
Snippets Groups Projects
Commit 957a64f4 authored by Leo Ma's avatar Leo Ma
Browse files

upgrade libx264


Signed-off-by: default avatarLeo Ma <begeekmyfriend@gmail.com>
parent ab9e285e
No related branches found
No related tags found
No related merge requests found
Showing
with 51 additions and 49 deletions
#!/bin/sh
 
ANDROID_NDK=D:/Android/android-sdk/ndk-bundle
ANDROID_NDK=$HOME/Android/Sdk/ndk-bundle
SYSROOT=$ANDROID_NDK/platforms/android-21/arch-arm64
CROSS_PREFIX=$ANDROID_NDK/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64/bin/aarch64-linux-android-
CROSS_PREFIX=$ANDROID_NDK/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-
EXTRA_CFLAGS="-march=armv8-a -D__ANDROID__"
EXTRA_LDFLAGS="-nostdlib"
PREFIX=`pwd`/libs/arm64-v8a
 
configure --prefix=$PREFIX \
./configure --prefix=$PREFIX \
--host=aarch64-linux \
--sysroot=$SYSROOT \
--cross-prefix=$CROSS_PREFIX \
Loading
Loading
#!/bin/sh
 
ANDROID_NDK=D:/Android/android-sdk/ndk-bundle
ANDROID_NDK=$HOME/Android/Sdk/ndk-bundle
SYSROOT=$ANDROID_NDK/platforms/android-19/arch-arm
CROSS_PREFIX=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-
CROSS_PREFIX=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
EXTRA_CFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon -D__ANDROID__ -D__ARM_ARCH_7__ -D__ARM_ARCH_7A__"
EXTRA_LDFLAGS="-nostdlib"
PREFIX=`pwd`/libs/armeabi-v7a
 
configure --prefix=$PREFIX \
./configure --prefix=$PREFIX \
--host=arm-linux \
--sysroot=$SYSROOT \
--cross-prefix=$CROSS_PREFIX \
Loading
Loading
#!/bin/sh
 
ANDROID_NDK=D:/Android/android-sdk/ndk-bundle
ANDROID_NDK=$HOME/Android/Sdk/ndk-bundle
SYSROOT=$ANDROID_NDK/platforms/android-19/arch-x86
CROSS_PREFIX=$ANDROID_NDK/toolchains/x86-4.9/prebuilt/windows-x86_64/bin/i686-linux-android-
CROSS_PREFIX=$ANDROID_NDK/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-
EXTRA_CFLAGS="-D__ANDROID__ -D__i686__"
EXTRA_LDFLAGS="-nostdlib"
PREFIX=`pwd`/libs/x86
 
configure --prefix=$PREFIX \
./configure --prefix=$PREFIX \
--host=i686-linux \
--sysroot=$SYSROOT \
--cross-prefix=$CROSS_PREFIX \
Loading
Loading
/*****************************************************************************
* asm-offsets.c: check asm offsets for aarch64
*****************************************************************************
* Copyright (C) 2014-2016 x264 project
* Copyright (C) 2014-2017 x264 project
*
* Authors: Janne Grunau <janne-x264@jannau.net>
*
Loading
Loading
/*****************************************************************************
* asm-offsets.h: asm offsets for aarch64
*****************************************************************************
* Copyright (C) 2014-2016 x264 project
* Copyright (C) 2014-2017 x264 project
*
* Authors: Janne Grunau <janne-x264@jannau.net>
*
Loading
Loading
/*****************************************************************************
* asm.S: AArch64 utility macros
*****************************************************************************
* Copyright (C) 2008-2016 x264 project
* Copyright (C) 2008-2017 x264 project
*
* Authors: Mans Rullgard <mans@mansr.com>
* David Conrad <lessen42@gmail.com>
Loading
Loading
/*****************************************************************************
* bitstream-a.S: aarch64 bitstream functions
*****************************************************************************
* Copyright (C) 2014-2016 x264 project
* Copyright (C) 2014-2017 x264 project
*
* Authors: Janne Grunau <janne-x264@jannau.net>
*
Loading
Loading
/*****************************************************************************
* cabac-a.S: aarch64 cabac
*****************************************************************************
* Copyright (C) 2014-2016 x264 project
* Copyright (C) 2014-2017 x264 project
*
* Authors: Janne Grunau <janne-x264@jannau.net>
*
Loading
Loading
/****************************************************************************
* dct-a.S: aarch64 transform and zigzag
*****************************************************************************
* Copyright (C) 2009-2016 x264 project
* Copyright (C) 2009-2017 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Janne Grunau <janne-x264@jannau.net>
Loading
Loading
/*****************************************************************************
* dct.h: aarch64 transform and zigzag
*****************************************************************************
* Copyright (C) 2009-2016 x264 project
* Copyright (C) 2009-2017 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Janne Grunau <janne-x264@jannau.net>
Loading
Loading
/*****************************************************************************
* deblock.S: aarch64 deblocking
*****************************************************************************
* Copyright (C) 2009-2016 x264 project
* Copyright (C) 2009-2017 x264 project
*
* Authors: Mans Rullgard <mans@mansr.com>
* Janne Grunau <janne-x264@jannau.net>
Loading
Loading
/*****************************************************************************
* mc.S: aarch64 motion compensation
*****************************************************************************
* Copyright (C) 2009-2016 x264 project
* Copyright (C) 2009-2017 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Janne Grunau <janne-x264@jannau.net>
Loading
Loading
@@ -1254,8 +1254,9 @@ load_deinterleave_chroma:
endfunc
 
function x264_plane_copy_core_neon, export=1
add x8, x4, #15
and x4, x8, #~15
add w8, w4, #15 // 32-bit write clears the upper 32-bit the register
and w4, w8, #~15
// safe use of the full reg since negative width makes no sense
sub x1, x1, x4
sub x3, x3, x4
1:
Loading
Loading
@@ -1430,7 +1431,7 @@ endfunc
add v0.8h, v0.8h, v5.8h
.endm
 
function integral_init4h_neon, export=1
function x264_integral_init4h_neon, export=1
sub x3, x0, x2, lsl #1
ld1 {v6.8b,v7.8b}, [x1], #16
1:
Loading
Loading
@@ -1465,7 +1466,7 @@ endfunc
add v0.8h, v0.8h, \s\().8h
.endm
 
function integral_init8h_neon, export=1
function x264_integral_init8h_neon, export=1
sub x3, x0, x2, lsl #1
ld1 {v16.8b,v17.8b}, [x1], #16
1:
Loading
Loading
@@ -1482,7 +1483,7 @@ function integral_init8h_neon, export=1
ret
endfunc
 
function integral_init4v_neon, export=1
function x264_integral_init4v_neon, export=1
mov x3, x0
add x4, x0, x2, lsl #3
add x8, x0, x2, lsl #4
Loading
Loading
@@ -1517,7 +1518,7 @@ function integral_init4v_neon, export=1
ret
endfunc
 
function integral_init8v_neon, export=1
function x264_integral_init8v_neon, export=1
add x2, x0, x1, lsl #4
sub x1, x1, #8
ands x3, x1, #16 - 1
Loading
Loading
/*****************************************************************************
* mc-c.c: aarch64 motion compensation
*****************************************************************************
* Copyright (C) 2009-2016 x264 project
* Copyright (C) 2009-2017 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Janne Grunau <janne-x264@jannau.net>
Loading
Loading
@@ -94,10 +94,10 @@ void x264_mc_copy_w8_neon ( uint8_t *, intptr_t, uint8_t *, intptr_t, int );
void x264_mc_copy_w16_neon( uint8_t *, intptr_t, uint8_t *, intptr_t, int );
 
void x264_mc_chroma_neon( uint8_t *, uint8_t *, intptr_t, uint8_t *, intptr_t, int, int, int, int );
void integral_init4h_neon( uint16_t *, uint8_t *, intptr_t );
void integral_init4v_neon( uint16_t *, uint16_t *, intptr_t );
void integral_init8h_neon( uint16_t *, uint8_t *, intptr_t );
void integral_init8v_neon( uint16_t *, intptr_t );
void x264_integral_init4h_neon( uint16_t *, uint8_t *, intptr_t );
void x264_integral_init4v_neon( uint16_t *, uint16_t *, intptr_t );
void x264_integral_init8h_neon( uint16_t *, uint8_t *, intptr_t );
void x264_integral_init8v_neon( uint16_t *, intptr_t );
void x264_frame_init_lowres_core_neon( uint8_t *, uint8_t *, uint8_t *, uint8_t *, uint8_t *, intptr_t, intptr_t, int, int );
 
void x264_mbtree_propagate_cost_neon( int16_t *, uint16_t *, uint16_t *, uint16_t *, uint16_t *, float *, int );
Loading
Loading
@@ -154,7 +154,7 @@ static void mc_luma_neon( uint8_t *dst, intptr_t i_dst_stride,
int qpel_idx = ((mvy&3)<<2) + (mvx&3);
intptr_t offset = (mvy>>2)*i_src_stride + (mvx>>2);
uint8_t *src1 = src[x264_hpel_ref0[qpel_idx]] + offset;
if ( (mvy&3) == 3 ) // explict if() to force conditional add
if( (mvy&3) == 3 ) // explict if() to force conditional add
src1 += i_src_stride;
 
if( qpel_idx & 5 ) /* qpel interpolation needed */
Loading
Loading
@@ -180,7 +180,7 @@ static uint8_t *get_ref_neon( uint8_t *dst, intptr_t *i_dst_stride,
int qpel_idx = ((mvy&3)<<2) + (mvx&3);
intptr_t offset = (mvy>>2)*i_src_stride + (mvx>>2);
uint8_t *src1 = src[x264_hpel_ref0[qpel_idx]] + offset;
if ( (mvy&3) == 3 ) // explict if() to force conditional add
if( (mvy&3) == 3 ) // explict if() to force conditional add
src1 += i_src_stride;
 
if( qpel_idx & 5 ) /* qpel interpolation needed */
Loading
Loading
@@ -265,10 +265,10 @@ void x264_mc_init_aarch64( int cpu, x264_mc_functions_t *pf )
pf->hpel_filter = x264_hpel_filter_neon;
pf->frame_init_lowres_core = x264_frame_init_lowres_core_neon;
 
pf->integral_init4h = integral_init4h_neon;
pf->integral_init8h = integral_init8h_neon;
pf->integral_init4v = integral_init4v_neon;
pf->integral_init8v = integral_init8v_neon;
pf->integral_init4h = x264_integral_init4h_neon;
pf->integral_init8h = x264_integral_init8h_neon;
pf->integral_init4v = x264_integral_init4v_neon;
pf->integral_init8v = x264_integral_init8v_neon;
 
pf->mbtree_propagate_cost = x264_mbtree_propagate_cost_neon;
pf->mbtree_propagate_list = x264_mbtree_propagate_list_neon;
Loading
Loading
/*****************************************************************************
* mc.h: aarch64 motion compensation
*****************************************************************************
* Copyright (C) 2014-2016 x264 project
* Copyright (C) 2014-2017 x264 project
*
* Authors: Janne Grunau <janne-x264@jannau.net>
*
Loading
Loading
/*****************************************************************************
* pixel.S: aarch64 pixel metrics
*****************************************************************************
* Copyright (C) 2009-2016 x264 project
* Copyright (C) 2009-2017 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Janne Grunau <janne-x264@jannau.net>
Loading
Loading
/*****************************************************************************
* pixel.h: aarch64 pixel metrics
*****************************************************************************
* Copyright (C) 2009-2016 x264 project
* Copyright (C) 2009-2017 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Janne Grunau <janne-x264@jannau.net>
Loading
Loading
/*****************************************************************************
* predict.S: aarch64 intra prediction
*****************************************************************************
* Copyright (C) 2009-2016 x264 project
* Copyright (C) 2009-2017 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Mans Rullgard <mans@mansr.com>
Loading
Loading
/*****************************************************************************
* predict.c: aarch64 intra prediction
*****************************************************************************
* Copyright (C) 2009-2016 x264 project
* Copyright (C) 2009-2017 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Janne Grunau <janne-x264@jannau.net>
Loading
Loading
@@ -54,13 +54,13 @@ void x264_predict_16x16_p_neon( uint8_t *src );
void x264_predict_4x4_init_aarch64( int cpu, x264_predict_t pf[12] )
{
#if !HIGH_BIT_DEPTH
if (cpu&X264_CPU_ARMV8)
if( cpu&X264_CPU_ARMV8 )
{
pf[I_PRED_4x4_H] = x264_predict_4x4_h_aarch64;
pf[I_PRED_4x4_V] = x264_predict_4x4_v_aarch64;
}
 
if (cpu&X264_CPU_NEON)
if( cpu&X264_CPU_NEON )
{
pf[I_PRED_4x4_DC] = x264_predict_4x4_dc_neon;
pf[I_PRED_4x4_DC_TOP] = x264_predict_4x4_dc_top_neon;
Loading
Loading
@@ -73,11 +73,12 @@ void x264_predict_4x4_init_aarch64( int cpu, x264_predict_t pf[12] )
void x264_predict_8x8c_init_aarch64( int cpu, x264_predict_t pf[7] )
{
#if !HIGH_BIT_DEPTH
if (cpu&X264_CPU_ARMV8) {
if( cpu&X264_CPU_ARMV8 )
{
pf[I_PRED_CHROMA_V] = x264_predict_8x8c_v_aarch64;
}
 
if (!(cpu&X264_CPU_NEON))
if( !(cpu&X264_CPU_NEON) )
return;
 
pf[I_PRED_CHROMA_DC] = x264_predict_8x8c_dc_neon;
Loading
Loading
@@ -91,7 +92,7 @@ void x264_predict_8x8c_init_aarch64( int cpu, x264_predict_t pf[7] )
 
void x264_predict_8x16c_init_aarch64( int cpu, x264_predict_t pf[7] )
{
if (!(cpu&X264_CPU_NEON))
if( !(cpu&X264_CPU_NEON) )
return;
 
#if !HIGH_BIT_DEPTH
Loading
Loading
@@ -106,7 +107,7 @@ void x264_predict_8x16c_init_aarch64( int cpu, x264_predict_t pf[7] )
 
void x264_predict_8x8_init_aarch64( int cpu, x264_predict8x8_t pf[12], x264_predict_8x8_filter_t *predict_filter )
{
if (!(cpu&X264_CPU_NEON))
if( !(cpu&X264_CPU_NEON) )
return;
 
#if !HIGH_BIT_DEPTH
Loading
Loading
@@ -124,7 +125,7 @@ void x264_predict_8x8_init_aarch64( int cpu, x264_predict8x8_t pf[12], x264_pred
 
void x264_predict_16x16_init_aarch64( int cpu, x264_predict_t pf[7] )
{
if (!(cpu&X264_CPU_NEON))
if( !(cpu&X264_CPU_NEON) )
return;
 
#if !HIGH_BIT_DEPTH
Loading
Loading
/*****************************************************************************
* predict.h: aarch64 intra prediction
*****************************************************************************
* Copyright (C) 2009-2016 x264 project
* Copyright (C) 2009-2017 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Janne Grunau <janne-x264@jannau.net>
Loading
Loading
/****************************************************************************
* quant.S: arm quantization and level-run
*****************************************************************************
* Copyright (C) 2009-2016 x264 project
* Copyright (C) 2009-2017 x264 project
*
* Authors: David Conrad <lessen42@gmail.com>
* Janne Grunau <janne-x264@jannau.net>
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment