Commit 3a3a89cc authored by Frank Barchard's avatar Frank Barchard

rotate include and proto cleanup

R=harryjin@google.com
BUG=libyuv:468

Review URL: https://webrtc-codereview.appspot.com/55679005.
parent 5be90d23
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include "libyuv/rotate.h" #include "libyuv/row.h"
#include "libyuv/cpu_id.h" #include "libyuv/cpu_id.h"
#include "libyuv/convert.h" #include "libyuv/convert.h"
......
...@@ -27,24 +27,20 @@ extern "C" { ...@@ -27,24 +27,20 @@ extern "C" {
(defined(__x86_64__) && !defined(__native_client__)) || defined(__i386__)) (defined(__x86_64__) && !defined(__native_client__)) || defined(__i386__))
#define HAS_SCALEARGBROWDOWNEVEN_SSE2 #define HAS_SCALEARGBROWDOWNEVEN_SSE2
void ScaleARGBRowDownEven_SSE2(const uint8* src_ptr, int src_stride, void ScaleARGBRowDownEven_SSE2(const uint8* src_ptr, int src_stride,
int src_stepx, int src_stepx, uint8* dst_ptr, int dst_width);
uint8* dst_ptr, int dst_width);
#endif #endif
#if !defined(LIBYUV_DISABLE_NEON) && !defined(__native_client__) && \ #if !defined(LIBYUV_DISABLE_NEON) && !defined(__native_client__) && \
(defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__)) (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__))
#define HAS_SCALEARGBROWDOWNEVEN_NEON #define HAS_SCALEARGBROWDOWNEVEN_NEON
void ScaleARGBRowDownEven_NEON(const uint8* src_ptr, int src_stride, void ScaleARGBRowDownEven_NEON(const uint8* src_ptr, int src_stride,
int src_stepx, int src_stepx, uint8* dst_ptr, int dst_width);
uint8* dst_ptr, int dst_width);
#endif #endif
void ScaleARGBRowDownEven_C(const uint8* src_ptr, int, void ScaleARGBRowDownEven_C(const uint8* src_ptr, int,
int src_stepx, int src_stepx, uint8* dst_ptr, int dst_width);
uint8* dst_ptr, int dst_width);
static void ARGBTranspose(const uint8* src, int src_stride, static void ARGBTranspose(const uint8* src, int src_stride,
uint8* dst, int dst_stride, uint8* dst, int dst_stride, int width, int height) {
int width, int height) {
int i; int i;
int src_pixel_step = src_stride >> 2; int src_pixel_step = src_stride >> 2;
void (*ScaleARGBRowDownEven)(const uint8* src_ptr, int src_stride, void (*ScaleARGBRowDownEven)(const uint8* src_ptr, int src_stride,
...@@ -68,8 +64,7 @@ static void ARGBTranspose(const uint8* src, int src_stride, ...@@ -68,8 +64,7 @@ static void ARGBTranspose(const uint8* src, int src_stride,
} }
void ARGBRotate90(const uint8* src, int src_stride, void ARGBRotate90(const uint8* src, int src_stride,
uint8* dst, int dst_stride, uint8* dst, int dst_stride, int width, int height) {
int width, int height) {
// Rotate by 90 is a ARGBTranspose with the source read // Rotate by 90 is a ARGBTranspose with the source read
// from bottom to top. So set the source pointer to the end // from bottom to top. So set the source pointer to the end
// of the buffer and flip the sign of the source stride. // of the buffer and flip the sign of the source stride.
...@@ -79,8 +74,7 @@ void ARGBRotate90(const uint8* src, int src_stride, ...@@ -79,8 +74,7 @@ void ARGBRotate90(const uint8* src, int src_stride,
} }
void ARGBRotate270(const uint8* src, int src_stride, void ARGBRotate270(const uint8* src, int src_stride,
uint8* dst, int dst_stride, uint8* dst, int dst_stride, int width, int height) {
int width, int height) {
// Rotate by 270 is a ARGBTranspose with the destination written // Rotate by 270 is a ARGBTranspose with the destination written
// from bottom to top. So set the destination pointer to the end // from bottom to top. So set the destination pointer to the end
// of the buffer and flip the sign of the destination stride. // of the buffer and flip the sign of the destination stride.
...@@ -90,8 +84,7 @@ void ARGBRotate270(const uint8* src, int src_stride, ...@@ -90,8 +84,7 @@ void ARGBRotate270(const uint8* src, int src_stride,
} }
void ARGBRotate180(const uint8* src, int src_stride, void ARGBRotate180(const uint8* src, int src_stride,
uint8* dst, int dst_stride, uint8* dst, int dst_stride, int width, int height) {
int width, int height) {
// Swap first and last row and mirror the content. Uses a temporary row. // Swap first and last row and mirror the content. Uses a temporary row.
align_buffer_64(row, width * 4); align_buffer_64(row, width * 4);
const uint8* src_bot = src + src_stride * (height - 1); const uint8* src_bot = src + src_stride * (height - 1);
...@@ -166,8 +159,7 @@ void ARGBRotate180(const uint8* src, int src_stride, ...@@ -166,8 +159,7 @@ void ARGBRotate180(const uint8* src, int src_stride,
LIBYUV_API LIBYUV_API
int ARGBRotate(const uint8* src_argb, int src_stride_argb, int ARGBRotate(const uint8* src_argb, int src_stride_argb,
uint8* dst_argb, int dst_stride_argb, uint8* dst_argb, int dst_stride_argb, int width, int height,
int width, int height,
enum RotationMode mode) { enum RotationMode mode) {
if (!src_argb || width <= 0 || height == 0 || !dst_argb) { if (!src_argb || width <= 0 || height == 0 || !dst_argb) {
return -1; return -1;
......
...@@ -8,13 +8,8 @@ ...@@ -8,13 +8,8 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include "libyuv/rotate.h"
#include "libyuv/cpu_id.h"
#include "libyuv/convert.h"
#include "libyuv/planar_functions.h"
#include "libyuv/rotate_row.h"
#include "libyuv/row.h" #include "libyuv/row.h"
#include "libyuv/rotate_row.h"
#ifdef __cplusplus #ifdef __cplusplus
namespace libyuv { namespace libyuv {
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include "libyuv/row.h" #include "libyuv/row.h"
#include "libyuv/rotate_row.h"
#include "libyuv/basic_types.h" #include "libyuv/basic_types.h"
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include "libyuv/row.h" #include "libyuv/row.h"
#include "libyuv/rotate_row.h"
#include "libyuv/basic_types.h" #include "libyuv/basic_types.h"
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include "libyuv/row.h" #include "libyuv/row.h"
#include "libyuv/rotate_row.h"
#include "libyuv/basic_types.h" #include "libyuv/basic_types.h"
...@@ -21,11 +22,10 @@ extern "C" { ...@@ -21,11 +22,10 @@ extern "C" {
#if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) #if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__)
static uvec8 kVTbl4x4Transpose = static uvec8 kVTbl4x4Transpose =
{ 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15 }; { 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15 };
void TransposeWx8_NEON(const uint8* src, int src_stride, void TransposeWx8_NEON(const uint8* src, int src_stride,
uint8* dst, int dst_stride, uint8* dst, int dst_stride, int width) {
int width) {
const uint8* src_temp = NULL; const uint8* src_temp = NULL;
int64 width64 = (int64) width; // Work around clang 3.4 warning. int64 width64 = (int64) width; // Work around clang 3.4 warning.
asm volatile ( asm volatile (
......
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