[x265-commits] [x265] log: do not report weightb twice
Steve Borho
steve at borho.org
Thu Apr 24 08:23:22 CEST 2014
details: http://hg.videolan.org/x265/rev/5f49217b2489
branches:
changeset: 6744:5f49217b2489
user: Steve Borho <steve at borho.org>
date: Mon Apr 21 16:12:35 2014 -0500
description:
log: do not report weightb twice
Subject: [x265] slicetype: rowsCompleted variable should be volatile
details: http://hg.videolan.org/x265/rev/84315557c97f
branches:
changeset: 6745:84315557c97f
user: Steve Borho <steve at borho.org>
date: Mon Apr 21 22:23:48 2014 -0500
description:
slicetype: rowsCompleted variable should be volatile
Don't allow a compiler to optimize out the reads, it would cause a deadlock
Subject: [x265] me: stack allocated pointer moved to heap
details: http://hg.videolan.org/x265/rev/54e73d05a5b1
branches:
changeset: 6746:54e73d05a5b1
user: Deepthi Nandakumar <deepthi at multicorewareinc.com>
date: Tue Apr 22 17:03:19 2014 +0530
description:
me: stack allocated pointer moved to heap
Subject: [x265] me: backout previous patch; add 1 to account for temporal MV candidate
details: http://hg.videolan.org/x265/rev/7ff92e09900e
branches:
changeset: 6747:7ff92e09900e
user: Deepthi Nandakumar <deepthi at multicorewareinc.com>
date: Tue Apr 22 20:11:06 2014 +0530
description:
me: backout previous patch; add 1 to account for temporal MV candidate
Subject: [x265] update x86inc.asm
details: http://hg.videolan.org/x265/rev/ce11d3617899
branches:
changeset: 6748:ce11d3617899
user: Min Chen <chenm003 at 163.com>
date: Tue Apr 22 14:30:45 2014 +0800
description:
update x86inc.asm
Subject: [x265] testbench: ensure randomly generated width and height are >= 16
details: http://hg.videolan.org/x265/rev/d916025046f7
branches:
changeset: 6749:d916025046f7
user: Murugan Vairavel <murugan at multicorewareinc.com>
date: Tue Apr 22 18:15:37 2014 +0530
description:
testbench: ensure randomly generated width and height are >= 16
Fixes a crash in testbench caused by upshift and downshift when height equal to 1
Subject: [x265] pixel: Added C Primitives for estimateCUPropagateCost and removed from lookahead
details: http://hg.videolan.org/x265/rev/4ed2953f358e
branches:
changeset: 6750:4ed2953f358e
user: Gopu Govindaswamy
date: Tue Apr 22 12:01:17 2014 +0530
description:
pixel: Added C Primitives for estimateCUPropagateCost and removed from lookahead
Subject: [x265] cmake: do not prefix absolute library paths with -l in pc file
details: http://hg.videolan.org/x265/rev/d11c90310c8a
branches:
changeset: 6751:d11c90310c8a
user: Steve Borho <steve at borho.org>
date: Tue Apr 22 13:41:04 2014 -0500
description:
cmake: do not prefix absolute library paths with -l in pc file
fixes static linking on Mac OS X in particular
Subject: [x265] Backed out changeset: ce11d3617899
details: http://hg.videolan.org/x265/rev/53712f218a1a
branches:
changeset: 6752:53712f218a1a
user: Steve Borho <steve at borho.org>
date: Tue Apr 22 22:52:49 2014 -0500
description:
Backed out changeset: ce11d3617899
Subject: [x265] fix wrong cpu type on interp_4tap_vert_x_4x2
details: http://hg.videolan.org/x265/rev/aa8442a28aa4
branches:
changeset: 6753:aa8442a28aa4
user: Min Chen <chenm003 at 163.com>
date: Wed Apr 23 13:56:05 2014 +0800
description:
fix wrong cpu type on interp_4tap_vert_x_4x2
Subject: [x265] threadpool: increase reference count if pool was allocated while blocked
details: http://hg.videolan.org/x265/rev/ea597d46f30e
branches:
changeset: 6754:ea597d46f30e
user: Steve Borho <steve at borho.org>
date: Wed Apr 23 01:56:45 2014 -0500
description:
threadpool: increase reference count if pool was allocated while blocked
Subject: [x265] testbench: port x264 stack & register check code
details: http://hg.videolan.org/x265/rev/91685d4e6c1a
branches:
changeset: 6755:91685d4e6c1a
user: Min Chen <chenm003 at 163.com>
date: Wed Apr 23 14:39:13 2014 -0500
description:
testbench: port x264 stack & register check code
Subject: [x265] pixelharness: stack-check all asm pixel primitives
details: http://hg.videolan.org/x265/rev/56a1c114d3be
branches:
changeset: 6756:56a1c114d3be
user: Min Chen <chenm003 at 163.com>
date: Wed Apr 23 14:39:45 2014 -0500
description:
pixelharness: stack-check all asm pixel primitives
Subject: [x265] update x86inc.asm
details: http://hg.videolan.org/x265/rev/cdd79be8cff9
branches:
changeset: 6757:cdd79be8cff9
user: Min Chen <chenm003 at 163.com>
date: Wed Apr 23 14:39:24 2014 -0500
description:
update x86inc.asm
Subject: [x265] primitives: nit
details: http://hg.videolan.org/x265/rev/1c9b3a48ea13
branches:
changeset: 6758:1c9b3a48ea13
user: Steve Borho <steve at borho.org>
date: Wed Apr 23 17:28:52 2014 -0500
description:
primitives: nit
Subject: [x265] improve by LEA to ADD in cvt32to16_shr
details: http://hg.videolan.org/x265/rev/f8b68aa1877d
branches:
changeset: 6759:f8b68aa1877d
user: Min Chen <chenm003 at 163.com>
date: Wed Apr 23 14:39:38 2014 -0500
description:
improve by LEA to ADD in cvt32to16_shr
Subject: [x265] cmake: export YASM_FLAGS from CMakeASM_YASMInformation.cmake
details: http://hg.videolan.org/x265/rev/c24c7b2d0eff
branches:
changeset: 6760:c24c7b2d0eff
user: Steve Borho <steve at borho.org>
date: Wed Apr 23 23:50:30 2014 -0500
description:
cmake: export YASM_FLAGS from CMakeASM_YASMInformation.cmake
This avoids duplicate logic in other cmake scripts
Subject: [x265] move checkasm-a.asm to the test/ folder (fixes linux link)
details: http://hg.videolan.org/x265/rev/6dca7a1de7f7
branches:
changeset: 6761:6dca7a1de7f7
user: Steve Borho <steve at borho.org>
date: Thu Apr 24 00:16:39 2014 -0500
description:
move checkasm-a.asm to the test/ folder (fixes linux link)
Subject: [x265] align the stack for GCC x86_32 builds
details: http://hg.videolan.org/x265/rev/4c341edb4cf8
branches:
changeset: 6762:4c341edb4cf8
user: Steve Borho <steve at borho.org>
date: Thu Apr 17 14:15:42 2014 -0500
description:
align the stack for GCC x86_32 builds
For all threads x265 creates, align the stack immediately in the call to
threadMain().
The API calls do not appear to require an aligned stack; all primitives that
require stack aligned buffers are called from frame encoder or worker pool
threads
Subject: [x265] fixups for testbench build on Windows
details: http://hg.videolan.org/x265/rev/904b96e1c436
branches:
changeset: 6763:904b96e1c436
user: Steve Borho <steve at borho.org>
date: Thu Apr 24 00:38:01 2014 -0500
description:
fixups for testbench build on Windows
Subject: [x265] TComMotionInfo: nit
details: http://hg.videolan.org/x265/rev/e9f64036fbee
branches:
changeset: 6764:e9f64036fbee
user: Steve Borho <steve at borho.org>
date: Thu Apr 24 01:15:51 2014 -0500
description:
TComMotionInfo: nit
diffstat:
source/CMakeLists.txt | 29 +--
source/Lib/TLibCommon/TComMotionInfo.h | 8 +-
source/Lib/TLibEncoder/TEncSearch.cpp | 2 +-
source/cmake/CMakeASM_YASMInformation.cmake | 32 ++-
source/common/CMakeLists.txt | 4 +-
source/common/common.h | 11 +
source/common/param.cpp | 1 -
source/common/pixel.cpp | 17 ++
source/common/primitives.h | 6 +-
source/common/threading.cpp | 10 +-
source/common/threadpool.cpp | 6 +-
source/common/x86/asm-primitives.cpp | 2 +-
source/common/x86/blockcopy8.asm | 6 +-
source/common/x86/ipfilter16.asm | 2 +-
source/common/x86/ipfilter8.h | 2 +-
source/common/x86/x86inc.asm | 66 +++++---
source/encoder/slicetype.cpp | 20 +--
source/encoder/slicetype.h | 4 +-
source/test/CMakeLists.txt | 15 +-
source/test/checkasm-a.asm | 219 +++++++++++++++++++++++++++
source/test/pixelharness.cpp | 223 +++++++++++++++++----------
source/test/testharness.h | 46 +++++
22 files changed, 544 insertions(+), 187 deletions(-)
diffs (truncated from 1634 to 300 lines):
diff -r 3acc99098339 -r e9f64036fbee source/CMakeLists.txt
--- a/source/CMakeLists.txt Tue Apr 22 02:16:58 2014 +0300
+++ b/source/CMakeLists.txt Thu Apr 24 01:15:51 2014 -0500
@@ -206,39 +206,20 @@ add_subdirectory(encoder)
add_subdirectory(common)
if((MSVC_IDE OR XCODE) AND ENABLE_ASSEMBLY)
- # this is horrible. ugly, and hacky, and it reproduces logic found
- # in the yasm CMake modules, but this is required because of this cmake bug
+ # this is required because of this cmake bug
# http://www.cmake.org/Bug/print_bug_page.php?bug_id=8170
- if (X64)
- if(APPLE)
- set(FLAGS -f macho64 -m amd64 -DPREFIX -DPIC -DARCH_X86_64=1 -DHAVE_ALIGNED_STACK=1)
- else()
- set(FLAGS -f win64 -m amd64 -DARCH_X86_64=1 -DHAVE_ALIGNED_STACK=0)
- endif()
- else()
- if(APPLE)
- set(FLAGS -f macho -DARCH_X86_64=0 -DHAVE_ALIGNED_STACK=1 -DPREFIX)
- else()
- set(FLAGS -f win32 -DARCH_X86_64=0 -DHAVE_ALIGNED_STACK=0 -DPREFIX)
- endif()
- endif()
if(WIN32)
set(SUFFIX obj)
else()
set(SUFFIX o)
endif()
- if (HIGH_BIT_DEPTH)
- set(FLAGS ${FLAGS} -DHIGH_BIT_DEPTH=1 -DBIT_DEPTH=10)
- else()
- set(FLAGS ${FLAGS} -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8)
- endif()
foreach(ASM ${MSVC_ASMS})
set(YASM_SRC ${CMAKE_CURRENT_SOURCE_DIR}/common/x86/${ASM})
list(APPEND YASM_SRCS ${YASM_SRC})
list(APPEND YASM_OBJS ${ASM}.${SUFFIX})
add_custom_command(
OUTPUT ${ASM}.${SUFFIX}
- COMMAND ${YASM_EXECUTABLE} ARGS ${FLAGS} ${YASM_SRC} -o ${ASM}.${SUFFIX}
+ COMMAND ${YASM_EXECUTABLE} ARGS ${YASM_FLAGS} ${YASM_SRC} -o ${ASM}.${SUFFIX}
DEPENDS ${YASM_SRC})
endforeach()
endif()
@@ -294,7 +275,11 @@ endif()
if(X265_LATEST_TAG)
# convert lists of link libraries into -lstdc++ -lm etc..
foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS})
- list(APPEND PLIBLIST "-l${LIB}")
+ if(IS_ABSOLUTE ${LIB} AND EXISTS ${LIB})
+ list(APPEND PLIBLIST "${LIB}")
+ else()
+ list(APPEND PLIBLIST "-l${LIB}")
+ endif()
endforeach()
if(PLIBLIST)
# blacklist of libraries that should not be in Libs.private
diff -r 3acc99098339 -r e9f64036fbee source/Lib/TLibCommon/TComMotionInfo.h
--- a/source/Lib/TLibCommon/TComMotionInfo.h Tue Apr 22 02:16:58 2014 +0300
+++ b/source/Lib/TLibCommon/TComMotionInfo.h Thu Apr 24 01:15:51 2014 -0500
@@ -54,11 +54,11 @@ namespace x265 {
// ====================================================================================================================
/// parameters for AMVP
-typedef struct _AMVPInfo
+struct AMVPInfo
{
- MV m_mvCand[AMVP_MAX_NUM_CANDS_MEM]; ///< array of motion vector predictor candidates
- int m_num; ///< number of motion vector predictor candidates
-} AMVPInfo;
+ MV m_mvCand[AMVP_MAX_NUM_CANDS_MEM]; ///< array of motion vector predictor candidates
+ int m_num; ///< number of motion vector predictor candidates
+};
// ====================================================================================================================
// Class definition
diff -r 3acc99098339 -r e9f64036fbee source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp Tue Apr 22 02:16:58 2014 +0300
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp Thu Apr 24 01:15:51 2014 -0500
@@ -2305,7 +2305,7 @@ bool TEncSearch::predInterSearch(TComDat
bits--;
}
- MV mvc[(MD_ABOVE_LEFT + 1) * 2];
+ MV mvc[(MD_ABOVE_LEFT + 1) * 2 + 1];
int numMvc = cu->fillMvpCand(partIdx, partAddr, l, ref, &amvpInfo[l][ref], mvc);
// Pick the best possible MVP from AMVP candidates based on least residual
diff -r 3acc99098339 -r e9f64036fbee source/cmake/CMakeASM_YASMInformation.cmake
--- a/source/cmake/CMakeASM_YASMInformation.cmake Tue Apr 22 02:16:58 2014 +0300
+++ b/source/cmake/CMakeASM_YASMInformation.cmake Thu Apr 24 01:15:51 2014 -0500
@@ -2,44 +2,46 @@ set(ASM_DIALECT "_YASM")
set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
if(X64)
- set(ASM_FLAGS "-DARCH_X86_64=1 -m amd64 -DPIC")
+ list(APPEND ASM_FLAGS -DARCH_X86_64=1 -DPIC)
if(APPLE)
- set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1 "-f macho64 -DPREFIX")
+ set(ARGS -f macho64 -m amd64 -DPREFIX)
elseif(UNIX AND NOT CYGWIN)
- set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1 "-f elf64")
+ set(ARGS -f elf64 -m amd64)
else()
- set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1 "-f win64")
+ set(ARGS -f win64 -m amd64)
endif()
else()
- set(ASM_FLAGS -DARCH_X86_64=0)
+ list(APPEND ASM_FLAGS -DARCH_X86_64=0)
if(APPLE)
- set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1 "-f macho")
+ set(ARGS -f macho)
elseif(UNIX AND NOT CYGWIN)
- set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1 "-f elf32")
+ set(ARGS -f elf32)
else()
- set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1 "-f win32 -DPREFIX")
+ set(ARGS -f win32 -DPREFIX)
endif()
endif()
-# we cannot assume 16-byte stack alignment on x86_32 even with GCC
-if(GCC AND X64)
- set(ASM_FLAGS "${ASM_FLAGS} -DHAVE_ALIGNED_STACK=1")
+if(GCC)
+ list(APPEND ASM_FLAGS -DHAVE_ALIGNED_STACK=1)
else()
- set(ASM_FLAGS "${ASM_FLAGS} -DHAVE_ALIGNED_STACK=0")
+ list(APPEND ASM_FLAGS -DHAVE_ALIGNED_STACK=0)
endif()
if(HIGH_BIT_DEPTH)
- set(ASM_FLAGS "${ASM_FLAGS} -DHIGH_BIT_DEPTH=1 -DBIT_DEPTH=10")
+ list(APPEND ASM_FLAGS -DHIGH_BIT_DEPTH=1 -DBIT_DEPTH=10)
else()
- set(ASM_FLAGS "${ASM_FLAGS} -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8")
+ list(APPEND ASM_FLAGS -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8)
endif()
+set(YASM_FLAGS ${ARGS} ${ASM_FLAGS} PARENT_SCOPE)
+string(REPLACE ";" " " CMAKE_ASM_YASM_COMPILER_ARG1 "${ARGS}")
# This section exists to override the one in CMakeASMInformation.cmake
# (the default Information file). This removes the <FLAGS>
# thing so that your C compiler flags that have been set via
# set_target_properties don't get passed to yasm and confuse it.
if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
- set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> ${ASM_FLAGS} -o <OBJECT> <SOURCE>")
+ string(REPLACE ";" " " STR_ASM_FLAGS "${ASM_FLAGS}")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> ${STR_ASM_FLAGS} -o <OBJECT> <SOURCE>")
endif()
include(CMakeASMInformation)
diff -r 3acc99098339 -r e9f64036fbee source/common/CMakeLists.txt
--- a/source/common/CMakeLists.txt Tue Apr 22 02:16:58 2014 +0300
+++ b/source/common/CMakeLists.txt Thu Apr 24 01:15:51 2014 -0500
@@ -119,10 +119,10 @@ if(ENABLE_ASSEMBLY)
# MSVC requires custom build rules in the main cmake script for yasm
set(MSVC_ASMS "${A_SRCS}" CACHE INTERNAL "yasm sources")
set(A_SRCS)
- else()
- enable_language(ASM_YASM)
endif()
+ enable_language(ASM_YASM)
+
foreach(SRC ${A_SRCS} ${C_SRCS})
set(ASM_PRIMITIVES ${ASM_PRIMITIVES} x86/${SRC})
endforeach()
diff -r 3acc99098339 -r e9f64036fbee source/common/common.h
--- a/source/common/common.h Tue Apr 22 02:16:58 2014 +0300
+++ b/source/common/common.h Thu Apr 24 01:15:51 2014 -0500
@@ -47,10 +47,21 @@
#define ALIGN_VAR_8(T, var) T var __attribute__((aligned(8)))
#define ALIGN_VAR_16(T, var) T var __attribute__((aligned(16)))
#define ALIGN_VAR_32(T, var) T var __attribute__((aligned(32)))
+
+#if X265_ARCH_X86 && !defined(X86_64)
+extern "C" intptr_t x265_stack_align( void (*func)(), ... );
+#define x265_stack_align(func,...) x265_stack_align((void (*)())func, __VA_ARGS__)
+#else
+#define x265_stack_align(func,...) func(__VA_ARGS__)
+#endif
+
#elif defined(_MSC_VER)
+
#define ALIGN_VAR_8(T, var) __declspec(align(8)) T var
#define ALIGN_VAR_16(T, var) __declspec(align(16)) T var
#define ALIGN_VAR_32(T, var) __declspec(align(32)) T var
+#define x265_stack_align(func,...) func(__VA_ARGS__)
+
#endif // if defined(__GNUC__)
#if HIGH_BIT_DEPTH
diff -r 3acc99098339 -r e9f64036fbee source/common/param.cpp
--- a/source/common/param.cpp Tue Apr 22 02:16:58 2014 +0300
+++ b/source/common/param.cpp Thu Apr 24 01:15:51 2014 -0500
@@ -1103,7 +1103,6 @@ void x265_print_params(x265_param *param
else
fprintf(stderr, "tskip ");
}
- TOOLOPT(param->bEnableWeightedBiPred, "weightbp");
fprintf(stderr, "\n");
fflush(stderr);
}
diff -r 3acc99098339 -r e9f64036fbee source/common/pixel.cpp
--- a/source/common/pixel.cpp Tue Apr 22 02:16:58 2014 +0300
+++ b/source/common/pixel.cpp Thu Apr 24 01:15:51 2014 -0500
@@ -865,6 +865,22 @@ void planecopy_sp_c(uint16_t *src, intpt
src += srcStride;
}
}
+
+/* Estimate the total amount of influence on future quality that could be had if we
+ * were to improve the reference samples used to inter predict any given CU. */
+void estimateCUPropagateCost(int *dst, uint16_t *propagateIn, int32_t *intraCosts, uint16_t *interCosts,
+ int32_t *invQscales, double *fpsFactor, int len)
+{
+ double fps = *fpsFactor / 256;
+ for (int i = 0; i < len; i++)
+ {
+ double intraCost = intraCosts[i] * invQscales[i];
+ double propagateAmount = (double)propagateIn[i] + intraCost * fps;
+ double propagateNum = (double)intraCosts[i] - (interCosts[i] & ((1 << 14) - 1));
+ double propagateDenom = (double)intraCosts[i];
+ dst[i] = (int)(propagateAmount * propagateNum / propagateDenom + 0.5);
+ }
+}
} // end anonymous namespace
namespace x265 {
@@ -1158,5 +1174,6 @@ void Setup_C_PixelPrimitives(EncoderPrim
p.plane_copy_deinterleave_c = plane_copy_deinterleave_chroma;
p.planecopy_cp = planecopy_cp_c;
p.planecopy_sp = planecopy_sp_c;
+ p.propagateCost = estimateCUPropagateCost;
}
}
diff -r 3acc99098339 -r e9f64036fbee source/common/primitives.h
--- a/source/common/primitives.h Tue Apr 22 02:16:58 2014 +0300
+++ b/source/common/primitives.h Thu Apr 24 01:15:51 2014 -0500
@@ -152,7 +152,7 @@ typedef void (*extendCURowBorder_t)(pixe
typedef void (*ssim_4x4x2_core_t)(const pixel *pix1, intptr_t stride1, const pixel *pix2, intptr_t stride2, int sums[2][4]);
typedef float (*ssim_end4_t)(int sum0[5][4], int sum1[5][4], int width);
typedef uint64_t (*var_t)(pixel *pix, intptr_t stride);
-typedef void (*plane_copy_deinterleave_t)(pixel *dstu, intptr_t dstuStride, pixel *dstv, intptr_t dstvStride, pixel *src, intptr_t srcStride, int w, int h);
+typedef void (*plane_copy_deinterleave_t)(pixel *dstu, intptr_t dstuStride, pixel *dstv, intptr_t dstvStride, pixel *src, intptr_t srcStride, int w, int h);
typedef void (*filter_pp_t) (pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx);
typedef void (*filter_hps_t) (pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride, int coeffIdx, int isRowExt);
@@ -175,6 +175,8 @@ typedef void (*saoCuOrgE0_t)(pixel * rec
typedef void (*planecopy_cp_t) (uint8_t *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int width, int height, int shift);
typedef void (*planecopy_sp_t) (uint16_t *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int width, int height, int shift, uint16_t mask);
+typedef void (*cutree_propagate_cost) (int *dst, uint16_t *propagateIn, int32_t *intraCosts, uint16_t *interCosts, int32_t *invQscales, double *fpsFactor, int len);
+
/* Define a structure containing function pointers to optimized encoder
* primitives. Each pointer can reference either an assembly routine,
* a vectorized primitive, or a C function. */
@@ -247,6 +249,8 @@ struct EncoderPrimitives
planecopy_cp_t planecopy_cp;
planecopy_sp_t planecopy_sp;
+ cutree_propagate_cost propagateCost;
+
struct
{
filter_pp_t filter_vpp[NUM_LUMA_PARTITIONS];
diff -r 3acc99098339 -r e9f64036fbee source/common/threading.cpp
--- a/source/common/threading.cpp Tue Apr 22 02:16:58 2014 +0300
+++ b/source/common/threading.cpp Thu Apr 24 01:15:51 2014 -0500
@@ -28,12 +28,18 @@
namespace x265 {
// x265 private namespace
+/* C shim for forced stack alignment */
+static void stackAlignMain(Thread *instance)
+{
+ instance->threadMain();
+}
+
#if _WIN32
static DWORD WINAPI ThreadShim(Thread *instance)
{
// defer processing to the virtual function implemented in the derived class
- instance->threadMain();
+ x265_stack_align(stackAlignMain, instance);
return 0;
}
@@ -70,7 +76,7 @@ static void *ThreadShim(void *opaque)
// defer processing to the virtual function implemented in the derived class
Thread *instance = reinterpret_cast<Thread *>(opaque);
- instance->threadMain();
+ x265_stack_align(stackAlignMain, instance);
return NULL;
More information about the x265-commits
mailing list