| @@ -58,6 +58,7 @@ static const int dst_fmts[] = { · 57 unmodified lines |
| 58 | // AV_PIX_FMT_RGB4_BYTE, | 58 | // AV_PIX_FMT_RGB4_BYTE, |
| 59 | // AV_PIX_FMT_BGR4_BYTE, | 59 | // AV_PIX_FMT_BGR4_BYTE, |
| 60 | // AV_PIX_FMT_MONOBLACK, | 60 | // AV_PIX_FMT_MONOBLACK, |
| | 61 | AV_PIX_FMT_GBRP, |
| 61 | }; | 62 | }; |
| 62 | | 63 | |
| 63 | static int cmp_off_by_n(const uint8_t *ref, const uint8_t *test, size_t n, int accuracy) | 64 | 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) · 52 unmodified lines |
| 116 | LOCAL_ALIGNED_8(uint8_t, src_a, [MAX_LINE_SIZE * 2]); | 117 | LOCAL_ALIGNED_8(uint8_t, src_a, [MAX_LINE_SIZE * 2]); |
| 117 | const uint8_t *src[4] = { src_y, src_u, src_v, src_a }; | 118 | const uint8_t *src[4] = { src_y, src_u, src_v, src_a }; |
| 118 | | 119 | |
| 119 | LOCAL_ALIGNED_8(uint8_t, dst0_, [2 * MAX_LINE_SIZE * 6]); | 120 | LOCAL_ALIGNED_8(uint8_t, dst0_0, [2 * MAX_LINE_SIZE * 6]); |
| 120 | uint8_t *dst0[4] = { dst0_ }; | 121 | LOCAL_ALIGNED_8(uint8_t, dst0_1, [2 * MAX_LINE_SIZE]); |
| 121 | uint8_t *lines0[2] = { dst0_, dst0_ + MAX_LINE_SIZE * 6 }; | 122 | LOCAL_ALIGNED_8(uint8_t, dst0_2, [2 * MAX_LINE_SIZE]); |
| 122 | | 123 | uint8_t *dst0[4] = { dst0_0, dst0_1, dst0_2 }; |
| 123 | LOCAL_ALIGNED_8(uint8_t, dst1_, [2 * MAX_LINE_SIZE * 6]); | 124 | uint8_t *lines0[4][2] = { |
| 124 | uint8_t *dst1[4] = { dst1_ }; | 125 | { dst0_0, dst0_0 + MAX_LINE_SIZE * 6 }, |
| 125 | uint8_t *lines1[2] = { dst1_, dst1_ + MAX_LINE_SIZE * 6 }; | 126 | { dst0_1, dst0_1 + MAX_LINE_SIZE }, |
| | 127 | { dst0_2, dst0_2 + MAX_LINE_SIZE } |
| | 128 | }; |
| | 129 | |
| | 130 | LOCAL_ALIGNED_8(uint8_t, dst1_0, [2 * MAX_LINE_SIZE * 6]); |
| | 131 | LOCAL_ALIGNED_8(uint8_t, dst1_1, [2 * MAX_LINE_SIZE]); |
| | 132 | LOCAL_ALIGNED_8(uint8_t, dst1_2, [2 * MAX_LINE_SIZE]); |
| | 133 | uint8_t *dst1[4] = { dst1_0, dst1_1, dst1_2 }; |
| | 134 | uint8_t *lines1[4][2] = { |
| | 135 | { dst1_0, dst1_0 + MAX_LINE_SIZE * 6 }, |
| | 136 | { dst1_1, dst1_1 + MAX_LINE_SIZE }, |
| | 137 | { dst1_2, dst1_2 + MAX_LINE_SIZE } |
| | 138 | }; |
| 126 | | 139 | |
| 127 | randomize_buffers(src_y, MAX_LINE_SIZE * 2); | 140 | randomize_buffers(src_y, MAX_LINE_SIZE * 2); |
| 128 | randomize_buffers(src_u, MAX_LINE_SIZE); | 141 | randomize_buffers(src_u, MAX_LINE_SIZE); |
| @@ -145,7 +158,11 @@ static void check_yuv2rgb(int src_pix_fmt) · 16 unmodified lines |
| 145 | width >> src_desc->log2_chroma_w, | 158 | width >> src_desc->log2_chroma_w, |
| 146 | width, | 159 | width, |
| 147 | }; | 160 | }; |
| 148 | int dstStride[4] = { MAX_LINE_SIZE * 6 }; | 161 | int dstStride[4] = { |
| | 162 | MAX_LINE_SIZE * 6, |
| | 163 | MAX_LINE_SIZE, |
| | 164 | MAX_LINE_SIZE, |
| | 165 | }; |
| 149 | | 166 | |
| 150 | // override log level to prevent spamming of the message | 167 | // override log level to prevent spamming of the message |
| 151 | // "No accelerated colorspace conversion found from %s to %s" | 168 | // "No accelerated colorspace conversion found from %s to %s" |
| @@ -159,8 +176,14 @@ static void check_yuv2rgb(int src_pix_fmt) · 7 unmodified lines |
| 159 | fail(); | 176 | fail(); |
| 160 | | 177 | |
| 161 | if (check_func(ctx->convert_unscaled, "%s_%s_%d", src_desc->name, dst_desc->name, width)) { | 178 | if (check_func(ctx->convert_unscaled, "%s_%s_%d", src_desc->name, dst_desc->name, width)) { |
| 162 | memset(dst0_, 0xFF, 2 * MAX_LINE_SIZE * 6); | 179 | memset(dst0_0, 0xFF, 2 * MAX_LINE_SIZE * 6); |
| 163 | memset(dst1_, 0xFF, 2 * MAX_LINE_SIZE * 6); | 180 | memset(dst1_0, 0xFF, 2 * MAX_LINE_SIZE * 6); |
| | 181 | if (dst_pix_fmt == AV_PIX_FMT_GBRP) { |
| | 182 | memset(dst0_1, 0xFF, MAX_LINE_SIZE); |
| | 183 | memset(dst0_2, 0xFF, MAX_LINE_SIZE); |
| | 184 | memset(dst1_1, 0xFF, MAX_LINE_SIZE); |
| | 185 | memset(dst1_2, 0xFF, MAX_LINE_SIZE); |
| | 186 | } |
| 164 | | 187 | |
| 165 | call_ref(ctx, src, srcStride, srcSliceY, | 188 | call_ref(ctx, src, srcStride, srcSliceY, |
| 166 | srcSliceH, dst0, dstStride); | 189 | srcSliceH, dst0, dstStride); |
| @@ -173,19 +196,24 @@ static void check_yuv2rgb(int src_pix_fmt) · 6 unmodified lines |
| 173 | dst_pix_fmt == AV_PIX_FMT_BGRA || | 196 | dst_pix_fmt == AV_PIX_FMT_BGRA || |
| 174 | dst_pix_fmt == AV_PIX_FMT_RGB24 || | 197 | dst_pix_fmt == AV_PIX_FMT_RGB24 || |
| 175 | dst_pix_fmt == AV_PIX_FMT_BGR24) { | 198 | dst_pix_fmt == AV_PIX_FMT_BGR24) { |
| 176 | if (cmp_off_by_n(lines0[0], lines1[0], width * sample_size, 3) || | 199 | if (cmp_off_by_n(lines0[0][0], lines1[0][0], width * sample_size, 3) || |
| 177 | cmp_off_by_n(lines0[1], lines1[1], width * sample_size, 3)) | 200 | cmp_off_by_n(lines0[0][1], lines1[0][1], width * sample_size, 3)) |
| 178 | fail(); | 201 | fail(); |
| 179 | } else if (dst_pix_fmt == AV_PIX_FMT_RGB565 || | 202 | } else if (dst_pix_fmt == AV_PIX_FMT_RGB565 || |
| 180 | dst_pix_fmt == AV_PIX_FMT_BGR565) { | 203 | dst_pix_fmt == AV_PIX_FMT_BGR565) { |
| 181 | if (cmp_565_by_n(lines0[0], lines1[0], width, 2) || | 204 | if (cmp_565_by_n(lines0[0][0], lines1[0][0], width, 2) || |
| 182 | cmp_565_by_n(lines0[1], lines1[1], width, 2)) | 205 | cmp_565_by_n(lines0[0][1], lines1[0][1], width, 2)) |
| 183 | fail(); | 206 | fail(); |
| 184 | } else if (dst_pix_fmt == AV_PIX_FMT_RGB555 || | 207 | } else if (dst_pix_fmt == AV_PIX_FMT_RGB555 || |
| 185 | dst_pix_fmt == AV_PIX_FMT_BGR555) { | 208 | dst_pix_fmt == AV_PIX_FMT_BGR555) { |
| 186 | if (cmp_555_by_n(lines0[0], lines1[0], width, 2) || | 209 | if (cmp_555_by_n(lines0[0][0], lines1[0][0], width, 2) || |
| 187 | cmp_555_by_n(lines0[1], lines1[1], width, 2)) | 210 | cmp_555_by_n(lines0[0][1], lines1[0][1], width, 2)) |
| 188 | fail(); | 211 | fail(); |
| | 212 | } else if (dst_pix_fmt == AV_PIX_FMT_GBRP) { |
| | 213 | for (int p = 0; p < 3; p++) |
| | 214 | for (int l = 0; l < 2; l++) |
| | 215 | if (cmp_off_by_n(lines0[p][l], lines1[p][l], width, 3)) |
| | 216 | fail(); |
| 189 | } else { | 217 | } else { |
| 190 | fail(); | 218 | fail(); |
| 191 | } | 219 | } |