From c4708f97ffde63337e923a947b0d24adba9ff610 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 18 Mar 2020 17:40:26 +0100 Subject: [PATCH] examples: don't use lrintf for each sample --- src/examples/video-dsp-play.c | 8 ++++---- src/examples/video-play.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/examples/video-dsp-play.c b/src/examples/video-dsp-play.c index 8475ed961..566b10243 100644 --- a/src/examples/video-dsp-play.c +++ b/src/examples/video-dsp-play.c @@ -140,10 +140,10 @@ on_process(void *_data, struct spa_io_position *position) for (i = 0; i < data->position->video.size.height; i++) { struct pixel *p = (struct pixel *) src; for (j = 0; j < data->position->video.size.width; j++) { - dst[j * 4 + 0] = SPA_CLAMP(lrintf(p[j].r * 255.0f), 0, 255); - dst[j * 4 + 1] = SPA_CLAMP(lrintf(p[j].g * 255.0f), 0, 255); - dst[j * 4 + 2] = SPA_CLAMP(lrintf(p[j].b * 255.0f), 0, 255); - dst[j * 4 + 3] = SPA_CLAMP(lrintf(p[j].a * 255.0f), 0, 255); + dst[j * 4 + 0] = SPA_CLAMP(p[j].r * 255.0f, 0, 255); + dst[j * 4 + 1] = SPA_CLAMP(p[j].g * 255.0f, 0, 255); + dst[j * 4 + 2] = SPA_CLAMP(p[j].b * 255.0f, 0, 255); + dst[j * 4 + 3] = SPA_CLAMP(p[j].a * 255.0f, 0, 255); } src += sstride; dst += dstride; diff --git a/src/examples/video-play.c b/src/examples/video-play.c index e23fefcb6..1d9cd983b 100644 --- a/src/examples/video-play.c +++ b/src/examples/video-play.c @@ -194,10 +194,10 @@ on_process(void *_data) for (i = 0; i < data->size.height; i++) { struct pixel *p = (struct pixel *) src; for (j = 0; j < data->size.width; j++) { - dst[j * 4 + 0] = SPA_CLAMP(lrintf(p[j].r * 255.0f), 0, 255); - dst[j * 4 + 1] = SPA_CLAMP(lrintf(p[j].g * 255.0f), 0, 255); - dst[j * 4 + 2] = SPA_CLAMP(lrintf(p[j].b * 255.0f), 0, 255); - dst[j * 4 + 3] = SPA_CLAMP(lrintf(p[j].a * 255.0f), 0, 255); + dst[j * 4 + 0] = SPA_CLAMP(p[j].r * 255.0f, 0, 255); + dst[j * 4 + 1] = SPA_CLAMP(p[j].g * 255.0f, 0, 255); + dst[j * 4 + 2] = SPA_CLAMP(p[j].b * 255.0f, 0, 255); + dst[j * 4 + 3] = SPA_CLAMP(p[j].a * 255.0f, 0, 255); } src += sstride; dst += dstride;