[x265] [PATCH] tencsbac: WritePCMCode for Cb and Cr merged into single block
Steve Borho
steve at borho.org
Mon Mar 10 19:04:52 CET 2014
On Mon, Mar 10, 2014 at 3:41 AM, <gopu at multicorewareinc.com> wrote:
> # HG changeset patch
> # User Gopu Govindaswamy
> # Date 1394440478 -19800
> # Mon Mar 10 14:04:38 2014 +0530
> # Node ID 592b9b952a71f11b778fb4f8afadf86ff9c9a05c
> # Parent ba31dfc650d88afa937293a40fdaafd20c10c83e
> tencsbac: WritePCMCode for Cb and Cr merged into single block
I'm a little leary of changes to the PCM code paths, I don't know if
they're currently used at all. Did you check that this code path was
exercised by your test sequence(s)?
> diff -r ba31dfc650d8 -r 592b9b952a71 source/Lib/TLibEncoder/TEncSbac.cpp
> --- a/source/Lib/TLibEncoder/TEncSbac.cpp Mon Mar 10 12:14:41 2014 +0530
> +++ b/source/Lib/TLibEncoder/TEncSbac.cpp Mon Mar 10 14:04:38 2014 +0530
> @@ -1261,7 +1261,7 @@
> int numZeroSubstreamsAtEndOfSlice = slice->getPic()->getFrameHeightInCU() - 1 - ((slice->getSliceCurEndCUAddr() - 1) / maxNumParts / slice->getPic()->getFrameWidthInCU());
> numEntryPointOffsets = slice->getPic()->getFrameHeightInCU() - numZeroSubstreamsAtEndOfSlice - 1;
> slice->setNumEntryPointOffsets(numEntryPointOffsets);
> - entryPointOffset = new uint32_t[numEntryPointOffsets];
> + entryPointOffset = X265_MALLOC(uint32_t, numEntryPointOffsets);
> for (int idx = 0; idx < numEntryPointOffsets; idx++)
> {
> entryPointOffset[idx] = (substreamSizes[idx] >> 3);
> @@ -1290,7 +1290,7 @@
> WRITE_CODE(entryPointOffset[idx] - 1, offsetLenMinus1 + 1, "entry_point_offset_minus1");
> }
>
> - delete [] entryPointOffset;
> + X265_FREE(entryPointOffset);
> }
>
> void TEncSbac::codeTerminatingBit(uint32_t lsLast)
> @@ -1891,37 +1891,22 @@
> pcmSample += width;
> }
>
> - pcmSample = cu->getPCMSampleCb() + chromaOffset;
> width = cu->getCUSize(absPartIdx) / 2;
> height = cu->getCUSize(absPartIdx) / 2;
> sampleBits = cu->getSlice()->getSPS()->getPCMBitDepthChroma();
> + pixel* pcmSampleCb = cu->getPCMSampleCb() + chromaOffset;
> + pixel* pcmSampleCr = cu->getPCMSampleCr() + chromaOffset;
>
> for (y = 0; y < height; y++)
> {
> for (x = 0; x < width; x++)
> {
> - uint32_t sample = pcmSample[x];
> -
> - m_binIf->xWritePCMCode(sample, sampleBits);
> + m_binIf->xWritePCMCode(pcmSampleCb[x], sampleBits);
> + m_binIf->xWritePCMCode(pcmSampleCr[x], sampleBits);
> }
> -
> - pcmSample += width;
> + pcmSampleCb += width;
> + pcmSampleCr += width;
> }
> -
> - pcmSample = cu->getPCMSampleCr() + chromaOffset;
> -
> - for (y = 0; y < height; y++)
> - {
> - for (x = 0; x < width; x++)
> - {
> - uint32_t sample = pcmSample[x];
> -
> - m_binIf->xWritePCMCode(sample, sampleBits);
> - }
> -
> - pcmSample += width;
> - }
> -
> m_binIf->resetBac();
> }
> }
> _______________________________________________
> 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