aboutsummaryrefslogtreecommitdiff
path: root/files/include/libyuv/planar_functions.h
diff options
context:
space:
mode:
Diffstat (limited to 'files/include/libyuv/planar_functions.h')
-rw-r--r--files/include/libyuv/planar_functions.h496
1 files changed, 280 insertions, 216 deletions
diff --git a/files/include/libyuv/planar_functions.h b/files/include/libyuv/planar_functions.h
index 040839c2..f6f5b3ed 100644
--- a/files/include/libyuv/planar_functions.h
+++ b/files/include/libyuv/planar_functions.h
@@ -22,58 +22,120 @@ namespace libyuv {
extern "C" {
#endif
+// TODO(fbarchard): Move cpu macros to row.h
+#if defined(__pnacl__) || defined(__CLR_VER) || \
+ (defined(__native_client__) && defined(__x86_64__)) || \
+ (defined(__i386__) && !defined(__SSE__) && !defined(__clang__))
+#define LIBYUV_DISABLE_X86
+#endif
+// MemorySanitizer does not support assembly code yet. http://crbug.com/344505
+#if defined(__has_feature)
+#if __has_feature(memory_sanitizer)
+#define LIBYUV_DISABLE_X86
+#endif
+#endif
+// The following are available on all x86 platforms:
+#if !defined(LIBYUV_DISABLE_X86) && \
+ (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__))
+#define HAS_ARGBAFFINEROW_SSE2
+#endif
+
// Copy a plane of data.
LIBYUV_API
-void CopyPlane(const uint8* src_y,
+void CopyPlane(const uint8_t* src_y,
int src_stride_y,
- uint8* dst_y,
+ uint8_t* dst_y,
int dst_stride_y,
int width,
int height);
LIBYUV_API
-void CopyPlane_16(const uint16* src_y,
+void CopyPlane_16(const uint16_t* src_y,
int src_stride_y,
- uint16* dst_y,
+ uint16_t* dst_y,
int dst_stride_y,
int width,
int height);
+LIBYUV_API
+void Convert16To8Plane(const uint16_t* src_y,
+ int src_stride_y,
+ uint8_t* dst_y,
+ int dst_stride_y,
+ int scale, // 16384 for 10 bits
+ int width,
+ int height);
+
+LIBYUV_API
+void Convert8To16Plane(const uint8_t* src_y,
+ int src_stride_y,
+ uint16_t* dst_y,
+ int dst_stride_y,
+ int scale, // 1024 for 10 bits
+ int width,
+ int height);
+
// Set a plane of data to a 32 bit value.
LIBYUV_API
-void SetPlane(uint8* dst_y,
+void SetPlane(uint8_t* dst_y,
int dst_stride_y,
int width,
int height,
- uint32 value);
+ uint32_t value);
// Split interleaved UV plane into separate U and V planes.
LIBYUV_API
-void SplitUVPlane(const uint8* src_uv,
+void SplitUVPlane(const uint8_t* src_uv,
int src_stride_uv,
- uint8* dst_u,
+ uint8_t* dst_u,
int dst_stride_u,
- uint8* dst_v,
+ uint8_t* dst_v,
int dst_stride_v,
int width,
int height);
// Merge separate U and V planes into one interleaved UV plane.
LIBYUV_API
-void MergeUVPlane(const uint8* src_u,
+void MergeUVPlane(const uint8_t* src_u,
int src_stride_u,
- const uint8* src_v,
+ const uint8_t* src_v,
int src_stride_v,
- uint8* dst_uv,
+ uint8_t* dst_uv,
int dst_stride_uv,
int width,
int height);
+// Split interleaved RGB plane into separate R, G and B planes.
+LIBYUV_API
+void SplitRGBPlane(const uint8_t* src_rgb,
+ int src_stride_rgb,
+ uint8_t* dst_r,
+ int dst_stride_r,
+ uint8_t* dst_g,
+ int dst_stride_g,
+ uint8_t* dst_b,
+ int dst_stride_b,
+ int width,
+ int height);
+
+// Merge separate R, G and B planes into one interleaved RGB plane.
+LIBYUV_API
+void MergeRGBPlane(const uint8_t* src_r,
+ int src_stride_r,
+ const uint8_t* src_g,
+ int src_stride_g,
+ const uint8_t* src_b,
+ int src_stride_b,
+ uint8_t* dst_rgb,
+ int dst_stride_rgb,
+ int width,
+ int height);
+
// Copy I400. Supports inverting.
LIBYUV_API
-int I400ToI400(const uint8* src_y,
+int I400ToI400(const uint8_t* src_y,
int src_stride_y,
- uint8* dst_y,
+ uint8_t* dst_y,
int dst_stride_y,
int width,
int height);
@@ -83,17 +145,17 @@ int I400ToI400(const uint8* src_y,
// Copy I422 to I422.
#define I422ToI422 I422Copy
LIBYUV_API
-int I422Copy(const uint8* src_y,
+int I422Copy(const uint8_t* src_y,
int src_stride_y,
- const uint8* src_u,
+ const uint8_t* src_u,
int src_stride_u,
- const uint8* src_v,
+ const uint8_t* src_v,
int src_stride_v,
- uint8* dst_y,
+ uint8_t* dst_y,
int dst_stride_y,
- uint8* dst_u,
+ uint8_t* dst_u,
int dst_stride_u,
- uint8* dst_v,
+ uint8_t* dst_v,
int dst_stride_v,
int width,
int height);
@@ -101,84 +163,97 @@ int I422Copy(const uint8* src_y,
// Copy I444 to I444.
#define I444ToI444 I444Copy
LIBYUV_API
-int I444Copy(const uint8* src_y,
+int I444Copy(const uint8_t* src_y,
int src_stride_y,
- const uint8* src_u,
+ const uint8_t* src_u,
int src_stride_u,
- const uint8* src_v,
+ const uint8_t* src_v,
int src_stride_v,
- uint8* dst_y,
+ uint8_t* dst_y,
int dst_stride_y,
- uint8* dst_u,
+ uint8_t* dst_u,
int dst_stride_u,
- uint8* dst_v,
+ uint8_t* dst_v,
int dst_stride_v,
int width,
int height);
// Convert YUY2 to I422.
LIBYUV_API
-int YUY2ToI422(const uint8* src_yuy2,
+int YUY2ToI422(const uint8_t* src_yuy2,
int src_stride_yuy2,
- uint8* dst_y,
+ uint8_t* dst_y,
int dst_stride_y,
- uint8* dst_u,
+ uint8_t* dst_u,
int dst_stride_u,
- uint8* dst_v,
+ uint8_t* dst_v,
int dst_stride_v,
int width,
int height);
// Convert UYVY to I422.
LIBYUV_API
-int UYVYToI422(const uint8* src_uyvy,
+int UYVYToI422(const uint8_t* src_uyvy,
int src_stride_uyvy,
- uint8* dst_y,
+ uint8_t* dst_y,
int dst_stride_y,
- uint8* dst_u,
+ uint8_t* dst_u,
int dst_stride_u,
- uint8* dst_v,
+ uint8_t* dst_v,
int dst_stride_v,
int width,
int height);
LIBYUV_API
-int YUY2ToNV12(const uint8* src_yuy2,
+int YUY2ToNV12(const uint8_t* src_yuy2,
int src_stride_yuy2,
- uint8* dst_y,
+ uint8_t* dst_y,
int dst_stride_y,
- uint8* dst_uv,
+ uint8_t* dst_uv,
int dst_stride_uv,
int width,
int height);
LIBYUV_API
-int UYVYToNV12(const uint8* src_uyvy,
+int UYVYToNV12(const uint8_t* src_uyvy,
int src_stride_uyvy,
- uint8* dst_y,
+ uint8_t* dst_y,
+ int dst_stride_y,
+ uint8_t* dst_uv,
+ int dst_stride_uv,
+ int width,
+ int height);
+
+// Convert NV21 to NV12.
+LIBYUV_API
+int NV21ToNV12(const uint8_t* src_y,
+ int src_stride_y,
+ const uint8_t* src_vu,
+ int src_stride_vu,
+ uint8_t* dst_y,
int dst_stride_y,
- uint8* dst_uv,
+ uint8_t* dst_uv,
int dst_stride_uv,
int width,
int height);
LIBYUV_API
-int YUY2ToY(const uint8* src_yuy2,
+int YUY2ToY(const uint8_t* src_yuy2,
int src_stride_yuy2,
- uint8* dst_y,
+ uint8_t* dst_y,
int dst_stride_y,
int width,
int height);
// Convert I420 to I400. (calls CopyPlane ignoring u/v).
LIBYUV_API
-int I420ToI400(const uint8* src_y,
+int I420ToI400(const uint8_t* src_y,
int src_stride_y,
- const uint8* src_u,
+ const uint8_t* src_u,
int src_stride_u,
- const uint8* src_v,
+ const uint8_t* src_v,
int src_stride_v,
- uint8* dst_y,
+ uint8_t* dst_y,
int dst_stride_y,
int width,
int height);
@@ -189,17 +264,17 @@ int I420ToI400(const uint8* src_y,
// I420 mirror.
LIBYUV_API
-int I420Mirror(const uint8* src_y,
+int I420Mirror(const uint8_t* src_y,
int src_stride_y,
- const uint8* src_u,
+ const uint8_t* src_u,
int src_stride_u,
- const uint8* src_v,
+ const uint8_t* src_v,
int src_stride_v,
- uint8* dst_y,
+ uint8_t* dst_y,
int dst_stride_y,
- uint8* dst_u,
+ uint8_t* dst_u,
int dst_stride_u,
- uint8* dst_v,
+ uint8_t* dst_v,
int dst_stride_v,
int width,
int height);
@@ -210,9 +285,9 @@ int I420Mirror(const uint8* src_y,
// I400 mirror. A single plane is mirrored horizontally.
// Pass negative height to achieve 180 degree rotation.
LIBYUV_API
-int I400Mirror(const uint8* src_y,
+int I400Mirror(const uint8_t* src_y,
int src_stride_y,
- uint8* dst_y,
+ uint8_t* dst_y,
int dst_stride_y,
int width,
int height);
@@ -222,20 +297,20 @@ int I400Mirror(const uint8* src_y,
// ARGB mirror.
LIBYUV_API
-int ARGBMirror(const uint8* src_argb,
+int ARGBMirror(const uint8_t* src_argb,
int src_stride_argb,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
int width,
int height);
// Convert NV12 to RGB565.
LIBYUV_API
-int NV12ToRGB565(const uint8* src_y,
+int NV12ToRGB565(const uint8_t* src_y,
int src_stride_y,
- const uint8* src_uv,
+ const uint8_t* src_uv,
int src_stride_uv,
- uint8* dst_rgb565,
+ uint8_t* dst_rgb565,
int dst_stride_rgb565,
int width,
int height);
@@ -243,39 +318,39 @@ int NV12ToRGB565(const uint8* src_y,
// I422ToARGB is in convert_argb.h
// Convert I422 to BGRA.
LIBYUV_API
-int I422ToBGRA(const uint8* src_y,
+int I422ToBGRA(const uint8_t* src_y,
int src_stride_y,
- const uint8* src_u,
+ const uint8_t* src_u,
int src_stride_u,
- const uint8* src_v,
+ const uint8_t* src_v,
int src_stride_v,
- uint8* dst_bgra,
+ uint8_t* dst_bgra,
int dst_stride_bgra,
int width,
int height);
// Convert I422 to ABGR.
LIBYUV_API
-int I422ToABGR(const uint8* src_y,
+int I422ToABGR(const uint8_t* src_y,
int src_stride_y,
- const uint8* src_u,
+ const uint8_t* src_u,
int src_stride_u,
- const uint8* src_v,
+ const uint8_t* src_v,
int src_stride_v,
- uint8* dst_abgr,
+ uint8_t* dst_abgr,
int dst_stride_abgr,
int width,
int height);
// Convert I422 to RGBA.
LIBYUV_API
-int I422ToRGBA(const uint8* src_y,
+int I422ToRGBA(const uint8_t* src_y,
int src_stride_y,
- const uint8* src_u,
+ const uint8_t* src_u,
int src_stride_u,
- const uint8* src_v,
+ const uint8_t* src_v,
int src_stride_v,
- uint8* dst_rgba,
+ uint8_t* dst_rgba,
int dst_stride_rgba,
int width,
int height);
@@ -284,20 +359,20 @@ int I422ToRGBA(const uint8* src_y,
#define RGB24ToRAW RAWToRGB24
LIBYUV_API
-int RAWToRGB24(const uint8* src_raw,
+int RAWToRGB24(const uint8_t* src_raw,
int src_stride_raw,
- uint8* dst_rgb24,
+ uint8_t* dst_rgb24,
int dst_stride_rgb24,
int width,
int height);
// Draw a rectangle into I420.
LIBYUV_API
-int I420Rect(uint8* dst_y,
+int I420Rect(uint8_t* dst_y,
int dst_stride_y,
- uint8* dst_u,
+ uint8_t* dst_u,
int dst_stride_u,
- uint8* dst_v,
+ uint8_t* dst_v,
int dst_stride_v,
int x,
int y,
@@ -309,38 +384,38 @@ int I420Rect(uint8* dst_y,
// Draw a rectangle into ARGB.
LIBYUV_API
-int ARGBRect(uint8* dst_argb,
+int ARGBRect(uint8_t* dst_argb,
int dst_stride_argb,
- int x,
- int y,
+ int dst_x,
+ int dst_y,
int width,
int height,
- uint32 value);
+ uint32_t value);
// Convert ARGB to gray scale ARGB.
LIBYUV_API
-int ARGBGrayTo(const uint8* src_argb,
+int ARGBGrayTo(const uint8_t* src_argb,
int src_stride_argb,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
int width,
int height);
// Make a rectangle of ARGB gray scale.
LIBYUV_API
-int ARGBGray(uint8* dst_argb,
+int ARGBGray(uint8_t* dst_argb,
int dst_stride_argb,
- int x,
- int y,
+ int dst_x,
+ int dst_y,
int width,
int height);
// Make a rectangle of ARGB Sepia tone.
LIBYUV_API
-int ARGBSepia(uint8* dst_argb,
+int ARGBSepia(uint8_t* dst_argb,
int dst_stride_argb,
- int x,
- int y,
+ int dst_x,
+ int dst_y,
int width,
int height);
@@ -351,11 +426,11 @@ int ARGBSepia(uint8* dst_argb,
// The next 4 coefficients apply to B, G, R, A and produce R of the output.
// The last 4 coefficients apply to B, G, R, A and produce A of the output.
LIBYUV_API
-int ARGBColorMatrix(const uint8* src_argb,
+int ARGBColorMatrix(const uint8_t* src_argb,
int src_stride_argb,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
- const int8* matrix_argb,
+ const int8_t* matrix_argb,
int width,
int height);
@@ -366,33 +441,33 @@ int ARGBColorMatrix(const uint8* src_argb,
// The next 4 coefficients apply to B, G, R, A and produce G of the output.
// The last 4 coefficients apply to B, G, R, A and produce R of the output.
LIBYUV_API
-int RGBColorMatrix(uint8* dst_argb,
+int RGBColorMatrix(uint8_t* dst_argb,
int dst_stride_argb,
- const int8* matrix_rgb,
- int x,
- int y,
+ const int8_t* matrix_rgb,
+ int dst_x,
+ int dst_y,
int width,
int height);
// Apply a color table each ARGB pixel.
// Table contains 256 ARGB values.
LIBYUV_API
-int ARGBColorTable(uint8* dst_argb,
+int ARGBColorTable(uint8_t* dst_argb,
int dst_stride_argb,
- const uint8* table_argb,
- int x,
- int y,
+ const uint8_t* table_argb,
+ int dst_x,
+ int dst_y,
int width,
int height);
// Apply a color table each ARGB pixel but preserve destination alpha.
// Table contains 256 ARGB values.
LIBYUV_API
-int RGBColorTable(uint8* dst_argb,
+int RGBColorTable(uint8_t* dst_argb,
int dst_stride_argb,
- const uint8* table_argb,
- int x,
- int y,
+ const uint8_t* table_argb,
+ int dst_x,
+ int dst_y,
int width,
int height);
@@ -400,11 +475,11 @@ int RGBColorTable(uint8* dst_argb,
// Table contains 32768 values indexed by [Y][C] where 7 it 7 bit luma from
// RGB (YJ style) and C is an 8 bit color component (R, G or B).
LIBYUV_API
-int ARGBLumaColorTable(const uint8* src_argb,
+int ARGBLumaColorTable(const uint8_t* src_argb,
int src_stride_argb,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
- const uint8* luma_rgb_table,
+ const uint8_t* luma,
int width,
int height);
@@ -417,9 +492,9 @@ int ARGBLumaColorTable(const uint8* src_argb,
// A polynomial approximation can be dirived using software such as 'R'.
LIBYUV_API
-int ARGBPolynomial(const uint8* src_argb,
+int ARGBPolynomial(const uint8_t* src_argb,
int src_stride_argb,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
const float* poly,
int width,
@@ -428,68 +503,72 @@ int ARGBPolynomial(const uint8* src_argb,
// Convert plane of 16 bit shorts to half floats.
// Source values are multiplied by scale before storing as half float.
LIBYUV_API
-int HalfFloatPlane(const uint16* src_y,
+int HalfFloatPlane(const uint16_t* src_y,
int src_stride_y,
- uint16* dst_y,
+ uint16_t* dst_y,
int dst_stride_y,
float scale,
int width,
int height);
+// Convert a buffer of bytes to floats, scale the values and store as floats.
+LIBYUV_API
+int ByteToFloat(const uint8_t* src_y, float* dst_y, float scale, int width);
+
// Quantize a rectangle of ARGB. Alpha unaffected.
// scale is a 16 bit fractional fixed point scaler between 0 and 65535.
// interval_size should be a value between 1 and 255.
// interval_offset should be a value between 0 and 255.
LIBYUV_API
-int ARGBQuantize(uint8* dst_argb,
+int ARGBQuantize(uint8_t* dst_argb,
int dst_stride_argb,
int scale,
int interval_size,
int interval_offset,
- int x,
- int y,
+ int dst_x,
+ int dst_y,
int width,
int height);
// Copy ARGB to ARGB.
LIBYUV_API
-int ARGBCopy(const uint8* src_argb,
+int ARGBCopy(const uint8_t* src_argb,
int src_stride_argb,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
int width,
int height);
// Copy Alpha channel of ARGB to alpha of ARGB.
LIBYUV_API
-int ARGBCopyAlpha(const uint8* src_argb,
+int ARGBCopyAlpha(const uint8_t* src_argb,
int src_stride_argb,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
int width,
int height);
// Extract the alpha channel from ARGB.
LIBYUV_API
-int ARGBExtractAlpha(const uint8* src_argb,
+int ARGBExtractAlpha(const uint8_t* src_argb,
int src_stride_argb,
- uint8* dst_a,
+ uint8_t* dst_a,
int dst_stride_a,
int width,
int height);
// Copy Y channel to Alpha of ARGB.
LIBYUV_API
-int ARGBCopyYToAlpha(const uint8* src_y,
+int ARGBCopyYToAlpha(const uint8_t* src_y,
int src_stride_y,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
int width,
int height);
-typedef void (*ARGBBlendRow)(const uint8* src_argb0,
- const uint8* src_argb1,
- uint8* dst_argb,
+typedef void (*ARGBBlendRow)(const uint8_t* src_argb0,
+ const uint8_t* src_argb1,
+ uint8_t* dst_argb,
int width);
// Get function to Alpha Blend ARGB pixels and store to destination.
@@ -500,11 +579,11 @@ ARGBBlendRow GetARGBBlend();
// Source is pre-multiplied by alpha using ARGBAttenuate.
// Alpha of destination is set to 255.
LIBYUV_API
-int ARGBBlend(const uint8* src_argb0,
+int ARGBBlend(const uint8_t* src_argb0,
int src_stride_argb0,
- const uint8* src_argb1,
+ const uint8_t* src_argb1,
int src_stride_argb1,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
int width,
int height);
@@ -512,13 +591,13 @@ int ARGBBlend(const uint8* src_argb0,
// Alpha Blend plane and store to destination.
// Source is not pre-multiplied by alpha.
LIBYUV_API
-int BlendPlane(const uint8* src_y0,
+int BlendPlane(const uint8_t* src_y0,
int src_stride_y0,
- const uint8* src_y1,
+ const uint8_t* src_y1,
int src_stride_y1,
- const uint8* alpha,
+ const uint8_t* alpha,
int alpha_stride,
- uint8* dst_y,
+ uint8_t* dst_y,
int dst_stride_y,
int width,
int height);
@@ -527,102 +606,102 @@ int BlendPlane(const uint8* src_y0,
// Source is not pre-multiplied by alpha.
// Alpha is full width x height and subsampled to half size to apply to UV.
LIBYUV_API
-int I420Blend(const uint8* src_y0,
+int I420Blend(const uint8_t* src_y0,
int src_stride_y0,
- const uint8* src_u0,
+ const uint8_t* src_u0,
int src_stride_u0,
- const uint8* src_v0,
+ const uint8_t* src_v0,
int src_stride_v0,
- const uint8* src_y1,
+ const uint8_t* src_y1,
int src_stride_y1,
- const uint8* src_u1,
+ const uint8_t* src_u1,
int src_stride_u1,
- const uint8* src_v1,
+ const uint8_t* src_v1,
int src_stride_v1,
- const uint8* alpha,
+ const uint8_t* alpha,
int alpha_stride,
- uint8* dst_y,
+ uint8_t* dst_y,
int dst_stride_y,
- uint8* dst_u,
+ uint8_t* dst_u,
int dst_stride_u,
- uint8* dst_v,
+ uint8_t* dst_v,
int dst_stride_v,
int width,
int height);
// Multiply ARGB image by ARGB image. Shifted down by 8. Saturates to 255.
LIBYUV_API
-int ARGBMultiply(const uint8* src_argb0,
+int ARGBMultiply(const uint8_t* src_argb0,
int src_stride_argb0,
- const uint8* src_argb1,
+ const uint8_t* src_argb1,
int src_stride_argb1,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
int width,
int height);
// Add ARGB image with ARGB image. Saturates to 255.
LIBYUV_API
-int ARGBAdd(const uint8* src_argb0,
+int ARGBAdd(const uint8_t* src_argb0,
int src_stride_argb0,
- const uint8* src_argb1,
+ const uint8_t* src_argb1,
int src_stride_argb1,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
int width,
int height);
// Subtract ARGB image (argb1) from ARGB image (argb0). Saturates to 0.
LIBYUV_API
-int ARGBSubtract(const uint8* src_argb0,
+int ARGBSubtract(const uint8_t* src_argb0,
int src_stride_argb0,
- const uint8* src_argb1,
+ const uint8_t* src_argb1,
int src_stride_argb1,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
int width,
int height);
// Convert I422 to YUY2.
LIBYUV_API
-int I422ToYUY2(const uint8* src_y,
+int I422ToYUY2(const uint8_t* src_y,
int src_stride_y,
- const uint8* src_u,
+ const uint8_t* src_u,
int src_stride_u,
- const uint8* src_v,
+ const uint8_t* src_v,
int src_stride_v,
- uint8* dst_frame,
- int dst_stride_frame,
+ uint8_t* dst_yuy2,
+ int dst_stride_yuy2,
int width,
int height);
// Convert I422 to UYVY.
LIBYUV_API
-int I422ToUYVY(const uint8* src_y,
+int I422ToUYVY(const uint8_t* src_y,
int src_stride_y,
- const uint8* src_u,
+ const uint8_t* src_u,
int src_stride_u,
- const uint8* src_v,
+ const uint8_t* src_v,
int src_stride_v,
- uint8* dst_frame,
- int dst_stride_frame,
+ uint8_t* dst_uyvy,
+ int dst_stride_uyvy,
int width,
int height);
// Convert unattentuated ARGB to preattenuated ARGB.
LIBYUV_API
-int ARGBAttenuate(const uint8* src_argb,
+int ARGBAttenuate(const uint8_t* src_argb,
int src_stride_argb,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
int width,
int height);
// Convert preattentuated ARGB to unattenuated ARGB.
LIBYUV_API
-int ARGBUnattenuate(const uint8* src_argb,
+int ARGBUnattenuate(const uint8_t* src_argb,
int src_stride_argb,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
int width,
int height);
@@ -631,9 +710,9 @@ int ARGBUnattenuate(const uint8* src_argb,
// Computes table of cumulative sum for image where the value is the sum
// of all values above and to the left of the entry. Used by ARGBBlur.
LIBYUV_API
-int ARGBComputeCumulativeSum(const uint8* src_argb,
+int ARGBComputeCumulativeSum(const uint8_t* src_argb,
int src_stride_argb,
- int32* dst_cumsum,
+ int32_t* dst_cumsum,
int dst_stride32_cumsum,
int width,
int height);
@@ -645,11 +724,11 @@ int ARGBComputeCumulativeSum(const uint8* src_argb,
// radius is number of pixels around the center. e.g. 1 = 3x3. 2=5x5.
// Blur is optimized for radius of 5 (11x11) or less.
LIBYUV_API
-int ARGBBlur(const uint8* src_argb,
+int ARGBBlur(const uint8_t* src_argb,
int src_stride_argb,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
- int32* dst_cumsum,
+ int32_t* dst_cumsum,
int dst_stride32_cumsum,
int width,
int height,
@@ -657,24 +736,24 @@ int ARGBBlur(const uint8* src_argb,
// Multiply ARGB image by ARGB value.
LIBYUV_API
-int ARGBShade(const uint8* src_argb,
+int ARGBShade(const uint8_t* src_argb,
int src_stride_argb,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
int width,
int height,
- uint32 value);
+ uint32_t value);
// Interpolate between two images using specified amount of interpolation
// (0 to 255) and store to destination.
// 'interpolation' is specified as 8 bit fraction where 0 means 100% src0
// and 255 means 1% src0 and 99% src1.
LIBYUV_API
-int InterpolatePlane(const uint8* src0,
+int InterpolatePlane(const uint8_t* src0,
int src_stride0,
- const uint8* src1,
+ const uint8_t* src1,
int src_stride1,
- uint8* dst,
+ uint8_t* dst,
int dst_stride,
int width,
int height,
@@ -683,11 +762,11 @@ int InterpolatePlane(const uint8* src0,
// Interpolate between two ARGB images using specified amount of interpolation
// Internally calls InterpolatePlane with width * 4 (bpp).
LIBYUV_API
-int ARGBInterpolate(const uint8* src_argb0,
+int ARGBInterpolate(const uint8_t* src_argb0,
int src_stride_argb0,
- const uint8* src_argb1,
+ const uint8_t* src_argb1,
int src_stride_argb1,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
int width,
int height,
@@ -697,93 +776,78 @@ int ARGBInterpolate(const uint8* src_argb0,
// Internally calls InterpolatePlane on each plane where the U and V planes
// are half width and half height.
LIBYUV_API
-int I420Interpolate(const uint8* src0_y,
+int I420Interpolate(const uint8_t* src0_y,
int src0_stride_y,
- const uint8* src0_u,
+ const uint8_t* src0_u,
int src0_stride_u,
- const uint8* src0_v,
+ const uint8_t* src0_v,
int src0_stride_v,
- const uint8* src1_y,
+ const uint8_t* src1_y,
int src1_stride_y,
- const uint8* src1_u,
+ const uint8_t* src1_u,
int src1_stride_u,
- const uint8* src1_v,
+ const uint8_t* src1_v,
int src1_stride_v,
- uint8* dst_y,
+ uint8_t* dst_y,
int dst_stride_y,
- uint8* dst_u,
+ uint8_t* dst_u,
int dst_stride_u,
- uint8* dst_v,
+ uint8_t* dst_v,
int dst_stride_v,
int width,
int height,
int interpolation);
-#if defined(__pnacl__) || defined(__CLR_VER) || \
- (defined(__i386__) && !defined(__SSE2__))
-#define LIBYUV_DISABLE_X86
-#endif
-// MemorySanitizer does not support assembly code yet. http://crbug.com/344505
-#if defined(__has_feature)
-#if __has_feature(memory_sanitizer)
-#define LIBYUV_DISABLE_X86
-#endif
-#endif
-// The following are available on all x86 platforms:
-#if !defined(LIBYUV_DISABLE_X86) && \
- (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__))
-#define HAS_ARGBAFFINEROW_SSE2
-#endif
-
// Row function for copying pixels from a source with a slope to a row
// of destination. Useful for scaling, rotation, mirror, texture mapping.
LIBYUV_API
-void ARGBAffineRow_C(const uint8* src_argb,
+void ARGBAffineRow_C(const uint8_t* src_argb,
int src_argb_stride,
- uint8* dst_argb,
+ uint8_t* dst_argb,
const float* uv_dudv,
int width);
+// TODO(fbarchard): Move ARGBAffineRow_SSE2 to row.h
LIBYUV_API
-void ARGBAffineRow_SSE2(const uint8* src_argb,
+void ARGBAffineRow_SSE2(const uint8_t* src_argb,
int src_argb_stride,
- uint8* dst_argb,
+ uint8_t* dst_argb,
const float* uv_dudv,
int width);
// Shuffle ARGB channel order. e.g. BGRA to ARGB.
// shuffler is 16 bytes and must be aligned.
LIBYUV_API
-int ARGBShuffle(const uint8* src_bgra,
+int ARGBShuffle(const uint8_t* src_bgra,
int src_stride_bgra,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
- const uint8* shuffler,
+ const uint8_t* shuffler,
int width,
int height);
// Sobel ARGB effect with planar output.
LIBYUV_API
-int ARGBSobelToPlane(const uint8* src_argb,
+int ARGBSobelToPlane(const uint8_t* src_argb,
int src_stride_argb,
- uint8* dst_y,
+ uint8_t* dst_y,
int dst_stride_y,
int width,
int height);
// Sobel ARGB effect.
LIBYUV_API
-int ARGBSobel(const uint8* src_argb,
+int ARGBSobel(const uint8_t* src_argb,
int src_stride_argb,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
int width,
int height);
// Sobel ARGB effect w/ Sobel X, Sobel, Sobel Y in ARGB.
LIBYUV_API
-int ARGBSobelXY(const uint8* src_argb,
+int ARGBSobelXY(const uint8_t* src_argb,
int src_stride_argb,
- uint8* dst_argb,
+ uint8_t* dst_argb,
int dst_stride_argb,
int width,
int height);