[x265] [PATCH 2 of 4 RFC] cmake: introduce EXPORT_C_API build variable
Steve Borho
steve at borho.org
Fri Jun 5 20:28:03 CEST 2015
# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1433528132 18000
# Fri Jun 05 13:15:32 2015 -0500
# Node ID 899dba6c252cb75f5efa4ea5c7a575bcb65118eb
# Parent 8a269d0d0d821865cf9f0c0732c590970f330004
cmake: introduce EXPORT_C_API build variable
EXPORT_C_API (defaulting to ON) toggles whether the public API methods declared
in x265.h are exported as C functions from libx265 or whether they are declared
within the private namespace.
The internal private namespace had to be made into a compile-time
define. When EXPORT_C_API is enabled, X265_NS will be "x265" as before.
When disabled, X265_NS will be "x265_8bpp" or "x265_10bpp", based on bit
depth
This is necessary prep-work to link two distinct libx265 static
libraries together.
diff -r 8a269d0d0d82 -r 899dba6c252c source/CMakeLists.txt
--- a/source/CMakeLists.txt Fri Jun 05 11:29:35 2015 -0500
+++ b/source/CMakeLists.txt Fri Jun 05 13:15:32 2015 -0500
@@ -287,6 +287,22 @@
add_definitions(-DHIGH_BIT_DEPTH=0)
endif(HIGH_BIT_DEPTH)
+# this option can only be used when linking multiple libx265 libraries
+# together, and some alternate API access method is implemented.
+option(EXPORT_C_API "Implement public C programming interface" ON)
+mark_as_advanced(EXPORT_C_API)
+if(EXPORT_C_API)
+ set(X265_NS x265)
+ add_definitions(-DEXPORT_C_API=1)
+elseif(HIGH_BIT_DEPTH)
+ set(X265_NS x265_10bpp)
+ add_definitions(-DEXPORT_C_API=0)
+else()
+ set(X265_NS x265_8bpp)
+ add_definitions(-DEXPORT_C_API=0)
+endif()
+add_definitions(-DX265_NS=${X265_NS})
+
option(WARNINGS_AS_ERRORS "Stop compiles on first warning" OFF)
if(WARNINGS_AS_ERRORS)
if(GCC)
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/bitstream.cpp
--- a/source/common/bitstream.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/bitstream.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -1,7 +1,7 @@
#include "common.h"
#include "bitstream.h"
-using namespace x265;
+using namespace X265_NS;
#if defined(_MSC_VER)
#pragma warning(disable: 4244)
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/bitstream.h
--- a/source/common/bitstream.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/bitstream.h Fri Jun 05 13:15:32 2015 -0500
@@ -24,7 +24,7 @@
#ifndef X265_BITSTREAM_H
#define X265_BITSTREAM_H 1
-namespace x265 {
+namespace X265_NS {
// private namespace
class BitInterface
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/common.cpp
--- a/source/common/common.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/common.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -50,7 +50,7 @@
#endif
}
-using namespace x265;
+using namespace X265_NS;
#define X265_ALIGNBYTES 32
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/common.h
--- a/source/common/common.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/common.h Fri Jun 05 13:15:32 2015 -0500
@@ -313,7 +313,7 @@
#define CHROMA_V_SHIFT(x) (x == X265_CSP_I420)
#define X265_MAX_PRED_MODE_PER_CTU 85 * 2 * 8
-namespace x265 {
+namespace X265_NS {
enum { SAO_NUM_OFFSET = 4 };
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/constants.cpp
--- a/source/common/constants.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/constants.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -25,7 +25,7 @@
#include "constants.h"
#include "threading.h"
-namespace x265 {
+namespace X265_NS {
#if HIGH_BIT_DEPTH
// lambda = pow(2, (double)q / 6 - 2) * (1 << (X265_DEPTH - 8));
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/constants.h
--- a/source/common/constants.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/constants.h Fri Jun 05 13:15:32 2015 -0500
@@ -26,7 +26,7 @@
#include "common.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
extern int g_ctuSizeConfigured;
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/contexts.h
--- a/source/common/contexts.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/contexts.h Fri Jun 05 13:15:32 2015 -0500
@@ -104,7 +104,7 @@
extern "C" const uint32_t g_entropyStateBits[128];
-namespace x265 {
+namespace X265_NS {
// private namespace
extern const uint32_t g_entropyBits[128];
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/cpu.cpp
--- a/source/common/cpu.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/cpu.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -57,7 +57,7 @@
#endif // if X265_ARCH_ARM
-namespace x265 {
+namespace X265_NS {
const cpu_name_t cpu_names[] =
{
#if X265_ARCH_X86
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/cpu.h
--- a/source/common/cpu.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/cpu.h Fri Jun 05 13:15:32 2015 -0500
@@ -44,7 +44,7 @@
#define x265_emms() x265_cpu_emms()
#endif
-namespace x265 {
+namespace X265_NS {
uint32_t cpu_detect(void);
struct cpu_name_t
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/cudata.cpp
--- a/source/common/cudata.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/cudata.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -28,7 +28,7 @@
#include "mv.h"
#include "cudata.h"
-using namespace x265;
+using namespace X265_NS;
namespace {
// file private namespace
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/cudata.h
--- a/source/common/cudata.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/cudata.h Fri Jun 05 13:15:32 2015 -0500
@@ -28,7 +28,7 @@
#include "slice.h"
#include "mv.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
class FrameData;
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/dct.cpp
--- a/source/common/dct.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/dct.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -31,7 +31,7 @@
#include "primitives.h"
#include "contexts.h" // costCoeffNxN_c
-using namespace x265;
+using namespace X265_NS;
#if _MSC_VER
#pragma warning(disable: 4127) // conditional expression is constant, typical for templated functions
@@ -875,7 +875,7 @@
} // closing - anonymous file-static namespace
-namespace x265 {
+namespace X265_NS {
// x265 private namespace
void setupDCTPrimitives_c(EncoderPrimitives& p)
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/deblock.cpp
--- a/source/common/deblock.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/deblock.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -28,7 +28,7 @@
#include "slice.h"
#include "mv.h"
-using namespace x265;
+using namespace X265_NS;
#define DEBLOCK_SMALLEST_BLOCK 8
#define DEFAULT_INTRA_TC_OFFSET 2
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/deblock.h
--- a/source/common/deblock.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/deblock.h Fri Jun 05 13:15:32 2015 -0500
@@ -26,7 +26,7 @@
#include "common.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
class CUData;
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/frame.cpp
--- a/source/common/frame.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/frame.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -26,7 +26,7 @@
#include "picyuv.h"
#include "framedata.h"
-using namespace x265;
+using namespace X265_NS;
Frame::Frame()
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/frame.h
--- a/source/common/frame.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/frame.h Fri Jun 05 13:15:32 2015 -0500
@@ -28,7 +28,7 @@
#include "lowres.h"
#include "threading.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
class FrameData;
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/framedata.cpp
--- a/source/common/framedata.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/framedata.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -24,7 +24,7 @@
#include "framedata.h"
#include "picyuv.h"
-using namespace x265;
+using namespace X265_NS;
FrameData::FrameData()
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/framedata.h
--- a/source/common/framedata.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/framedata.h Fri Jun 05 13:15:32 2015 -0500
@@ -28,7 +28,7 @@
#include "slice.h"
#include "cudata.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
class PicYuv;
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/intrapred.cpp
--- a/source/common/intrapred.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/intrapred.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -24,7 +24,7 @@
#include "common.h"
#include "primitives.h"
-using namespace x265;
+using namespace X265_NS;
namespace {
@@ -234,7 +234,7 @@
}
}
-namespace x265 {
+namespace X265_NS {
// x265 private namespace
void setupIntraPrimitives_c(EncoderPrimitives& p)
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/ipfilter.cpp
--- a/source/common/ipfilter.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/ipfilter.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -27,7 +27,7 @@
#include "primitives.h"
#include "x265.h"
-using namespace x265;
+using namespace X265_NS;
#if _MSC_VER
#pragma warning(disable: 4127) // conditional expression is constant, typical for templated functions
@@ -369,7 +369,7 @@
}
}
-namespace x265 {
+namespace X265_NS {
// x265 private namespace
#define CHROMA_420(W, H) \
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/loopfilter.cpp
--- a/source/common/loopfilter.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/loopfilter.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -138,7 +138,7 @@
}
}
-namespace x265 {
+namespace X265_NS {
void setupLoopFilterPrimitives_c(EncoderPrimitives &p)
{
p.saoCuOrgE0 = processSaoCUE0;
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/lowres.cpp
--- a/source/common/lowres.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/lowres.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -25,7 +25,7 @@
#include "lowres.h"
#include "mv.h"
-using namespace x265;
+using namespace X265_NS;
bool Lowres::create(PicYuv *origPic, int _bframes, bool bAQEnabled)
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/lowres.h
--- a/source/common/lowres.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/lowres.h Fri Jun 05 13:15:32 2015 -0500
@@ -29,7 +29,7 @@
#include "picyuv.h"
#include "mv.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
struct ReferencePlanes
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/md5.cpp
--- a/source/common/md5.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/md5.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -25,7 +25,7 @@
#include "common.h"
#include "md5.h"
-namespace x265 {
+namespace X265_NS {
// private x265 namespace
#ifndef ARCH_BIG_ENDIAN
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/md5.h
--- a/source/common/md5.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/md5.h Fri Jun 05 13:15:32 2015 -0500
@@ -27,7 +27,7 @@
#include "common.h"
-namespace x265 {
+namespace X265_NS {
//private x265 namespace
typedef struct MD5Context
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/mv.h
--- a/source/common/mv.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/mv.h Fri Jun 05 13:15:32 2015 -0500
@@ -27,7 +27,7 @@
#include "common.h"
#include "primitives.h"
-namespace x265 {
+namespace X265_NS {
// private x265 namespace
#if _MSC_VER
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/param.cpp
--- a/source/common/param.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/param.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -76,27 +76,35 @@
#endif // if !defined(HAVE_STRTOK_R)
-using namespace x265;
+#if EXPORT_C_API
-extern "C"
+/* these functions are exported as C functions (default) */
+using namespace X265_NS;
+extern "C" {
+
+#else
+
+/* these functions exist within private namespace (multilib) */
+namespace X265_NS {
+
+#endif
+
x265_param *x265_param_alloc()
{
return (x265_param*)x265_malloc(sizeof(x265_param));
}
-extern "C"
void x265_param_free(x265_param* p)
{
x265_free(p);
}
-extern "C"
void x265_param_default(x265_param* param)
{
memset(param, 0, sizeof(x265_param));
/* Applying default values to all elements in the param structure */
- param->cpuid = x265::cpu_detect();
+ param->cpuid = X265_NS::cpu_detect();
param->bEnableWavefront = 1;
param->frameNumThreads = 0;
@@ -235,10 +243,13 @@
param->vui.defDispWinBottomOffset = 0;
}
-extern "C"
int x265_param_default_preset(x265_param* param, const char* preset, const char* tune)
{
- x265_param_default(param);
+#if EXPORT_C_API
+ ::x265_param_default(param);
+#else
+ X265_NS::x265_param_default(param);
+#endif
if (preset)
{
@@ -486,7 +497,6 @@
#define atof(str) x265_atof(str, bError)
#define atobool(str) (bNameWasBool = true, x265_atobool(str, bError))
-extern "C"
int x265_param_parse(x265_param* p, const char* name, const char* value)
{
bool bError = false;
@@ -866,7 +876,9 @@
return bError ? X265_PARAM_BAD_VALUE : 0;
}
-namespace x265 {
+} /* end extern "C" or namespace */
+
+namespace X265_NS {
// internal encoder functions
int x265_atoi(const char* str, bool& bError)
@@ -895,7 +907,7 @@
if (isdigit(value[0]))
cpu = x265_atoi(value, bError);
else
- cpu = !strcmp(value, "auto") || x265_atobool(value, bError) ? x265::cpu_detect() : 0;
+ cpu = !strcmp(value, "auto") || x265_atobool(value, bError) ? X265_NS::cpu_detect() : 0;
if (bError)
{
@@ -906,12 +918,12 @@
for (init = buf; (tok = strtok_r(init, ",", &saveptr)); init = NULL)
{
int i;
- for (i = 0; x265::cpu_names[i].flags && strcasecmp(tok, x265::cpu_names[i].name); i++)
+ for (i = 0; X265_NS::cpu_names[i].flags && strcasecmp(tok, X265_NS::cpu_names[i].name); i++)
{
}
- cpu |= x265::cpu_names[i].flags;
- if (!x265::cpu_names[i].flags)
+ cpu |= X265_NS::cpu_names[i].flags;
+ if (!X265_NS::cpu_names[i].flags)
bError = 1;
}
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/param.h
--- a/source/common/param.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/param.h Fri Jun 05 13:15:32 2015 -0500
@@ -24,7 +24,8 @@
#ifndef X265_PARAM_H
#define X265_PARAM_H
-namespace x265 {
+namespace X265_NS {
+
int x265_check_params(x265_param *param);
int x265_set_globals(x265_param *param);
void x265_print_params(x265_param *param);
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/piclist.cpp
--- a/source/common/piclist.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/piclist.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -25,7 +25,7 @@
#include "piclist.h"
#include "frame.h"
-using namespace x265;
+using namespace X265_NS;
void PicList::pushFront(Frame& curFrame)
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/piclist.h
--- a/source/common/piclist.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/piclist.h Fri Jun 05 13:15:32 2015 -0500
@@ -24,9 +24,10 @@
#ifndef X265_PICLIST_H
#define X265_PICLIST_H
-#include <cstdlib>
+#include "common.h"
-namespace x265 {
+namespace X265_NS {
+
class Frame;
class PicList
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/picyuv.cpp
--- a/source/common/picyuv.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/picyuv.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -26,7 +26,7 @@
#include "slice.h"
#include "primitives.h"
-using namespace x265;
+using namespace X265_NS;
PicYuv::PicYuv()
{
@@ -259,7 +259,7 @@
}
}
-namespace x265 {
+namespace X265_NS {
template<uint32_t OUTPUT_BITDEPTH_DIV8>
static void md5_block(MD5Context& md5, const pixel* plane, uint32_t n)
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/picyuv.h
--- a/source/common/picyuv.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/picyuv.h Fri Jun 05 13:15:32 2015 -0500
@@ -28,7 +28,7 @@
#include "md5.h"
#include "x265.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
class ShortYuv;
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/pixel.cpp
--- a/source/common/pixel.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/pixel.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -30,7 +30,7 @@
#include <cstdlib> // abs()
-using namespace x265;
+using namespace X265_NS;
namespace {
// place functions in anonymous namespace (file static)
@@ -962,7 +962,7 @@
}
} // end anonymous namespace
-namespace x265 {
+namespace X265_NS {
// x265 private namespace
/* Extend the edges of a picture so that it may safely be used for motion
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/predict.cpp
--- a/source/common/predict.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/predict.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -28,7 +28,7 @@
#include "predict.h"
#include "primitives.h"
-using namespace x265;
+using namespace X265_NS;
#if _MSC_VER
#pragma warning(disable: 4127) // conditional expression is constant
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/predict.h
--- a/source/common/predict.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/predict.h Fri Jun 05 13:15:32 2015 -0500
@@ -30,7 +30,7 @@
#include "shortyuv.h"
#include "yuv.h"
-namespace x265 {
+namespace X265_NS {
class CUData;
class Slice;
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/primitives.cpp
--- a/source/common/primitives.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/primitives.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -24,7 +24,7 @@
#include "common.h"
#include "primitives.h"
-namespace x265 {
+namespace X265_NS {
// x265 private namespace
extern const uint8_t lumaPartitionMapTable[] =
@@ -188,14 +188,14 @@
p.chroma[X265_CSP_I422].cu[BLOCK_422_2x4].sse_pp = NULL;
}
}
-using namespace x265;
+using namespace X265_NS;
/* cpuid >= 0 - force CPU type
* cpuid < 0 - auto-detect if uninitialized */
void x265_setup_primitives(x265_param *param, int cpuid)
{
if (cpuid < 0)
- cpuid = x265::cpu_detect();
+ cpuid = X265_NS::cpu_detect();
// initialize global variables
if (!primitives.pu[0].sad)
@@ -223,26 +223,26 @@
char buf[1000];
char *p = buf + sprintf(buf, "using cpu capabilities:");
char *none = p;
- for (int i = 0; x265::cpu_names[i].flags; i++)
+ for (int i = 0; X265_NS::cpu_names[i].flags; i++)
{
- if (!strcmp(x265::cpu_names[i].name, "SSE")
+ if (!strcmp(X265_NS::cpu_names[i].name, "SSE")
&& (cpuid & X265_CPU_SSE2))
continue;
- if (!strcmp(x265::cpu_names[i].name, "SSE2")
+ if (!strcmp(X265_NS::cpu_names[i].name, "SSE2")
&& (cpuid & (X265_CPU_SSE2_IS_FAST | X265_CPU_SSE2_IS_SLOW)))
continue;
- if (!strcmp(x265::cpu_names[i].name, "SSE3")
+ if (!strcmp(X265_NS::cpu_names[i].name, "SSE3")
&& (cpuid & X265_CPU_SSSE3 || !(cpuid & X265_CPU_CACHELINE_64)))
continue;
- if (!strcmp(x265::cpu_names[i].name, "SSE4.1")
+ if (!strcmp(X265_NS::cpu_names[i].name, "SSE4.1")
&& (cpuid & X265_CPU_SSE42))
continue;
- if (!strcmp(x265::cpu_names[i].name, "BMI1")
+ if (!strcmp(X265_NS::cpu_names[i].name, "BMI1")
&& (cpuid & X265_CPU_BMI2))
continue;
- if ((cpuid & x265::cpu_names[i].flags) == x265::cpu_names[i].flags
- && (!i || x265::cpu_names[i].flags != x265::cpu_names[i - 1].flags))
- p += sprintf(p, " %s", x265::cpu_names[i].name);
+ if ((cpuid & X265_NS::cpu_names[i].flags) == X265_NS::cpu_names[i].flags
+ && (!i || X265_NS::cpu_names[i].flags != X265_NS::cpu_names[i - 1].flags))
+ p += sprintf(p, " %s", X265_NS::cpu_names[i].name);
}
if (p == none)
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/primitives.h
--- a/source/common/primitives.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/primitives.h Fri Jun 05 13:15:32 2015 -0500
@@ -33,7 +33,7 @@
#include "common.h"
#include "cpu.h"
-namespace x265 {
+namespace X265_NS {
// x265 private namespace
enum LumaPU
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/quant.cpp
--- a/source/common/quant.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/quant.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -30,7 +30,7 @@
#include "cudata.h"
#include "contexts.h"
-using namespace x265;
+using namespace X265_NS;
#define SIGN(x,y) ((x^(y >> 31))-(y >> 31))
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/quant.h
--- a/source/common/quant.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/quant.h Fri Jun 05 13:15:32 2015 -0500
@@ -28,7 +28,7 @@
#include "scalinglist.h"
#include "contexts.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
class CUData;
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/scalinglist.cpp
--- a/source/common/scalinglist.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/scalinglist.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -114,7 +114,7 @@
}
-namespace x265 {
+namespace X265_NS {
// private namespace
const int ScalingList::s_numCoefPerSize[NUM_SIZES] = { 16, 64, 256, 1024 };
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/scalinglist.h
--- a/source/common/scalinglist.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/scalinglist.h Fri Jun 05 13:15:32 2015 -0500
@@ -26,7 +26,7 @@
#include "common.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
class ScalingList
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/shortyuv.cpp
--- a/source/common/shortyuv.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/shortyuv.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -28,7 +28,7 @@
#include "x265.h"
-using namespace x265;
+using namespace X265_NS;
ShortYuv::ShortYuv()
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/shortyuv.h
--- a/source/common/shortyuv.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/shortyuv.h Fri Jun 05 13:15:32 2015 -0500
@@ -28,7 +28,7 @@
#include "common.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
class Yuv;
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/slice.cpp
--- a/source/common/slice.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/slice.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -27,7 +27,7 @@
#include "picyuv.h"
#include "slice.h"
-using namespace x265;
+using namespace X265_NS;
void Slice::setRefPicList(PicList& picList)
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/slice.h
--- a/source/common/slice.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/slice.h Fri Jun 05 13:15:32 2015 -0500
@@ -26,7 +26,7 @@
#include "common.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
class Frame;
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/threading.cpp
--- a/source/common/threading.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/threading.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -23,7 +23,7 @@
#include "threading.h"
-namespace x265 {
+namespace X265_NS {
// x265 private namespace
#if X265_ARCH_X86 && !defined(X86_64) && ENABLE_ASSEMBLY && defined(__GNUC__)
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/threading.h
--- a/source/common/threading.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/threading.h Fri Jun 05 13:15:32 2015 -0500
@@ -71,7 +71,7 @@
#endif // ifdef __GNUC__
-namespace x265 {
+namespace X265_NS {
// x265 private namespace
#ifdef _WIN32
@@ -463,6 +463,6 @@
void stop();
};
-} // end namespace x265
+} // end namespace X265_NS
#endif // ifndef X265_THREADING_H
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/threadpool.cpp
--- a/source/common/threadpool.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/threadpool.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -60,7 +60,7 @@
#include <numa.h>
#endif
-namespace x265 {
+namespace X265_NS {
// x265 private namespace
class WorkerThread : public Thread
@@ -480,4 +480,4 @@
#endif
}
-} // end namespace x265
+} // end namespace X265_NS
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/threadpool.h
--- a/source/common/threadpool.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/threadpool.h Fri Jun 05 13:15:32 2015 -0500
@@ -27,7 +27,7 @@
#include "common.h"
#include "threading.h"
-namespace x265 {
+namespace X265_NS {
// x265 private namespace
class ThreadPool;
@@ -167,6 +167,6 @@
virtual void processTasks(int workerThreadId) = 0;
};
-} // end namespace x265
+} // end namespace X265_NS
#endif // ifndef X265_THREADPOOL_H
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/vec/dct-sse3.cpp
--- a/source/common/vec/dct-sse3.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/vec/dct-sse3.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -33,7 +33,7 @@
#include <xmmintrin.h> // SSE
#include <pmmintrin.h> // SSE3
-using namespace x265;
+using namespace X265_NS;
namespace {
#define SHIFT1 7
@@ -1420,7 +1420,7 @@
}
-namespace x265 {
+namespace X265_NS {
void setupIntrinsicDCT_sse3(EncoderPrimitives &p)
{
/* Note: We have AVX2 assembly for these functions, but since AVX2 is still
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/vec/dct-sse41.cpp
--- a/source/common/vec/dct-sse41.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/vec/dct-sse41.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -33,7 +33,7 @@
#include <xmmintrin.h> // SSE
#include <smmintrin.h> // SSE4.1
-using namespace x265;
+using namespace X265_NS;
namespace {
void dequant_scaling(const int16_t* quantCoef, const int32_t *deQuantCoef, int16_t* coef, int num, int per, int shift)
@@ -102,7 +102,7 @@
}
}
-namespace x265 {
+namespace X265_NS {
void setupIntrinsicDCT_sse41(EncoderPrimitives &p)
{
p.dequant_scaling = dequant_scaling;
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/vec/dct-ssse3.cpp
--- a/source/common/vec/dct-ssse3.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/vec/dct-ssse3.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -34,7 +34,7 @@
#include <pmmintrin.h> // SSE3
#include <tmmintrin.h> // SSSE3
-using namespace x265;
+using namespace X265_NS;
namespace {
ALIGN_VAR_32(static const int16_t, tab_dct_8[][8]) =
@@ -1132,7 +1132,7 @@
}
}
-namespace x265 {
+namespace X265_NS {
void setupIntrinsicDCT_ssse3(EncoderPrimitives &p)
{
/* Note: We have AVX2 assembly for these two functions, but since AVX2 is
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/vec/vec-primitives.cpp
--- a/source/common/vec/vec-primitives.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/vec/vec-primitives.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -50,7 +50,7 @@
#endif // compiler checks
#endif // if X265_ARCH_X86
-namespace x265 {
+namespace X265_NS {
// private x265 namespace
void setupIntrinsicDCT_sse3(EncoderPrimitives&);
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/wavefront.cpp
--- a/source/common/wavefront.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/wavefront.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -26,7 +26,7 @@
#include "wavefront.h"
#include "common.h"
-namespace x265 {
+namespace X265_NS {
// x265 private namespace
bool WaveFront::init(int numRows)
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/wavefront.h
--- a/source/common/wavefront.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/wavefront.h Fri Jun 05 13:15:32 2015 -0500
@@ -27,7 +27,7 @@
#include "common.h"
#include "threadpool.h"
-namespace x265 {
+namespace X265_NS {
// x265 private namespace
// Generic wave-front scheduler, manages busy-state of CU rows as a priority
@@ -92,6 +92,6 @@
// derived classes.
virtual void processRow(int row, int threadId) = 0;
};
-} // end namespace x265
+} // end namespace X265_NS
#endif // ifndef X265_WAVEFRONT_H
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/winxp.cpp
--- a/source/common/winxp.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/winxp.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -25,7 +25,7 @@
#if defined(_WIN32) && (_WIN32_WINNT < 0x0600) // _WIN32_WINNT_VISTA
-namespace x265 {
+namespace X265_NS {
/* Mimic CONDITION_VARIABLE functions only supported on Vista+ */
int WINAPI cond_init(ConditionVariable *cond)
@@ -121,7 +121,7 @@
DeleteCriticalSection(&cond->broadcastMutex);
DeleteCriticalSection(&cond->waiterCountMutex);
}
-} // namespace x265
+} // namespace X265_NS
#elif defined(_MSC_VER)
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/winxp.h
--- a/source/common/winxp.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/winxp.h Fri Jun 05 13:15:32 2015 -0500
@@ -30,7 +30,7 @@
#include <intrin.h> // _InterlockedCompareExchange64
#endif
-namespace x265 {
+namespace X265_NS {
/* non-native condition variable */
typedef struct
{
@@ -56,7 +56,7 @@
#define WakeAllConditionVariable x265::cond_broadcast
#define XP_CONDITION_VAR_FREE x265::cond_destroy
-} // namespace x265
+} // namespace X265_NS
#else // if defined(_WIN32) && (_WIN32_WINNT < 0x0600)
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/x86/asm-primitives.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -778,7 +778,7 @@
ALL_CHROMA_444_PU(filter_hpp, interp_4tap_horiz_pp, cpu); \
ALL_CHROMA_444_PU(filter_hps, interp_4tap_horiz_ps, cpu);
-namespace x265 {
+namespace X265_NS {
// private x265 namespace
template<int size>
@@ -788,8 +788,8 @@
const int filterSize = NTAPS_LUMA;
const int halfFilterSize = filterSize >> 1;
- x265::primitives.pu[size].luma_hps(src, srcStride, immed, MAX_CU_SIZE, idxX, 1);
- x265::primitives.pu[size].luma_vsp(immed + (halfFilterSize - 1) * MAX_CU_SIZE, MAX_CU_SIZE, dst, dstStride, idxY);
+ primitives.pu[size].luma_hps(src, srcStride, immed, MAX_CU_SIZE, idxX, 1);
+ primitives.pu[size].luma_vsp(immed + (halfFilterSize - 1) * MAX_CU_SIZE, MAX_CU_SIZE, dst, dstStride, idxY);
}
#if HIGH_BIT_DEPTH
@@ -3123,7 +3123,7 @@
}
#endif // if HIGH_BIT_DEPTH
-} // namespace x265
+} // namespace X265_NS
extern "C" {
#ifdef __INTEL_COMPILER
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/yuv.cpp
--- a/source/common/yuv.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/yuv.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -28,7 +28,7 @@
#include "picyuv.h"
#include "primitives.h"
-using namespace x265;
+using namespace X265_NS;
Yuv::Yuv()
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/common/yuv.h
--- a/source/common/yuv.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/common/yuv.h Fri Jun 05 13:15:32 2015 -0500
@@ -27,7 +27,7 @@
#include "common.h"
#include "primitives.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
class ShortYuv;
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/analysis.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -33,7 +33,7 @@
#include "rdcost.h"
#include "encoder.h"
-using namespace x265;
+using namespace X265_NS;
/* An explanation of rate distortion levels (--rd-level)
*
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/analysis.h
--- a/source/encoder/analysis.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/analysis.h Fri Jun 05 13:15:32 2015 -0500
@@ -35,7 +35,7 @@
#include "entropy.h"
#include "search.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
class Entropy;
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/api.cpp
--- a/source/encoder/api.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/api.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -31,9 +31,19 @@
#include "nal.h"
#include "bitcost.h"
-using namespace x265;
+#if EXPORT_C_API
-extern "C"
+/* these functions are exported as C functions (default) */
+using namespace X265_NS;
+extern "C" {
+
+#else
+
+/* these functions exist within private namespace (multilib) */
+namespace X265_NS {
+
+#endif
+
x265_encoder *x265_encoder_open(x265_param *p)
{
if (!p)
@@ -92,7 +102,6 @@
return NULL;
}
-extern "C"
int x265_encoder_headers(x265_encoder *enc, x265_nal **pp_nal, uint32_t *pi_nal)
{
if (pp_nal && enc)
@@ -109,7 +118,6 @@
return -1;
}
-extern "C"
void x265_encoder_parameters(x265_encoder *enc, x265_param *out)
{
if (enc && out)
@@ -119,7 +127,6 @@
}
}
-extern "C"
int x265_encoder_reconfig(x265_encoder* enc, x265_param* param_in)
{
if (!enc || !param_in)
@@ -140,7 +147,6 @@
return ret;
}
-extern "C"
int x265_encoder_encode(x265_encoder *enc, x265_nal **pp_nal, uint32_t *pi_nal, x265_picture *pic_in, x265_picture *pic_out)
{
if (!enc)
@@ -175,7 +181,6 @@
return numEncoded;
}
-extern "C"
void x265_encoder_get_stats(x265_encoder *enc, x265_stats *outputStats, uint32_t statsSizeBytes)
{
if (enc && outputStats)
@@ -185,7 +190,6 @@
}
}
-extern "C"
void x265_encoder_log(x265_encoder* enc, int argc, char **argv)
{
if (enc)
@@ -195,7 +199,6 @@
}
}
-extern "C"
void x265_encoder_close(x265_encoder *enc)
{
if (enc)
@@ -210,7 +213,6 @@
}
}
-extern "C"
void x265_cleanup(void)
{
if (!g_ctuSizeConfigured)
@@ -220,13 +222,11 @@
}
}
-extern "C"
x265_picture *x265_picture_alloc()
{
return (x265_picture*)x265_malloc(sizeof(x265_picture));
}
-extern "C"
void x265_picture_init(x265_param *param, x265_picture *pic)
{
memset(pic, 0, sizeof(x265_picture));
@@ -245,7 +245,6 @@
}
}
-extern "C"
void x265_picture_free(x265_picture *p)
{
return x265_free(p);
@@ -301,7 +300,6 @@
#define ext ".so"
#endif
-extern "C"
const x265_api* x265_api_get(int bitDepth)
{
if (bitDepth && bitDepth != X265_DEPTH)
@@ -413,3 +411,5 @@
if (err) *err = X265_API_QUERY_ERR_NONE;
return &libapi;
}
+
+} /* end namespace or extern "C" */
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/bitcost.cpp
--- a/source/encoder/bitcost.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/bitcost.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -25,7 +25,7 @@
#include "primitives.h"
#include "bitcost.h"
-using namespace x265;
+using namespace X265_NS;
void BitCost::setQP(unsigned int qp)
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/bitcost.h
--- a/source/encoder/bitcost.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/bitcost.h Fri Jun 05 13:15:32 2015 -0500
@@ -28,7 +28,7 @@
#include "threading.h"
#include "mv.h"
-namespace x265 {
+namespace X265_NS {
// private x265 namespace
class BitCost
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/dpb.cpp
--- a/source/encoder/dpb.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/dpb.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -29,7 +29,7 @@
#include "dpb.h"
-using namespace x265;
+using namespace X265_NS;
DPB::~DPB()
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/dpb.h
--- a/source/encoder/dpb.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/dpb.h Fri Jun 05 13:15:32 2015 -0500
@@ -26,7 +26,7 @@
#include "piclist.h"
-namespace x265 {
+namespace X265_NS {
// private namespace for x265
class Frame;
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/encoder.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -39,7 +39,7 @@
#include "x265.h"
-namespace x265 {
+namespace X265_NS {
const char g_sliceTypeToChar[] = {'B', 'P', 'I'};
}
@@ -53,7 +53,7 @@
static const char* defaultAnalysisFileName = "x265_analysis.dat";
-using namespace x265;
+using namespace X265_NS;
Encoder::Encoder()
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/encoder.h
--- a/source/encoder/encoder.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/encoder.h Fri Jun 05 13:15:32 2015 -0500
@@ -32,7 +32,7 @@
struct x265_encoder {};
-namespace x265 {
+namespace X265_NS {
// private namespace
extern const char g_sliceTypeToChar[3];
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/entropy.cpp
--- a/source/encoder/entropy.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/entropy.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -35,7 +35,7 @@
#define CU_DQP_EG_k 0 // exp-golomb order
#define START_VALUE 8 // start value for dpcm mode
-namespace x265 {
+namespace X265_NS {
Entropy::Entropy()
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/entropy.h
--- a/source/encoder/entropy.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/entropy.h Fri Jun 05 13:15:32 2015 -0500
@@ -31,7 +31,7 @@
#include "contexts.h"
#include "slice.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
struct SaoCtuParam;
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/frameencoder.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -35,7 +35,7 @@
#include "slicetype.h"
#include "nal.h"
-namespace x265 {
+namespace X265_NS {
void weightAnalyse(Slice& slice, Frame& frame, x265_param& param);
FrameEncoder::FrameEncoder()
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/frameencoder.h
--- a/source/encoder/frameencoder.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/frameencoder.h Fri Jun 05 13:15:32 2015 -0500
@@ -41,7 +41,7 @@
#include "reference.h"
#include "nal.h"
-namespace x265 {
+namespace X265_NS {
// private x265 namespace
class ThreadPool;
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/framefilter.cpp
--- a/source/encoder/framefilter.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/framefilter.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -30,7 +30,7 @@
#include "frameencoder.h"
#include "wavefront.h"
-using namespace x265;
+using namespace X265_NS;
static uint64_t computeSSD(pixel *fenc, pixel *rec, intptr_t stride, uint32_t width, uint32_t height);
static float calculateSSIM(pixel *pix1, intptr_t stride1, pixel *pix2, intptr_t stride2, uint32_t width, uint32_t height, void *buf, uint32_t& cnt);
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/framefilter.h
--- a/source/encoder/framefilter.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/framefilter.h Fri Jun 05 13:15:32 2015 -0500
@@ -30,7 +30,7 @@
#include "deblock.h"
#include "sao.h"
-namespace x265 {
+namespace X265_NS {
// private x265 namespace
class Encoder;
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/level.cpp
--- a/source/encoder/level.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/level.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -25,7 +25,7 @@
#include "slice.h"
#include "level.h"
-namespace x265 {
+namespace X265_NS {
typedef struct
{
uint32_t maxLumaSamples;
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/level.h
--- a/source/encoder/level.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/level.h Fri Jun 05 13:15:32 2015 -0500
@@ -27,7 +27,7 @@
#include "common.h"
#include "x265.h"
-namespace x265 {
+namespace X265_NS {
// encoder private namespace
struct VPS;
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/motion.cpp
--- a/source/encoder/motion.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/motion.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -31,7 +31,7 @@
#pragma warning(disable: 4127) // conditional expression is constant (macros use this construct)
#endif
-using namespace x265;
+using namespace X265_NS;
namespace {
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/motion.h
--- a/source/encoder/motion.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/motion.h Fri Jun 05 13:15:32 2015 -0500
@@ -30,7 +30,7 @@
#include "bitcost.h"
#include "yuv.h"
-namespace x265 {
+namespace X265_NS {
// private x265 namespace
class MotionEstimate : public BitCost
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/nal.cpp
--- a/source/encoder/nal.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/nal.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -25,7 +25,7 @@
#include "bitstream.h"
#include "nal.h"
-using namespace x265;
+using namespace X265_NS;
NALList::NALList()
: m_numNal(0)
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/nal.h
--- a/source/encoder/nal.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/nal.h Fri Jun 05 13:15:32 2015 -0500
@@ -27,7 +27,7 @@
#include "common.h"
#include "x265.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
class Bitstream;
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/ratecontrol.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -37,7 +37,7 @@
#define BR_SHIFT 6
#define CPB_SHIFT 4
-using namespace x265;
+using namespace X265_NS;
/* Amortize the partial cost of I frames over the next N frames */
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/ratecontrol.h
--- a/source/encoder/ratecontrol.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/ratecontrol.h Fri Jun 05 13:15:32 2015 -0500
@@ -29,7 +29,7 @@
#include "common.h"
#include "sei.h"
-namespace x265 {
+namespace X265_NS {
// encoder namespace
class Encoder;
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/rdcost.h
--- a/source/encoder/rdcost.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/rdcost.h Fri Jun 05 13:15:32 2015 -0500
@@ -27,7 +27,7 @@
#include "common.h"
#include "slice.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
class RDCost
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/reference.cpp
--- a/source/encoder/reference.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/reference.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -29,7 +29,7 @@
#include "reference.h"
-using namespace x265;
+using namespace X265_NS;
MotionReference::MotionReference()
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/reference.h
--- a/source/encoder/reference.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/reference.h Fri Jun 05 13:15:32 2015 -0500
@@ -29,7 +29,7 @@
#include "lowres.h"
#include "mv.h"
-namespace x265 {
+namespace X265_NS {
// private x265 namespace
struct WeightParam;
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/sao.cpp
--- a/source/encoder/sao.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/sao.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -60,7 +60,7 @@
} // end anonymous namespace
-namespace x265 {
+namespace X265_NS {
const uint32_t SAO::s_eoTable[NUM_EDGETYPE] =
{
@@ -1613,7 +1613,7 @@
}
}
-// NOTE: must put in namespace x265 since we need class SAO
+// NOTE: must put in namespace X265_NS since we need class SAO
void saoCuStatsE2_c(const pixel *fenc, const pixel *rec, intptr_t stride, int8_t *upBuff1, int8_t *upBufft, int endX, int endY, int32_t *stats, int32_t *count)
{
X265_CHECK(endX < MAX_CU_SIZE, "endX check failure\n");
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/sao.h
--- a/source/encoder/sao.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/sao.h Fri Jun 05 13:15:32 2015 -0500
@@ -30,7 +30,7 @@
#include "frame.h"
#include "entropy.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
enum SAOTypeLen
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/search.cpp
--- a/source/encoder/search.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/search.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -33,7 +33,7 @@
#include "analysis.h" // TLD
#include "framedata.h"
-using namespace x265;
+using namespace X265_NS;
#if _MSC_VER
#pragma warning(disable: 4800) // 'uint8_t' : forcing value to bool 'true' or 'false' (performance warning)
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/search.h
--- a/source/encoder/search.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/search.h Fri Jun 05 13:15:32 2015 -0500
@@ -48,7 +48,7 @@
#define ProfileCounter(cu, count)
#endif
-namespace x265 {
+namespace X265_NS {
// private namespace
class Entropy;
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/sei.cpp
--- a/source/encoder/sei.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/sei.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -26,7 +26,7 @@
#include "slice.h"
#include "sei.h"
-using namespace x265;
+using namespace X265_NS;
/* x265's identifying GUID */
const uint8_t SEIuserDataUnregistered::m_uuid_iso_iec_11578[16] = {
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/sei.h
--- a/source/encoder/sei.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/sei.h Fri Jun 05 13:15:32 2015 -0500
@@ -28,7 +28,7 @@
#include "bitstream.h"
#include "slice.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
class SEI : public SyntaxElementWriter
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/slicetype.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -40,7 +40,7 @@
#define ProfileLookaheadTime(elapsed, count)
#endif
-using namespace x265;
+using namespace X265_NS;
namespace {
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/slicetype.h
--- a/source/encoder/slicetype.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/slicetype.h Fri Jun 05 13:15:32 2015 -0500
@@ -30,7 +30,7 @@
#include "piclist.h"
#include "threadpool.h"
-namespace x265 {
+namespace X265_NS {
// private namespace
struct Lowres;
diff -r 8a269d0d0d82 -r 899dba6c252c source/encoder/weightPrediction.cpp
--- a/source/encoder/weightPrediction.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/encoder/weightPrediction.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -31,7 +31,7 @@
#include "mv.h"
#include "bitstream.h"
-using namespace x265;
+using namespace X265_NS;
namespace {
struct Cache
{
@@ -217,7 +217,7 @@
}
}
-namespace x265 {
+namespace X265_NS {
void weightAnalyse(Slice& slice, Frame& frame, x265_param& param)
{
WeightParam wp[2][MAX_NUM_REF][3];
diff -r 8a269d0d0d82 -r 899dba6c252c source/input/input.cpp
--- a/source/input/input.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/input/input.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -25,7 +25,7 @@
#include "yuv.h"
#include "y4m.h"
-using namespace x265;
+using namespace X265_NS;
InputFile* InputFile::open(InputFileInfo& info, bool bForceY4m)
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/input/input.h
--- a/source/input/input.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/input/input.h Fri Jun 05 13:15:32 2015 -0500
@@ -31,9 +31,9 @@
#define MIN_FRAME_RATE 1
#define MAX_FRAME_RATE 300
-#include "x265.h"
+#include "common.h"
-namespace x265 {
+namespace X265_NS {
// private x265 namespace
struct InputFileInfo
diff -r 8a269d0d0d82 -r 899dba6c252c source/input/y4m.cpp
--- a/source/input/y4m.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/input/y4m.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -36,7 +36,7 @@
#endif
#endif
-using namespace x265;
+using namespace X265_NS;
using namespace std;
static const char header[] = "FRAME";
diff -r 8a269d0d0d82 -r 899dba6c252c source/input/y4m.h
--- a/source/input/y4m.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/input/y4m.h Fri Jun 05 13:15:32 2015 -0500
@@ -30,7 +30,7 @@
#define QUEUE_SIZE 5
-namespace x265 {
+namespace X265_NS {
// x265 private namespace
class Y4MInput : public InputFile, public Thread
diff -r 8a269d0d0d82 -r 899dba6c252c source/input/yuv.cpp
--- a/source/input/yuv.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/input/yuv.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -36,7 +36,7 @@
#endif
#endif
-using namespace x265;
+using namespace X265_NS;
using namespace std;
YUVInput::YUVInput(InputFileInfo& info)
diff -r 8a269d0d0d82 -r 899dba6c252c source/input/yuv.h
--- a/source/input/yuv.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/input/yuv.h Fri Jun 05 13:15:32 2015 -0500
@@ -30,7 +30,7 @@
#define QUEUE_SIZE 5
-namespace x265 {
+namespace X265_NS {
// private x265 namespace
class YUVInput : public InputFile, public Thread
diff -r 8a269d0d0d82 -r 899dba6c252c source/output/output.cpp
--- a/source/output/output.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/output/output.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -28,7 +28,7 @@
#include "raw.h"
-using namespace x265;
+using namespace X265_NS;
ReconFile* ReconFile::open(const char *fname, int width, int height, uint32_t bitdepth, uint32_t fpsNum, uint32_t fpsDenom, int csp)
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/output/output.h
--- a/source/output/output.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/output/output.h Fri Jun 05 13:15:32 2015 -0500
@@ -28,7 +28,7 @@
#include "x265.h"
#include "input/input.h"
-namespace x265 {
+namespace X265_NS {
// private x265 namespace
class ReconFile
diff -r 8a269d0d0d82 -r 899dba6c252c source/output/raw.cpp
--- a/source/output/raw.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/output/raw.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -24,7 +24,7 @@
#include "raw.h"
-using namespace x265;
+using namespace X265_NS;
using namespace std;
RAWOutput::RAWOutput(const char* fname, InputFileInfo&)
diff -r 8a269d0d0d82 -r 899dba6c252c source/output/raw.h
--- a/source/output/raw.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/output/raw.h Fri Jun 05 13:15:32 2015 -0500
@@ -30,7 +30,7 @@
#include <fstream>
#include <iostream>
-namespace x265 {
+namespace X265_NS {
class RAWOutput : public OutputFile
{
protected:
diff -r 8a269d0d0d82 -r 899dba6c252c source/output/reconplay.cpp
--- a/source/output/reconplay.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/output/reconplay.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -27,7 +27,7 @@
#include <signal.h>
-using namespace x265;
+using namespace X265_NS;
#if _WIN32
#define popen _popen
diff -r 8a269d0d0d82 -r 899dba6c252c source/output/reconplay.h
--- a/source/output/reconplay.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/output/reconplay.h Fri Jun 05 13:15:32 2015 -0500
@@ -29,7 +29,7 @@
#include "threading.h"
#include <cstdio>
-namespace x265 {
+namespace X265_NS {
// private x265 namespace
class ReconPlay : public Thread
diff -r 8a269d0d0d82 -r 899dba6c252c source/output/y4m.cpp
--- a/source/output/y4m.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/output/y4m.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -25,7 +25,7 @@
#include "output.h"
#include "y4m.h"
-using namespace x265;
+using namespace X265_NS;
using namespace std;
Y4MOutput::Y4MOutput(const char *filename, int w, int h, uint32_t fpsNum, uint32_t fpsDenom, int csp)
diff -r 8a269d0d0d82 -r 899dba6c252c source/output/y4m.h
--- a/source/output/y4m.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/output/y4m.h Fri Jun 05 13:15:32 2015 -0500
@@ -27,7 +27,7 @@
#include "output.h"
#include <fstream>
-namespace x265 {
+namespace X265_NS {
// private x265 namespace
class Y4MOutput : public ReconFile
diff -r 8a269d0d0d82 -r 899dba6c252c source/output/yuv.cpp
--- a/source/output/yuv.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/output/yuv.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -25,7 +25,7 @@
#include "output.h"
#include "yuv.h"
-using namespace x265;
+using namespace X265_NS;
using namespace std;
YUVOutput::YUVOutput(const char *filename, int w, int h, uint32_t d, int csp)
diff -r 8a269d0d0d82 -r 899dba6c252c source/output/yuv.h
--- a/source/output/yuv.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/output/yuv.h Fri Jun 05 13:15:32 2015 -0500
@@ -29,7 +29,7 @@
#include <fstream>
-namespace x265 {
+namespace X265_NS {
// private x265 namespace
class YUVOutput : public ReconFile
diff -r 8a269d0d0d82 -r 899dba6c252c source/profile/vtune/vtune.cpp
--- a/source/profile/vtune/vtune.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/profile/vtune/vtune.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -36,7 +36,7 @@
}
-namespace x265 {
+namespace X265_NS {
__itt_domain* domain;
__itt_string_handle* taskHandle[NUM_VTUNE_TASKS];
diff -r 8a269d0d0d82 -r 899dba6c252c source/profile/vtune/vtune.h
--- a/source/profile/vtune/vtune.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/profile/vtune/vtune.h Fri Jun 05 13:15:32 2015 -0500
@@ -26,7 +26,7 @@
#include "ittnotify.h"
-namespace x265 {
+namespace X265_NS {
#define CPU_EVENT(x) x,
enum VTuneTasksEnum
diff -r 8a269d0d0d82 -r 899dba6c252c source/test/intrapredharness.cpp
--- a/source/test/intrapredharness.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/test/intrapredharness.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -25,7 +25,7 @@
#include "predict.h"
#include "intrapredharness.h"
-using namespace x265;
+using namespace X265_NS;
IntraPredHarness::IntraPredHarness()
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/test/ipfilterharness.cpp
--- a/source/test/ipfilterharness.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/test/ipfilterharness.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -27,7 +27,7 @@
#include "common.h"
#include "ipfilterharness.h"
-using namespace x265;
+using namespace X265_NS;
IPFilterHarness::IPFilterHarness()
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/test/mbdstharness.cpp
--- a/source/test/mbdstharness.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/test/mbdstharness.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -27,7 +27,7 @@
#include "common.h"
#include "mbdstharness.h"
-using namespace x265;
+using namespace X265_NS;
struct DctConf
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/test/pixelharness.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -24,7 +24,7 @@
#include "pixelharness.h"
#include "primitives.h"
-using namespace x265;
+using namespace X265_NS;
PixelHarness::PixelHarness()
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/test/testbench.cpp
--- a/source/test/testbench.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/test/testbench.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -32,7 +32,7 @@
#include "param.h"
#include "cpu.h"
-using namespace x265;
+using namespace X265_NS;
const char* lumaPartStr[NUM_PU_SIZES] =
{
diff -r 8a269d0d0d82 -r 899dba6c252c source/test/testharness.h
--- a/source/test/testharness.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/test/testharness.h Fri Jun 05 13:15:32 2015 -0500
@@ -42,7 +42,7 @@
#define SHORT_MIN -32767
#define UNSIGNED_SHORT_MAX 65535
-using namespace x265;
+using namespace X265_NS;
extern const char* lumaPartStr[NUM_PU_SIZES];
extern const char* const* chromaPartStr[X265_CSP_COUNT];
diff -r 8a269d0d0d82 -r 899dba6c252c source/x265.cpp
--- a/source/x265.cpp Fri Jun 05 11:29:35 2015 -0500
+++ b/source/x265.cpp Fri Jun 05 13:15:32 2015 -0500
@@ -59,7 +59,7 @@
#define SetThreadExecutionState(es)
#endif
-using namespace x265;
+using namespace X265_NS;
/* Ctrl-C handler */
static volatile sig_atomic_t b_ctrl_c /* = 0 */;
diff -r 8a269d0d0d82 -r 899dba6c252c source/x265cli.h
--- a/source/x265cli.h Fri Jun 05 11:29:35 2015 -0500
+++ b/source/x265cli.h Fri Jun 05 13:15:32 2015 -0500
@@ -27,7 +27,7 @@
#include <getopt.h>
#ifdef __cplusplus
-namespace x265 {
+namespace X265_NS {
#endif
static const char short_options[] = "o:D:P:p:f:F:r:I:i:b:s:t:q:m:hwV?";
@@ -244,7 +244,7 @@
H0("\nOutput Options:\n");
H0("-o/--output <filename> Bitstream output file name\n");
H0("-D/--output-depth 8|10 Output bit depth (also internal bit depth). Default %d\n", param->internalBitDepth);
- H0(" --log-level <string> Logging level: none error warning info debug full. Default %s\n", x265::logLevelNames[param->logLevel + 1]);
+ H0(" --log-level <string> Logging level: none error warning info debug full. Default %s\n", X265_NS::logLevelNames[param->logLevel + 1]);
H0(" --no-progress Disable CLI progress reports\n");
H0(" --[no-]cu-stats Enable logging stats about distribution of cu across all modes. Default %s\n",OPT(param->bLogCuStats));
H1(" --csv <filename> Comma separated log file, log level >= 3 frame log, else one line per run\n");
More information about the x265-devel
mailing list