aboutsummaryrefslogtreecommitdiff
path: root/gentest.c
diff options
context:
space:
mode:
Diffstat (limited to 'gentest.c')
-rw-r--r--gentest.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gentest.c b/gentest.c
index 03d9340..0bdf3a1 100644
--- a/gentest.c
+++ b/gentest.c
@@ -139,10 +139,17 @@ static void fill_yuv_planar(unsigned char *y_mem, unsigned char *u_mem,
static void *testbuf;
-int gentest_init(unsigned int width, unsigned int height, unsigned int size)
+int gentest_init(unsigned int width, unsigned int height, unsigned int stride,
+ unsigned int crop_w, unsigned int crop_h,
+ unsigned int size)
{
- unsigned int stride = ALIGN(width, 128);
unsigned char *y_mem, *u_mem, *v_mem;
+ unsigned int w = width, h = height;
+
+ if (crop_w && crop_h) {
+ w = crop_w;
+ h = crop_h;
+ }
srand(1);
@@ -151,10 +158,10 @@ int gentest_init(unsigned int width, unsigned int height, unsigned int size)
return -1;
y_mem = testbuf;
- u_mem = testbuf + stride * ALIGN(height, 32);
+ u_mem = testbuf + stride * height;
v_mem = u_mem + 1;
- fill_yuv_planar(y_mem, u_mem, v_mem, width, height, stride);
+ fill_yuv_planar(y_mem, u_mem, v_mem, w, h, stride);
return 0;
}