diff --git a/source/Lib/CommonLib/InterPrediction.cpp b/source/Lib/CommonLib/InterPrediction.cpp
index 05b783eae755dcb62c8d89b2cd7ff796fb4b74f2..31faa3fc78be09c65520f80dd881b215551325cb 100644
--- a/source/Lib/CommonLib/InterPrediction.cpp
+++ b/source/Lib/CommonLib/InterPrediction.cpp
@@ -251,12 +251,10 @@ bool InterPrediction::xCheckIdenticalMotion( const PredictionUnit &pu )
   {
     if( pu.refIdx[0] >= 0 && pu.refIdx[1] >= 0 )
     {
-      int RefPOCL0 = slice.getRefPic( REF_PIC_LIST_0, pu.refIdx[0] )->getPOC();
-      int RefPOCL1 = slice.getRefPic( REF_PIC_LIST_1, pu.refIdx[1] )->getPOC();
-      int RefLayerId0 = slice.getRefPic( REF_PIC_LIST_0, pu.refIdx[0] )->layerId;
-      int RefLayerId1 = slice.getRefPic( REF_PIC_LIST_1, pu.refIdx[1] )->layerId;
+      const Picture *refPicL0 = slice.getRefPic(REF_PIC_LIST_0, pu.refIdx[0]);
+      const Picture *refPicL1 = slice.getRefPic(REF_PIC_LIST_1, pu.refIdx[1]);
 
-      if (RefPOCL0 == RefPOCL1 && RefLayerId0 == RefLayerId1)
+      if (refPicL0 == refPicL1)
       {
         if( !pu.cu->affine )
         {