<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 26, 2018 at 2:28 PM, <span dir="ltr"><<a href="mailto:aruna@multicorewareinc.com" target="_blank">aruna@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 Aruna Matheswaran <<a href="mailto:aruna@multicorewareinc.com">aruna@multicorewareinc.com</a>><br>
# Date 1532078824 -19800<br>
# Fri Jul 20 14:57:04 2018 +0530<br>
# Node ID 29345837cd2057dd2cfca837c1a36c<wbr>ab94e41bc4<br>
# Parent 79c76e42cb28876d3fa3141f5f1f1a<wbr>6b3973af0a<br>
Enhance VBV lookahead of RADL pictures<br>
<br>
This patch does the following,<br>
1) Modifies the slice type enforcement flow to enhance VBV lookahead of RADL frames.<br>
2) Update test CLI.<br>
<br>
diff -r 79c76e42cb28 -r 29345837cd20 source/encoder/slicetype.cpp<br>
--- a/source/encoder/slicetype.cpp Wed Jul 25 14:40:47 2018 +0530<br>
+++ b/source/encoder/slicetype.cpp Fri Jul 20 14:57:04 2018 +0530<br>
@@ -1147,14 +1147,6 @@<br>
bframes--;<br>
}<br>
}<br>
- if (m_param->radl && !m_param->bOpenGOP && list[bframes + 1])<br>
- {<br>
- if ((frm.frameNum - m_lastKeyframe) > (m_param->keyframeMax - m_param->radl - 1) && (frm.frameNum - m_lastKeyframe) < m_param->keyframeMax)<br>
- frm.sliceType = X265_TYPE_B;<br>
- if ((frm.frameNum - m_lastKeyframe) == (m_param->keyframeMax - m_param->radl - 1))<br>
- frm.sliceType = X265_TYPE_P;<br>
- }<br>
-<br>
if (bframes == m_param->bframes || !list[bframes + 1])<br>
{<br>
if (IS_X265_TYPE_B(frm.sliceType)<wbr>)<br>
@@ -1538,6 +1530,7 @@<br>
int numBFrames = 0;<br>
int numAnalyzed = numFrames;<br>
bool isScenecut = scenecut(frames, 0, 1, true, origNumFrames);<br>
+<br>
/* When scenecut threshold is set, use scenecut detection for I frame placements */<br>
if (m_param->scenecutThreshold && isScenecut)<br>
{<br>
@@ -1645,14 +1638,28 @@<br>
frames[numFrames]->sliceType = X265_TYPE_P;<br>
}<br>
<br>
- /* Check scenecut on the first minigop. */<br>
- for (int j = 1; j < numBFrames + 1; j++)<br>
+ bool bForceRADL = m_param->radl && !m_param->bOpenGOP;<br>
+ bool bLastMiniGop = (framecnt >= m_param->bframes + 1) ? false : true;<br>
+ int preRADL = m_lastKeyframe + m_param->keyframeMax - m_param->radl - 1; /*Frame preceeding RADL in POC order*/<br>
+ if (bForceRADL && (frames[0]->frameNum == preRADL) && !bLastMiniGop)<br>
{<br>
- if (scenecut(frames, j, j + 1, false, origNumFrames))<br>
+ int j = 1;<br>
+ numBFrames = m_param->radl;<br>
+ for (; j <= m_param->radl; j++)<br>
+ frames[j]->sliceType = X265_TYPE_B;<br>
+ frames[j]->sliceType = X265_TYPE_I;<br>
+ }<br>
+ else /* Check scenecut and RADL on the first minigop. */<br>
+ {<br>
+ for (int j = 1; j < numBFrames + 1; j++)<br>
{<br>
- frames[j]->sliceType = X265_TYPE_P;<br>
- numAnalyzed = j;<br>
- break;<br>
+ if (scenecut(frames, j, j + 1, false, origNumFrames) || <br>
+ (bForceRADL && (frames[j]->frameNum == preRADL)))<br>
+ {<br>
+ frames[j]->sliceType = X265_TYPE_P;<br>
+ numAnalyzed = j;<br>
+ break;<br>
+ }<br>
}<br>
}<br>
resetStart = bKeyframe ? 1 : X265_MIN(numBFrames + 2, numAnalyzed + 1);<br>
diff -r 79c76e42cb28 -r 29345837cd20 source/test/regression-tests.<wbr>txt<br>
--- a/source/test/regression-<wbr>tests.txt Wed Jul 25 14:40:47 2018 +0530<br>
+++ b/source/test/regression-<wbr>tests.txt Fri Jul 20 14:57:04 2018 +0530<br>
@@ -149,7 +149,7 @@<br>
Kimono1_1920x1080_24_400.yuv,-<wbr>-preset veryslow --crf 4 --cu-lossless --slices 2 --limit-refs 3 --limit-modes<br>
Kimono1_1920x1080_24_400.yuv,-<wbr>-preset placebo --ctu 32 --max-tu-size 8 --limit-tu 2<br>
big_buck_bunny_360p24.y4m, --keyint 60 --min-keyint 40 --gop-lookahead 14<br>
-BasketballDrive_1920x1080_50.<wbr>y4m, --preset medium --no-open-gop --keyint 50 --min-keyint 50 --radl 2<br>
+BasketballDrive_1920x1080_50.<wbr>y4m, --preset medium --no-open-gop --keyint 50 --min-keyint 50 --radl 2 --vbv-maxrate 5000 --vbv-bufsize 5000<br>
<br>
# Main12 intraCost overflow bug test<br>
720p50_parkrun_ter.y4m,--<wbr>preset medium<br>
<br>______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
<br></blockquote></div><br></div><div class="gmail_extra">Pushed.</div></div>