images: Fix YUV and other image data tests

This commit is contained in:
Jean-Philippe Andre 2017-01-11 10:52:33 +09:00
parent f59b164351
commit 0529ce56b6
6 changed files with 174 additions and 258 deletions

View File

@ -20,13 +20,12 @@ static Evas_Object *o_images[1];
/* setup */ /* setup */
static void _setup(void) static void _setup(void)
{ {
int i;
Evas_Object *o; Evas_Object *o;
void *pixels; Eina_Slice sl;
Eina_Slice slice;
pixels = malloc(sizeof (int) * 640 * 480); sl.len = 640 * 480 * 4;
for (i = 0; i < 1; i++) sl.mem = malloc(sl.len);
for (int i = 0; i < 1; i++)
{ {
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas); o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
o_images[i] = o; o_images[i] = o;
@ -35,50 +34,53 @@ static void _setup(void)
efl_gfx_fill_set(o, 0, 0, 640, 480); efl_gfx_fill_set(o, 0, 0, 640, 480);
efl_gfx_size_set(o, 640, 480); efl_gfx_size_set(o, 640, 480);
efl_gfx_visible_set(o, EINA_TRUE); efl_gfx_visible_set(o, EINA_TRUE);
slice = (Eina_Slice)EINA_SLICE_STR(pixels); efl_gfx_buffer_managed_set(o, &sl, 640, 480, 0, EFL_GFX_COLORSPACE_ARGB8888, 0);
efl_gfx_buffer_copy_set(o_images[i], &slice, 640, 480, 640 * sizeof (int), EFL_GFX_COLORSPACE_ARGB8888, 0);
} }
free(pixels);
done = 0; done = 0;
} }
/* cleanup */ /* cleanup */
static void _cleanup(void) static void _cleanup(void)
{ {
int i; for (int i = 0; i < 1; i++)
for (i = 0; i < 1; i++) efl_del(o_images[i]); {
Evas_Object *o = o_images[i];
Eina_Slice sl = {};
efl_gfx_buffer_managed_get(o, &sl, 0);
free((void *) sl.mem);
efl_del(o);
}
} }
/* loop - do things */ /* loop - do things */
static void _loop(double t, int f) static void _loop(double t, int f)
{ {
int i, st; for (int i = 0; i < 1; i++)
Evas_Coord x, y, w, h;
Eina_Rw_Slice rw_slice;
for (i = 0; i < 1; i++)
{ {
unsigned int result, *p; Evas_Object *o = o_images[i];
int length; unsigned int *data, *p;
Evas_Coord x, y, w, h;
Eina_Rw_Slice sl = {};
int st;
w = 640; w = 640;
h = 480; h = 480;
x = (win_w / 2) - (w / 2); x = (win_w / 2) - (w / 2);
y = (win_h / 2) - (h / 2); y = (win_h / 2) - (h / 2);
efl_gfx_position_set(o_images[i], x, y); efl_gfx_position_set(o, x, y);
efl_gfx_size_set(o_images[i], w, h); efl_gfx_size_set(o, w, h);
efl_gfx_fill_set(o_images[i], 0, 0, w, h); efl_gfx_fill_set(o, 0, 0, w, h);
result = efl_gfx_buffer_map(o_images[i], &rw_slice, efl_gfx_buffer_map(o, &sl, EFL_GFX_BUFFER_ACCESS_MODE_WRITE,
EFL_GFX_BUFFER_ACCESS_MODE_WRITE, 0, 0, 0, 0, EFL_GFX_COLORSPACE_ARGB8888, 0, &st);
0, 0, 0, 0, EFL_GFX_COLORSPACE_ARGB8888, 0, data = sl.mem;
&st); if (!data)
if (!result)
{ {
fprintf(stderr, "ERROR: Failed to map image!\n"); fprintf(stderr, "ERROR: Failed to map image!\n");
continue; continue;
} }
st = st >> 2; st = st >> 2;
p = rw_slice.mem; p = sl.mem;
for (y = 0; y < h; y++) for (y = 0; y < h; y++)
{ {
for (x = 0; x < w; x++) for (x = 0; x < w; x++)
@ -88,8 +90,8 @@ static void _loop(double t, int f)
} }
p += (st - w); p += (st - w);
} }
efl_gfx_buffer_unmap(o_images[i], &rw_slice); efl_gfx_buffer_unmap(o, &sl);
efl_gfx_buffer_update_add(o_images[i], 0, 0, w, h); efl_gfx_buffer_update_add(o, 0, 0, w, h);
} }
FPS_STD(NAME); FPS_STD(NAME);
} }

View File

@ -20,12 +20,12 @@ static Evas_Object *o_images[1];
/* setup */ /* setup */
static void _setup(void) static void _setup(void)
{ {
int i;
Evas_Object *o; Evas_Object *o;
void *pixels; Eina_Slice sl;
pixels = malloc(sizeof (int) * 640 * 480); sl.len = 640 * 480 * 4;
for (i = 0; i < 1; i++) sl.mem = malloc(sl.len);
for (int i = 0; i < 1; i++)
{ {
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas); o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
o_images[i] = o; o_images[i] = o;
@ -34,17 +34,23 @@ static void _setup(void)
efl_gfx_fill_set(o, 0, 0, 640, 480); efl_gfx_fill_set(o, 0, 0, 640, 480);
efl_gfx_size_set(o, 640, 480); efl_gfx_size_set(o, 640, 480);
efl_gfx_visible_set(o, EINA_TRUE); efl_gfx_visible_set(o, EINA_TRUE);
efl_gfx_buffer_copy_set(o_images[i], pixels, 640, 480, 640 * sizeof (int), EFL_GFX_COLORSPACE_ARGB8888, 0); efl_gfx_buffer_managed_set(o, &sl, 640, 480, 0, EFL_GFX_COLORSPACE_ARGB8888, 0);
} }
free(pixels);
done = 0; done = 0;
} }
/* cleanup */ /* cleanup */
static void _cleanup(void) static void _cleanup(void)
{ {
int i; for (int i = 0; i < 1; i++)
for (i = 0; i < 1; i++) efl_del(o_images[i]); {
Evas_Object *o = o_images[i];
Eina_Slice sl = {};
efl_gfx_buffer_managed_get(o, &sl, 0);
free((void *) sl.mem);
efl_del(o);
}
} }
/* loop - do things */ /* loop - do things */
@ -52,31 +58,30 @@ static void _loop(double t, int f)
{ {
int i, st; int i, st;
Evas_Coord x, y, w, h; Evas_Coord x, y, w, h;
Eina_Rw_Slice rw_slice;
for (i = 0; i < 1; i++) for (i = 0; i < 1; i++)
{ {
unsigned int result, *p; Evas_Object *o = o_images[i];
unsigned int *p;
Eina_Rw_Slice sl = {};
int a, r, g, b; int a, r, g, b;
w = 640; w = 640;
h = 480; h = 480;
x = (win_w / 2) - (w / 2); x = (win_w / 2) - (w / 2);
y = (win_h / 2) - (h / 2); y = (win_h / 2) - (h / 2);
efl_gfx_position_set(o_images[i], x, y); efl_gfx_position_set(o, x, y);
efl_gfx_size_set(o_images[i], w, h); efl_gfx_size_set(o, w, h);
efl_gfx_fill_set(o_images[i], 0, 0, w, h); efl_gfx_fill_set(o, 0, 0, w, h);
result = efl_gfx_buffer_map(o_images[i], &rw_slice, efl_gfx_buffer_map(o, &sl, EFL_GFX_BUFFER_ACCESS_MODE_WRITE,
EFL_GFX_BUFFER_ACCESS_MODE_WRITE, 0, 0, 0, 0, EFL_GFX_COLORSPACE_ARGB8888, 0, &st);
0, 0, 0, 0, EFL_GFX_COLORSPACE_ARGB8888, 0, if (!sl.mem)
&st);
if (!result)
{ {
fprintf(stderr, "ERROR: Failed to map image!\n"); fprintf(stderr, "ERROR: Failed to map image!\n");
continue; continue;
} }
st = st >> 2; st = st >> 2;
p = rw_slice.mem; p = sl.mem;
for (y = 0; y < h; y++) for (y = 0; y < h; y++)
{ {
for (x = 0; x < w; x++) for (x = 0; x < w; x++)
@ -97,8 +102,8 @@ static void _loop(double t, int f)
} }
p += (st - w); p += (st - w);
} }
efl_gfx_buffer_unmap(o_images[i], &rw_slice); efl_gfx_buffer_unmap(o, &sl);
efl_gfx_buffer_update_add(o_images[i], 0, 0, w, h); efl_gfx_buffer_update_add(o, 0, 0, w, h);
} }
FPS_STD(NAME); FPS_STD(NAME);
} }

View File

@ -16,62 +16,34 @@ static int done = 0;
/* private data */ /* private data */
static Evas_Object *o_images[1]; static Evas_Object *o_images[1];
static unsigned char *yp = NULL, *up = NULL, *vp = NULL; static Eina_Slice slice[3];
/* setup */ /* setup */
static void _setup(void) static void _setup(void)
{ {
int i, y;
FILE *f; FILE *f;
unsigned char **lp; for (int i = 0; i < 1; i++)
Evas_Object *o;
Eina_Slice slice;
for (i = 0; i < 1; i++)
{ {
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas); Evas_Object *o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
o_images[i] = o; o_images[i] = o;
efl_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC); efl_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
efl_gfx_buffer_alpha_set(o, 0); efl_gfx_buffer_alpha_set(o, 0);
efl_gfx_fill_set(o, 0, 0, 640, 480); efl_gfx_fill_set(o, 0, 0, 640, 480);
efl_gfx_size_set(o, 640, 480); efl_gfx_size_set(o, 640, 480);
efl_gfx_visible_set(o, EINA_TRUE); efl_gfx_visible_set(o, EINA_TRUE);
slice.mem = malloc(sizeof (void*) * (480 + 240 + 240));
slice.len = (480 + 240 + 240);
yp = malloc(640 * 480);
up = malloc(320 * 240);
vp = malloc(320 * 240);
f = fopen(build_path("tp.yuv"), "rb");
if (f)
{
fread(yp, 640 * 480, 1, f);
fread(up, 320 * 240, 1, f);
fread(vp, 320 * 240, 1, f);
fclose(f);
}
lp = (unsigned char**) slice.bytes;
for (y = 0; y < 480; y++) slice[0].len = 640 * 480;
slice[1].len = 320 * 240;
slice[2].len = 320 * 240;
f = fopen(build_path("tp.yuv"), "rb");
if (!f) continue;
for (int p = 0; p < 3; p++)
{ {
*lp = yp + (y * 640); slice[p].mem = malloc(slice[p].len);
lp++; fread((void *) slice[p].mem, slice[p].len, 1, f);
efl_gfx_buffer_managed_set(o, &slice[p], 640, 480, 0, EFL_GFX_COLORSPACE_YCBCR422P601_PL, p);
} }
for (y = 0; y < 240; y++) fclose(f);
{
*lp = up + (y * 320);
lp++;
}
for (y = 0; y < 240; y++)
{
*lp = vp + (y * 320);
lp++;
}
/* efl_gfx_buffer_copy_set(o_images[i], &slice, 640, 480, 640 * sizeof (int), EVAS_COLORSPACE_YCBCR422P601_PL, 0); */
free(slice.mem);
// Not a real copy in fact...
/* free(yp); */
/* free(up); */
/* free(vp); */
} }
done = 0; done = 0;
} }
@ -79,12 +51,16 @@ static void _setup(void)
/* cleanup */ /* cleanup */
static void _cleanup(void) static void _cleanup(void)
{ {
int i; for (int i = 0; i < 1; i++)
for (i = 0; i < 1; i++) efl_del(o_images[i]); {
// FIXME: the object is not destroyed anymore so we can't free the data Evas_Object *o = o_images[i];
/* free(yp); */ for (int p = 0; p < 3; p++)
/* free(up); */ {
/* free(vp); */ efl_gfx_buffer_managed_set(o, NULL, 640, 480, 0, EFL_GFX_COLORSPACE_YCBCR422P601_PL, p);
free((void *) slice[p].mem);
}
efl_del(o);
}
} }
/* loop - do things */ /* loop - do things */

View File

@ -16,60 +16,34 @@ static int done = 0;
/* private data */ /* private data */
static Evas_Object *o_images[1]; static Evas_Object *o_images[1];
static unsigned char *yp = NULL, *up = NULL, *vp = NULL; static Eina_Slice slice[3];
/* setup */ /* setup */
static void _setup(void) static void _setup(void)
{ {
int i, y;
FILE *f; FILE *f;
unsigned char **data, **lp; for (int i = 0; i < 1; i++)
Evas_Object *o;
Eina_Slice slice;
for (i = 0; i < 1; i++)
{ {
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas); Evas_Object *o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
o_images[i] = o; o_images[i] = o;
efl_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC); efl_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
efl_gfx_buffer_alpha_set(o, 0); efl_gfx_buffer_alpha_set(o, 0);
efl_gfx_fill_set(o, 0, 0, 640, 480); efl_gfx_fill_set(o, 0, 0, 640, 480);
efl_gfx_size_set(o, 640, 480); efl_gfx_size_set(o, 640, 480);
efl_image_smooth_scale_set(o, 0);
efl_gfx_visible_set(o, EINA_TRUE); efl_gfx_visible_set(o, EINA_TRUE);
data = malloc(sizeof (void*) * (480 + 240 + 240));
yp = malloc(640 * 480); slice[0].len = 640 * 480;
up = malloc(320 * 240); slice[1].len = 320 * 240;
vp = malloc(320 * 240); slice[2].len = 320 * 240;
f = fopen(build_path("tp.yuv"), "rb"); f = fopen(build_path("tp.yuv"), "rb");
if (f) if (!f) continue;
for (int p = 0; p < 3; p++)
{ {
fread(yp, 640 * 480, 1, f); slice[p].mem = malloc(slice[p].len);
fread(up, 320 * 240, 1, f); fread((void *) slice[p].mem, slice[p].len, 1, f);
fread(vp, 320 * 240, 1, f); efl_gfx_buffer_managed_set(o, &slice[p], 640, 480, 0, EFL_GFX_COLORSPACE_YCBCR422P601_PL, p);
fclose(f);
} }
lp = data; fclose(f);
for (y = 0; y < 480; y++)
{
*lp = yp + (y * 640);
lp++;
}
for (y = 0; y < 240; y++)
{
*lp = up + (y * 320);
lp++;
}
for (y = 0; y < 240; y++)
{
*lp = vp + (y * 320);
lp++;
}
slice = (Eina_Slice)EINA_SLICE_STR(*data);
efl_gfx_buffer_managed_set(o_images[i], &slice, 640, 480, 0, EFL_GFX_COLORSPACE_YCBCR422P601_PL, 0);
free(yp);
free(up);
free(vp);
} }
done = 0; done = 0;
} }
@ -77,11 +51,16 @@ static void _setup(void)
/* cleanup */ /* cleanup */
static void _cleanup(void) static void _cleanup(void)
{ {
int i; for (int i = 0; i < 1; i++)
for (i = 0; i < 1; i++) efl_del(o_images[i]); {
/* free(yp); */ Evas_Object *o = o_images[i];
/* free(up); */ for (int p = 0; p < 3; p++)
/* free(vp); */ {
efl_gfx_buffer_managed_set(o, NULL, 640, 480, 0, EFL_GFX_COLORSPACE_YCBCR422P601_PL, p);
free((void *) slice[p].mem);
}
efl_del(o);
}
} }
/* loop - do things */ /* loop - do things */

View File

@ -16,59 +16,34 @@ static int done = 0;
/* private data */ /* private data */
static Evas_Object *o_images[1]; static Evas_Object *o_images[1];
static unsigned char *yp = NULL, *up = NULL, *vp = NULL; static Eina_Slice slice[3];
/* setup */ /* setup */
static void _setup(void) static void _setup(void)
{ {
int i, y;
FILE *f; FILE *f;
unsigned char **data, **lp; for (int i = 0; i < 1; i++)
Evas_Object *o;
Eina_Slice slice;
for (i = 0; i < 1; i++)
{ {
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas); Evas_Object *o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
o_images[i] = o; o_images[i] = o;
efl_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC); efl_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
efl_gfx_buffer_alpha_set(o, 0); efl_gfx_buffer_alpha_set(o, 0);
efl_gfx_fill_set(o, 0, 0, 640, 480); efl_gfx_fill_set(o, 0, 0, 640, 480);
efl_gfx_size_set(o, 640, 480); efl_gfx_size_set(o, 640, 480);
efl_gfx_visible_set(o, EINA_TRUE); efl_gfx_visible_set(o, EINA_TRUE);
data = malloc(sizeof (void*) * (480 + 240 + 240));
yp = malloc(640 * 480); slice[0].len = 640 * 480;
up = malloc(320 * 240); slice[1].len = 320 * 240;
vp = malloc(320 * 240); slice[2].len = 320 * 240;
f = fopen(build_path("tp.yuv"), "rb"); f = fopen(build_path("tp.yuv"), "rb");
if (f) if (!f) continue;
for (int p = 0; p < 3; p++)
{ {
fread(yp, 640 * 480, 1, f); slice[p].mem = malloc(slice[p].len);
fread(up, 320 * 240, 1, f); fread((void *) slice[p].mem, slice[p].len, 1, f);
fread(vp, 320 * 240, 1, f); efl_gfx_buffer_managed_set(o, &slice[p], 640, 480, 0, EFL_GFX_COLORSPACE_YCBCR422P601_PL, p);
fclose(f);
} }
lp = data; fclose(f);
for (y = 0; y < 480; y++)
{
*lp = yp + (y * 640);
lp++;
}
for (y = 0; y < 240; y++)
{
*lp = up + (y * 320);
lp++;
}
for (y = 0; y < 240; y++)
{
*lp = vp + (y * 320);
lp++;
}
slice = (Eina_Slice)EINA_SLICE_STR(*data);
efl_gfx_buffer_managed_set(o_images[i], &slice, 640, 480, 0, EFL_GFX_COLORSPACE_YCBCR422P601_PL, 0);
free(yp);
free(up);
free(vp);
} }
done = 0; done = 0;
} }
@ -76,11 +51,16 @@ static void _setup(void)
/* cleanup */ /* cleanup */
static void _cleanup(void) static void _cleanup(void)
{ {
int i; for (int i = 0; i < 1; i++)
for (i = 0; i < 1; i++) efl_del(o_images[i]); {
/* free(yp); */ Evas_Object *o = o_images[i];
/* free(up); */ for (int p = 0; p < 3; p++)
/* free(vp); */ {
efl_gfx_buffer_managed_set(o, NULL, 640, 480, 0, EFL_GFX_COLORSPACE_YCBCR422P601_PL, p);
free((void *) slice[p].mem);
}
efl_del(o);
}
} }
/* loop - do things */ /* loop - do things */

View File

@ -16,60 +16,40 @@ static int done = 0;
/* private data */ /* private data */
static Evas_Object *o_images[1]; static Evas_Object *o_images[1];
static unsigned char *yp = NULL, *up = NULL, *vp = NULL; static Eina_Slice slice[3];
/* setup */ /* setup */
static void _setup(void) static void _setup(void)
{ {
int i, y; int stride;
FILE *f; FILE *f;
unsigned char **data, **lp; int w = 320 - 16;
Evas_Object *o; for (int i = 0; i < 1; i++)
Eina_Slice slice;
for (i = 0; i < 1; i++)
{ {
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas); Evas_Object *o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
o_images[i] = o; o_images[i] = o;
efl_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC); efl_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
efl_gfx_buffer_alpha_set(o, 0); efl_gfx_buffer_alpha_set(o, 0);
efl_gfx_fill_set(o, 0, 0, 640, 480); efl_gfx_fill_set(o, 0, 0, 640, 480);
efl_gfx_size_set(o, 640, 480); efl_gfx_size_set(o, 640, 480);
efl_gfx_visible_set(o, EINA_TRUE); efl_gfx_visible_set(o, EINA_TRUE);
data = malloc(sizeof (unsigned char*) * (480 + 240 + 240));
yp = malloc(640 * 480); // in this test, the stride is 640 but the width changes
up = malloc(320 * 240); slice[0].len = 640 * 480;
vp = malloc(320 * 240); slice[1].len = 320 * 240;
slice[2].len = 320 * 240;
f = fopen(build_path("tp.yuv"), "rb"); f = fopen(build_path("tp.yuv"), "rb");
if (f) if (!f) continue;
stride = 640;
for (int p = 0; p < 3; p++)
{ {
fread(yp, 640 * 480, 1, f); slice[p].mem = malloc(slice[p].len);
fread(up, 320 * 240, 1, f); fread((void *) slice[p].mem, slice[p].len, 1, f);
fread(vp, 320 * 240, 1, f); efl_gfx_buffer_managed_set(o, &slice[p], w, 480, stride,
fclose(f); EFL_GFX_COLORSPACE_YCBCR422P601_PL, p);
stride = 320;
} }
lp = data; fclose(f);
for (y = 0; y < 480; y++)
{
*lp = yp + (y * 640);
lp++;
}
for (y = 0; y < 240; y++)
{
*lp = up + (y * 320);
lp++;
}
for (y = 0; y < 240; y++)
{
*lp = vp + (y * 320);
lp++;
}
slice = (Eina_Slice)EINA_SLICE_STR(*data);
efl_gfx_buffer_managed_set(o_images[i], &slice, 640, 480, 0, EFL_GFX_COLORSPACE_YCBCR422P601_PL, 0);
efl_gfx_buffer_update_add(o_images[i], 0, 0, 320, 480);
free(yp);
free(up);
free(vp);
} }
done = 0; done = 0;
} }
@ -77,11 +57,17 @@ static void _setup(void)
/* cleanup */ /* cleanup */
static void _cleanup(void) static void _cleanup(void)
{ {
int i; for (int i = 0; i < 1; i++)
for (i = 0; i < 1; i++) efl_del(o_images[i]); {
/* free(yp); */ Evas_Object *o = o_images[i];
/* free(up); */ for (int p = 0; p < 3; p++)
/* free(vp); */ {
efl_gfx_buffer_managed_set(o, NULL, 640, 480, 0,
EFL_GFX_COLORSPACE_YCBCR422P601_PL, p);
free((void *) slice[p].mem);
}
efl_del(o);
}
} }
/* loop - do things */ /* loop - do things */
@ -89,47 +75,35 @@ static void _loop(double t, int f)
{ {
int i; int i;
Evas_Coord x, y, w, h; Evas_Coord x, y, w, h;
Eina_Slice slice;
for (i = 0; i < 1; i++) for (i = 0; i < 1; i++)
{ {
unsigned char **lp; Evas_Object *o = o_images[i];
Eina_Slice sl[3];
int stride;
for (int p = 0; p < 3; p++)
efl_gfx_buffer_managed_get(o, &sl[p], p);
w = 640; w = 640;
h = 480; h = 480;
x = (win_w / 2) - (w / 2); x = (win_w / 2) - (w / 2);
y = (win_h / 2) - (h / 2); y = (win_h / 2) - (h / 2);
efl_gfx_position_set(o_images[i], x, y); efl_gfx_position_set(o, x, y);
efl_gfx_size_set(o_images[i], w, h); efl_gfx_size_set(o, w, h);
efl_gfx_fill_set(o_images[i], 0, 0, w, h); efl_gfx_fill_set(o, 0, 0, w, h);
w = 320 - 16 + f; // logic here differs a bit from old expedite
if (w < 1) w = 1; w = 320 - 16 + (f * 2) % 336;
else if (w > 640) w = 640; if (w > 640) w = 320;
w &= ~0x1; stride = 640;
for (int p = 0; p < 3; p++)
slice.mem = malloc(sizeof (void*) * (480 + 240 + 240));
slice.len = (480 + 240 + 240);
lp = slice.mem;
for (y = 0; y < 480; y++)
{ {
*lp = yp + (y * 640); efl_gfx_buffer_managed_set(o, &sl[p], w, 480, stride,
lp++; EFL_GFX_COLORSPACE_YCBCR422P601_PL, p);
stride = 320;
} }
for (y = 0; y < 240; y++) efl_gfx_buffer_update_add(o, 0, 0, w, 480);
{
*lp = up + (y * 320);
lp++;
}
for (y = 0; y < 240; y++)
{
*lp = vp + (y * 320);
lp++;
}
/* efl_gfx_buffer_copy_set(o_images[i], &slice, w, 480, w * sizeof (int), EVAS_COLORSPACE_YCBCR422P601_PL, 0); */
efl_gfx_buffer_update_add(o_images[i], 0, 0, w, 480);
free(slice.mem);
} }
FPS_STD(NAME); FPS_STD(NAME);
} }