<div dir="ltr"><div># HG changeset patch</div><div># User Shazeb Nawaz Khan <<a href="mailto:shazeb@multicorewareinc.com">shazeb@multicorewareinc.com</a>></div><div># Date 1380099889 -19800</div><div>#      Wed Sep 25 14:34:49 2013 +0530</div>
<div># Node ID 0cc1b50c7d500c182332f09fc66420002909d5ec</div><div># Parent  4d0ced5c64fed290302b730ef8ac7d8613420a0d</div><div>Added support for multiple references</div><div><br></div><div>Added a commandline parameter '--ref <max number of references>'. DPB size adjusted to use number of references.</div>
<div><br></div><div>diff -r 4d0ced5c64fe -r 0cc1b50c7d50 source/common/common.cpp</div><div>--- a/source/common/common.cpp<span class="" style="white-space:pre"> </span>Wed Sep 25 11:33:50 2013 +0530</div><div>+++ b/source/common/common.cpp<span class="" style="white-space:pre">       </span>Wed Sep 25 14:34:49 2013 +0530</div>
<div>@@ -160,7 +160,7 @@</div><div>     param->bEnableSignHiding = 1;</div><div>     param->bEnableTransformSkip = 1;</div><div>     param->bEnableTSkipFast = 1;</div><div>-</div><div>+    param->maxNumReferences = 1;</div>
<div>     /* Loop Filter */</div><div>     param->bEnableLoopFilter = 1;</div><div>     </div><div>diff -r 4d0ced5c64fe -r 0cc1b50c7d50 source/encoder/dpb.h</div><div>--- a/source/encoder/dpb.h<span class="" style="white-space:pre">     </span>Wed Sep 25 11:33:50 2013 +0530</div>
<div>+++ b/source/encoder/dpb.h<span class="" style="white-space:pre">  </span>Wed Sep 25 14:34:49 2013 +0530</div><div>@@ -52,10 +52,9 @@</div><div>         m_lastIDR = 0;</div><div>         m_pocCRA = 0;</div><div>         m_bRefreshPending = false;</div>
<div>-        m_maxRefL0 = 1;             //TODO: This values should later be fetched from input params</div><div>+        m_maxRefL0 = cfg->param.maxNumReferences;</div><div>         m_maxRefL1 = 1;</div><div>     }</div>
<div>-</div><div>     ~DPB();</div><div> </div><div>     void prepareEncode(TComPic*);</div><div>diff -r 4d0ced5c64fe -r 0cc1b50c7d50 source/encoder/encoder.cpp</div><div>--- a/source/encoder/encoder.cpp<span class="" style="white-space:pre">  </span>Wed Sep 25 11:33:50 2013 +0530</div>
<div>+++ b/source/encoder/encoder.cpp<span class="" style="white-space:pre">    </span>Wed Sep 25 14:34:49 2013 +0530</div><div>@@ -263,8 +263,8 @@</div><div>     vps.setMaxLayers(1);</div><div>     for (int i = 0; i < MAX_TLAYER; i++)</div>
<div>     {</div><div>-        m_numReorderPics[i] = _param->bframes;</div><div>-        m_maxDecPicBuffering[i] = _param->bframes + 2;</div><div>+        m_numReorderPics[i] = 1;</div><div>+        m_maxDecPicBuffering[i] = X265_MIN(MAX_NUM_REF, X265_MAX(m_numReorderPics[i] + 1, _param->maxNumReferences));</div>
<div>         vps.setNumReorderPics(m_numReorderPics[i], i);</div><div>         vps.setMaxDecPicBuffering(m_maxDecPicBuffering[i], i);</div><div>     }</div><div>diff -r 4d0ced5c64fe -r 0cc1b50c7d50 source/x265.h</div><div>
--- a/source/x265.h<span class="" style="white-space:pre">    </span>Wed Sep 25 11:33:50 2013 +0530</div><div>+++ b/source/x265.h<span class="" style="white-space:pre">  </span>Wed Sep 25 14:34:49 2013 +0530</div><div>@@ -248,7 +248,7 @@</div>
<div>     int       bEnableTransformSkip;            ///< enable intra transform skipping</div><div>     int       bEnableTSkipFast;                ///< enable fast intra transform skipping</div><div>     int       bEnableRDOQTS;                   ///< enable RD optimized quantization when transform skip is selected</div>
<div>-</div><div>+    int       maxNumReferences;                ///< maximum number of references a frame can have in L0</div><div>     // loop filter</div><div>     int       bEnableLoopFilter;               ///< enable Loop Filter</div>
<div> </div><div>diff -r 4d0ced5c64fe -r 0cc1b50c7d50 source/x265opts.h</div><div>--- a/source/x265opts.h<span class="" style="white-space:pre">        </span>Wed Sep 25 11:33:50 2013 +0530</div><div>+++ b/source/x265opts.h<span class="" style="white-space:pre">      </span>Wed Sep 25 14:34:49 2013 +0530</div>
<div>@@ -66,6 +66,7 @@</div><div> OPT("bframes",         param->bframes,                required_argument, 'b', "Maximum number of consecutive b-frames (now it only enables B GOP structure)")</div>
<div> OPT("bframe-bias",     param->bFrameBias,             required_argument, 0, "Bias towards B frame decisions")</div><div> OPT("b-adapt",         param->bFrameAdaptive,         required_argument, 0, "0 - none, 1 - fast, 2 - full (trellis) adaptive B frame scheduling")</div>
<div>+OPT("ref",             param->maxNumReferences,       required_argument, 0, "max number of references to be allowed (1 .. 16) ")</div><div> // Disabled because weighted uni-prediction was busted by not using</div>
<div> // pre-generated planes in motion compensation</div><div> //OPT("no-weightp",      param->bEnableWeightedPred,          no_argument, 0, "Disable weighted prediction in P slices")</div><div><br>
</div></div>