changeset 9554:19ba9e1ab526

Merge with public
author Praveen Tiwari <praveen@multicorewareinc.com>
date Fri, 20 Feb 2015 10:01:23 +0530
parents 35356968a48a (current diff) 9391c286ba55 (diff)
children bcd32fad1690
files
diffstat 9 files changed, 80 insertions(+-), 34 deletions(-) [+]
line wrap: on
line diff
--- a/doc/reST/cli.rst	Thu Feb 19 17:09:04 2015 +0530
+++ b/doc/reST/cli.rst	Fri Feb 20 10:01:23 2015 +0530
@@ -477,7 +477,7 @@ the prediction quad-tree.
 	and less frame parallelism as well. Because of this the faster
 	presets use a CU size of 32. Default: 64
 
-.. option:: --min-cu-size, <64|32|16|8>
+.. option:: --min-cu-size <64|32|16|8>
 
 	Minimum CU size (width and height). By using 16 or 32 the encoder
 	will not analyze the cost of CUs below that minimum threshold,
--- a/source/CMakeLists.txt	Thu Feb 19 17:09:04 2015 +0530
+++ b/source/CMakeLists.txt	Fri Feb 20 10:01:23 2015 +0530
@@ -61,6 +61,15 @@ if(UNIX)
     if(LIBRT)
         list(APPEND PLATFORM_LIBS rt)
     endif()
+    find_package(Numa)
+    if(NUMA_FOUND)
+        add_definitions(-DHAVE_LIBNUMA)
+        message(STATUS "libnuma found, building with support for NUMA nodes")
+        set(PLATFORM_LIBS ${PLATFORM_LIBS} ${NUMA_LIBRARY})
+        link_directories(${NUMA_LIBRARY_DIR})
+        include_directories(${NUMA_INCLUDE_DIR})
+    endif()
+    mark_as_advanced(LIBRT NUMA_FOUND)
 endif(UNIX)
 
 if(X64 AND NOT WIN32)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/source/cmake/FindNuma.cmake	Fri Feb 20 10:01:23 2015 +0530
@@ -0,0 +1,43 @@
+# Module for locating libnuma
+#
+# Read-only variables:
+#   NUMA_FOUND
+#     Indicates that the library has been found.
+#
+#   NUMA_INCLUDE_DIR
+#     Points to the libnuma include directory.
+#
+#   NUMA_LIBRARY_DIR
+#     Points to the directory that contains the libraries.
+#     The content of this variable can be passed to link_directories.
+#
+#   NUMA_LIBRARY
+#     Points to the libnuma that can be passed to target_link_libararies.
+#
+# Copyright (c) 2015 Steve Borho
+
+include(FindPackageHandleStandardArgs)
+
+find_path(NUMA_ROOT_DIR
+  NAMES include/numa.h
+  PATHS ENV NUMA_ROOT
+  DOC "NUMA root directory")
+
+find_path(NUMA_INCLUDE_DIR
+  NAMES numa.h
+  HINTS ${NUMA_ROOT_DIR}
+  PATH_SUFFIXES include
+  DOC "NUMA include directory")
+
+find_library(NUMA_LIBRARY
+  NAMES numa
+  HINTS ${NUMA_ROOT_DIR}
+  DOC "NUMA library")
+
+if (NUMA_LIBRARY)
+    get_filename_component(NUMA_LIBRARY_DIR ${NUMA_LIBRARY} PATH)
+endif()
+
+mark_as_advanced(NUMA_INCLUDE_DIR NUMA_LIBRARY_DIR NUMA_LIBRARY)
+
+find_package_handle_standard_args(NUMA REQUIRED_VARS NUMA_ROOT_DIR NUMA_INCLUDE_DIR NUMA_LIBRARY)
--- a/source/common/param.cpp	Thu Feb 19 17:09:04 2015 +0530
+++ b/source/common/param.cpp	Fri Feb 20 10:01:23 2015 +0530
@@ -929,9 +929,7 @@ void setParamAspectRatio(x265_param *p, 
 void getParamAspectRatio(x265_param *p, int& width, int& height)
 {
     if (!p->vui.aspectRatioIdc)
-    {
         width = height = 0;
-    }
     else if ((size_t)p->vui.aspectRatioIdc <= sizeof(fixedRatios) / sizeof(fixedRatios[0]))
     {
         width  = fixedRatios[p->vui.aspectRatioIdc - 1][0];
@@ -943,9 +941,7 @@ void getParamAspectRatio(x265_param *p, 
         height = p->vui.sarHeight;
     }
     else
-    {
         width = height = 0;
-    }
 }
 
 static inline int _confirm(x265_param *param, bool bflag, const char* message)
--- a/source/common/picyuv.cpp	Thu Feb 19 17:09:04 2015 +0530
+++ b/source/common/picyuv.cpp	Fri Feb 20 10:01:23 2015 +0530
@@ -176,9 +176,7 @@ void PicYuv::copyFromPicture(const x265_
         for (int r = 0; r < height; r++)
         {
             for (int c = 0; c < width; c++)
-            {
                 yPixel[c] = (pixel)yChar[c];
-            }
 
             yPixel += m_stride;
             yChar += pic.stride[0] / sizeof(*yChar);
--- a/source/common/slice.h	Thu Feb 19 17:09:04 2015 +0530
+++ b/source/common/slice.h	Fri Feb 20 10:01:23 2015 +0530
@@ -288,6 +288,14 @@ struct WeightParam
     }
 };
 
+#define SET_WEIGHT(w, b, s, d, o) \
+    { \
+        (w).inputWeight = (s); \
+        (w).log2WeightDenom = (d); \
+        (w).inputOffset = (o); \
+        (w).bPresentFlag = (b); \
+    }
+
 class Slice
 {
 public:
--- a/source/common/threading.h	Thu Feb 19 17:09:04 2015 +0530
+++ b/source/common/threading.h	Fri Feb 20 10:01:23 2015 +0530
@@ -42,32 +42,32 @@
 #include <sys/sysctl.h>
 #endif
 
-#ifdef __GNUC__                         /* GCCs builtin atomics */
+#ifdef __GNUC__               /* GCCs builtin atomics */
 
 #include <sys/time.h>
 #include <unistd.h>
 
-#define CLZ(id, x)                          id = (unsigned long)__builtin_clz(x) ^ 31
-#define CTZ(id, x)                          id = (unsigned long)__builtin_ctz(x)
-#define ATOMIC_OR(ptr, mask)                __sync_fetch_and_or(ptr, mask)
-#define ATOMIC_AND(ptr, mask)               __sync_fetch_and_and(ptr, mask)
-#define ATOMIC_INC(ptr)                     __sync_add_and_fetch((volatile int32_t*)ptr, 1)
-#define ATOMIC_DEC(ptr)                     __sync_add_and_fetch((volatile int32_t*)ptr, -1)
-#define ATOMIC_ADD(ptr, value)              __sync_fetch_and_add((volatile int32_t*)ptr, value)
-#define GIVE_UP_TIME()                      usleep(0)
+#define CLZ(id, x)            id = (unsigned long)__builtin_clz(x) ^ 31
+#define CTZ(id, x)            id = (unsigned long)__builtin_ctz(x)
+#define ATOMIC_OR(ptr, mask)  __sync_fetch_and_or(ptr, mask)
+#define ATOMIC_AND(ptr, mask) __sync_fetch_and_and(ptr, mask)
+#define ATOMIC_INC(ptr)       __sync_add_and_fetch((volatile int32_t*)ptr, 1)
+#define ATOMIC_DEC(ptr)       __sync_add_and_fetch((volatile int32_t*)ptr, -1)
+#define ATOMIC_ADD(ptr, val)  __sync_fetch_and_add((volatile int32_t*)ptr, val)
+#define GIVE_UP_TIME()        usleep(0)
 
-#elif defined(_MSC_VER)                 /* Windows atomic intrinsics */
+#elif defined(_MSC_VER)       /* Windows atomic intrinsics */
 
 #include <intrin.h>
 
-#define CLZ(id, x)                          _BitScanReverse(&id, x)
-#define CTZ(id, x)                          _BitScanForward(&id, x)
-#define ATOMIC_INC(ptr)                     InterlockedIncrement((volatile LONG*)ptr)
-#define ATOMIC_DEC(ptr)                     InterlockedDecrement((volatile LONG*)ptr)
-#define ATOMIC_ADD(ptr, value)              InterlockedExchangeAdd((volatile LONG*)ptr, value)
-#define ATOMIC_OR(ptr, mask)                _InterlockedOr((volatile LONG*)ptr, (LONG)mask)
-#define ATOMIC_AND(ptr, mask)               _InterlockedAnd((volatile LONG*)ptr, (LONG)mask)
-#define GIVE_UP_TIME()                      Sleep(0)
+#define CLZ(id, x)            _BitScanReverse(&id, x)
+#define CTZ(id, x)            _BitScanForward(&id, x)
+#define ATOMIC_INC(ptr)       InterlockedIncrement((volatile LONG*)ptr)
+#define ATOMIC_DEC(ptr)       InterlockedDecrement((volatile LONG*)ptr)
+#define ATOMIC_ADD(ptr, val)  InterlockedExchangeAdd((volatile LONG*)ptr, val)
+#define ATOMIC_OR(ptr, mask)  _InterlockedOr((volatile LONG*)ptr, (LONG)mask)
+#define ATOMIC_AND(ptr, mask) _InterlockedAnd((volatile LONG*)ptr, (LONG)mask)
+#define GIVE_UP_TIME()        Sleep(0)
 
 #endif // ifdef __GNUC__
 
--- a/source/encoder/slicetype.h	Thu Feb 19 17:09:04 2015 +0530
+++ b/source/encoder/slicetype.h	Fri Feb 20 10:01:23 2015 +0530
@@ -39,14 +39,6 @@ class Frame;
 #define LOWRES_COST_MASK  ((1 << 14) - 1)
 #define LOWRES_COST_SHIFT 14
 
-#define SET_WEIGHT(w, b, s, d, o) \
-    { \
-        (w).inputWeight = (s); \
-        (w).log2WeightDenom = (d); \
-        (w).inputOffset = (o); \
-        (w).bPresentFlag = b; \
-    }
-
 class EstimateRow
 {
 public:
--- a/source/encoder/weightPrediction.cpp	Thu Feb 19 17:09:04 2015 +0530
+++ b/source/encoder/weightPrediction.cpp	Fri Feb 20 10:01:23 2015 +0530
@@ -27,8 +27,8 @@
 #include "frame.h"
 #include "picyuv.h"
 #include "lowres.h"
+#include "slice.h"
 #include "mv.h"
-#include "slicetype.h"
 #include "bitstream.h"
 
 using namespace x265;