Commit 964f9bcc authored by Simon Morlat's avatar Simon Morlat

fix unused functions warnings in x86

parent a8a63acd
......@@ -281,7 +281,7 @@ MS2_PUBLIC void ms_scaler_context_free(MSScalerContext *ctx);
MS2_PUBLIC void ms_video_set_scaler_impl(MSScalerDesc *desc);
MS2_PUBLIC mblk_t *copy_ycbcrbiplanar_to_true_yuv_with_rotation(char* y, char* cbcr, int rotation, int w, int h, int y_byte_per_row,int cbcr_byte_per_row, bool_t uFirstvSecond);
MS2_PUBLIC mblk_t *copy_ycbcrbiplanar_to_true_yuv_with_rotation(uint8_t* y, uint8_t* cbcr, int rotation, int w, int h, int y_byte_per_row,int cbcr_byte_per_row, bool_t uFirstvSecond);
/*** Encoder Helpers ***/
/* Frame rate controller */
......
......@@ -907,8 +907,9 @@ static void rotate_plane(int wDest, int hDest, int full_width, uint8_t* src, uin
}
}
/*static*/ void rotate_plane_neon_clockwise(int wDest, int hDest, int full_width, uint8_t* src, uint8_t* dst) {
#if defined (__ARM_NEON__)
/*static*/ void rotate_plane_neon_clockwise(int wDest, int hDest, int full_width, uint8_t* src, uint8_t* dst) {
#define BLOCK_WIDTH 8
int hSrc = wDest;
int wSrc = hDest;
......@@ -930,11 +931,9 @@ static void rotate_plane(int wDest, int hDest, int full_width, uint8_t* src, uin
dst -= incr;
src += src_stride;
}
#endif
}
/*static*/ void rotate_plane_neon_anticlockwise(int wDest, int hDest, int full_width, uint8_t* src, uint8_t* dst) {
#if defined (__ARM_NEON__)
#define BLOCK_WIDTH 8
int hSrc = wDest;
int wSrc = hDest;
......@@ -957,11 +956,11 @@ static void rotate_plane(int wDest, int hDest, int full_width, uint8_t* src, uin
dst -= incr;
src += src_stride;
}
#endif
}
/*static*/ void rotate_cbcr_to_cr_cb(int wDest, int hDest, int full_width, uint8_t* cbcr_src, uint8_t* cr_dst, uint8_t* cb_dst,bool_t clockWise) {
#if defined (__ARM_NEON__)
int hSrc = wDest;
int wSrc = hDest;
int src_stride = 2*full_width;
......@@ -1030,11 +1029,10 @@ static void rotate_plane(int wDest, int hDest, int full_width, uint8_t* src, uin
cr_dst -= incr;
cbcr_src += src_stride;
}
#endif
}
static void reverse_16bytes_neon(unsigned char* src, unsigned char* dest) {
#if defined (__ARM_NEON__)
__asm (/*load 16x1 pixel
[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]*/
"vld1.8 {d0,d1},[%0] \n\t"
......@@ -1049,11 +1047,9 @@ static void reverse_16bytes_neon(unsigned char* src, unsigned char* dest) {
: "r"(src),"r"(dest)/*in*/
: "r4","d0","d1","memory" /*modified*/
);
#endif
}
static void deinterlace_and_reverse_2x8bytes_neon(unsigned char* src, unsigned char* udest, unsigned char* vdest) {
#if defined (__ARM_NEON__)
__asm (/*load 16x1 values
[ U0, V0, U1, V1, U2, V2, U3, V3, U4, V4, U5, V5, U6, V6, U7, V7]
[ U0, U1, U2, U3, U4, U5, U6, U7, V0, V1, V2, V3, V4, V5, V6, V7]*/
......@@ -1069,15 +1065,16 @@ static void deinterlace_and_reverse_2x8bytes_neon(unsigned char* src, unsigned c
: "r"(src),"r"(udest),"r"(vdest)/*in*/
: "r4","d0","d1","memory" /*modified*/
);
#endif
}
#endif
#ifdef ANDROID
#include "cpu-features.h"
static int hasNeon = -1;
#endif
/* Destination and source images may have their dimensions inverted.*/
mblk_t *copy_ycbcrbiplanar_to_true_yuv_with_rotation(char* y, char* cbcr, int rotation, int w, int h, int y_byte_per_row,int cbcr_byte_per_row, bool_t uFirstvSecond) {
mblk_t *copy_ycbcrbiplanar_to_true_yuv_with_rotation(uint8_t* y, uint8_t * cbcr, int rotation, int w, int h, int y_byte_per_row,int cbcr_byte_per_row, bool_t uFirstvSecond) {
MSPicture pict;
mblk_t *yuv_block = ms_yuv_buf_alloc(&pict, w, h);
......@@ -1113,7 +1110,7 @@ mblk_t *copy_ycbcrbiplanar_to_true_yuv_with_rotation(char* y, char* cbcr, int ro
}
}
} else {
#ifdef ANDROID
#if defined (ANDROID) && defined (__ARM_NEON__)
if (hasNeon) {
// 180° y rotation
for(i=0; i<h; i++) {
......@@ -1152,7 +1149,7 @@ mblk_t *copy_ycbcrbiplanar_to_true_yuv_with_rotation(char* y, char* cbcr, int ro
}
} else {
bool_t clockwise = rotation == 90 ? TRUE : FALSE;
#ifdef ANDROID
#if defined(ANDROID) && defined (__ARM_NEON__)
// Rotate Y
if (hasNeon) {
if (clockwise) {
......@@ -1167,14 +1164,14 @@ mblk_t *copy_ycbcrbiplanar_to_true_yuv_with_rotation(char* y, char* cbcr, int ro
uint8_t* srcy = (uint8_t*) y;
rotate_plane(w,h,y_byte_per_row,srcy,dsty,1, clockwise);
}
#ifdef ANDROID
#if defined(ANDROID) && defined (__ARM_NEON__)
if (hasNeon) {
rotate_cbcr_to_cr_cb(uv_w,uv_h, cbcr_byte_per_row/2, (uint8_t*)cbcr, pict.planes[2], pict.planes[1],clockwise);
} else
#endif
{
// Copying U
uint8_t* srcu = (uint8_t*) cbcr;
uint8_t* srcu = cbcr;
uint8_t* dstu = pict.planes[1];
rotate_plane(uv_w,uv_h,cbcr_byte_per_row/2,srcu,dstu, 2, clockwise);
// Copying V
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment