|
@@ -58,6 +58,7 @@ static const int dst_fmts[] = {
|
|
|
// AV_PIX_FMT_RGB4_BYTE,
|
|
|
// AV_PIX_FMT_BGR4_BYTE,
|
|
|
// AV_PIX_FMT_MONOBLACK,
|
|
|
+ AV_PIX_FMT_GBRP,
|
|
|
};
|
|
|
|
|
|
static int cmp_off_by_n(const uint8_t *ref, const uint8_t *test, size_t n, int accuracy)
|
|
@@ -116,13 +117,25 @@ static void check_yuv2rgb(int src_pix_fmt)
|
|
|
LOCAL_ALIGNED_8(uint8_t, src_a, [MAX_LINE_SIZE * 2]);
|
|
|
const uint8_t *src[4] = { src_y, src_u, src_v, src_a };
|
|
|
|
|
|
- LOCAL_ALIGNED_8(uint8_t, dst0_, [2 * MAX_LINE_SIZE * 6]);
|
|
|
- uint8_t *dst0[4] = { dst0_ };
|
|
|
- uint8_t *lines0[2] = { dst0_, dst0_ + MAX_LINE_SIZE * 6 };
|
|
|
-
|
|
|
- LOCAL_ALIGNED_8(uint8_t, dst1_, [2 * MAX_LINE_SIZE * 6]);
|
|
|
- uint8_t *dst1[4] = { dst1_ };
|
|
|
- uint8_t *lines1[2] = { dst1_, dst1_ + MAX_LINE_SIZE * 6 };
|
|
|
+ LOCAL_ALIGNED_8(uint8_t, dst0_0, [2 * MAX_LINE_SIZE * 6]);
|
|
|
+ LOCAL_ALIGNED_8(uint8_t, dst0_1, [2 * MAX_LINE_SIZE]);
|
|
|
+ LOCAL_ALIGNED_8(uint8_t, dst0_2, [2 * MAX_LINE_SIZE]);
|
|
|
+ uint8_t *dst0[4] = { dst0_0, dst0_1, dst0_2 };
|
|
|
+ uint8_t *lines0[4][2] = {
|
|
|
+ { dst0_0, dst0_0 + MAX_LINE_SIZE * 6 },
|
|
|
+ { dst0_1, dst0_1 + MAX_LINE_SIZE },
|
|
|
+ { dst0_2, dst0_2 + MAX_LINE_SIZE }
|
|
|
+ };
|
|
|
+
|
|
|
+ LOCAL_ALIGNED_8(uint8_t, dst1_0, [2 * MAX_LINE_SIZE * 6]);
|
|
|
+ LOCAL_ALIGNED_8(uint8_t, dst1_1, [2 * MAX_LINE_SIZE]);
|
|
|
+ LOCAL_ALIGNED_8(uint8_t, dst1_2, [2 * MAX_LINE_SIZE]);
|
|
|
+ uint8_t *dst1[4] = { dst1_0, dst1_1, dst1_2 };
|
|
|
+ uint8_t *lines1[4][2] = {
|
|
|
+ { dst1_0, dst1_0 + MAX_LINE_SIZE * 6 },
|
|
|
+ { dst1_1, dst1_1 + MAX_LINE_SIZE },
|
|
|
+ { dst1_2, dst1_2 + MAX_LINE_SIZE }
|
|
|
+ };
|
|
|
|
|
|
randomize_buffers(src_y, MAX_LINE_SIZE * 2);
|
|
|
randomize_buffers(src_u, MAX_LINE_SIZE);
|
|
@@ -145,7 +158,11 @@ static void check_yuv2rgb(int src_pix_fmt)
|
|
|
width >> src_desc->log2_chroma_w,
|
|
|
width,
|
|
|
};
|
|
|
- int dstStride[4] = { MAX_LINE_SIZE * 6 };
|
|
|
+ int dstStride[4] = {
|
|
|
+ MAX_LINE_SIZE * 6,
|
|
|
+ MAX_LINE_SIZE,
|
|
|
+ MAX_LINE_SIZE,
|
|
|
+ };
|
|
|
|
|
|
// override log level to prevent spamming of the message
|
|
|
// "No accelerated colorspace conversion found from %s to %s"
|
|
@@ -159,8 +176,14 @@ static void check_yuv2rgb(int src_pix_fmt)
|
|
|
fail();
|
|
|
|
|
|
if (check_func(ctx->convert_unscaled, "%s_%s_%d", src_desc->name, dst_desc->name, width)) {
|
|
|
- memset(dst0_, 0xFF, 2 * MAX_LINE_SIZE * 6);
|
|
|
- memset(dst1_, 0xFF, 2 * MAX_LINE_SIZE * 6);
|
|
|
+ memset(dst0_0, 0xFF, 2 * MAX_LINE_SIZE * 6);
|
|
|
+ memset(dst1_0, 0xFF, 2 * MAX_LINE_SIZE * 6);
|
|
|
+ if (dst_pix_fmt == AV_PIX_FMT_GBRP) {
|
|
|
+ memset(dst0_1, 0xFF, MAX_LINE_SIZE);
|
|
|
+ memset(dst0_2, 0xFF, MAX_LINE_SIZE);
|
|
|
+ memset(dst1_1, 0xFF, MAX_LINE_SIZE);
|
|
|
+ memset(dst1_2, 0xFF, MAX_LINE_SIZE);
|
|
|
+ }
|
|
|
|
|
|
call_ref(ctx, src, srcStride, srcSliceY,
|
|
|
srcSliceH, dst0, dstStride);
|
|
@@ -173,19 +196,24 @@ static void check_yuv2rgb(int src_pix_fmt)
|
|
|
dst_pix_fmt == AV_PIX_FMT_BGRA ||
|
|
|
dst_pix_fmt == AV_PIX_FMT_RGB24 ||
|
|
|
dst_pix_fmt == AV_PIX_FMT_BGR24) {
|
|
|
- if (cmp_off_by_n(lines0[0], lines1[0], width * sample_size, 3) ||
|
|
|
- cmp_off_by_n(lines0[1], lines1[1], width * sample_size, 3))
|
|
|
+ if (cmp_off_by_n(lines0[0][0], lines1[0][0], width * sample_size, 3) ||
|
|
|
+ cmp_off_by_n(lines0[0][1], lines1[0][1], width * sample_size, 3))
|
|
|
fail();
|
|
|
} else if (dst_pix_fmt == AV_PIX_FMT_RGB565 ||
|
|
|
dst_pix_fmt == AV_PIX_FMT_BGR565) {
|
|
|
- if (cmp_565_by_n(lines0[0], lines1[0], width, 2) ||
|
|
|
- cmp_565_by_n(lines0[1], lines1[1], width, 2))
|
|
|
+ if (cmp_565_by_n(lines0[0][0], lines1[0][0], width, 2) ||
|
|
|
+ cmp_565_by_n(lines0[0][1], lines1[0][1], width, 2))
|
|
|
fail();
|
|
|
} else if (dst_pix_fmt == AV_PIX_FMT_RGB555 ||
|
|
|
dst_pix_fmt == AV_PIX_FMT_BGR555) {
|
|
|
- if (cmp_555_by_n(lines0[0], lines1[0], width, 2) ||
|
|
|
- cmp_555_by_n(lines0[1], lines1[1], width, 2))
|
|
|
+ if (cmp_555_by_n(lines0[0][0], lines1[0][0], width, 2) ||
|
|
|
+ cmp_555_by_n(lines0[0][1], lines1[0][1], width, 2))
|
|
|
fail();
|
|
|
+ } else if (dst_pix_fmt == AV_PIX_FMT_GBRP) {
|
|
|
+ for (int p = 0; p < 3; p++)
|
|
|
+ for (int l = 0; l < 2; l++)
|
|
|
+ if (cmp_off_by_n(lines0[p][l], lines1[p][l], width, 3))
|
|
|
+ fail();
|
|
|
} else {
|
|
|
fail();
|
|
|
}
|