[x265] [PATCH 2/2] Modify WPP Entry point generation to be more generic

Nicolas Morey-Chaisemartin nmorey at kalray.eu
Tue Nov 4 09:28:35 CET 2014


# HG changeset patch
# User Nicolas Morey-Chaisemartin <nmorey at kalray.eu>
# Date 1414492715 -3600
#      Tue Oct 28 11:38:35 2014 +0100

Modify WPP Entry point generation to be more generic

---
  source/encoder/entropy.cpp      | 10 +++++-----
  source/encoder/entropy.h        |  2 +-
  source/encoder/frameencoder.cpp |  2 +-
  3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/source/encoder/entropy.cpp b/source/encoder/entropy.cpp
index e881f00..bf1c67b 100644
--- a/source/encoder/entropy.cpp
+++ b/source/encoder/entropy.cpp
@@ -489,7 +489,7 @@ void Entropy::codeSliceHeader(const Slice& slice, FrameData& encData)
  }
  
  /** write wavefront substreams sizes for the slice header */
-void Entropy::codeSliceHeaderWPPEntryPoints(const Slice& slice, const uint32_t *substreamSizes, uint32_t maxOffset)
+void Entropy::codeSliceHeaderEntryPoints(uint32_t nSubStreams, const uint32_t *substreamSizes, uint32_t maxOffset)
  {
      uint32_t offsetLen = 1;
      while (maxOffset >= (1U << offsetLen))
@@ -498,12 +498,12 @@ void Entropy::codeSliceHeaderWPPEntryPoints(const Slice& slice, const uint32_t *
          X265_CHECK(offsetLen < 32, "offsetLen is too large\n");
      }
  
-    uint32_t numRows = slice.m_sps->numCuInHeight - 1;
-    WRITE_UVLC(numRows, "num_entry_point_offsets");
-    if (numRows > 0)
+    uint32_t nEntryPoints = nSubStreams - 1;
+    WRITE_UVLC(nEntryPoints, "num_entry_point_offsets");
+    if (nEntryPoints > 0)
          WRITE_UVLC(offsetLen - 1, "offset_len_minus1");
  
-    for (uint32_t i = 0; i < numRows; i++)
+    for (uint32_t i = 0; i < nEntryPoints; i++)
          WRITE_CODE(substreamSizes[i] - 1, offsetLen, "entry_point_offset_minus1");
  }
  
diff --git a/source/encoder/entropy.h b/source/encoder/entropy.h
index bed06cf..c9d5ca3 100644
--- a/source/encoder/entropy.h
+++ b/source/encoder/entropy.h
@@ -149,7 +149,7 @@ public:
      void codeHrdParameters(const HRDInfo& hrd);
  
      void codeSliceHeader(const Slice& slice, FrameData& encData);
-    void codeSliceHeaderWPPEntryPoints(const Slice& slice, const uint32_t *substreamSizes, uint32_t maxOffset);
+    void codeSliceHeaderEntryPoints(uint32_t nSubStreams, const uint32_t *substreamSizes, uint32_t maxOffset);
      void codeShortTermRefPicSet(const RPS& rps);
      void finishSlice()                 { encodeBinTrm(1); finish(); dynamic_cast<Bitstream*>(m_bitIf)->writeByteAlignment(); }
  
diff --git a/source/encoder/frameencoder.cpp b/source/encoder/frameencoder.cpp
index c6e6915..70f9fbd 100644
--- a/source/encoder/frameencoder.cpp
+++ b/source/encoder/frameencoder.cpp
@@ -404,7 +404,7 @@ void FrameEncoder::compressFrame()
      // complete the slice header by writing WPP row-starts
      m_entropyCoder.setBitstream(&m_bs);
      if (slice->m_pps->bEntropyCodingSyncEnabled)
-        m_entropyCoder.codeSliceHeaderWPPEntryPoints(*slice, m_substreamSizes, maxStreamSize);
+        m_entropyCoder.codeSliceHeaderEntryPoints(numSubstreams, m_substreamSizes, maxStreamSize);
      m_bs.writeByteAlignment();
  
      m_nalList.serialize(slice->m_nalUnitType, m_bs);


More information about the x265-devel mailing list