shithub: hj264

Download patch

ref: 6f2acb35217404d16c25089be80e31696d16d089
parent: 5eebf86ca323c5b9704153070e2c790e9e3a0d19
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed Jul 14 07:28:01 EDT 2021

set max long term ref frames number and set frames channel size to 1

--- a/hj264.c
+++ b/hj264.c
@@ -206,6 +206,7 @@
 	cp.gop = Gop;
 	cp.max_threads = nthreads;
 	cp.temporal_denoise_flag = denoise;
+	cp.max_long_term_reference_frames = MAX_LONG_TERM_FRAMES;
 	cp.vbv_size_bytes = kbps/1000*8/2; /* 2 seconds */
 	cp.width = ww;
 	cp.height = hh;
@@ -414,7 +415,7 @@
 		sysfatal("hj264new: %r");
 	if(Binit(&h->out, 1, OWRITE) < 0)
 		sysfatal("Binit failed: %r");
-	h->frame = chancreate(sizeof(void*), fps);
+	h->frame = chancreate(sizeof(void*), 1); /* FIXME this is wrong as the encoder might be too late */
 
 	/* FIXME how about changing these on the fly? */
 	h->rp.encode_speed = Maxquality - quality;