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