mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-07 17:26:49 +08:00
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
This commit is contained in:
parent
f6e4e14713
commit
6b5a8efff7
@ -1,6 +1,6 @@
|
||||
Name: libyuv
|
||||
URL: http://code.google.com/p/libyuv/
|
||||
Version: 397
|
||||
Version: 398
|
||||
License: BSD
|
||||
License File: LICENSE
|
||||
|
||||
|
||||
@ -27,8 +27,11 @@ void SetPlane(uint8* dst_y, int dst_stride_y,
|
||||
int width, int height,
|
||||
uint32 value);
|
||||
|
||||
// Alias.
|
||||
#define I400ToI400 CopyPlane
|
||||
// Copy I400. Supports inverting.
|
||||
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).
|
||||
LIBYUV_API
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
||||
#define INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
#define LIBYUV_VERSION 397
|
||||
#define LIBYUV_VERSION 398
|
||||
|
||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||
|
||||
@ -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.
|
||||
LIBYUV_API
|
||||
int I420ToI400(const uint8* src_y, int src_stride_y,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user