[x265] [PATCH] Save intra mode in lowres

Nicolas Morey-Chaisemartin nmorey at kalray.eu
Thu Oct 30 18:10:06 CET 2014


# HG changeset patch
# User Nicolas Morey-Chaisemartin <nmorey at kalray.eu>
# Date 1414664871 -3600
#      Thu Oct 30 11:27:51 2014 +0100

Save intra mode in lowres

---
  source/common/lowres.cpp     | 2 ++
  source/common/lowres.h       | 1 +
  source/encoder/slicetype.cpp | 1 +
  3 files changed, 4 insertions(+)

diff --git a/source/common/lowres.cpp b/source/common/lowres.cpp
index fe4f7b9..9923cc1 100644
--- a/source/common/lowres.cpp
+++ b/source/common/lowres.cpp
@@ -69,6 +69,7 @@ bool Lowres::create(PicYuv *origPic, int _bframes, bool bAQEnabled)
      lowresPlane[3] = buffer[3] + padoffset;
  
      CHECKED_MALLOC(intraCost, int32_t, cuCount);
+    CHECKED_MALLOC(intraMode, uint8_t, cuCount);
  
      for (int i = 0; i < bframes + 2; i++)
      {
@@ -99,6 +100,7 @@ void Lowres::destroy()
          X265_FREE(buffer[i]);
  
      X265_FREE(intraCost);
+    X265_FREE(intraMode);
  
      for (int i = 0; i < bframes + 2; i++)
      {
diff --git a/source/common/lowres.h b/source/common/lowres.h
index b88ad3e0..96e50fd 100644
--- a/source/common/lowres.h
+++ b/source/common/lowres.h
@@ -116,6 +116,7 @@ struct Lowres : public ReferencePlanes
      int32_t*  rowSatds[X265_BFRAME_MAX + 2][X265_BFRAME_MAX + 2];
      int       intraMbs[X265_BFRAME_MAX + 2];
      int32_t*  intraCost;
+    uint8_t*  intraMode;
      int64_t   satdCost;
      uint16_t* lowresCostForRc;
      uint16_t(*lowresCosts[X265_BFRAME_MAX + 2][X265_BFRAME_MAX + 2]);
diff --git a/source/encoder/slicetype.cpp b/source/encoder/slicetype.cpp
index cc70c20..3f7a61f 100644
--- a/source/encoder/slicetype.cpp
+++ b/source/encoder/slicetype.cpp
@@ -1701,6 +1701,7 @@ void EstimateRow::estimateCUCost(Lowres **frames, ReferencePlanes *wfref0, int c
          const int intraPenalty = 5 * m_lookAheadLambda;
          icost += intraPenalty + lowresPenalty; /* estimate intra signal cost */
          fenc->intraCost[cuXY] = icost;
+        fenc->intraMode[cuXY] = lowmode;
          int icostAq = icost;
          if (bFrameScoreCU)
          {


More information about the x265-devel mailing list