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

Steve Borho steve at borho.org
Mon Mar 30 17:44:37 CEST 2015


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


More information about the x265-devel mailing list