<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 3, 2014 at 6:51 AM, <span dir="ltr"><<a href="mailto:ashok@multicorewareinc.com" target="_blank">ashok@multicorewareinc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User <a href="mailto:ashok@multicorewareinc.com">ashok@multicorewareinc.com</a><br>
# Date 1388753501 -19800<br>
# Fri Jan 03 18:21:41 2014 +0530<br>
# Node ID 98e238489f843ff233c512570c1fab75b2ff801a<br>
# Parent f83443bbae4d5b0e98bc85e011d8a4f4fe0bce95<br>
Modify TComDataCU structure to support multiple color space formats<br>
<br>
diff -r f83443bbae4d -r 98e238489f84 source/Lib/TLibCommon/CommonDef.h<br>
--- a/source/Lib/TLibCommon/CommonDef.h Fri Jan 03 18:16:18 2014 +0530<br>
+++ b/source/Lib/TLibCommon/CommonDef.h Fri Jan 03 18:21:41 2014 +0530<br>
@@ -88,6 +88,9 @@<br>
#define MLS_GRP_NUM 64 ///< G644 : Max number of coefficient groups, max(16, 64)<br>
#define MLS_CG_SIZE 4 ///< G644 : Coefficient group size of 4x4<br>
<br>
+#define MLS_CG_LOG2_WIDTH 2<br>
+#define MLS_CG_LOG2_HEIGHT 2<br>
+<br>
#define ARL_C_PRECISION 7 ///< G382: 7-bit arithmetic precision<br>
#define LEVEL_RANGE 30 ///< G382: max coefficient level in statistics collection<br>
<br>
diff -r f83443bbae4d -r 98e238489f84 source/Lib/TLibCommon/ContextTables.h<br>
--- a/source/Lib/TLibCommon/ContextTables.h Fri Jan 03 18:16:18 2014 +0530<br>
+++ b/source/Lib/TLibCommon/ContextTables.h Fri Jan 03 18:21:41 2014 +0530<br>
@@ -153,10 +153,21 @@<br>
#define sbacGetEntropyBits(S, V) (g_entropyBits[(S) ^ (V)])<br>
#define sbacGetEntropyBitsTrm(V) (g_entropyBits[126 ^ (V)])<br>
<br>
+#define CHANNEL_TYPE_LUMA 0<br>
+#define CHANNEL_TYPE_CHROMA 1<br>
+#define MAX_NUM_CHANNEL_TYPE 2<br>
+<br>
// ====================================================================================================================<br>
// Tables<br>
// ====================================================================================================================<br>
<br>
+#define NEIGHBOURHOOD_00_CONTEXT_1_THRESHOLD_4x4 3<br>
+#define NEIGHBOURHOOD_00_CONTEXT_2_THRESHOLD_4x4 1<br>
+<br>
+static const uint32_t significanceMapContextSetStart [MAX_NUM_CHANNEL_TYPE][3] = { {0, 9, 21}, {0, 9, 12} };<br>
+static const uint32_t significanceMapContextSetSize [MAX_NUM_CHANNEL_TYPE][3] = { {9, 12, 6}, {9, 3, 3} };<br>
+static const uint32_t nonDiagonalScan8x8ContextOffset [MAX_NUM_CHANNEL_TYPE] = { 6, 0 };<br>
+static const uint32_t notFirstGroupNeighbourhoodContextOffset[MAX_NUM_CHANNEL_TYPE] = { 3, 0 };<br>
<br>
// initial probability for cu_transquant_bypass flag<br>
static const uint8_t<br>
diff -r f83443bbae4d -r 98e238489f84 source/Lib/TLibCommon/TComDataCU.cpp<br>
--- a/source/Lib/TLibCommon/TComDataCU.cpp Fri Jan 03 18:16:18 2014 +0530<br>
+++ b/source/Lib/TLibCommon/TComDataCU.cpp Fri Jan 03 18:21:41 2014 +0530<br>
@@ -629,7 +629,7 @@<br>
memcpy(rpcCU->getCoeffY() + tmp2, m_trCoeffY, sizeof(TCoeff) * tmp);<br>
memcpy(rpcCU->getPCMSampleY() + tmp2, m_iPCMSampleY, sizeof(Pel) * tmp);<br>
<br>
- tmp = ((g_maxCUWidth >> m_hChromaShift) * (g_maxCUHeight >> m_hChromaShift)) >> (uhDepth << 1);<br>
+ tmp = ((g_maxCUWidth >> m_hChromaShift) * (g_maxCUHeight >> m_vChromaShift)) >> (uhDepth << 1);<br>
tmp2 = m_absIdxInLCU * (m_pic->getMinCUWidth() >> m_hChromaShift) * (m_pic->getMinCUHeight() >> m_vChromaShift);<br>
memcpy(rpcCU->getCoeffCb() + tmp2, m_trCoeffCb, sizeof(TCoeff) * tmp);<br>
memcpy(rpcCU->getCoeffCr() + tmp2, m_trCoeffCr, sizeof(TCoeff) * tmp);<br>
@@ -2961,60 +2961,71 @@<br>
<br>
uint32_t TComDataCU::getCoefScanIdx(uint32_t absPartIdx, uint32_t width, bool bIsLuma, bool bIsIntra)<br>
{<br>
- uint32_t uiCTXIdx;<br>
uint32_t scanIdx;<br>
uint32_t dirMode;<br>
<br>
if (!bIsIntra)<br>
{<br>
- scanIdx = SCAN_DIAG;<br>
- return scanIdx;<br>
+ return SCAN_DIAG;<br>
}<br>
<br>
- switch (width)<br>
- {<br>
- case 2: uiCTXIdx = 6;<br>
- break;<br>
- case 4: uiCTXIdx = 5;<br>
- break;<br>
- case 8: uiCTXIdx = 4;<br>
- break;<br>
- case 16: uiCTXIdx = 3;<br>
- break;<br>
- case 32: uiCTXIdx = 2;<br>
- break;<br>
- case 64: uiCTXIdx = 1;<br>
- break;<br>
- default: uiCTXIdx = 0;<br>
- break;<br>
- }<br>
-<br>
+ //check that MDCS can be used for this TU<br>
+<br>
+ uint32_t height = width; // For testing Need to change later<br>
if (bIsLuma)<br>
{<br>
+ const uint32_t maximumWidth = MDCS_MAXIMUM_WIDTH;<br>
+ const uint32_t maximumHeight = MDCS_MAXIMUM_HEIGHT;<br>
+<br>
+ if ((width > maximumWidth) || (height > maximumHeight)) return SCAN_DIAG;<br>
+<br>
dirMode = getLumaIntraDir(absPartIdx);<br>
- scanIdx = SCAN_DIAG;<br>
- if (uiCTXIdx > 3 && uiCTXIdx < 6) //if multiple scans supported for transform size<br>
- {<br>
- scanIdx = abs((int)dirMode - VER_IDX) < 5 ? SCAN_HOR : (abs((int)dirMode - HOR_IDX) < 5 ? SCAN_VER : SCAN_DIAG);<br>
- }<br>
}<br>
else<br>
{<br>
- dirMode = getChromaIntraDir(absPartIdx);<br>
+ const uint32_t maximumWidth = MDCS_MAXIMUM_WIDTH >> m_hChromaShift;<br>
+ const uint32_t maximumHeight = MDCS_MAXIMUM_HEIGHT >> m_vChromaShift;<br>
+<br>
+ if ((width > maximumWidth) || (height > maximumHeight)) return SCAN_DIAG;<br>
+<br>
+ dirMode = getChromaIntraDir(absPartIdx);<br>
if (dirMode == DM_CHROMA_IDX)<br>
{<br>
- // get number of partitions in current CU<br>
- uint32_t depth = getDepth(absPartIdx);<br>
- uint32_t numParts = getPic()->getNumPartInCU() >> (2 * depth);<br>
-<br>
- // get luma mode from upper-left corner of current CU<br>
- dirMode = getLumaIntraDir((absPartIdx / numParts) * numParts);<br>
+ dirMode = getLumaIntraDir(absPartIdx);<br>
}<br>
- scanIdx = SCAN_DIAG;<br>
- if (uiCTXIdx > 4 && uiCTXIdx < 7) //if multiple scans supported for transform size<br>
- {<br>
- scanIdx = abs((int)dirMode - VER_IDX) < 5 ? SCAN_HOR : (abs((int)dirMode - HOR_IDX) < 5 ? SCAN_VER : SCAN_DIAG);<br>
- }<br>
+ }<br>
+<br>
+ switch (MDCS_MODE)<br>
+ {<br>
+ case MDCS_BOTH_DIRECTIONS:<br>
+ if (abs((int)dirMode - VER_IDX) <= MDCS_ANGLE_LIMIT)<br>
+ scanIdx = SCAN_HOR;<br>
+ else if (abs((int)dirMode - HOR_IDX) <= MDCS_ANGLE_LIMIT)<br>
+ scanIdx = SCAN_VER;<br>
+ else<br>
+ scanIdx = SCAN_DIAG;<br>
+ break;<br>
+<br>
+ case MDCS_VERTICAL_ONLY:<br>
+ if (abs((int)dirMode - HOR_IDX) <= MDCS_ANGLE_LIMIT)<br>
+ scanIdx = SCAN_VER;<br>
+ break;<br>
+<br>
+ case MDCS_HORIZONTAL_ONLY:<br>
+ if (abs((int)dirMode - VER_IDX) <= MDCS_ANGLE_LIMIT)<br>
+ scanIdx = SCAN_HOR;<br>
+ break;<br>
+<br>
+ case MDCS_DISABLED:<br>
+ scanIdx = 0;<br>
+ break;<br>
+<br>
+ default:<br>
+ //std::cerr << "ERROR: Unrecognised MDCS mode" << std::endl;<br>
+ //assert(false);<br>
+ scanIdx = 0;<br>
+ //exit(1);<br>
+ break;<br></blockquote><div><br></div><div>remove these commented lines, if this condition is as bad as it looks it should at least issue an error log message.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
}<br>
<br>
return scanIdx;<br>
diff -r f83443bbae4d -r 98e238489f84 source/Lib/TLibCommon/TComDataCU.h<br>
--- a/source/Lib/TLibCommon/TComDataCU.h Fri Jan 03 18:16:18 2014 +0530<br>
+++ b/source/Lib/TLibCommon/TComDataCU.h Fri Jan 03 18:21:41 2014 +0530<br>
@@ -493,6 +493,7 @@<br>
int getHorzChromaShift() { return m_hChromaShift; }<br>
<br>
int getVertChromaShift() { return m_vChromaShift; }<br>
+ int getChromaFormat() { return m_chromaFormat; }<br>
};<br>
<br>
namespace RasterAddress {<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Steve Borho
</div></div>