shithub: treason

Download patch

ref: ee5b9871ff10c3a30d93845125c8568d12f8951f
parent: 388fe8b594357a85c94803d1c73b233672c1ecc0
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Sun Dec 13 18:12:42 EST 2020

show yuv→rgb delay

--- a/main.c
+++ b/main.c
@@ -234,8 +234,9 @@
 			case Cframe:
 				snprint(
 					info, sizeof(info),
-					"delay=%zdms %dx%d %s %s",
+					"yuv→rgb=%zdms display=%zdms %dx%d %s %s",
 					delay/1000000ULL,
+					yuv→rgb/1000000ULL,
 					frame->w, frame->h,
 					d->info,
 					d->s->info
--- a/misc.h
+++ b/misc.h
@@ -8,3 +8,4 @@
 
 extern int nproc;
 extern int debug;
+extern uvlong yuv→rgb;
--- a/yuv.c
+++ b/yuv.c
@@ -1,5 +1,8 @@
 #include <u.h>
+#include "misc.h"
 
+uvlong yuv→rgb;
+
 void yuv420_rgb24(
 	int width, int height,
 	u8int *y, u8int *u, u8int *v,
@@ -9,7 +12,9 @@
 	u32int w, h;
 	int r, g, b;
 	int yy, cb, cr, go;
+	uvlong start;
 
+	start = nanosec();
 	for(h = 0; h < height-1; h += 2){
 		for(w = 0; w < width-1; w += 2){
 			cb = *u - 0x80;
@@ -41,4 +46,5 @@
 		v += uvstride - w/2;
 		rgb += rgbstride*2 - 3*w;
 	}
+	yuv→rgb = nanosec() - start;
 }