[x265] [PATCH] Removed redundant code

dave dtyx265 at gmail.com
Mon Aug 25 23:11:40 CEST 2014


On 08/25/2014 01:36 PM, Steve Borho wrote:
> On 08/25, dtyx265 at gmail.com wrote:
>> # HG changeset patch
>> # User David T Yuen <dtyx265 at gmail.com>
>> # Date 1408983545 25200
>> # Node ID fa3c389b255b8299bf75b7dfdab145dfbdc3de40
>> # Parent  6e6756f94b27c3ef30f6159f1880112a7ff978e3
>> Removed redundant code
> if I do an encode with --preset slower, the outputs change with this
> patch. is this intentional?
It was not.  I only tested on a few vids with -I 1 to force intra 
prediction.  It produced bit-for bit identical results in less time.  I 
will look into --preset slower differences.
>
>> diff -r 6e6756f94b27 -r fa3c389b255b source/Lib/TLibEncoder/TEncSearch.cpp
>> --- a/source/Lib/TLibEncoder/TEncSearch.cpp	Fri Aug 22 15:53:34 2014 -0500
>> +++ b/source/Lib/TLibEncoder/TEncSearch.cpp	Mon Aug 25 09:19:05 2014 -0700
>> @@ -1537,34 +1537,6 @@
>>               }
>>           } // Mode loop
>>   
>> -        // TODO: there is a lot of redundant work happening here, please clean this up!
>> -        {
>> -            uint32_t origMode = bestPUMode;
>> -
>> -            cu->setLumaIntraDirSubParts(origMode, partOffset, depth + initTrDepth);
>> -
>> -            // set context models
>> -            m_entropyCoder->load(m_rdEntropyCoders[depth][CI_CURR_BEST]);
>> -
>> -            // determine residual for partition
>> -            uint32_t puDistY = 0;
>> -            uint64_t puCost  = 0;
>> -            xRecurIntraCodingQT(cu, initTrDepth, partOffset, fencYuv, predYuv, resiYuv, puDistY, false, puCost);
> I suspect some of the bits up to here are perhaps required unless the
> last mode tried was the best mode.
Yes, xRecurIntraCodingQT is where the most work is done by this chunk of 
code so the difference is probably somewhere in there.
>
>> -            // check r-d cost
>> -            if (puCost < bestPUCost)
>> -            {
>> -                bestPUMode  = origMode;
>> -                bestPUDistY = puDistY;
>> -
>> -                xSetIntraResultQT(cu, initTrDepth, partOffset, reconYuv);
>> -
>> -                ::memcpy(m_qtTempTrIdx,  cu->getTransformIdx()     + partOffset, qPartNum * sizeof(uint8_t));
>> -                ::memcpy(m_qtTempCbf[0], cu->getCbf(TEXT_LUMA)     + partOffset, qPartNum * sizeof(uint8_t));
>> -                ::memcpy(m_qtTempTransformSkipFlag[0], cu->getTransformSkip(TEXT_LUMA)     + partOffset, qPartNum * sizeof(uint8_t));
>> -            }
>> -        } // Mode loop
>> -
>>           //--- update overall distortion ---
>>           overallDistY += bestPUDistY;
>>   
>> _______________________________________________
>> x265-devel mailing list
>> x265-devel at videolan.org
>> https://mailman.videolan.org/listinfo/x265-devel
Is there any test script available that covers at least a good basic set 
of testcases?


More information about the x265-devel mailing list