Commit 9c9215b2 authored by Frank Barchard's avatar Frank Barchard Committed by Commit Bot

End swap 10 bit RGB

Bug: libyuv:777
Test: None
Change-Id: I69b81f51c50d7739cfdb3cfb0c3d315c32bd63d2
Reviewed-on: https://chromium-review.googlesource.com/923042Reviewed-by: 's avatarMiguel Casas <mcasas@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
parent 66305588
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 1698
Version: 1699
License: BSD
License File: LICENSE
......
......@@ -547,6 +547,12 @@ int ARGB4444ToARGB(const uint8_t* src_argb4444,
int width,
int height);
// Aliases
#define AB30ToARGB AR30ToABGR
#define AB30ToABGR AR30ToARGB
#define AB30ToAR30 AR30ToAB30
// Convert AR30 To ARGB.
LIBYUV_API
int AR30ToARGB(const uint8_t* src_ar30,
......@@ -556,7 +562,6 @@ int AR30ToARGB(const uint8_t* src_ar30,
int width,
int height);
#define AB30ToABGR
// Convert AR30 To ABGR.
LIBYUV_API
......@@ -567,6 +572,15 @@ int AR30ToABGR(const uint8_t* src_ar30,
int width,
int height);
// Convert AR30 To AB30.
LIBYUV_API
int AR30ToAB30(const uint8_t* src_ar30,
int src_stride_ar30,
uint8_t* dst_ab30,
int dst_stride_ab30,
int width,
int height);
#ifdef HAVE_JPEG
// src_width/height provided by capture
// dst_width/height for clipping determine final size.
......
......@@ -1612,6 +1612,9 @@ void ARGB4444ToARGBRow_C(const uint8_t* src_argb4444,
int width);
void AR30ToARGBRow_C(const uint8_t* src_ar30, uint8_t* dst_argb, int width);
void AR30ToABGRRow_C(const uint8_t* src_ar30, uint8_t* dst_abgr, int width);
void ARGBToAR30Row_C(const uint8_t* src_argb, uint8_t* dst_ar30, int width);
void AR30ToAB30Row_C(const uint8_t* src_ar30, uint8_t* dst_ab30, int width);
void RGB24ToARGBRow_Any_SSSE3(const uint8_t* src_ptr,
uint8_t* dst_ptr,
int width);
......
......@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1698
#define LIBYUV_VERSION 1699
#endif // INCLUDE_LIBYUV_VERSION_H_
......@@ -1534,6 +1534,38 @@ int AR30ToABGR(const uint8_t* src_ar30,
return 0;
}
// Convert AR30 to AB30.
LIBYUV_API
int AR30ToAB30(const uint8_t* src_ar30,
int src_stride_ar30,
uint8_t* dst_ab30,
int dst_stride_ab30,
int width,
int height) {
int y;
if (!src_ar30 || !dst_ab30 || width <= 0 || height == 0) {
return -1;
}
// Negative height means invert the image.
if (height < 0) {
height = -height;
src_ar30 = src_ar30 + (height - 1) * src_stride_ar30;
src_stride_ar30 = -src_stride_ar30;
}
// Coalesce rows.
if (src_stride_ar30 == width * 4 && dst_stride_ab30 == width * 4) {
width *= height;
height = 1;
src_stride_ar30 = dst_stride_ab30 = 0;
}
for (y = 0; y < height; ++y) {
AR30ToAB30Row_C(src_ar30, dst_ab30, width);
src_ar30 += src_stride_ar30;
dst_ab30 += dst_stride_ab30;
}
return 0;
}
// Convert NV12 to ARGB with matrix
static int NV12ToARGBMatrix(const uint8_t* src_y,
int src_stride_y,
......
......@@ -212,6 +212,20 @@ void AR30ToABGRRow_C(const uint8_t* src_ar30, uint8_t* dst_abgr, int width) {
}
}
void AR30ToAB30Row_C(const uint8_t* src_ar30, uint8_t* dst_ab30, int width) {
int x;
for (x = 0; x < width; ++x) {
uint32_t ar30 = *(uint32_t*)src_ar30;
uint32_t b = ar30 & 0x3ff;
uint32_t g = (ar30 >> 10) & 0x3ff;
uint32_t r = (ar30 >> 20) & 0x3ff;
uint32_t a = (ar30 >> 30) & 0x3;
*(uint32_t*)(dst_ab30) = r | (g << 10) | (b << 20) | (a << 30);
dst_ab30 += 4;
src_ar30 += 4;
}
}
void ARGBToRGB24Row_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width) {
int x;
for (x = 0; x < width; ++x) {
......
......@@ -596,7 +596,6 @@ TESTPLANARTOB(I420, 2, 2, I400, 1, 1, 1, 0, ARGB, 4)
TESTPLANARTOB(J420, 2, 2, J400, 1, 1, 1, 0, ARGB, 4)
TESTPLANARTOB(I420, 2, 2, AR30, 4, 4, 1, 0, ARGB, 4)
TESTPLANARTOB(H420, 2, 2, AR30, 4, 4, 1, 0, ARGB, 4)
// TESTPLANARTOB(I420, 2, 2, AR30, 4, 4, 1, 0, ABGR, 4)
#define TESTQPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \
YALIGN, W1280, DIFF, N, NEG, OFF, ATTEN) \
......@@ -1084,6 +1083,9 @@ TESTATOB(ARGB1555, 2, 2, 1, ARGB, 4, 4, 1, 0)
TESTATOB(ARGB4444, 2, 2, 1, ARGB, 4, 4, 1, 0)
TESTATOB(AR30, 4, 4, 1, ARGB, 4, 4, 1, 0)
TESTATOB(AR30, 4, 4, 1, ABGR, 4, 4, 1, 0)
TESTATOB(AB30, 4, 4, 1, ARGB, 4, 4, 1, 0)
TESTATOB(AB30, 4, 4, 1, ABGR, 4, 4, 1, 0)
TESTATOB(AR30, 4, 4, 1, AB30, 4, 4, 1, 0)
TESTATOB(YUY2, 2, 4, 1, ARGB, 4, 4, 1, ARM_YUV_ERROR)
TESTATOB(UYVY, 2, 4, 1, ARGB, 4, 4, 1, ARM_YUV_ERROR)
TESTATOB(YUY2, 2, 4, 1, Y, 1, 1, 1, 0)
......
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