Commit 6b5a8eff authored by fbarchard@google.com's avatar fbarchard@google.com

I400 invert support which fixes a valgrind bug

BUG=117
TEST=I400ToI400Invert_OptVsC
Review URL: https://webrtc-codereview.appspot.com/859010

git-svn-id: http://libyuv.googlecode.com/svn/trunk@398 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent f6e4e147
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 397 Version: 398
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -27,8 +27,11 @@ void SetPlane(uint8* dst_y, int dst_stride_y, ...@@ -27,8 +27,11 @@ void SetPlane(uint8* dst_y, int dst_stride_y,
int width, int height, int width, int height,
uint32 value); uint32 value);
// Alias. // Copy I400. Supports inverting.
#define I400ToI400 CopyPlane LIBYUV_API
int I400ToI400(const uint8* src_y, int src_stride_y,
uint8* dst_y, int dst_stride_y,
int width, int height);
// Copy a plane of data (I420 to I400). // Copy a plane of data (I420 to I400).
LIBYUV_API LIBYUV_API
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 397 #define LIBYUV_VERSION 398
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
...@@ -55,6 +55,24 @@ void CopyPlane(const uint8* src_y, int src_stride_y, ...@@ -55,6 +55,24 @@ void CopyPlane(const uint8* src_y, int src_stride_y,
} }
} }
// Copy I400.
LIBYUV_API
int I400ToI400(const uint8* src_y, int src_stride_y,
uint8* dst_y, int dst_stride_y,
int width, int height) {
if (!src_y || !dst_y || width <= 0 || height == 0) {
return -1;
}
// Negative height means invert the image.
if (height < 0) {
height = -height;
src_y = src_y + (height - 1) * src_stride_y;
src_stride_y = -src_stride_y;
}
CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, width, height);
return 0;
}
// Convert I420 to I400. // Convert I420 to I400.
LIBYUV_API LIBYUV_API
int I420ToI400(const uint8* src_y, int src_stride_y, int I420ToI400(const uint8* src_y, int src_stride_y,
......
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