[x265] [PATCH 1 of 2] ratecontrol: clean up confusing if-checks in calcAdaptiveQuantFrame

Aarthi Priya Thirumalai aarthi at multicorewareinc.com
Fri Feb 21 13:06:20 CET 2014


On Fri, Feb 21, 2014 at 5:23 PM, Aarthi Priya Thirumalai <
aarthi at multicorewareinc.com> wrote:

>
>
>
> On Fri, Feb 21, 2014 at 4:53 PM, <deepthi at multicorewareinc.com> wrote:
>
>> # HG changeset patch
>> # User Deepthi Nandakumar <deepthi at multicorewareinc.com>
>> # Date 1392976266 -19800
>> # Node ID 3275142274c8e424c9a9a57dbc2c70b0707ea996
>> # Parent  5e2043f89aa11363dffe33a0ff06550a7d862326
>> ratecontrol: clean up confusing if-checks in calcAdaptiveQuantFrame
>>
>> diff -r 5e2043f89aa1 -r 3275142274c8 source/encoder/ratecontrol.cpp
>> --- a/source/encoder/ratecontrol.cpp    Fri Feb 21 03:05:48 2014 -0600
>> +++ b/source/encoder/ratecontrol.cpp    Fri Feb 21 15:21:06 2014 +0530
>> @@ -105,23 +105,20 @@
>>      int block_xy = 0;
>>      int block_x = 0, block_y = 0;
>>      double strength = 0.f;
>> -    if (cfg->param.rc.aqMode == X265_AQ_NONE || cfg->param.rc.aqStrength
>> == 0)
>> +
>> +    if (cfg->param.rc.cuTree && cfg->param.rc.aqStrength == 0) /* CUTree
>> is enabled with zero strength AQ */
>>      {
>> -        /* Need to init it anyways for CU tree */
>>          int cuWidth = ((maxCol / 2) + X265_LOWRES_CU_SIZE - 1) >>
>> X265_LOWRES_CU_BITS;
>>          int cuHeight = ((maxRow / 2) + X265_LOWRES_CU_SIZE - 1) >>
>> X265_LOWRES_CU_BITS;
>>          int cuCount = cuWidth * cuHeight;
>> -
>> -        if (cfg->param.rc.aqMode && cfg->param.rc.aqStrength == 0)
>>
>               we need the above check . can be re written as if
> (cfg->param.rc.cuTree) -- sry, pls ignore this comment. since we always
> malloc inQscaleFactor, dont think this if check is necessary.
>
But since we need to do weighted prediction even if aq and cu tree is
disabled, the primary if condition (at the beginning )needs to pass if
aqMode is NONE.

>
>
+
>> +        memset(pic->m_lowres.qpOffset, 0, cuCount * sizeof(double));
>> +        memset(pic->m_lowres.qpAqOffset, 0, cuCount * sizeof(double));
>> +        for (int cuxy = 0; cuxy < cuCount; cuxy++)
>>          {
>> -            memset(pic->m_lowres.qpOffset, 0, cuCount * sizeof(double));
>> -            memset(pic->m_lowres.qpAqOffset, 0, cuCount *
>> sizeof(double));
>> -            for (int cuxy = 0; cuxy < cuCount; cuxy++)
>> -            {
>> -                pic->m_lowres.invQscaleFactor[cuxy] = 256;
>> -            }
>> +            pic->m_lowres.invQscaleFactor[cuxy] = 256;
>>          }
>> -
>> +
>>          /* Need variance data for weighted prediction */
>>          if (cfg->param.bEnableWeightedPred)
>>          {
>> _______________________________________________
>> 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/20140221/6315071e/attachment-0001.html>


More information about the x265-devel mailing list