[x265-commits] [x265] recon: nits

Steve Borho steve at borho.org
Tue Feb 10 19:27:38 CET 2015


details:   http://hg.videolan.org/x265/rev/e692ee795a59
branches:  
changeset: 9334:e692ee795a59
user:      Steve Borho <steve at borho.org>
date:      Mon Feb 09 17:13:41 2015 -0600
description:
recon: nits
Subject: [x265] nit: remove remaining :: scope prefixes from memset and memcpy

details:   http://hg.videolan.org/x265/rev/0cf24f853d7b
branches:  
changeset: 9335:0cf24f853d7b
user:      Steve Borho <steve at borho.org>
date:      Mon Feb 09 17:52:53 2015 -0600
description:
nit: remove remaining :: scope prefixes from memset and memcpy

we might as well be consistent

diffstat:

 source/common/bitstream.cpp   |  2 +-
 source/common/ipfilter.cpp    |  4 ++--
 source/common/scalinglist.cpp |  2 +-
 source/common/shortyuv.cpp    |  6 +++---
 source/common/slice.cpp       |  4 ++--
 source/common/slice.h         |  6 +++---
 source/output/y4m.cpp         |  8 --------
 source/output/yuv.cpp         |  4 ----
 8 files changed, 12 insertions(+), 24 deletions(-)

diffs (152 lines):

diff -r 6f2220b4c9a5 -r 0cf24f853d7b source/common/bitstream.cpp
--- a/source/common/bitstream.cpp	Tue Feb 10 11:25:23 2015 -0600
+++ b/source/common/bitstream.cpp	Mon Feb 09 17:52:53 2015 -0600
@@ -27,7 +27,7 @@ void Bitstream::push_back(uint8_t val)
         uint8_t *temp = X265_MALLOC(uint8_t, m_byteAlloc * 2);
         if (temp)
         {
-            ::memcpy(temp, m_fifo, m_byteOccupancy);
+            memcpy(temp, m_fifo, m_byteOccupancy);
             X265_FREE(m_fifo);
             m_fifo = temp;
             m_byteAlloc *= 2;
diff -r 6f2220b4c9a5 -r 0cf24f853d7b source/common/ipfilter.cpp
--- a/source/common/ipfilter.cpp	Tue Feb 10 11:25:23 2015 -0600
+++ b/source/common/ipfilter.cpp	Mon Feb 09 17:52:53 2015 -0600
@@ -84,8 +84,8 @@ void extendCURowColBorder(pixel* txt, in
         }
 
 #else
-        ::memset(txt - marginX, txt[0], marginX);
-        ::memset(txt + width, txt[width - 1], marginX);
+        memset(txt - marginX, txt[0], marginX);
+        memset(txt + width, txt[width - 1], marginX);
 #endif
 
         txt += stride;
diff -r 6f2220b4c9a5 -r 0cf24f853d7b source/common/scalinglist.cpp
--- a/source/common/scalinglist.cpp	Tue Feb 10 11:25:23 2015 -0600
+++ b/source/common/scalinglist.cpp	Mon Feb 09 17:52:53 2015 -0600
@@ -222,7 +222,7 @@ const int32_t* ScalingList::getScalingLi
 
 void ScalingList::processDefaultMarix(int sizeId, int listId)
 {
-    ::memcpy(m_scalingListCoef[sizeId][listId], getScalingListDefaultAddress(sizeId, listId), sizeof(int) * X265_MIN(MAX_MATRIX_COEF_NUM, s_numCoefPerSize[sizeId]));
+    memcpy(m_scalingListCoef[sizeId][listId], getScalingListDefaultAddress(sizeId, listId), sizeof(int) * X265_MIN(MAX_MATRIX_COEF_NUM, s_numCoefPerSize[sizeId]));
     m_scalingListDC[sizeId][listId] = SCALING_LIST_DC;
 }
 
diff -r 6f2220b4c9a5 -r 0cf24f853d7b source/common/shortyuv.cpp
--- a/source/common/shortyuv.cpp	Tue Feb 10 11:25:23 2015 -0600
+++ b/source/common/shortyuv.cpp	Mon Feb 09 17:52:53 2015 -0600
@@ -66,9 +66,9 @@ void ShortYuv::destroy()
 
 void ShortYuv::clear()
 {
-    ::memset(m_buf[0], 0, (m_size  * m_size) *  sizeof(int16_t));
-    ::memset(m_buf[1], 0, (m_csize * m_csize) * sizeof(int16_t));
-    ::memset(m_buf[2], 0, (m_csize * m_csize) * sizeof(int16_t));
+    memset(m_buf[0], 0, (m_size  * m_size) *  sizeof(int16_t));
+    memset(m_buf[1], 0, (m_csize * m_csize) * sizeof(int16_t));
+    memset(m_buf[2], 0, (m_csize * m_csize) * sizeof(int16_t));
 }
 
 void ShortYuv::subtract(const Yuv& srcYuv0, const Yuv& srcYuv1, uint32_t log2Size)
diff -r 6f2220b4c9a5 -r 0cf24f853d7b source/common/slice.cpp
--- a/source/common/slice.cpp	Tue Feb 10 11:25:23 2015 -0600
+++ b/source/common/slice.cpp	Mon Feb 09 17:52:53 2015 -0600
@@ -33,7 +33,7 @@ void Slice::setRefPicList(PicList& picLi
 {
     if (m_sliceType == I_SLICE)
     {
-        ::memset(m_refPicList, 0, sizeof(m_refPicList));
+        memset(m_refPicList, 0, sizeof(m_refPicList));
         m_numRefIdx[1] = m_numRefIdx[0] = 0;
         return;
     }
@@ -112,7 +112,7 @@ void Slice::setRefPicList(PicList& picLi
     if (m_sliceType != B_SLICE)
     {
         m_numRefIdx[1] = 0;
-        ::memset(m_refPicList[1], 0, sizeof(m_refPicList[1]));
+        memset(m_refPicList[1], 0, sizeof(m_refPicList[1]));
     }
     else
     {
diff -r 6f2220b4c9a5 -r 0cf24f853d7b source/common/slice.h
--- a/source/common/slice.h	Tue Feb 10 11:25:23 2015 -0600
+++ b/source/common/slice.h	Mon Feb 09 17:52:53 2015 -0600
@@ -55,9 +55,9 @@ struct RPS
         , numberOfNegativePictures(0)
         , numberOfPositivePictures(0)
     {
-        ::memset(deltaPOC, 0, sizeof(deltaPOC));
-        ::memset(poc, 0, sizeof(poc));
-        ::memset(bUsed, 0, sizeof(bUsed));
+        memset(deltaPOC, 0, sizeof(deltaPOC));
+        memset(poc, 0, sizeof(poc));
+        memset(bUsed, 0, sizeof(bUsed));
     }
 
     void sortDeltaPOC();
diff -r 6f2220b4c9a5 -r 0cf24f853d7b source/output/y4m.cpp
--- a/source/output/y4m.cpp	Tue Feb 10 11:25:23 2015 -0600
+++ b/source/output/y4m.cpp	Mon Feb 09 17:52:53 2015 -0600
@@ -46,9 +46,7 @@ Y4MOutput::Y4MOutput(const char *filenam
     }
 
     for (int i = 0; i < x265_cli_csps[colorSpace].planes; i++)
-    {
         frameSize += (uint32_t)((width >> x265_cli_csps[colorSpace].width[i]) * (height >> x265_cli_csps[colorSpace].height[i]));
-    }
 }
 
 Y4MOutput::~Y4MOutput()
@@ -66,14 +64,10 @@ bool Y4MOutput::writePicture(const x265_
 
 #if HIGH_BIT_DEPTH
     if (pic.bitDepth > 8 && pic.poc == 0)
-    {
         x265_log(NULL, X265_LOG_WARNING, "y4m: down-shifting reconstructed pixels to 8 bits\n");
-    }
 #else
     if (pic.bitDepth > 8 && pic.poc == 0)
-    {
         x265_log(NULL, X265_LOG_WARNING, "y4m: forcing reconstructed pixels to 8 bits\n");
-    }
 #endif
 
     X265_CHECK(pic.colorSpace == colorSpace, "invalid color space\n");
@@ -89,9 +83,7 @@ bool Y4MOutput::writePicture(const x265_
         for (int h = 0; h < height >> x265_cli_csps[colorSpace].height[i]; h++)
         {
             for (int w = 0; w < width >> x265_cli_csps[colorSpace].width[i]; w++)
-            {
                 buf[w] = (char)(src[w] >> shift);
-            }
 
             ofs.write(buf, width >> x265_cli_csps[colorSpace].width[i]);
             src += pic.stride[i] / sizeof(*src);
diff -r 6f2220b4c9a5 -r 0cf24f853d7b source/output/yuv.cpp
--- a/source/output/yuv.cpp	Tue Feb 10 11:25:23 2015 -0600
+++ b/source/output/yuv.cpp	Mon Feb 09 17:52:53 2015 -0600
@@ -39,9 +39,7 @@ YUVOutput::YUVOutput(const char *filenam
     buf = new char[width];
 
     for (int i = 0; i < x265_cli_csps[colorSpace].planes; i++)
-    {
         frameSize += (uint32_t)((width >> x265_cli_csps[colorSpace].width[i]) * (height >> x265_cli_csps[colorSpace].height[i]));
-    }
 }
 
 YUVOutput::~YUVOutput()
@@ -69,9 +67,7 @@ bool YUVOutput::writePicture(const x265_
             for (int h = 0; h < height >> x265_cli_csps[colorSpace].height[i]; h++)
             {
                 for (int w = 0; w < width >> x265_cli_csps[colorSpace].width[i]; w++)
-                {
                     buf[w] = (char)(src[w] >> shift);
-                }
 
                 ofs.write(buf, width >> x265_cli_csps[colorSpace].width[i]);
                 src += pic.stride[i] / sizeof(*src);


More information about the x265-commits mailing list