[x265] [PATCH 4 of 4] TEncSearch: Fix compile error due to char array subscript

ShinYee Chung shinyee at multicorewareinc.com
Wed Jun 19 18:25:20 CEST 2013


# HG changeset patch
# User ShinYee Chung <shinyee at multicorewareinc.com>
# Date 1371657974 -28800
# Node ID 36c819ca7f0a87749415253fc2e55cb0e4b53ee4
# Parent  8dba5d24798a020b9027913d820f69930329583d
TEncSearch: Fix compile error due to char array subscript.

Sample compile errors in Linux64/GCC4.8.1:

$HEVC/source/Lib/TLibEncoder/TEncSearch.cpp:2134:75: error: array subscript has type ‘char’ [-Werror=char-subscripts]
     x265::pixelcmp sa8d = x265::primitives.sa8d[g_aucConvertToBit[uiWidth]];
                                                                           ^
$HEVC/source/Lib/TLibEncoder/TEncSearch.cpp: In member function ‘Void TEncSearch::estIntraPredQT(TComDataCU*, TComYuv*, TComYuv*, TShortYUV*, TComYuv*, UInt&, Bool)’:
$HEVC/source/Lib/TLibEncoder/TEncSearch.cpp:2206:79: error: array subscript has type ‘char’ [-Werror=char-subscripts]
         x265::pixelcmp sa8d = x265::primitives.sa8d[g_aucConvertToBit[uiWidth]];
                                                                               ^

diff -r 8dba5d24798a -r 36c819ca7f0a source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp	Thu Jun 20 00:13:24 2013 +0800
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp	Thu Jun 20 00:06:14 2013 +0800
@@ -2131,7 +2131,7 @@
     UInt  uiMaxMode   = 4;
     UInt  uiBestMode  = MAX_UINT;
     UInt  uiMinSAD    = MAX_UINT;
-    x265::pixelcmp sa8d = x265::primitives.sa8d[g_aucConvertToBit[uiWidth]];
+    x265::pixelcmp sa8d = x265::primitives.sa8d[(int)g_aucConvertToBit[uiWidth]];
     for (UInt uiMode  = uiMinMode; uiMode < uiMaxMode; uiMode++)
     {
         //--- get prediction ---
@@ -2203,7 +2203,7 @@
         UInt uiStride      = pcPredYuv->getStride();
         UInt uiRdModeList[FAST_UDI_MAX_RDMODE_NUM];
         Int numModesForFullRD = g_aucIntraModeNumFast[uiWidthBit];
-        x265::pixelcmp sa8d = x265::primitives.sa8d[g_aucConvertToBit[uiWidth]];
+        x265::pixelcmp sa8d = x265::primitives.sa8d[(int)g_aucConvertToBit[uiWidth]];
 
         Bool doFastSearch = (numModesForFullRD != numModesAvailable);
         if (doFastSearch)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xhevc.hg-4.patch
Type: text/x-patch
Size: 2117 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20130620/f4eb4670/attachment-0001.bin>


More information about the x265-devel mailing list