This naming scheme is used elsewhere, so it's sensible to be consistent.
Furthermore this prevents the 'checkheaders' target from getting tripped up.
---
 Makefile                        |    2 -
 cmdutils_common_opts.h          |   31 -----------
 common_opts_template.c          |   31 +++++++++++
 ffmpeg.c                        |    2 +-
 ffplay.c                        |    2 +-
 ffprobe.c                       |    2 +-
 ffserver.c                      |    2 +-
 libavcodec/bit_depth_template.c |  106 +++++++++++++++++++++++++++++++++++++++
 libavcodec/dsputil_template.c   |    2 +-
 libavcodec/h264dsp_template.c   |    2 +-
 libavcodec/h264idct_template.c  |    2 +-
 libavcodec/h264pred_template.c  |    3 +-
 libavcodec/high_bit_depth.h     |  106 ---------------------------------------
 13 files changed, 146 insertions(+), 147 deletions(-)
 delete mode 100644 cmdutils_common_opts.h
 create mode 100644 common_opts_template.c
 create mode 100644 libavcodec/bit_depth_template.c
 delete mode 100644 libavcodec/high_bit_depth.h

diff --git a/Makefile b/Makefile
index d69004b..46bf00e 100644
--- a/Makefile
+++ b/Makefile
@@ -33,8 +33,6 @@ FFLIBS := avutil
 
 DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
 
-SKIPHEADERS = cmdutils_common_opts.h
-
 include common.mak
 
 FF_LDFLAGS   := $(FFLDFLAGS)
diff --git a/cmdutils_common_opts.h b/cmdutils_common_opts.h
deleted file mode 100644
index 20ac0fa..0000000
--- a/cmdutils_common_opts.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-    { "L", OPT_EXIT, {(void*)show_license}, "show license" },
-    { "h", OPT_EXIT, {(void*)show_help}, "show help" },
-    { "?", OPT_EXIT, {(void*)show_help}, "show help" },
-    { "help", OPT_EXIT, {(void*)show_help}, "show help" },
-    { "-help", OPT_EXIT, {(void*)show_help}, "show help" },
-    { "version", OPT_EXIT, {(void*)show_version}, "show version" },
-    { "formats"  , OPT_EXIT, {(void*)show_formats  }, "show available formats" 
},
-    { "codecs"   , OPT_EXIT, {(void*)show_codecs   }, "show available codecs" 
},
-    { "bsfs"     , OPT_EXIT, {(void*)show_bsfs     }, "show available bit 
stream filters" },
-    { "protocols", OPT_EXIT, {(void*)show_protocols}, "show available 
protocols" },
-    { "filters",   OPT_EXIT, {(void*)show_filters  }, "show available filters" 
},
-    { "pix_fmts" , OPT_EXIT, {(void*)show_pix_fmts }, "show available pixel 
formats" },
-    { "loglevel", HAS_ARG | OPT_FUNC2, {(void*)opt_loglevel}, "set libav* 
logging level", "loglevel" },
diff --git a/common_opts_template.c b/common_opts_template.c
new file mode 100644
index 0000000..20ac0fa
--- /dev/null
+++ b/common_opts_template.c
@@ -0,0 +1,31 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+    { "L", OPT_EXIT, {(void*)show_license}, "show license" },
+    { "h", OPT_EXIT, {(void*)show_help}, "show help" },
+    { "?", OPT_EXIT, {(void*)show_help}, "show help" },
+    { "help", OPT_EXIT, {(void*)show_help}, "show help" },
+    { "-help", OPT_EXIT, {(void*)show_help}, "show help" },
+    { "version", OPT_EXIT, {(void*)show_version}, "show version" },
+    { "formats"  , OPT_EXIT, {(void*)show_formats  }, "show available formats" 
},
+    { "codecs"   , OPT_EXIT, {(void*)show_codecs   }, "show available codecs" 
},
+    { "bsfs"     , OPT_EXIT, {(void*)show_bsfs     }, "show available bit 
stream filters" },
+    { "protocols", OPT_EXIT, {(void*)show_protocols}, "show available 
protocols" },
+    { "filters",   OPT_EXIT, {(void*)show_filters  }, "show available filters" 
},
+    { "pix_fmts" , OPT_EXIT, {(void*)show_pix_fmts }, "show available pixel 
formats" },
+    { "loglevel", HAS_ARG | OPT_FUNC2, {(void*)opt_loglevel}, "set libav* 
logging level", "loglevel" },
diff --git a/ffmpeg.c b/ffmpeg.c
index c99c4de..561abf3 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -4208,7 +4208,7 @@ static int opt_preset(const char *opt, const char *arg)
 
 static const OptionDef options[] = {
     /* main options */
-#include "cmdutils_common_opts.h"
+#include "common_opts_template.c"
     { "f", HAS_ARG, {(void*)opt_format}, "force format", "fmt" },
     { "i", HAS_ARG, {(void*)opt_input_file}, "input file name", "filename" },
     { "y", OPT_BOOL, {(void*)&file_overwrite}, "overwrite output files" },
diff --git a/ffplay.c b/ffplay.c
index a5dc358..2341700 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2972,7 +2972,7 @@ static int opt_thread_count(const char *opt, const char 
*arg)
 }
 
 static const OptionDef options[] = {
-#include "cmdutils_common_opts.h"
+#include "common_opts_template.c"
     { "x", HAS_ARG | OPT_FUNC2, {(void*)opt_width}, "force displayed width", 
"width" },
     { "y", HAS_ARG | OPT_FUNC2, {(void*)opt_height}, "force displayed height", 
"height" },
     { "s", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_size}, "set frame size (WxH 
or abbreviation)", "size" },
diff --git a/ffprobe.c b/ffprobe.c
index b5d19f0..4bbaa0f 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -366,7 +366,7 @@ static void opt_pretty(void)
 }
 
 static const OptionDef options[] = {
-#include "cmdutils_common_opts.h"
+#include "common_opts_template.c"
     { "f", HAS_ARG, {(void*)opt_format}, "force format", "format" },
     { "unit", OPT_BOOL, {(void*)&show_value_unit}, "show unit of the displayed 
values" },
     { "prefix", OPT_BOOL, {(void*)&use_value_prefix}, "use SI prefixes for the 
displayed values" },
diff --git a/ffserver.c b/ffserver.c
index b4613af..4d4cd01 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -4669,7 +4669,7 @@ static void show_help(void)
 }
 
 static const OptionDef options[] = {
-#include "cmdutils_common_opts.h"
+#include "common_opts_template.c"
     { "n", OPT_BOOL, {(void *)&no_launch }, "enable no-launch mode" },
     { "d", 0, {(void*)opt_debug}, "enable debug mode" },
     { "f", HAS_ARG | OPT_STRING, {(void*)&config_filename }, "use configfile 
instead of /etc/ffserver.conf", "configfile" },
diff --git a/libavcodec/bit_depth_template.c b/libavcodec/bit_depth_template.c
new file mode 100644
index 0000000..c0a6eaf
--- /dev/null
+++ b/libavcodec/bit_depth_template.c
@@ -0,0 +1,106 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "dsputil.h"
+
+#ifndef BIT_DEPTH
+#define BIT_DEPTH 8
+#endif
+
+#ifdef AVCODEC_H264_HIGH_DEPTH_H
+#   undef pixel
+#   undef pixel2
+#   undef pixel4
+#   undef dctcoef
+#   undef INIT_CLIP
+#   undef no_rnd_avg_pixel4
+#   undef rnd_avg_pixel4
+#   undef AV_RN2P
+#   undef AV_RN4P
+#   undef AV_RN4PA
+#   undef AV_WN2P
+#   undef AV_WN4P
+#   undef AV_WN4PA
+#   undef CLIP
+#   undef FUNC
+#   undef FUNCC
+#   undef av_clip_pixel
+#   undef PIXEL_SPLAT_X4
+#else
+#   define AVCODEC_H264_HIGH_DEPTH_H
+#   define CLIP_PIXEL(depth)\
+    static inline uint16_t av_clip_pixel_ ## depth (int p)\
+    {\
+        const int pixel_max = (1 << depth)-1;\
+        return (p & ~pixel_max) ? (-p)>>31 & pixel_max : p;\
+    }
+
+CLIP_PIXEL( 9)
+CLIP_PIXEL(10)
+#endif
+
+#if BIT_DEPTH > 8
+#   define pixel  uint16_t
+#   define pixel2 uint32_t
+#   define pixel4 uint64_t
+#   define dctcoef int32_t
+
+#   define INIT_CLIP
+#   define no_rnd_avg_pixel4 no_rnd_avg64
+#   define    rnd_avg_pixel4    rnd_avg64
+#   define AV_RN2P  AV_RN32
+#   define AV_RN4P  AV_RN64
+#   define AV_RN4PA AV_RN64A
+#   define AV_WN2P  AV_WN32
+#   define AV_WN4P  AV_WN64
+#   define AV_WN4PA AV_WN64A
+#   define PIXEL_SPLAT_X4(x) ((x)*0x0001000100010001ULL)
+#else
+#   define pixel  uint8_t
+#   define pixel2 uint16_t
+#   define pixel4 uint32_t
+#   define dctcoef int16_t
+
+#   define INIT_CLIP uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
+#   define no_rnd_avg_pixel4 no_rnd_avg32
+#   define    rnd_avg_pixel4    rnd_avg32
+#   define AV_RN2P  AV_RN16
+#   define AV_RN4P  AV_RN32
+#   define AV_RN4PA AV_RN32A
+#   define AV_WN2P  AV_WN16
+#   define AV_WN4P  AV_WN32
+#   define AV_WN4PA AV_WN32A
+#   define PIXEL_SPLAT_X4(x) ((x)*0x01010101U)
+#endif
+
+#if BIT_DEPTH == 8
+#   define av_clip_pixel(a) av_clip_uint8(a)
+#   define CLIP(a) cm[a]
+#   define FUNC(a)  a ## _8
+#   define FUNCC(a) a ## _8_c
+#elif BIT_DEPTH == 9
+#   define av_clip_pixel(a) av_clip_pixel_9(a)
+#   define CLIP(a)          av_clip_pixel_9(a)
+#   define FUNC(a)  a ## _9
+#   define FUNCC(a) a ## _9_c
+#elif BIT_DEPTH == 10
+#   define av_clip_pixel(a) av_clip_pixel_10(a)
+#   define CLIP(a)          av_clip_pixel_10(a)
+#   define FUNC(a)  a ## _10
+#   define FUNCC(a) a ## _10_c
+#endif
diff --git a/libavcodec/dsputil_template.c b/libavcodec/dsputil_template.c
index 8ca6d3e..49e34e0 100644
--- a/libavcodec/dsputil_template.c
+++ b/libavcodec/dsputil_template.c
@@ -27,7 +27,7 @@
  * DSP utils
  */
 
-#include "high_bit_depth.h"
+#include "bit_depth_template.c"
 
 static inline void FUNC(copy_block2)(uint8_t *dst, const uint8_t *src, int 
dstStride, int srcStride, int h)
 {
diff --git a/libavcodec/h264dsp_template.c b/libavcodec/h264dsp_template.c
index 91162ea..475517d 100644
--- a/libavcodec/h264dsp_template.c
+++ b/libavcodec/h264dsp_template.c
@@ -25,7 +25,7 @@
  * @author Michael Niedermayer <[email protected]>
  */
 
-#include "high_bit_depth.h"
+#include "bit_depth_template.c"
 
 #define op_scale1(x)  block[x] = av_clip_pixel( (block[x]*weight + offset) >> 
log2_denom )
 #define op_scale2(x)  dst[x] = av_clip_pixel( (src[x]*weights + dst[x]*weightd 
+ offset) >> (log2_denom+1))
diff --git a/libavcodec/h264idct_template.c b/libavcodec/h264idct_template.c
index 39c9a1c..0159206 100644
--- a/libavcodec/h264idct_template.c
+++ b/libavcodec/h264idct_template.c
@@ -25,7 +25,7 @@
  * @author Michael Niedermayer <[email protected]>
  */
 
-#include "high_bit_depth.h"
+#include "bit_depth_template.c"
 
 #ifndef AVCODEC_H264IDCT_INTERNAL_H
 #define AVCODEC_H264IDCT_INTERNAL_H
diff --git a/libavcodec/h264pred_template.c b/libavcodec/h264pred_template.c
index 1c1fe0b..e5d9155 100644
--- a/libavcodec/h264pred_template.c
+++ b/libavcodec/h264pred_template.c
@@ -26,7 +26,8 @@
  */
 
 #include "mathops.h"
-#include "high_bit_depth.h"
+
+#include "bit_depth_template.c"
 
 static void FUNCC(pred4x4_vertical)(uint8_t *_src, const uint8_t *topright, 
int _stride){
     pixel *src = (pixel*)_src;
diff --git a/libavcodec/high_bit_depth.h b/libavcodec/high_bit_depth.h
deleted file mode 100644
index c0a6eaf..0000000
--- a/libavcodec/high_bit_depth.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "dsputil.h"
-
-#ifndef BIT_DEPTH
-#define BIT_DEPTH 8
-#endif
-
-#ifdef AVCODEC_H264_HIGH_DEPTH_H
-#   undef pixel
-#   undef pixel2
-#   undef pixel4
-#   undef dctcoef
-#   undef INIT_CLIP
-#   undef no_rnd_avg_pixel4
-#   undef rnd_avg_pixel4
-#   undef AV_RN2P
-#   undef AV_RN4P
-#   undef AV_RN4PA
-#   undef AV_WN2P
-#   undef AV_WN4P
-#   undef AV_WN4PA
-#   undef CLIP
-#   undef FUNC
-#   undef FUNCC
-#   undef av_clip_pixel
-#   undef PIXEL_SPLAT_X4
-#else
-#   define AVCODEC_H264_HIGH_DEPTH_H
-#   define CLIP_PIXEL(depth)\
-    static inline uint16_t av_clip_pixel_ ## depth (int p)\
-    {\
-        const int pixel_max = (1 << depth)-1;\
-        return (p & ~pixel_max) ? (-p)>>31 & pixel_max : p;\
-    }
-
-CLIP_PIXEL( 9)
-CLIP_PIXEL(10)
-#endif
-
-#if BIT_DEPTH > 8
-#   define pixel  uint16_t
-#   define pixel2 uint32_t
-#   define pixel4 uint64_t
-#   define dctcoef int32_t
-
-#   define INIT_CLIP
-#   define no_rnd_avg_pixel4 no_rnd_avg64
-#   define    rnd_avg_pixel4    rnd_avg64
-#   define AV_RN2P  AV_RN32
-#   define AV_RN4P  AV_RN64
-#   define AV_RN4PA AV_RN64A
-#   define AV_WN2P  AV_WN32
-#   define AV_WN4P  AV_WN64
-#   define AV_WN4PA AV_WN64A
-#   define PIXEL_SPLAT_X4(x) ((x)*0x0001000100010001ULL)
-#else
-#   define pixel  uint8_t
-#   define pixel2 uint16_t
-#   define pixel4 uint32_t
-#   define dctcoef int16_t
-
-#   define INIT_CLIP uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-#   define no_rnd_avg_pixel4 no_rnd_avg32
-#   define    rnd_avg_pixel4    rnd_avg32
-#   define AV_RN2P  AV_RN16
-#   define AV_RN4P  AV_RN32
-#   define AV_RN4PA AV_RN32A
-#   define AV_WN2P  AV_WN16
-#   define AV_WN4P  AV_WN32
-#   define AV_WN4PA AV_WN32A
-#   define PIXEL_SPLAT_X4(x) ((x)*0x01010101U)
-#endif
-
-#if BIT_DEPTH == 8
-#   define av_clip_pixel(a) av_clip_uint8(a)
-#   define CLIP(a) cm[a]
-#   define FUNC(a)  a ## _8
-#   define FUNCC(a) a ## _8_c
-#elif BIT_DEPTH == 9
-#   define av_clip_pixel(a) av_clip_pixel_9(a)
-#   define CLIP(a)          av_clip_pixel_9(a)
-#   define FUNC(a)  a ## _9
-#   define FUNCC(a) a ## _9_c
-#elif BIT_DEPTH == 10
-#   define av_clip_pixel(a) av_clip_pixel_10(a)
-#   define CLIP(a)          av_clip_pixel_10(a)
-#   define FUNC(a)  a ## _10
-#   define FUNCC(a) a ## _10_c
-#endif
-- 
1.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to