[x265] [PATCH] slicetype: fix crash when rc-lookahead = bframes

Deepthi Nandakumar deepthi at multicorewareinc.com
Mon Mar 9 08:37:39 CET 2015


slicetypeAnalyse::maxSearch also needs to be changed, or you could trigger
another crash using --b-adapt 1.

It seems to me, under the hood we're just incrementing lookaheadDepth. That
may be the right thing to do here, or do a CHECK for lookaheadDepth >=
bframes?

On Mon, Mar 9, 2015 at 12:25 PM, <aarthi at multicorewareinc.com> wrote:

> # HG changeset patch
> # User Aarthi Thirumalai
> # Date 1425883938 -19800
> #      Mon Mar 09 12:22:18 2015 +0530
> # Node ID 520ab30492f631b5502b309183f47efc0b8a9768
> # Parent  043c2418864b0a3ada6f597e6def6ead73d90b5f
> slicetype: fix crash when rc-lookahead = bframes.
>
> diff -r 043c2418864b -r 520ab30492f6 source/encoder/slicetype.cpp
> --- a/source/encoder/slicetype.cpp      Fri Mar 06 13:15:55 2015 -0600
> +++ b/source/encoder/slicetype.cpp      Mon Mar 09 12:22:18 2015 +0530
> @@ -484,7 +484,7 @@
>      memset(m_preframes, 0, sizeof(m_preframes));
>      m_preTotal = m_preAcquired = m_preCompleted = 0;
>      m_sliceTypeBusy = false;
> -    m_fullQueueSize = m_param->lookaheadDepth;
> +    m_fullQueueSize = X265_MAX(m_param->lookaheadDepth, m_param->bframes
> + 1);
>      m_bAdaptiveQuant = m_param->rc.aqMode || m_param->bEnableWeightedPred
> || m_param->bEnableWeightedBiPred;
>
>      /* If we have a thread pool and are using --b-adapt 2, it is generally
> @@ -835,7 +835,7 @@
>  {
>      Lowres *frames[X265_LOOKAHEAD_MAX];
>      Frame *list[X265_LOOKAHEAD_MAX];
> -    int maxSearch = X265_MIN(m_param->lookaheadDepth, X265_LOOKAHEAD_MAX);
> +    int maxSearch = X265_MIN(X265_MAX(m_param->lookaheadDepth,
> m_param->bframes + 1), X265_LOOKAHEAD_MAX);
>
>      memset(frames, 0, sizeof(frames));
>      memset(list, 0, sizeof(list));
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20150309/6ab6b0e7/attachment.html>


More information about the x265-devel mailing list