<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 17, 2013 at 2:21 AM, <span dir="ltr"><<a href="mailto:aarthi@multicorewareinc.com" target="_blank">aarthi@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 Aarthi Thirumalai<<a href="mailto:aarthi@multicorewareinc.com">aarthi@multicorewareinc.com</a>><br>
# Date 1381989693 -19800<br>
# Thu Oct 17 11:31:33 2013 +0530<br>
# Node ID aad785763f1d38473177e3f1293d3012d79239ca<br>
# Parent 1d6b3626f1b3d4b8f8f181e66eaaa649f90bac02<br>
TComPic: add m_qpAqOffset to store qp offsets per CU when Aq is enabled<br></blockquote><div><br></div><div>I have a nit, sorry</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff -r 1d6b3626f1b3 -r aad785763f1d source/Lib/TLibCommon/TComPic.cpp<br>
--- a/source/Lib/TLibCommon/TComPic.cpp Wed Oct 16 20:38:44 2013 -0500<br>
+++ b/source/Lib/TLibCommon/TComPic.cpp Thu Oct 17 11:31:33 2013 +0530<br>
@@ -61,6 +61,7 @@<br>
memset(&m_lowres, 0, sizeof(m_lowres));<br>
m_next = NULL;<br>
m_prev = NULL;<br>
+ m_qpAqOffset = NULL;<br>
m_SSDY = 0;<br>
m_SSDU = 0;<br>
m_SSDV = 0;<br>
@@ -69,25 +70,32 @@<br>
TComPic::~TComPic()<br>
{}<br>
<br>
-void TComPic::create(int width, int height, UInt maxWidth, UInt maxHeight, UInt maxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, int bframes)<br>
+void TComPic::create(TEncCfg* cfg)<br>
{<br>
m_picSym = new TComPicSym;<br>
- m_picSym->create(width, height, maxWidth, maxHeight, maxDepth);<br>
+ m_picSym->create(cfg->param.sourceWidth,cfg->param.sourceHeight, g_maxCUWidth, g_maxCUHeight, g_maxCUDepth);<br>
<br>
m_origPicYuv = new TComPicYuv;<br>
- m_origPicYuv->create(width, height, maxWidth, maxHeight, maxDepth);<br>
+ m_origPicYuv->create(cfg->param.sourceWidth,cfg->param.sourceHeight, g_maxCUWidth, g_maxCUHeight, g_maxCUDepth);<br>
<br>
m_reconPicYuv = new TComPicYuv;<br>
- m_reconPicYuv->create(width, height, maxWidth, maxHeight, maxDepth);<br>
+ m_reconPicYuv->create(cfg->param.sourceWidth,cfg->param.sourceHeight, g_maxCUWidth, g_maxCUHeight, g_maxCUDepth);<br>
<br>
/* store conformance window parameters with picture */<br>
- m_conformanceWindow = conformanceWindow;<br>
+ m_conformanceWindow = cfg->getConformanceWindow();<br>
<br>
/* store display window parameters with picture */<br>
- m_defaultDisplayWindow = defaultDisplayWindow;<br>
+ m_defaultDisplayWindow = cfg->getDefaultDisplayWindow();<br>
<br>
/* configure lowres dimensions */<br>
- m_lowres.create(this, bframes);<br>
+ m_lowres.create(this, cfg->param.bframes);<br>
+<br>
+ if (cfg->param.rc.aqMode)<br>
+ {<br>
+ m_qpAqOffset = (double *)x265_malloc(sizeof(double) * getPicSym()->getNumberOfCUsInFrame());<br>
+ if (!m_qpAqOffset)<br>
+ cfg->param.rc.aqMode = 0;<br>
+ }<br></blockquote><div><br></div><div>perfect</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
}<br>
<br>
void TComPic::destroy(int bframes)<br>
@@ -114,6 +122,7 @@<br>
}<br>
<br>
m_lowres.destroy(bframes);<br>
+ X265_FREE(m_qpAqOffset);<br>
}<br>
<br>
//! \}<br>
diff -r 1d6b3626f1b3 -r aad785763f1d source/Lib/TLibCommon/TComPic.h<br>
--- a/source/Lib/TLibCommon/TComPic.h Wed Oct 16 20:38:44 2013 -0500<br>
+++ b/source/Lib/TLibCommon/TComPic.h Thu Oct 17 11:31:33 2013 +0530<br>
@@ -44,6 +44,7 @@<br>
#include "TComPicYuv.h"<br>
#include "lowres.h"<br>
#include "threading.h"<br>
+#include "TLibEncoder/TEncCfg.h"<br></blockquote><div><br></div><div>Perhaps a bit anal, but I prefer forward-declaring TEncCfg rather than including the header here.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
namespace x265 {<br>
// private namespace<br>
@@ -84,7 +85,7 @@<br>
<br>
TComPic* m_next;<br>
TComPic* m_prev;<br>
-<br>
+ double* m_qpAqOffset;<br>
UInt64 m_SSDY;<br>
UInt64 m_SSDU;<br>
UInt64 m_SSDV;<br>
@@ -92,7 +93,7 @@<br>
TComPic();<br>
virtual ~TComPic();<br>
<br>
- void create(int width, int height, UInt maxWidth, UInt maxHeight, UInt maxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, int bframes);<br>
+ void create(TEncCfg* cfg);<br>
<br>
virtual void destroy(int bframes);<br>
<br>
diff -r 1d6b3626f1b3 -r aad785763f1d source/encoder/encoder.cpp<br>
--- a/source/encoder/encoder.cpp Wed Oct 16 20:38:44 2013 -0500<br>
+++ b/source/encoder/encoder.cpp Thu Oct 17 11:31:33 2013 +0530<br>
@@ -166,8 +166,7 @@<br>
if (m_freeList.empty())<br>
{<br>
pic = new TComPic;<br>
- pic->create(param.sourceWidth, param.sourceHeight, g_maxCUWidth, g_maxCUHeight, g_maxCUDepth,<br>
- getConformanceWindow(), getDefaultDisplayWindow(), param.bframes);<br>
+ pic->create(this);<br>
if (param.bEnableSAO)<br>
{<br>
// TODO: these should be allocated on demand within the encoder<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>