Skip to content

Instantly share code, notes, and snippets.

@kodawah
Created February 21, 2019 18:50
Show Gist options
  • Save kodawah/8913a0714b5bcaab90fdb8bf26659b24 to your computer and use it in GitHub Desktop.
Save kodawah/8913a0714b5bcaab90fdb8bf26659b24 to your computer and use it in GitHub Desktop.
diff --git a/common/base.h b/common/base.h
index 28fc6524..38769d33 100644
--- a/common/base.h
+++ b/common/base.h
@@ -49,6 +49,31 @@
#include <limits.h>
#include "x264.h"
+
+x264_t *x264_8_encoder_open( x264_param_t * );
+void x264_8_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal );
+int x264_8_encoder_reconfig( x264_t *, x264_param_t * );
+void x264_8_encoder_parameters( x264_t *, x264_param_t * );
+int x264_8_encoder_headers( x264_t *, x264_nal_t **pp_nal, int *pi_nal );
+int x264_8_encoder_encode( x264_t *, x264_nal_t **pp_nal, int *pi_nal, x264_picture_t *pic_in, x264_picture_t *pic_out );
+void x264_8_encoder_close( x264_t * );
+int x264_8_encoder_delayed_frames( x264_t * );
+int x264_8_encoder_maximum_delayed_frames( x264_t * );
+void x264_8_encoder_intra_refresh( x264_t * );
+int x264_8_encoder_invalidate_reference( x264_t *, int64_t pts );
+
+x264_t *x264_10_encoder_open( x264_param_t * );
+void x264_10_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal );
+int x264_10_encoder_reconfig( x264_t *, x264_param_t * );
+void x264_10_encoder_parameters( x264_t *, x264_param_t * );
+int x264_10_encoder_headers( x264_t *, x264_nal_t **pp_nal, int *pi_nal );
+int x264_10_encoder_encode( x264_t *, x264_nal_t **pp_nal, int *pi_nal, x264_picture_t *pic_in, x264_picture_t *pic_out );
+void x264_10_encoder_close( x264_t * );
+int x264_10_encoder_delayed_frames( x264_t * );
+int x264_10_encoder_maximum_delayed_frames( x264_t * );
+void x264_10_encoder_intra_refresh( x264_t * );
+int x264_10_encoder_invalidate_reference( x264_t *, int64_t pts );
+
/****************************************************************************
* Macros
****************************************************************************/
diff --git a/encoder/api.c b/encoder/api.c
index b97612b7..14591094 100644
--- a/encoder/api.c
+++ b/encoder/api.c
@@ -31,29 +31,6 @@
****************************************************************************/
const int x264_chroma_format = X264_CHROMA_FORMAT;
-x264_t *x264_8_encoder_open( x264_param_t * );
-void x264_8_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal );
-int x264_8_encoder_reconfig( x264_t *, x264_param_t * );
-void x264_8_encoder_parameters( x264_t *, x264_param_t * );
-int x264_8_encoder_headers( x264_t *, x264_nal_t **pp_nal, int *pi_nal );
-int x264_8_encoder_encode( x264_t *, x264_nal_t **pp_nal, int *pi_nal, x264_picture_t *pic_in, x264_picture_t *pic_out );
-void x264_8_encoder_close( x264_t * );
-int x264_8_encoder_delayed_frames( x264_t * );
-int x264_8_encoder_maximum_delayed_frames( x264_t * );
-void x264_8_encoder_intra_refresh( x264_t * );
-int x264_8_encoder_invalidate_reference( x264_t *, int64_t pts );
-
-x264_t *x264_10_encoder_open( x264_param_t * );
-void x264_10_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal );
-int x264_10_encoder_reconfig( x264_t *, x264_param_t * );
-void x264_10_encoder_parameters( x264_t *, x264_param_t * );
-int x264_10_encoder_headers( x264_t *, x264_nal_t **pp_nal, int *pi_nal );
-int x264_10_encoder_encode( x264_t *, x264_nal_t **pp_nal, int *pi_nal, x264_picture_t *pic_in, x264_picture_t *pic_out );
-void x264_10_encoder_close( x264_t * );
-int x264_10_encoder_delayed_frames( x264_t * );
-int x264_10_encoder_maximum_delayed_frames( x264_t * );
-void x264_10_encoder_intra_refresh( x264_t * );
-int x264_10_encoder_invalidate_reference( x264_t *, int64_t pts );
typedef struct x264_api_t
{
diff --git a/encoder/encoder.c b/encoder/encoder.c
index 44a4684b..fc9cdf40 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -31,6 +31,7 @@
#include "analyse.h"
#include "ratecontrol.h"
#include "macroblock.h"
+#include "speed.h"
#include "me.h"
#if HAVE_INTEL_DISPATCHER
#include "extras/intel_dispatcher.h"
diff --git a/encoder/speed.h b/encoder/speed.h
new file mode 100644
index 00000000..cfe47736
--- /dev/null
+++ b/encoder/speed.h
@@ -0,0 +1,19 @@
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+
+
+#define x264_speedcontrol_new x264_template(speedcontrol_new)
+void x264_speedcontrol_new( x264_t *h );
+
+#define x264_speedcontrol_delete x264_template(speedcontrol_delete)
+void x264_speedcontrol_delete( x264_t *h );
+
+#define x264_speedcontrol_frame_end x264_template(speedcontrol_frame_end)
+void x264_speedcontrol_frame_end( x264_t *h );
+
+#define x264_speedcontrol_frame x264_template(speedcontrol_frame)
+void x264_speedcontrol_frame( x264_t *h );
+
+#define x264_speedcontrol_sync x264_template(speedcontrol_sync)
+void x264_speedcontrol_sync( x264_t *h, float f_buffer_fill, int i_buffer_size, int buffer_complete );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment