From 4fb7c337caedc0ecae9b59afbc155ba540ce45df Mon Sep 17 00:00:00 2001 From: "hunter@kvog.sh" Date: Mon, 2 Mar 2026 18:53:11 -0600 Subject: yuvbench: libyuv --- yuvbench/yuvbench_libyuv.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 yuvbench/yuvbench_libyuv.c (limited to 'yuvbench/yuvbench_libyuv.c') diff --git a/yuvbench/yuvbench_libyuv.c b/yuvbench/yuvbench_libyuv.c new file mode 100644 index 0000000..64da249 --- /dev/null +++ b/yuvbench/yuvbench_libyuv.c @@ -0,0 +1,21 @@ +#include "yuvbench.h" + +#include +#include + +static bool yuvbench_libyuv_convert(Ctx* ctx) +{ + const uint32_t w = ctx->inp_w; + const uint32_t h = ctx->inp_h; + const uint8_t* Y = (const uint8_t*)ctx->inp_buf; + const uint8_t* Cb = Y + (w * h); + const uint8_t* Cr = Cb + (w / 2 * h / 2); + return I420ToRAW(Y, w, Cb, w / 2, Cr, w / 2, ctx->out_buf, w * 3, w, h) == 0; +} + +Backend yuvbench_libyuv(void) +{ + Backend b = { 0 }; + b.convert_fn = yuvbench_libyuv_convert; + return b; +} -- cgit v1.2.3