examples: don't use lrintf for each sample

This commit is contained in:
Wim Taymans 2020-03-18 17:40:26 +01:00
parent 13d66df2df
commit c4708f97ff
2 changed files with 8 additions and 8 deletions

View file

@ -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;