[x265-commits] [x265] cmake: pick the old policy for MACOSX_RPATH (only applica...

Steve Borho steve at borho.org
Tue Apr 1 01:04:17 CEST 2014


details:   http://hg.videolan.org/x265/rev/4564298c30f6
branches:  
changeset: 6628:4564298c30f6
user:      Steve Borho <steve at borho.org>
date:      Mon Mar 31 15:54:59 2014 -0500
description:
cmake: pick the old policy for MACOSX_RPATH (only applicable for cmake 3.0)
Subject: [x265] frameencoder: prevent deadlock in non-wpp mode

details:   http://hg.videolan.org/x265/rev/f3c97e82ab04
branches:  
changeset: 6629:f3c97e82ab04
user:      Steve Borho <steve at borho.org>
date:      Mon Mar 31 15:56:08 2014 -0500
description:
frameencoder: prevent deadlock in non-wpp mode
Subject: [x265] xp: fix header guards for XP support, fixes MinGW build

details:   http://hg.videolan.org/x265/rev/ae07405973b7
branches:  
changeset: 6630:ae07405973b7
user:      Steve Borho <steve at borho.org>
date:      Mon Mar 31 16:29:12 2014 -0500
description:
xp: fix header guards for XP support, fixes MinGW build

If no _WIN32_WINNT version is specified, MinGW defaults to XP SP3.  Our include
guards were checking for <= XP instead of checking for any version before Vista
which was the version that introduced native CONDITION_VARIABLE support
Subject: [x265] dither: port dither related functions from x264

details:   http://hg.videolan.org/x265/rev/106fc00d4eab
branches:  
changeset: 6631:106fc00d4eab
user:      Selvakumar Nithiyaruban <selvakumar at multicorewareinc.com>
date:      Mon Mar 31 12:05:22 2014 +0530
description:
dither: port dither related functions from x264
Subject: [x265] cli: add cli option for dither

details:   http://hg.videolan.org/x265/rev/b521f535442a
branches:  
changeset: 6632:b521f535442a
user:      Selvakumar Nithiyaruban <selvakumar at multicorewareinc.com>
date:      Mon Mar 31 12:11:14 2014 +0530
description:
cli: add cli option for dither
Subject: [x265] primitives: added C primitives for upShift/downShift of input pixels

details:   http://hg.videolan.org/x265/rev/a30786caa6c3
branches:  
changeset: 6633:a30786caa6c3
user:      Murugan Vairavel <murugan at multicorewareinc.com>
date:      Mon Mar 31 17:50:37 2014 +0530
description:
primitives: added C primitives for upShift/downShift of input pixels
Subject: [x265] asm: code for input pixel upShift/downShift

details:   http://hg.videolan.org/x265/rev/c4ea6cffe2b3
branches:  
changeset: 6634:c4ea6cffe2b3
user:      Murugan Vairavel <murugan at multicorewareinc.com>
date:      Mon Mar 31 17:51:38 2014 +0530
description:
asm: code for input pixel upShift/downShift
Subject: [x265] testbench: code for testing input pixel upShift/downShift primitives

details:   http://hg.videolan.org/x265/rev/dc9a6a87db56
branches:  
changeset: 6635:dc9a6a87db56
user:      Murugan Vairavel <murugan at multicorewareinc.com>
date:      Mon Mar 31 17:52:12 2014 +0530
description:
testbench: code for testing input pixel upShift/downShift primitives
Subject: [x265] remove macro NEW_CALCRECON

details:   http://hg.videolan.org/x265/rev/5d607fd4531f
branches:  
changeset: 6636:5d607fd4531f
user:      Min Chen <chenm003 at 163.com>
date:      Mon Mar 31 17:45:16 2014 -0500
description:
remove macro NEW_CALCRECON

diffstat:

 doc/reST/cli.rst                      |   10 +-
 source/CMakeLists.txt                 |    7 +-
 source/Lib/TLibCommon/TComPicYuv.cpp  |   57 +---------
 source/Lib/TLibEncoder/TEncSearch.cpp |   16 --
 source/common/common.cpp              |    6 +
 source/common/common.h                |    2 +
 source/common/pixel.cpp               |   43 +++++--
 source/common/primitives.h            |    6 +-
 source/common/winxp.cpp               |    2 +-
 source/common/winxp.h                 |    2 +-
 source/common/x86/asm-primitives.cpp  |    2 +
 source/common/x86/pixel-a.asm         |  187 ++++++++++++++++++++++++++++++++++
 source/common/x86/pixel-util8.asm     |   76 -------------
 source/common/x86/pixel.h             |    3 +
 source/encoder/frameencoder.cpp       |    2 +-
 source/filters/filters.cpp            |   75 +++++++++++++
 source/filters/filters.h              |   31 +++++
 source/test/pixelharness.cpp          |  112 +++++++++++++++++++-
 source/test/pixelharness.h            |    4 +
 source/x265.cpp                       |   25 ++++
 20 files changed, 498 insertions(+), 170 deletions(-)

diffs (truncated from 1239 to 300 lines):

diff -r 6f7b323061dc -r 5d607fd4531f doc/reST/cli.rst
--- a/doc/reST/cli.rst	Sat Mar 29 20:27:43 2014 -0500
+++ b/doc/reST/cli.rst	Mon Mar 31 17:45:16 2014 -0500
@@ -158,6 +158,15 @@ Input Options
 
 	**CLI ONLY**
 
+.. option:: --dither
+
+	Enable high quality downscaling. Dithering is based on the diffusion
+	of errors from one row of pixels to the next row of pixels in a
+	picture. Only applicable when the input bit depth is larger than
+	8bits and internal bit depth is 8bits. Default disabled
+
+	**CLI ONLY**
+
 .. option:: --input-res <wxh>
 
 	YUV only: Source picture size [w x h]
@@ -208,7 +217,6 @@ Input Options
 
 	**CLI ONLY**
 
-
 Quad-Tree analysis
 ==================
 
diff -r 6f7b323061dc -r 5d607fd4531f source/CMakeLists.txt
--- a/source/CMakeLists.txt	Sat Mar 29 20:27:43 2014 -0500
+++ b/source/CMakeLists.txt	Mon Mar 31 17:45:16 2014 -0500
@@ -8,6 +8,7 @@ endif()
 message(STATUS "cmake version ${CMAKE_VERSION}")
 if(NOT CMAKE_VERSION VERSION_LESS "2.8.12.20131121")
     cmake_policy(SET CMP0025 OLD) # report Apple's Clang as just Clang
+    cmake_policy(SET CMP0042 OLD) # do not require MACOSX_RPATH
 endif()
 
 project (x265)
@@ -322,8 +323,10 @@ option(ENABLE_CLI "Build standalone CLI 
 if(ENABLE_CLI)
     file(GLOB InputFiles input/*.cpp input/*.h)
     file(GLOB OutputFiles output/*.cpp output/*.h)
+    file(GLOB FilterFiles filters/*.cpp filters/*.h)
     source_group(input FILES ${InputFiles})
     source_group(output FILES ${OutputFiles})
+    source_group(filters FILES ${FilterFiles})
 
     check_include_files(getopt.h HAVE_GETOPT_H)
     if(NOT HAVE_GETOPT_H)
@@ -336,10 +339,10 @@ if(ENABLE_CLI)
 
     if(XCODE)
         # Xcode seems unable to link the CLI with libs, so link as one targget
-        add_executable(cli ../COPYING ${InputFiles} ${OutputFiles} ${GETOPT} x265.cpp x265.h
+        add_executable(cli ../COPYING ${InputFiles} ${OutputFiles} ${FilterFiles} ${GETOPT} x265.cpp x265.h
                            $<TARGET_OBJECTS:encoder> $<TARGET_OBJECTS:common> ${YASM_OBJS} ${YASM_SRCS})
     else()
-        add_executable(cli ../COPYING ${InputFiles} ${OutputFiles} ${GETOPT} ${X265_RC_FILE} x265.cpp x265.h)
+        add_executable(cli ../COPYING ${InputFiles} ${OutputFiles} ${FilterFiles} ${GETOPT} ${X265_RC_FILE} x265.cpp x265.h)
         if(WIN32 OR NOT ENABLE_SHARED OR INTEL_CXX)
             # The CLI cannot link to the shared library on Windows, it
             # requires internal APIs not exported from the DLL
diff -r 6f7b323061dc -r 5d607fd4531f source/Lib/TLibCommon/TComPicYuv.cpp
--- a/source/Lib/TLibCommon/TComPicYuv.cpp	Sat Mar 29 20:27:43 2014 -0500
+++ b/source/Lib/TLibCommon/TComPicYuv.cpp	Mon Mar 31 17:45:16 2014 -0500
@@ -181,9 +181,6 @@ void TComPicYuv::copyFromPicture(const x
 
     if (pic.bitDepth < X265_DEPTH)
     {
-        /* 8bit input, 10bit internal depth. Do a simple up-shift of 2 bits */
-        assert(X265_DEPTH == 10);
-
         pixel *yPixel = getLumaAddr();
         pixel *uPixel = getCbAddr();
         pixel *vPixel = getCrAddr();
@@ -191,31 +188,11 @@ void TComPicYuv::copyFromPicture(const x
         uint8_t *yChar = (uint8_t*)pic.planes[0];
         uint8_t *uChar = (uint8_t*)pic.planes[1];
         uint8_t *vChar = (uint8_t*)pic.planes[2];
+        int shift = X265_MAX(0, X265_DEPTH - pic.bitDepth);
 
-        for (int r = 0; r < height; r++)
-        {
-            for (int c = 0; c < width; c++)
-            {
-                yPixel[c] = ((pixel)yChar[c]) << 2;
-            }
-
-            yPixel += getStride();
-            yChar += pic.stride[0] / sizeof(*yChar);
-        }
-
-        for (int r = 0; r < height >> m_vChromaShift; r++)
-        {
-            for (int c = 0; c < width >> m_hChromaShift; c++)
-            {
-                uPixel[c] = ((pixel)uChar[c]) << 2;
-                vPixel[c] = ((pixel)vChar[c]) << 2;
-            }
-
-            uPixel += getCStride();
-            vPixel += getCStride();
-            uChar += pic.stride[1] / sizeof(*uChar);
-            vChar += pic.stride[2] / sizeof(*vChar);
-        }
+        primitives.planecopy_cp(yChar, pic.stride[0] / sizeof(*yChar), yPixel, getStride(), width, height, shift);
+        primitives.planecopy_cp(uChar, pic.stride[1] / sizeof(*uChar), uPixel, getCStride(), width >> m_hChromaShift, height >> m_vChromaShift, shift);
+        primitives.planecopy_cp(vChar, pic.stride[2] / sizeof(*vChar), vPixel, getCStride(), width >> m_hChromaShift, height >> m_vChromaShift, shift);
     }
     else if (pic.bitDepth == 8)
     {
@@ -267,30 +244,10 @@ void TComPicYuv::copyFromPicture(const x
         int shift = X265_MAX(0, pic.bitDepth - X265_DEPTH);
 
         /* shift and mask pixels to final size */
-        for (int r = 0; r < height; r++)
-        {
-            for (int c = 0; c < width; c++)
-            {
-                yPixel[c] = (pixel)((yShort[c] >> shift) & mask);
-            }
 
-            yPixel += getStride();
-            yShort += pic.stride[0] / sizeof(*yShort);
-        }
-
-        for (int r = 0; r < height >> m_vChromaShift; r++)
-        {
-            for (int c = 0; c < width >> m_hChromaShift; c++)
-            {
-                uPixel[c] = (pixel)((uShort[c] >> shift) & mask);
-                vPixel[c] = (pixel)((vShort[c] >> shift) & mask);
-            }
-
-            uPixel += getCStride();
-            vPixel += getCStride();
-            uShort += pic.stride[1] / sizeof(*uShort);
-            vShort += pic.stride[2] / sizeof(*vShort);
-        }
+        primitives.planecopy_sp(yShort, pic.stride[0] / sizeof(*yShort), yPixel, getStride(), width, height, shift, mask);
+        primitives.planecopy_sp(uShort, pic.stride[1] / sizeof(*uShort), uPixel, getCStride(), width >> m_hChromaShift, height >> m_vChromaShift, shift, mask);
+        primitives.planecopy_sp(vShort, pic.stride[2] / sizeof(*vShort), vPixel, getCStride(), width >> m_hChromaShift, height >> m_vChromaShift, shift, mask);
     }
 
     /* extend the right edge if width was not multiple of the minimum CU size */
diff -r 6f7b323061dc -r 5d607fd4531f source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp	Sat Mar 29 20:27:43 2014 -0500
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp	Mon Mar 31 17:45:16 2014 -0500
@@ -464,18 +464,10 @@ void TEncSearch::xIntraCodingLumaBlk(TCo
     }
 
     assert(width <= 32);
-#if NEW_CALCRECON
     //===== reconstruction =====
     primitives.calcrecon[size](pred, residual, 0, reconQt, reconIPred, stride, MAX_CU_SIZE, reconIPredStride);
     //===== update distortion =====
     outDist += primitives.sse_sp[part](reconQt, MAX_CU_SIZE, fenc, stride);
-#else
-    ALIGN_VAR_32(pixel, recon[MAX_CU_SIZE * MAX_CU_SIZE]);
-    //===== reconstruction =====
-    primitives.calcrecon[size](pred, residual, recon, reconQt, reconIPred, stride, MAX_CU_SIZE, reconIPredStride);
-    //===== update distortion =====
-    outDist += primitives.sse_pp[part](fenc, stride, recon, stride);
-#endif
 }
 
 void TEncSearch::xIntraCodingChromaBlk(TComDataCU* cu,
@@ -594,18 +586,10 @@ void TEncSearch::xIntraCodingChromaBlk(T
 
     assert(((intptr_t)residual & (width - 1)) == 0);
     assert(width <= 32);
-#if NEW_CALCRECON
     //===== reconstruction =====
     primitives.calcrecon[size](pred, residual, 0, reconQt, reconIPred, stride, reconQtStride, reconIPredStride);
     //===== update distortion =====
     uint32_t dist = primitives.sse_sp[part](reconQt, reconQtStride, fenc, stride);
-#else
-    ALIGN_VAR_32(pixel, recon[MAX_CU_SIZE * MAX_CU_SIZE]);
-    //===== reconstruction =====
-    primitives.calcrecon[size](pred, residual, recon, reconQt, reconIPred, stride, reconQtStride, reconIPredStride);
-    //===== update distortion =====
-    uint32_t dist = primitives.sse_pp[part](fenc, stride, recon, stride);
-#endif
     if (ttype == TEXT_CHROMA_U)
     {
         outDist += m_rdCost->scaleChromaDistCb(dist);
diff -r 6f7b323061dc -r 5d607fd4531f source/common/common.cpp
--- a/source/common/common.cpp	Sat Mar 29 20:27:43 2014 -0500
+++ b/source/common/common.cpp	Mon Mar 31 17:45:16 2014 -0500
@@ -153,3 +153,9 @@ double x265_qp2qScale(double qp)
 {
     return 0.85 * pow(2.0, (qp - 12.0) / 6.0);
 }
+
+uint32_t x265_picturePlaneSize(int csp, int width, int height, int plane)
+{
+    uint32_t size = (uint32_t)(width >> x265_cli_csps[csp].width[plane]) * (height >> x265_cli_csps[csp].height[plane]);
+    return size;
+}
diff -r 6f7b323061dc -r 5d607fd4531f source/common/common.h
--- a/source/common/common.h	Sat Mar 29 20:27:43 2014 -0500
+++ b/source/common/common.h	Mon Mar 31 17:45:16 2014 -0500
@@ -154,4 +154,6 @@ double x265_ssim2dB(double ssim);
 double x265_qScale2qp(double qScale);
 double x265_qp2qScale(double qp);
 
+uint32_t x265_picturePlaneSize(int csp, int width, int height, int plane);
+
 #endif // ifndef X265_COMMON_H
diff -r 6f7b323061dc -r 5d607fd4531f source/common/pixel.cpp
--- a/source/common/pixel.cpp	Sat Mar 29 20:27:43 2014 -0500
+++ b/source/common/pixel.cpp	Mon Mar 31 17:45:16 2014 -0500
@@ -461,32 +461,19 @@ void getResidual(pixel *fenc, pixel *pre
 
 template<int blockSize>
 void calcRecons(pixel* pred, int16_t* residual,
-#if NEW_CALCRECON
                 pixel*,
-#else
-                pixel* recon,
-#endif
                 int16_t* recqt, pixel* recipred, int stride, int qtstride, int ipredstride)
 {
     for (int y = 0; y < blockSize; y++)
     {
         for (int x = 0; x < blockSize; x++)
         {
-#if NEW_CALCRECON
             recqt[x] = (int16_t)Clip(static_cast<int16_t>(pred[x]) + residual[x]);
             recipred[x] = (pixel)recqt[x];
-#else
-            recon[x] = Clip(static_cast<int16_t>(pred[x]) + residual[x]);
-            recqt[x] = (int16_t)recon[x];
-            recipred[x] = recon[x];
-#endif
         }
 
         pred += stride;
         residual += stride;
-#if !NEW_CALCRECON
-        recon += stride;
-#endif
         recqt += qtstride;
         recipred += ipredstride;
     }
@@ -852,6 +839,34 @@ void addAvg(int16_t* src0, int16_t* src1
         dst  += dstStride;
     }
 }
+
+void planecopy_cp_c(uint8_t *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int width, int height, int shift)
+{
+    for (int r = 0; r < height; r++)
+    {
+        for (int c = 0; c < width; c++)
+        {
+            dst[c] = ((pixel)src[c]) << shift;
+        }
+
+        dst += dstStride;
+        src += srcStride;
+    }
+}
+
+void planecopy_sp_c(uint16_t *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int width, int height, int shift, uint16_t mask)
+{
+    for (int r = 0; r < height; r++)
+    {
+        for (int c = 0; c < width; c++)
+        {
+            dst[c] = (pixel)((src[c] >> shift) & mask);
+        }
+
+        dst += dstStride;
+        src += srcStride;
+    }
+}
 }  // end anonymous namespace
 
 namespace x265 {
@@ -1099,5 +1114,7 @@ void Setup_C_PixelPrimitives(EncoderPrim
     p.var[BLOCK_32x32] = pixel_var<32>;
     p.var[BLOCK_64x64] = pixel_var<64>;
     p.plane_copy_deinterleave_c = plane_copy_deinterleave_chroma;
+    p.planecopy_cp = planecopy_cp_c;
+    p.planecopy_sp = planecopy_sp_c;
 }
 }
diff -r 6f7b323061dc -r 5d607fd4531f source/common/primitives.h
--- a/source/common/primitives.h	Sat Mar 29 20:27:43 2014 -0500
+++ b/source/common/primitives.h	Mon Mar 31 17:45:16 2014 -0500
@@ -32,8 +32,6 @@
 #include "common.h"
 #include "cpu.h"
 
-#define NEW_CALCRECON 1 // TODO: remove recon[] arg
-
 namespace x265 {
 // x265 private namespace
 


More information about the x265-commits mailing list