From: Boram Park Date: Fri, 16 Mar 2018 07:42:40 +0000 (+0900) Subject: buffers: use rand_r to draw noise color X-Git-Tag: submit/tizen/20180316.082049~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F40%2F172840%2F3;p=platform%2Fcore%2Fuifw%2Flibtdm.git buffers: use rand_r to draw noise color Change-Id: I44ce0464c620b77ab20540b75b9dcaeb49202040 --- diff --git a/tools/buffers.c b/tools/buffers.c index 5cf58ef..ea88179 100644 --- a/tools/buffers.c +++ b/tools/buffers.c @@ -254,8 +254,12 @@ fill_smpte_yuv_planar(const struct yuv_info *yuv, for (; x < width * 6 / 7; ++x) y_mem[x] = colors_bottom[(x - width * 5 / 7) * 3 / (width / 7) + 4].y; - for (; x < width; ++x) - y_mem[x] = colors_bottom[7].y; + for (; x < width; ++x) { + if (rand_r(&rand_seed) % 2) + y_mem[x] = colors_bottom[1].y; + else + y_mem[x] = colors_bottom[7].y; + } y_mem += stride; } @@ -292,8 +296,13 @@ fill_smpte_yuv_planar(const struct yuv_info *yuv, 3 / (width / 7) + 4].v; } for (; x < width; x += xsub) { - u_mem[x * cs / xsub] = colors_bottom[7].u; - v_mem[x * cs / xsub] = colors_bottom[7].v; + if (rand_r(&rand_seed) % 2) { + u_mem[x * cs / xsub] = colors_bottom[1].u; + v_mem[x * cs / xsub] = colors_bottom[1].v; + } else { + u_mem[x * cs / xsub] = colors_bottom[7].u; + v_mem[x * cs / xsub] = colors_bottom[7].v; + } } u_mem += stride * cs / xsub; v_mem += stride * cs / xsub;