[x265] [PATCH] Removed redundant code

Steve Borho steve at borho.org
Mon Aug 25 22:36:49 CEST 2014


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?

> 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.

> -            // 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

-- 
Steve Borho


More information about the x265-devel mailing list