[x265] [PATCH] rc: fix bug in ABR 2 pass, calculate aq-offset only for unreferenced frame in 2 pass

Aarthi Priya Thirumalai aarthi at multicorewareinc.com
Mon Mar 30 19:02:32 CEST 2015


For the last pass in multi pass encodes, slice types are taken from the
stats file before the frame is added into the lookahead queue. We would not
do slice type analysis here and just stick with slice types read from the
file.
So, at this point, we would already know slice types along with CUTree
offsets which we also copy  from the previous pass for all referenced
slices. Only for the unreferenced frames, we would need to recompute
aqoffsets as the data for those won't be written in the log files.

Since calcAdaptive() rewrites all the arrays - both AQ&CUTree offsets, we
should not do this and overwrite the values for referenced frames. This
flow was broken when the NUMA related commits were pushed in.
On Mar 30, 2015 9:14 PM, "Steve Borho" <steve at borho.org> wrote:

> On 03/30, santhoshini at multicorewareinc.com wrote:
> > # HG changeset patch
> > # User Santhoshini Sekar<santhoshini at multicorewareinc.com>
> > # Date 1427716771 -19800
> > #      Mon Mar 30 17:29:31 2015 +0530
> > # Node ID 1bdeb44d775d5be7523925017a1483294da2575d
> > # Parent  22a312799bb033d40a66fc83a1ac7af192ce2420
> > rc: fix bug in ABR 2 pass, calculate aq-offset only for unreferenced
> frame in 2 pass
> >
> > diff -r 22a312799bb0 -r 1bdeb44d775d source/encoder/slicetype.cpp
> > --- a/source/encoder/slicetype.cpp    Fri Mar 27 22:59:30 2015 -0500
> > +++ b/source/encoder/slicetype.cpp    Mon Mar 30 17:29:31 2015 +0530
> > @@ -699,7 +699,7 @@
> >              ProfileScopeEvent(prelookahead);
> >
> >              preFrame->m_lowres.init(preFrame->m_fencPic,
> preFrame->m_poc);
> > -            if (m_bAdaptiveQuant)
> > +            if (m_bAdaptiveQuant && (!m_param->rc.bStatRead
> ||(m_param->rc.bStatRead &&(!m_param->rc.cuTree || !
> IS_REFERENCED(preFrame)))))
>
> 1. white-space
>
> 2. this is pre-lookahead, the slice type and reference status is not
>    known yet. If the AQ offsets aren't needed, you'll need to clear them
>    after lookahead or just ignore them. If AQ offsets shouldn't be
>    generated regardless of slice type, m_bAdaptiveQuant should be
>    set to false much earlier
>
> --
> Steve Borho
> _______________________________________________
> 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/20150330/e495ec57/attachment.html>


More information about the x265-devel mailing list