[x264-devel] [PATCH 18/32] Adjust headers to make x264cli independent of common.h

Vittorio Giovara vittorio.giovara at gmail.com
Fri Jan 20 15:20:43 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 1d3108e..0144203 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 5dc746f..21bfba6 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 887e297..4af1bf8 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 94af828..df5b6f2 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 38af5ef..04466a3 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 028a701..9e84358 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 9008398..a8c7cbe 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 d9a716f..49b3f67 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 14ed174..053d463 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 f600744..79c93a4 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 9a94cca..b49e603 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 46a9ec3..7159a49 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 54647dd..4c7279d 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 96f5377..f2138cb 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 c70c086..3487de9 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 f2b04c7..f739c5a 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 6a10a51..f3be084 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 a6f37d4..006df64 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 2699051..15c7efb 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 71be64d..331d241 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