[x265-commits] [x265] api: new API functions need to be exported from Win DLL a...
Steve Borho
steve at borho.org
Wed May 6 22:05:25 CEST 2015
details: http://hg.videolan.org/x265/rev/9dd03a2b8b9b
branches:
changeset: 10383:9dd03a2b8b9b
user: Steve Borho <steve at borho.org>
date: Wed May 06 12:59:47 2015 -0500
description:
api: new API functions need to be exported from Win DLL and added to x265_api
The x265_api change affects binary compatibility, so bumping the build number
again
Subject: [x265] inline mvcost() to reduce address operators
details: http://hg.videolan.org/x265/rev/7a1fd7073941
branches:
changeset: 10384:7a1fd7073941
user: Min Chen <chenm003 at 163.com>
date: Tue May 05 14:44:19 2015 -0700
description:
inline mvcost() to reduce address operators
diffstat:
source/CMakeLists.txt | 2 +-
source/encoder/api.cpp | 1 +
source/encoder/motion.cpp | 48 ++++++++++++++++++++++++++++++++--------------
source/x265.def.in | 1 +
source/x265.h | 1 +
5 files changed, 37 insertions(+), 16 deletions(-)
diffs (124 lines):
diff -r 614b33d1b4ff -r 7a1fd7073941 source/CMakeLists.txt
--- a/source/CMakeLists.txt Tue Mar 31 15:38:35 2015 +0530
+++ b/source/CMakeLists.txt Tue May 05 14:44:19 2015 -0700
@@ -30,7 +30,7 @@ option(STATIC_LINK_CRT "Statically link
mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)
# X265_BUILD must be incremented each time the public API is changed
-set(X265_BUILD 58)
+set(X265_BUILD 59)
configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
"${PROJECT_BINARY_DIR}/x265.def")
configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
diff -r 614b33d1b4ff -r 7a1fd7073941 source/encoder/api.cpp
--- a/source/encoder/api.cpp Tue Mar 31 15:38:35 2015 +0530
+++ b/source/encoder/api.cpp Tue May 05 14:44:19 2015 -0700
@@ -264,6 +264,7 @@ static const x265_api libapi =
&x265_picture_init,
&x265_encoder_open,
&x265_encoder_parameters,
+ &x265_encoder_reconfig,
&x265_encoder_headers,
&x265_encoder_encode,
&x265_encoder_get_stats,
diff -r 614b33d1b4ff -r 7a1fd7073941 source/encoder/motion.cpp
--- a/source/encoder/motion.cpp Tue Mar 31 15:38:35 2015 +0530
+++ b/source/encoder/motion.cpp Tue May 05 14:44:19 2015 -0700
@@ -234,9 +234,14 @@ void MotionEstimate::setSourcePU(const Y
pix_base + (m1x) + (m1y) * stride, \
pix_base + (m2x) + (m2y) * stride, \
stride, costs); \
- (costs)[0] += mvcost((bmv + MV(m0x, m0y)) << 2); \
- (costs)[1] += mvcost((bmv + MV(m1x, m1y)) << 2); \
- (costs)[2] += mvcost((bmv + MV(m2x, m2y)) << 2); \
+ const uint16_t *base_mvx = &m_cost_mvx[(bmv.x + (m0x)) << 2]; \
+ const uint16_t *base_mvy = &m_cost_mvy[(bmv.y + (m0y)) << 2]; \
+ X265_CHECK(mvcost((bmv + MV(m0x, m0y)) << 2) == (base_mvx[((m0x) - (m0x)) << 2] + base_mvy[((m0y) - (m0y)) << 2]), "mvcost() check failure\n"); \
+ X265_CHECK(mvcost((bmv + MV(m1x, m1y)) << 2) == (base_mvx[((m1x) - (m0x)) << 2] + base_mvy[((m1y) - (m0y)) << 2]), "mvcost() check failure\n"); \
+ X265_CHECK(mvcost((bmv + MV(m2x, m2y)) << 2) == (base_mvx[((m2x) - (m0x)) << 2] + base_mvy[((m2y) - (m0y)) << 2]), "mvcost() check failure\n"); \
+ (costs)[0] += (base_mvx[((m0x) - (m0x)) << 2] + base_mvy[((m0y) - (m0y)) << 2]); \
+ (costs)[1] += (base_mvx[((m1x) - (m0x)) << 2] + base_mvy[((m1y) - (m0y)) << 2]); \
+ (costs)[2] += (base_mvx[((m2x) - (m0x)) << 2] + base_mvy[((m2y) - (m0y)) << 2]); \
}
#define COST_MV_PT_DIST_X4(m0x, m0y, p0, d0, m1x, m1y, p1, d1, m2x, m2y, p2, d2, m3x, m3y, p3, d3) \
@@ -247,10 +252,10 @@ void MotionEstimate::setSourcePU(const Y
fref + (m2x) + (m2y) * stride, \
fref + (m3x) + (m3y) * stride, \
stride, costs); \
- costs[0] += mvcost(MV(m0x, m0y) << 2); \
- costs[1] += mvcost(MV(m1x, m1y) << 2); \
- costs[2] += mvcost(MV(m2x, m2y) << 2); \
- costs[3] += mvcost(MV(m3x, m3y) << 2); \
+ (costs)[0] += mvcost(MV(m0x, m0y) << 2); \
+ (costs)[1] += mvcost(MV(m1x, m1y) << 2); \
+ (costs)[2] += mvcost(MV(m2x, m2y) << 2); \
+ (costs)[3] += mvcost(MV(m3x, m3y) << 2); \
COPY4_IF_LT(bcost, costs[0], bmv, MV(m0x, m0y), bPointNr, p0, bDistance, d0); \
COPY4_IF_LT(bcost, costs[1], bmv, MV(m1x, m1y), bPointNr, p1, bDistance, d1); \
COPY4_IF_LT(bcost, costs[2], bmv, MV(m2x, m2y), bPointNr, p2, bDistance, d2); \
@@ -266,10 +271,16 @@ void MotionEstimate::setSourcePU(const Y
pix_base + (m2x) + (m2y) * stride, \
pix_base + (m3x) + (m3y) * stride, \
stride, costs); \
- costs[0] += mvcost((omv + MV(m0x, m0y)) << 2); \
- costs[1] += mvcost((omv + MV(m1x, m1y)) << 2); \
- costs[2] += mvcost((omv + MV(m2x, m2y)) << 2); \
- costs[3] += mvcost((omv + MV(m3x, m3y)) << 2); \
+ const uint16_t *base_mvx = &m_cost_mvx[(omv.x << 2)]; \
+ const uint16_t *base_mvy = &m_cost_mvy[(omv.y << 2)]; \
+ X265_CHECK(mvcost((omv + MV(m0x, m0y)) << 2) == (base_mvx[(m0x) << 2] + base_mvy[(m0y) << 2]), "mvcost() check failure\n"); \
+ X265_CHECK(mvcost((omv + MV(m1x, m1y)) << 2) == (base_mvx[(m1x) << 2] + base_mvy[(m1y) << 2]), "mvcost() check failure\n"); \
+ X265_CHECK(mvcost((omv + MV(m2x, m2y)) << 2) == (base_mvx[(m2x) << 2] + base_mvy[(m2y) << 2]), "mvcost() check failure\n"); \
+ X265_CHECK(mvcost((omv + MV(m3x, m3y)) << 2) == (base_mvx[(m3x) << 2] + base_mvy[(m3y) << 2]), "mvcost() check failure\n"); \
+ costs[0] += (base_mvx[(m0x) << 2] + base_mvy[(m0y) << 2]); \
+ costs[1] += (base_mvx[(m1x) << 2] + base_mvy[(m1y) << 2]); \
+ costs[2] += (base_mvx[(m2x) << 2] + base_mvy[(m2y) << 2]); \
+ costs[3] += (base_mvx[(m3x) << 2] + base_mvy[(m3y) << 2]); \
COPY2_IF_LT(bcost, costs[0], bmv, omv + MV(m0x, m0y)); \
COPY2_IF_LT(bcost, costs[1], bmv, omv + MV(m1x, m1y)); \
COPY2_IF_LT(bcost, costs[2], bmv, omv + MV(m2x, m2y)); \
@@ -285,10 +296,17 @@ void MotionEstimate::setSourcePU(const Y
pix_base + (m2x) + (m2y) * stride, \
pix_base + (m3x) + (m3y) * stride, \
stride, costs); \
- (costs)[0] += mvcost((bmv + MV(m0x, m0y)) << 2); \
- (costs)[1] += mvcost((bmv + MV(m1x, m1y)) << 2); \
- (costs)[2] += mvcost((bmv + MV(m2x, m2y)) << 2); \
- (costs)[3] += mvcost((bmv + MV(m3x, m3y)) << 2); \
+ /* TODO: use restrict keyword in ICL */ \
+ const uint16_t *base_mvx = &m_cost_mvx[(bmv.x << 2)]; \
+ const uint16_t *base_mvy = &m_cost_mvy[(bmv.y << 2)]; \
+ X265_CHECK(mvcost((bmv + MV(m0x, m0y)) << 2) == (base_mvx[(m0x) << 2] + base_mvy[(m0y) << 2]), "mvcost() check failure\n"); \
+ X265_CHECK(mvcost((bmv + MV(m1x, m1y)) << 2) == (base_mvx[(m1x) << 2] + base_mvy[(m1y) << 2]), "mvcost() check failure\n"); \
+ X265_CHECK(mvcost((bmv + MV(m2x, m2y)) << 2) == (base_mvx[(m2x) << 2] + base_mvy[(m2y) << 2]), "mvcost() check failure\n"); \
+ X265_CHECK(mvcost((bmv + MV(m3x, m3y)) << 2) == (base_mvx[(m3x) << 2] + base_mvy[(m3y) << 2]), "mvcost() check failure\n"); \
+ (costs)[0] += (base_mvx[(m0x) << 2] + base_mvy[(m0y) << 2]); \
+ (costs)[1] += (base_mvx[(m1x) << 2] + base_mvy[(m1y) << 2]); \
+ (costs)[2] += (base_mvx[(m2x) << 2] + base_mvy[(m2y) << 2]); \
+ (costs)[3] += (base_mvx[(m3x) << 2] + base_mvy[(m3y) << 2]); \
}
#define DIA1_ITER(mx, my) \
diff -r 614b33d1b4ff -r 7a1fd7073941 source/x265.def.in
--- a/source/x265.def.in Tue Mar 31 15:38:35 2015 +0530
+++ b/source/x265.def.in Tue May 05 14:44:19 2015 -0700
@@ -14,6 +14,7 @@ x265_version_str
x265_build_info_str
x265_encoder_headers
x265_encoder_parameters
+x265_encoder_reconfig
x265_encoder_encode
x265_encoder_get_stats
x265_encoder_log
diff -r 614b33d1b4ff -r 7a1fd7073941 source/x265.h
--- a/source/x265.h Tue Mar 31 15:38:35 2015 +0530
+++ b/source/x265.h Tue May 05 14:44:19 2015 -0700
@@ -1299,6 +1299,7 @@ typedef struct x265_api
void (*picture_init)(x265_param*, x265_picture*);
x265_encoder* (*encoder_open)(x265_param*);
void (*encoder_parameters)(x265_encoder*, x265_param*);
+ int (*encoder_reconfig)(x265_encoder*, x265_param*);
int (*encoder_headers)(x265_encoder*, x265_nal**, uint32_t*);
int (*encoder_encode)(x265_encoder*, x265_nal**, uint32_t*, x265_picture*, x265_picture*);
void (*encoder_get_stats)(x265_encoder*, x265_stats*, uint32_t);
More information about the x265-commits
mailing list