[x265] [PATCH] sao: cleanup, remove unnecessary rdoInit, no output change
deepthi at multicorewareinc.com
deepthi at multicorewareinc.com
Fri Jul 3 06:16:18 CEST 2015
# HG changeset patch
# User Deepthi Nandakumar <deepthi at multicorewareinc.com>
# Date 1435896914 -19800
# Fri Jul 03 09:45:14 2015 +0530
# Node ID 1867f1703846ad606bde5c5872b7d02c29211097
# Parent de61709ccf560f8b340f2ffed6fbbdab85941101
sao: cleanup, remove unnecessary rdoInit, no output change
diff -r de61709ccf56 -r 1867f1703846 source/encoder/sao.cpp
--- a/source/encoder/sao.cpp Thu Jul 02 16:49:08 2015 -0700
+++ b/source/encoder/sao.cpp Fri Jul 03 09:45:14 2015 +0530
@@ -223,14 +223,19 @@
frame->m_encData->m_saoParam = saoParam;
}
- rdoSaoUnitRowInit(saoParam);
+ saoParam->bSaoFlag[0] = true;
+ saoParam->bSaoFlag[1] = true;
- // NOTE: Disable SAO automatic turn-off when frame parallelism is
- // enabled for output exact independent of frame thread count
- if (m_param->frameNumThreads > 1)
+ m_numNoSao[0] = 0; // Luma
+ m_numNoSao[1] = 0; // Chroma
+
+ // NOTE: Allow SAO automatic turn-off only when frame parallelism is disabled.
+ if (m_param->frameNumThreads == 1)
{
- saoParam->bSaoFlag[0] = true;
- saoParam->bSaoFlag[1] = true;
+ if (m_refDepth > 0 && m_depthSaoRate[0][m_refDepth - 1] > SAO_ENCODING_RATE)
+ saoParam->bSaoFlag[0] = false;
+ if (m_refDepth > 0 && m_depthSaoRate[1][m_refDepth - 1] > SAO_ENCODING_RATE_CHROMA)
+ saoParam->bSaoFlag[1] = false;
}
}
@@ -1176,19 +1181,6 @@
memset(m_offsetOrg, 0, sizeof(PerClass) * NUM_PLANE);
}
-void SAO::rdoSaoUnitRowInit(SAOParam* saoParam)
-{
- saoParam->bSaoFlag[0] = true;
- saoParam->bSaoFlag[1] = true;
-
- m_numNoSao[0] = 0; // Luma
- m_numNoSao[1] = 0; // Chroma
- if (m_refDepth > 0 && m_depthSaoRate[0][m_refDepth - 1] > SAO_ENCODING_RATE)
- saoParam->bSaoFlag[0] = false;
- if (m_refDepth > 0 && m_depthSaoRate[1][m_refDepth - 1] > SAO_ENCODING_RATE_CHROMA)
- saoParam->bSaoFlag[1] = false;
-}
-
void SAO::rdoSaoUnitRowEnd(const SAOParam* saoParam, int numctus)
{
if (!saoParam->bSaoFlag[0])
diff -r de61709ccf56 -r 1867f1703846 source/encoder/sao.h
--- a/source/encoder/sao.h Thu Jul 02 16:49:08 2015 -0700
+++ b/source/encoder/sao.h Fri Jul 03 09:45:14 2015 +0530
@@ -144,7 +144,6 @@
int32_t* currentDistortionTableBo, double* currentRdCostTableBo);
inline int64_t estSaoTypeDist(int plane, int typeIdx, double lambda, int32_t* currentDistortionTableBo, double* currentRdCostTableBo);
- void rdoSaoUnitRowInit(SAOParam* saoParam);
void rdoSaoUnitRowEnd(const SAOParam* saoParam, int numctus);
void rdoSaoUnitRow(SAOParam* saoParam, int idxY);
};
More information about the x265-devel
mailing list