[x264-devel] [PATCH 15/29] Adjust headers to make x264cli independent of common.h
Vittorio Giovara
vittorio.giovara at gmail.com
Thu Feb 2 10:05:27 CET 2017
---
filters/filters.c | 2 ++
filters/video/cache.c | 2 ++
filters/video/depth.c | 2 ++
filters/video/fix_vfr_pts.c | 1 +
filters/video/resize.c | 2 ++
filters/video/select_every.c | 2 ++
input/input.c | 1 +
input/input.h | 5 +++++
input/lavf.c | 2 ++
input/thread.c | 2 ++
input/timecode.c | 3 +++
input/y4m.c | 2 ++
output/flv.c | 3 +++
output/flv_bytestream.c | 1 +
output/flv_bytestream.h | 2 ++
output/matroska_ebml.c | 3 +++
output/mp4_lsmash.c | 1 +
output/raw.c | 1 +
x264.c | 10 +++++++++-
x264cli.h | 5 ++++-
20 files changed, 50 insertions(+), 2 deletions(-)
diff --git a/filters/filters.c b/filters/filters.c
index 9212a3e..9479cd1 100644
--- a/filters/filters.c
+++ b/filters/filters.c
@@ -26,6 +26,8 @@
*****************************************************************************/
#include "filters.h"
+#include <assert.h>
+
#define RETURN_IF_ERROR( cond, ... ) RETURN_IF_ERR( cond, "options", NULL, __VA_ARGS__ )
char **x264_split_options( const char *opt_str, const char * const *options )
diff --git a/filters/video/cache.c b/filters/video/cache.c
index 552e1b4..17acb3d 100644
--- a/filters/video/cache.c
+++ b/filters/video/cache.c
@@ -25,6 +25,8 @@
#include "video.h"
#include "internal.h"
+#include "common/common.h"
+
#define NAME "cache"
#define LAST_FRAME (h->first_frame + h->cur_size - 1)
diff --git a/filters/video/depth.c b/filters/video/depth.c
index 72eb288..2e09fe4 100644
--- a/filters/video/depth.c
+++ b/filters/video/depth.c
@@ -23,6 +23,8 @@
* For more information, contact us at licensing at x264.com.
*****************************************************************************/
+#include "common/common.h"
+
#include "video.h"
#define NAME "depth"
#define FAIL_IF_ERROR( cond, ... ) FAIL_IF_ERR( cond, NAME, __VA_ARGS__ )
diff --git a/filters/video/fix_vfr_pts.c b/filters/video/fix_vfr_pts.c
index e7e9346..0eaf566 100644
--- a/filters/video/fix_vfr_pts.c
+++ b/filters/video/fix_vfr_pts.c
@@ -25,6 +25,7 @@
#include "video.h"
#include "internal.h"
+#include "common/mathematics.h"
/* This filter calculates and store the frame's duration to the frame data
* (if it is not already calculated when the frame arrives to this point)
diff --git a/filters/video/resize.c b/filters/video/resize.c
index 4e95f31..2a1c82d 100644
--- a/filters/video/resize.c
+++ b/filters/video/resize.c
@@ -24,6 +24,8 @@
*****************************************************************************/
#include "video.h"
+#include "common/mathematics.h"
+
#define NAME "resize"
#define FAIL_IF_ERROR( cond, ... ) FAIL_IF_ERR( cond, NAME, __VA_ARGS__ )
diff --git a/filters/video/select_every.c b/filters/video/select_every.c
index f5b6750..dab2771 100644
--- a/filters/video/select_every.c
+++ b/filters/video/select_every.c
@@ -24,6 +24,8 @@
*****************************************************************************/
#include "video.h"
+#include "common/mathematics.h"
+
#define NAME "select_every"
#define FAIL_IF_ERROR( cond, ... ) FAIL_IF_ERR( cond, NAME, __VA_ARGS__ )
diff --git a/input/input.c b/input/input.c
index faadd4d..84a014c 100644
--- a/input/input.c
+++ b/input/input.c
@@ -25,6 +25,7 @@
*****************************************************************************/
#include "input.h"
+#include "common/mem.h"
#ifdef _WIN32
#include <io.h>
diff --git a/input/input.h b/input/input.h
index a66752d..084c3e3 100644
--- a/input/input.h
+++ b/input/input.h
@@ -28,8 +28,13 @@
#ifndef X264_INPUT_H
#define X264_INPUT_H
+#include <stdio.h>
+
+#include "config.h"
#include "x264cli.h"
+#include "common/osdep.h"
+
#ifdef _WIN32
#include <windows.h>
#endif
diff --git a/input/lavf.c b/input/lavf.c
index c0024a5..5067a3e 100644
--- a/input/lavf.c
+++ b/input/lavf.c
@@ -25,6 +25,8 @@
*****************************************************************************/
#include "input.h"
+#include "common/mathematics.h"
+
#define FAIL_IF_ERROR( cond, ... ) FAIL_IF_ERR( cond, "lavf", __VA_ARGS__ )
#undef DECLARE_ALIGNED
#include <libavformat/avformat.h>
diff --git a/input/thread.c b/input/thread.c
index 3d83bfa..d9622b7 100644
--- a/input/thread.c
+++ b/input/thread.c
@@ -25,6 +25,8 @@
*****************************************************************************/
#include "input.h"
+#include "common/threadpool.h"
+#include "common/mathematics.h"
typedef struct
{
diff --git a/input/timecode.c b/input/timecode.c
index 25f924c..d1fbfe3 100644
--- a/input/timecode.c
+++ b/input/timecode.c
@@ -24,6 +24,9 @@
*****************************************************************************/
#include "input.h"
+#include <math.h>
+#include <inttypes.h>
+
#define FAIL_IF_ERROR( cond, ... ) FAIL_IF_ERR( cond, "timecode", __VA_ARGS__ )
typedef struct
diff --git a/input/y4m.c b/input/y4m.c
index 8948f68..901faaa 100644
--- a/input/y4m.c
+++ b/input/y4m.c
@@ -25,6 +25,8 @@
*****************************************************************************/
#include "input.h"
+#include "common/mathematics.h"
+
#define FAIL_IF_ERROR( cond, ... ) FAIL_IF_ERR( cond, "y4m", __VA_ARGS__ )
typedef struct
diff --git a/output/flv.c b/output/flv.c
index dfe4d48..63ecbdd 100644
--- a/output/flv.c
+++ b/output/flv.c
@@ -23,8 +23,11 @@
* For more information, contact us at licensing at x264.com.
*****************************************************************************/
+#include <inttypes.h>
+
#include "output.h"
#include "flv_bytestream.h"
+#include "common/osdep.h"
#define CHECK(x)\
do {\
diff --git a/output/flv_bytestream.c b/output/flv_bytestream.c
index b57a63c..c18f38c 100644
--- a/output/flv_bytestream.c
+++ b/output/flv_bytestream.c
@@ -25,6 +25,7 @@
#include "output.h"
#include "flv_bytestream.h"
+#include "common/osdep.h"
uint64_t flv_dbl2int( double value )
{
diff --git a/output/flv_bytestream.h b/output/flv_bytestream.h
index af22b09..5da5696 100644
--- a/output/flv_bytestream.h
+++ b/output/flv_bytestream.h
@@ -26,6 +26,8 @@
#ifndef X264_FLV_BYTESTREAM_H
#define X264_FLV_BYTESTREAM_H
+#include <stdio.h>
+
/* offsets for packed values */
#define FLV_AUDIO_SAMPLESSIZE_OFFSET 1
#define FLV_AUDIO_SAMPLERATE_OFFSET 2
diff --git a/output/matroska_ebml.c b/output/matroska_ebml.c
index b92a23e..0fb47ca 100644
--- a/output/matroska_ebml.c
+++ b/output/matroska_ebml.c
@@ -23,8 +23,11 @@
* For more information, contact us at licensing at x264.com.
*****************************************************************************/
+#include <stdlib.h>
+
#include "output.h"
#include "matroska_ebml.h"
+#include "common/osdep.h"
#define CLSIZE 1048576
#define CHECK(x)\
diff --git a/output/mp4_lsmash.c b/output/mp4_lsmash.c
index 30bded0..b8af7a3 100644
--- a/output/mp4_lsmash.c
+++ b/output/mp4_lsmash.c
@@ -29,6 +29,7 @@
#include "output.h"
#include <lsmash.h>
+#include "common/osdep.h"
#define H264_NALU_LENGTH_SIZE 4
diff --git a/output/raw.c b/output/raw.c
index 47e3353..02bfc20 100644
--- a/output/raw.c
+++ b/output/raw.c
@@ -25,6 +25,7 @@
*****************************************************************************/
#include "output.h"
+#include "common/osdep.h"
static int open_file( char *psz_filename, hnd_t *p_handle, cli_output_opt_t *opt )
{
diff --git a/x264.c b/x264.c
index 016047a..15f0020 100644
--- a/x264.c
+++ b/x264.c
@@ -39,11 +39,19 @@
#include <signal.h>
#include <getopt.h>
-#include "common/common.h"
#include "x264cli.h"
#include "input/input.h"
#include "output/output.h"
#include "filters/filters.h"
+#include "common/cpu.h"
+#include "common/osdep.h"
+#include "common/mathematics.h"
+
+#define MAX_BIT_DEPTH 10
+#define QP_BD_OFFSET (6*(MAX_BIT_DEPTH-8))
+#define QP_MAX_SPEC (51+QP_BD_OFFSET)
+#define QP_MAX (QP_MAX_SPEC+18)
+#define QP_MAX_MAX (51+2*6+18)
#define FAIL_IF_ERROR( cond, ... ) FAIL_IF_ERR( cond, "x264", __VA_ARGS__ )
diff --git a/x264cli.h b/x264cli.h
index 9b5d31e..6ae500e 100644
--- a/x264cli.h
+++ b/x264cli.h
@@ -27,7 +27,10 @@
#ifndef X264_CLI_H
#define X264_CLI_H
-#include "common/common.h"
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include "x264.h"
/* In microseconds */
#define UPDATE_INTERVAL 250000
--
2.10.0
More information about the x264-devel
mailing list