diff options
author | Martin Vignali <martin.vignali@gmail.com> | 2018-04-22 19:14:23 +0200 |
---|---|---|
committer | Martin Vignali <martin.vignali@gmail.com> | 2018-04-22 19:15:32 +0200 |
commit | 07a566e7d6fc4dbb4250da55d925b5591b3d03f9 (patch) | |
tree | a6d235e72da69b4a01dfb6c195972f9d6b131e4e /tests/checkasm/sw_rgb.c | |
parent | e6e4625862818043f1cb50d947c014fc4b8fb064 (diff) | |
download | ffmpeg-07a566e7d6fc4dbb4250da55d925b5591b3d03f9.tar.gz |
swscale/swscale_unscaled : add X86_64 (SSE2 and AVX) for uyvyto422
and checkasm test
Diffstat (limited to 'tests/checkasm/sw_rgb.c')
-rw-r--r-- | tests/checkasm/sw_rgb.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c index 8fc2cfee9e..d2b211f7b4 100644 --- a/tests/checkasm/sw_rgb.c +++ b/tests/checkasm/sw_rgb.c @@ -35,8 +35,12 @@ } while (0) static const uint8_t width[] = {12, 16, 20, 32, 36, 128}; +static const struct {uint8_t w, h, s;} planes[] = { + {12,16,12}, {16,16,16}, {20,23,25}, {32,18,48}, {8,128,16}, {128,128,128} +}; #define MAX_STRIDE 128 +#define MAX_HEIGHT 128 static void check_shuffle_bytes(void * func, const char * report) { @@ -64,6 +68,49 @@ static void check_shuffle_bytes(void * func, const char * report) } } +static void check_uyvy_to_422p() +{ + int i; + + LOCAL_ALIGNED_32(uint8_t, src0, [MAX_STRIDE * MAX_HEIGHT * 2]); + LOCAL_ALIGNED_32(uint8_t, src1, [MAX_STRIDE * MAX_HEIGHT * 2]); + LOCAL_ALIGNED_32(uint8_t, dst_y_0, [MAX_STRIDE * MAX_HEIGHT]); + LOCAL_ALIGNED_32(uint8_t, dst_y_1, [MAX_STRIDE * MAX_HEIGHT]); + LOCAL_ALIGNED_32(uint8_t, dst_u_0, [(MAX_STRIDE/2) * MAX_HEIGHT]); + LOCAL_ALIGNED_32(uint8_t, dst_u_1, [(MAX_STRIDE/2) * MAX_HEIGHT]); + LOCAL_ALIGNED_32(uint8_t, dst_v_0, [(MAX_STRIDE/2) * MAX_HEIGHT]); + LOCAL_ALIGNED_32(uint8_t, dst_v_1, [(MAX_STRIDE/2) * MAX_HEIGHT]); + + declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, + const uint8_t *src, int width, int height, + int lumStride, int chromStride, int srcStride); + + randomize_buffers(src0, MAX_STRIDE * MAX_HEIGHT * 2); + memcpy(src1, src0, MAX_STRIDE * MAX_HEIGHT * 2); + + if (check_func(uyvytoyuv422, "uyvytoyuv422")) { + for (i = 0; i < 6; i ++) { + memset(dst_y_0, 0, MAX_STRIDE * MAX_HEIGHT); + memset(dst_y_1, 0, MAX_STRIDE * MAX_HEIGHT); + memset(dst_u_0, 0, (MAX_STRIDE/2) * MAX_HEIGHT); + memset(dst_u_1, 0, (MAX_STRIDE/2) * MAX_HEIGHT); + memset(dst_v_0, 0, (MAX_STRIDE/2) * MAX_HEIGHT); + memset(dst_v_1, 0, (MAX_STRIDE/2) * MAX_HEIGHT); + + call_ref(dst_y_0, dst_u_0, dst_v_0, src0, planes[i].w, planes[i].h, + MAX_STRIDE, MAX_STRIDE / 2, planes[i].s); + call_new(dst_y_1, dst_u_1, dst_v_1, src1, planes[i].w, planes[i].h, + MAX_STRIDE, MAX_STRIDE / 2, planes[i].s); + if (memcmp(dst_y_0, dst_y_1, MAX_STRIDE * MAX_HEIGHT) || + memcmp(dst_u_0, dst_u_1, (MAX_STRIDE/2) * MAX_HEIGHT) || + memcmp(dst_v_0, dst_v_1, (MAX_STRIDE/2) * MAX_HEIGHT)) + fail(); + } + bench_new(dst_y_1, dst_u_1, dst_v_1, src1, planes[5].w, planes[5].h, + MAX_STRIDE, MAX_STRIDE / 2, planes[5].s); + } +} + void checkasm_check_sw_rgb(void) { ff_sws_rgb2rgb_init(); @@ -82,4 +129,7 @@ void checkasm_check_sw_rgb(void) check_shuffle_bytes(shuffle_bytes_3210, "shuffle_bytes_3210"); report("shuffle_bytes_3210"); + + check_uyvy_to_422p(); + report("uyvytoyuv422"); } |