From 4f09e4da17017cd48e255cd59cd96efaef2a1e2d Mon Sep 17 00:00:00 2001
From: jzxu <xujizheng@bytedance.com>
Date: Mon, 23 Mar 2020 14:13:20 -0700
Subject: [PATCH] Fix the bug when CU size is larger than VPDU size.

---
 source/Lib/DecoderLib/DecCu.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/source/Lib/DecoderLib/DecCu.cpp b/source/Lib/DecoderLib/DecCu.cpp
index 7ee107ec2..92def10ee 100644
--- a/source/Lib/DecoderLib/DecCu.cpp
+++ b/source/Lib/DecoderLib/DecCu.cpp
@@ -122,7 +122,13 @@ void DecCu::decompressCtu( CodingStructure& cs, const UnitArea& ctuArea )
         const int vSize = cs.slice->getSPS()->getMaxCUHeight() > 64 ? 64 : cs.slice->getSPS()->getMaxCUHeight();
         if((currCU.Y().x % vSize) == 0 && (currCU.Y().y % vSize) == 0)
         {
-          m_pcInterPred->resetVPDUforIBC(cs.pcv->chrFormat, cs.slice->getSPS()->getMaxCUHeight(), vSize, currCU.Y().x  + g_IBCBufferSize / cs.slice->getSPS()->getMaxCUHeight() / 2, currCU.Y().y);
+          for(int x = currCU.Y().x; x < currCU.Y().y + currCU.Y().width; x += vSize)
+          {
+            for(int y = currCU.Y().y; y < currCU.Y().y + currCU.Y().height; y += vSize)
+            {
+              m_pcInterPred->resetVPDUforIBC(cs.pcv->chrFormat, cs.slice->getSPS()->getMaxCUHeight(), vSize, x + g_IBCBufferSize / cs.slice->getSPS()->getMaxCUHeight() / 2, y);
+            }
+          }
         }
       }
       if (currCU.predMode != MODE_INTRA && currCU.predMode != MODE_PLT && currCU.Y().valid())
-- 
GitLab