[x265-commits] [x265] uncrustify all source
Steve Borho
steve at borho.org
Mon Dec 2 00:44:02 CET 2013
details: http://hg.videolan.org/x265/rev/5bf05c39e566
branches:
changeset: 5407:5bf05c39e566
user: Steve Borho <steve at borho.org>
date: Sun Dec 01 17:41:43 2013 -0600
description:
uncrustify all source
diffstat:
source/Lib/TLibCommon/TComPicYuv.cpp | 4 +
source/Lib/TLibCommon/TComPrediction.cpp | 1 -
source/Lib/TLibCommon/TComSlice.h | 1 +
source/Lib/TLibCommon/TComYuv.cpp | 4 +-
source/Lib/TLibEncoder/TEncCu.cpp | 1 +
source/Lib/TLibEncoder/TEncCu.h | 2 +-
source/Lib/TLibEncoder/TEncSearch.cpp | 1 +
source/common/TShortYUV.cpp | 2 +
source/common/TShortYUV.h | 1 +
source/common/common.cpp | 8 +-
source/common/cpu.cpp | 8 +-
source/common/ipfilter.cpp | 9 ++-
source/common/pixel.cpp | 34 +++++++-------
source/common/primitives.h | 3 +-
source/common/vec/blockcopy-sse3.cpp | 1 +
source/common/vec/dct-sse3.cpp | 6 +-
source/common/vec/dct-ssse3.cpp | 2 +-
source/common/vec/intra-sse41.cpp | 3 +-
source/common/vec/intra-ssse3.cpp | 1 +
source/common/x86/asm-primitives.cpp | 9 ++-
source/common/x86/blockcopy8.h | 8 +-
source/common/x86/ipfilter8.h | 5 +-
source/common/x86/pixel.h | 10 ++--
source/encoder/compress.cpp | 18 +++---
source/encoder/encoder.cpp | 47 +++++++++++--------
source/encoder/frameencoder.cpp | 2 +
source/encoder/motion.cpp | 3 +
source/encoder/ratecontrol.cpp | 74 +++++++++++++++----------------
source/encoder/ratecontrol.h | 14 +++---
source/encoder/slicetype.cpp | 23 ++++++---
source/encoder/slicetype.h | 2 +-
source/input/y4m.cpp | 1 +
source/input/yuv.cpp | 1 +
source/output/y4m.cpp | 6 +-
source/output/yuv.cpp | 5 +-
source/test/intrapredharness.cpp | 7 +-
source/test/ipfilterharness.cpp | 23 +++++----
source/test/pixelharness.cpp | 28 ++++++-----
source/test/testbench.cpp | 1 +
source/x265.h | 16 +-----
40 files changed, 215 insertions(+), 180 deletions(-)
diffs (truncated from 1504 to 300 lines):
diff -r 7f2bc20e9ff1 -r 5bf05c39e566 source/Lib/TLibCommon/TComPicYuv.cpp
--- a/source/Lib/TLibCommon/TComPicYuv.cpp Sun Dec 01 16:50:08 2013 -0600
+++ b/source/Lib/TLibCommon/TComPicYuv.cpp Sun Dec 01 17:41:43 2013 -0600
@@ -209,6 +209,7 @@ void TComPicYuv::copyFromPicture(const x
/* internal pad to multiple of 16x16 blocks */
uint8_t rem = width & 15;
+
padx = rem ? 16 - rem : padx;
rem = width & 15;
pady = rem ? 16 - rem : pady;
@@ -232,6 +233,7 @@ void TComPicYuv::copyFromPicture(const x
{
Y[width + x] = Y[width - 1];
}
+
Y += getStride();
y += pic.stride[0];
}
@@ -249,6 +251,7 @@ void TComPicYuv::copyFromPicture(const x
U[(width >> m_hChromaShift) + x] = U[(width >> m_hChromaShift) - 1];
V[(width >> m_hChromaShift) + x] = V[(width >> m_hChromaShift) - 1];
}
+
U += getCStride();
V += getCStride();
u += pic.stride[1];
@@ -292,6 +295,7 @@ void TComPicYuv::copyFromPicture(const x
{
Y[width + x] = Y[width - 1];
}
+
Y += getStride();
y += pic.stride[0];
}
diff -r 7f2bc20e9ff1 -r 5bf05c39e566 source/Lib/TLibCommon/TComPrediction.cpp
--- a/source/Lib/TLibCommon/TComPrediction.cpp Sun Dec 01 16:50:08 2013 -0600
+++ b/source/Lib/TLibCommon/TComPrediction.cpp Sun Dec 01 17:41:43 2013 -0600
@@ -85,7 +85,6 @@ TComPrediction::~TComPrediction()
if (m_immedVals)
X265_FREE(m_immedVals);
-
}
void TComPrediction::initTempBuff(int csp)
diff -r 7f2bc20e9ff1 -r 5bf05c39e566 source/Lib/TLibCommon/TComSlice.h
--- a/source/Lib/TLibCommon/TComSlice.h Sun Dec 01 16:50:08 2013 -0600
+++ b/source/Lib/TLibCommon/TComSlice.h Sun Dec 01 17:41:43 2013 -0600
@@ -1269,6 +1269,7 @@ struct WpScalingParam
log2WeightDenom--;
inputWeight >>= 1;
}
+
inputWeight = X265_MIN(inputWeight, 127);
}
};
diff -r 7f2bc20e9ff1 -r 5bf05c39e566 source/Lib/TLibCommon/TComYuv.cpp
--- a/source/Lib/TLibCommon/TComYuv.cpp Sun Dec 01 16:50:08 2013 -0600
+++ b/source/Lib/TLibCommon/TComYuv.cpp Sun Dec 01 17:41:43 2013 -0600
@@ -427,8 +427,8 @@ void TComYuv::addClipChroma(TComYuv* src
uint32_t src1Stride = srcYuv1->m_cwidth;
uint32_t dststride = getCStride();
- primitives.chroma[m_csp].add_ps[part](dstU, dststride, srcU0, srcU1, src0Stride, src1Stride);
- primitives.chroma[m_csp].add_ps[part](dstV, dststride, srcV0, srcV1, src0Stride, src1Stride);
+ primitives.chroma[m_csp].add_ps[part](dstU, dststride, srcU0, srcU1, src0Stride, src1Stride);
+ primitives.chroma[m_csp].add_ps[part](dstV, dststride, srcV0, srcV1, src0Stride, src1Stride);
}
void TComYuv::subtract(TComYuv* srcYuv0, TComYuv* srcYuv1, uint32_t trUnitIdx, uint32_t partSize)
diff -r 7f2bc20e9ff1 -r 5bf05c39e566 source/Lib/TLibEncoder/TEncCu.cpp
--- a/source/Lib/TLibEncoder/TEncCu.cpp Sun Dec 01 16:50:08 2013 -0600
+++ b/source/Lib/TLibEncoder/TEncCu.cpp Sun Dec 01 17:41:43 2013 -0600
@@ -643,6 +643,7 @@ void TEncCu::xCompressIntraCU(TComDataCU
else
m_log->cntIntraNxN--;
}
+
m_log->cntIntra[depth + 1] += boundaryCu;
}
xCheckBestMode(outBestCU, outTempCU, depth); // RD compare current prediction with split prediction.
diff -r 7f2bc20e9ff1 -r 5bf05c39e566 source/Lib/TLibEncoder/TEncCu.h
--- a/source/Lib/TLibEncoder/TEncCu.h Sun Dec 01 16:50:08 2013 -0600
+++ b/source/Lib/TLibEncoder/TEncCu.h Sun Dec 01 17:41:43 2013 -0600
@@ -69,7 +69,7 @@ struct StatisticLog
StatisticLog()
{
- memset(this, 0, sizeof(StatisticLog));
+ memset(this, 0, sizeof(StatisticLog));
}
};
diff -r 7f2bc20e9ff1 -r 5bf05c39e566 source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp Sun Dec 01 16:50:08 2013 -0600
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp Sun Dec 01 17:41:43 2013 -0600
@@ -431,6 +431,7 @@ void TEncSearch::xIntraCodingLumaBlk(TCo
TCoeff* coeff = m_qtTempCoeffY[qtLayer] + numCoeffPerInc * absPartIdx;
int16_t* reconQt = m_qtTempTComYuv[qtLayer].getLumaAddr(absPartIdx);
+
assert(m_qtTempTComYuv[qtLayer].m_width == MAX_CU_SIZE);
uint32_t zorder = cu->getZorderIdxInCU() + absPartIdx;
diff -r 7f2bc20e9ff1 -r 5bf05c39e566 source/common/TShortYUV.cpp
--- a/source/common/TShortYUV.cpp Sun Dec 01 16:50:08 2013 -0600
+++ b/source/common/TShortYUV.cpp Sun Dec 01 17:41:43 2013 -0600
@@ -84,6 +84,7 @@ void TShortYUV::clear()
void TShortYUV::subtract(TComYuv* srcYuv0, TComYuv* srcYuv1, unsigned int trUnitIdx, unsigned int partSize)
{
int part = partitionFromSizes(partSize, partSize);
+
subtractLuma(srcYuv0, srcYuv1, trUnitIdx, partSize, part);
subtractChroma(srcYuv0, srcYuv1, trUnitIdx, partSize >> m_hChromaShift, part);
}
@@ -196,6 +197,7 @@ void TShortYUV::copyPartToPartLuma(TComY
unsigned int dstStride = dstPicYuv->getStride();
int part = partitionFromSizes(width, height);
+
primitives.luma_copy_sp[part](dst, dstStride, src, srcStride);
}
diff -r 7f2bc20e9ff1 -r 5bf05c39e566 source/common/TShortYUV.h
--- a/source/common/TShortYUV.h Sun Dec 01 16:50:08 2013 -0600
+++ b/source/common/TShortYUV.h Sun Dec 01 17:41:43 2013 -0600
@@ -55,6 +55,7 @@ private:
int m_csp;
int m_part;
+
public:
int16_t* m_bufY;
diff -r 7f2bc20e9ff1 -r 5bf05c39e566 source/common/common.cpp
--- a/source/common/common.cpp Sun Dec 01 16:50:08 2013 -0600
+++ b/source/common/common.cpp Sun Dec 01 17:41:43 2013 -0600
@@ -190,7 +190,7 @@ void x265_param_default(x265_param *para
param->bEnableTransformSkip = 0;
param->bEnableTSkipFast = 0;
param->maxNumReferences = 3;
-
+
/* Loop Filter */
param->bEnableLoopFilter = 1;
@@ -318,7 +318,7 @@ int x265_param_default_preset(x265_param
param->bEnableAMP = 0;
param->bEnableEarlySkip = 1;
param->bEnableCbfFastMode = 1;
- param->maxNumReferences = 1;
+ param->maxNumReferences = 1;
}
else if (!strcmp(preset, "faster"))
{
@@ -365,7 +365,7 @@ int x265_param_default_preset(x265_param
param->lookaheadDepth = 40;
param->bframes = 8;
param->tuQTMaxInterDepth = 3;
- param->tuQTMaxIntraDepth = 3;
+ param->tuQTMaxIntraDepth = 3;
param->rdLevel = 2;
param->subpelRefine = 4;
param->maxNumMergeCand = 4;
@@ -519,7 +519,7 @@ int x265_check_params(x265_param *param)
}
if (param->rc.aqStrength == 0)
{
- x265_log(param, X265_LOG_WARNING, "Aq mode specified, but Aq strength is 0, ignored\n" );
+ x265_log(param, X265_LOG_WARNING, "Aq mode specified, but Aq strength is 0, ignored\n");
param->rc.aqMode = 0;
}
diff -r 7f2bc20e9ff1 -r 5bf05c39e566 source/common/cpu.cpp
--- a/source/common/cpu.cpp Sun Dec 01 16:50:08 2013 -0600
+++ b/source/common/cpu.cpp Sun Dec 01 17:41:43 2013 -0600
@@ -305,10 +305,10 @@ int x265_cpu_cpuid_test(void)
#if defined(_MSC_VER)
#pragma warning(disable: 4100)
#elif defined(__GNUC__) || defined(__clang__) // use inline assembly, Gnu/AT&T syntax
-#define __cpuidex(regsArray, level, index)\
- __asm__ __volatile__ ("cpuid"\
- : "=a" ((regsArray)[0]), "=b" ((regsArray)[1]), "=c" ((regsArray)[2]), "=d" ((regsArray)[3])\
- : "0" (level), "2" (index));
+#define __cpuidex(regsArray, level, index) \
+ __asm__ __volatile__ ("cpuid" \
+ : "=a" ((regsArray)[0]), "=b" ((regsArray)[1]), "=c" ((regsArray)[2]), "=d" ((regsArray)[3]) \
+ : "0" (level), "2" (index));
#else
#error "compiler not supported"
#endif
diff -r 7f2bc20e9ff1 -r 5bf05c39e566 source/common/ipfilter.cpp
--- a/source/common/ipfilter.cpp Sun Dec 01 16:50:08 2013 -0600
+++ b/source/common/ipfilter.cpp Sun Dec 01 17:41:43 2013 -0600
@@ -276,6 +276,7 @@ void interp_horiz_ps_c(pixel *src, intpt
int headRoom = IF_INTERNAL_PREC - X265_DEPTH;
int shift = IF_FILTER_PREC - headRoom;
int offset = -IF_INTERNAL_OFFS << shift;
+
src -= N / 2 - 1;
int row, col;
@@ -482,14 +483,14 @@ namespace x265 {
#define CHROMA(W, H) \
p.chroma[X265_CSP_I420].filter_hpp[CHROMA_ ## W ## x ## H] = interp_horiz_pp_c<4, W, H>; \
p.chroma[X265_CSP_I420].filter_hps[CHROMA_ ## W ## x ## H] = interp_horiz_ps_c<4, W, H>; \
- p.chroma[X265_CSP_I420].filter_vpp[CHROMA_ ## W ## x ## H] = interp_vert_pp_c < 4, W, H >; \
+ p.chroma[X265_CSP_I420].filter_vpp[CHROMA_ ## W ## x ## H] = interp_vert_pp_c<4, W, H>; \
p.chroma[X265_CSP_I420].filter_vps[CHROMA_ ## W ## x ## H] = interp_vert_ps_c<4, W, H>; \
- p.chroma[X265_CSP_I420].filter_vsp[CHROMA_ ## W ## x ## H] = interp_vert_sp_c < 4, W, H >; \
- p.chroma[X265_CSP_I420].filter_vss[CHROMA_ ## W ## x ## H] = interp_vert_ss_c < 4, W, H >;
+ p.chroma[X265_CSP_I420].filter_vsp[CHROMA_ ## W ## x ## H] = interp_vert_sp_c<4, W, H>; \
+ p.chroma[X265_CSP_I420].filter_vss[CHROMA_ ## W ## x ## H] = interp_vert_ss_c<4, W, H>;
#define LUMA(W, H) \
p.luma_hpp[LUMA_ ## W ## x ## H] = interp_horiz_pp_c<8, W, H>; \
- p.luma_hps[LUMA_ ## W ## x ## H] = interp_horiz_ps_c<8, W, H>;\
+ p.luma_hps[LUMA_ ## W ## x ## H] = interp_horiz_ps_c<8, W, H>; \
p.luma_vpp[LUMA_ ## W ## x ## H] = interp_vert_pp_c<8, W, H>; \
p.luma_vps[LUMA_ ## W ## x ## H] = interp_vert_ps_c<8, W, H>; \
p.luma_vsp[LUMA_ ## W ## x ## H] = interp_vert_sp_c<8, W, H>; \
diff -r 7f2bc20e9ff1 -r 5bf05c39e566 source/common/pixel.cpp
--- a/source/common/pixel.cpp Sun Dec 01 16:50:08 2013 -0600
+++ b/source/common/pixel.cpp Sun Dec 01 17:41:43 2013 -0600
@@ -654,21 +654,21 @@ float ssim_end_1(int s1, int s2, int ss,
#define PIXEL_MAX ((1 << X265_DEPTH) - 1)
#if HIGH_BIT_DEPTH
#define type float
- static const float ssim_c1 = (float)(.01*.01*PIXEL_MAX*PIXEL_MAX*64);
- static const float ssim_c2 = (float)(.03*.03*PIXEL_MAX*PIXEL_MAX*64*63);
+ static const float ssim_c1 = (float)(.01 * .01 * PIXEL_MAX * PIXEL_MAX * 64);
+ static const float ssim_c2 = (float)(.03 * .03 * PIXEL_MAX * PIXEL_MAX * 64 * 63);
#else
#define type int
- static const int ssim_c1 = (int)(.01*.01*PIXEL_MAX*PIXEL_MAX*64 + .5);
- static const int ssim_c2 = (int)(.03*.03*PIXEL_MAX*PIXEL_MAX*64*63 + .5);
+ static const int ssim_c1 = (int)(.01 * .01 * PIXEL_MAX * PIXEL_MAX * 64 + .5);
+ static const int ssim_c2 = (int)(.03 * .03 * PIXEL_MAX * PIXEL_MAX * 64 * 63 + .5);
#endif
type fs1 = s1;
type fs2 = s2;
type fss = ss;
type fs12 = s12;
- type vars = fss*64 - fs1*fs1 - fs2*fs2;
- type covar = fs12*64 - fs1*fs2;
- return (float)(2*fs1*fs2 + ssim_c1) * (float)(2*covar + ssim_c2)
- / ((float)(fs1*fs1 + fs2*fs2 + ssim_c1) * (float)(vars + ssim_c2));
+ type vars = fss * 64 - fs1 * fs1 - fs2 * fs2;
+ type covar = fs12 * 64 - fs1 * fs2;
+ return (float)(2 * fs1 * fs2 + ssim_c1) * (float)(2 * covar + ssim_c2)
+ / ((float)(fs1 * fs1 + fs2 * fs2 + ssim_c1) * (float)(vars + ssim_c2));
#undef type
#undef PIXEL_MAX
}
@@ -784,19 +784,19 @@ void pixel_sub_ps_c(int16_t *a, intptr_t
template<int bx, int by>
void pixel_add_ps_c(pixel *a, intptr_t dstride, pixel *b0, int16_t *b1, intptr_t sstride0, intptr_t sstride1)
- {
+{
for (int y = 0; y < by; y++)
{
- for (int x = 0; x < bx; x++)
- {
- a[x] = (pixel)ClipY(b0[x] + b1[x]);
- }
+ for (int x = 0; x < bx; x++)
+ {
+ a[x] = (pixel)ClipY(b0[x] + b1[x]);
+ }
- b0 += sstride0;
- b1 += sstride1;
- a += dstride;
+ b0 += sstride0;
+ b1 += sstride1;
+ a += dstride;
}
- }
+}
} // end anonymous namespace
namespace x265 {
diff -r 7f2bc20e9ff1 -r 5bf05c39e566 source/common/primitives.h
--- a/source/common/primitives.h Sun Dec 01 16:50:08 2013 -0600
+++ b/source/common/primitives.h Sun Dec 01 17:41:43 2013 -0600
@@ -273,7 +273,8 @@ struct EncoderPrimitives
plane_copy_deinterleave_t plane_copy_deinterleave_c;
extendCURowBorder_t extendRowBorder;
- struct {
+ struct
+ {
filter_pp_t filter_vpp[NUM_LUMA_PARTITIONS];
filter_ps_t filter_vps[NUM_LUMA_PARTITIONS];
filter_sp_t filter_vsp[NUM_LUMA_PARTITIONS];
diff -r 7f2bc20e9ff1 -r 5bf05c39e566 source/common/vec/blockcopy-sse3.cpp
--- a/source/common/vec/blockcopy-sse3.cpp Sun Dec 01 16:50:08 2013 -0600
+++ b/source/common/vec/blockcopy-sse3.cpp Sun Dec 01 17:41:43 2013 -0600
More information about the x265-commits
mailing list