shithub: hj264

Download patch

ref: 897140071501dca8d2e54a943a451f2f61d4d51d
parent: 6f2acb35217404d16c25089be80e31696d16d089
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed Jul 14 07:30:45 EDT 2021

use faster (on new cpus) memcpy

--- a/hj264.c
+++ b/hj264.c
@@ -1,5 +1,6 @@
 #define MINIH264_IMPLEMENTATION
 #define H264E_MAX_THREADS 7
+#define memcpy memcpyf
 #include "minih264e.h"
 #include <thread.h>
 #include <bio.h>
--- /dev/null
+++ b/memcpyf.s
@@ -1,0 +1,7 @@
+TEXT memcpyf(SB),1,$0
+	MOVQ RARG, DI
+	MOVQ DI, AX
+	MOVQ p2+8(FP), SI
+	MOVL n+16(FP), CX
+	CLD; REP; MOVSB
+	RET
--- a/mkfile
+++ b/mkfile
@@ -11,6 +11,7 @@
 
 OFILES=\
 	hj264.$O\
+	memcpyf.$O\
 
 default:V: all