{"id":399,"date":"2014-07-28T01:07:45","date_gmt":"2014-07-27T17:07:45","guid":{"rendered":"http:\/\/www.fujiangyun.com\/?p=399"},"modified":"2014-07-28T01:11:32","modified_gmt":"2014-07-27T17:11:32","slug":"hevc%e7%a0%94%e7%a9%b6%e5%b9%b3%e5%8f%b0hm%e7%9a%84lcu%e5%88%92%e5%88%86%e8%af%a6%e8%a7%a3%ef%bc%88%e8%bd%ac%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.fujiangyun.com\/blog\/?p=399","title":{"rendered":"HEVC\u7814\u7a76\u5e73\u53f0HM\u7684LCU\u5212\u5206\u8be6\u89e3\uff08\u8f6c\uff09"},"content":{"rendered":"<p>\u9996\u5148\uff0c\u5bf9\u4e8e\u56db\u53c9\u6811\u7684\u5206\u5272\u5f62\u5f0f\uff0c\u5927\u5bb6\u60f3\u5fc5\u90fd\u5df2\u7ecf\u4e86\u89e3\u4e86\uff0c\u8fd9\u91cc\u5c31\u4e0d\u8fdb\u884c\u8fc7\u591a\u7684\u8d58\u8ff0\uff0c\u4e0b\u9762\u662f\u5e38\u89c1\u7684\u56db\u53c9\u6811\u7ed3\u6784\u793a\u610f\u56fe\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" alt=\"\" src=\"http:\/\/img.my.csdn.net\/uploads\/201212\/07\/1354881602_2918.jpg\" width=\"541\" height=\"355\" \/><\/p>\n<p>\u63a5\u4e0b\u6765\u662f\u4ee3\u7801\u90e8\u5206\uff1a<\/p>\n<p>\u8be5\u8fc7\u7a0b\u4e3b\u8981\u7531<strong>TEncCu::xCompressCU\u51fd\u6570\u7684\u9012\u5f52\u5b9e\u73b0\u3002<\/strong><\/p>\n<p>&nbsp;<\/p>\n<pre lang=\"cpp\" line=\"1\" escaped=\"true\">    \/\/ further split\u8fdb\u4e00\u6b65\u8fdb\u884cCU\u7684\u5206\u5272\r\n    if( bSubBranch &amp;&amp; bTrySplitDQP &amp;&amp; uiDepth &lt; g_uiMaxCUDepth - g_uiAddCUDepth )\r\n    {\r\n      UChar       uhNextDepth         = uiDepth+1;\r\n      TComDataCU* pcSubBestPartCU     = m_ppcBestCU[uhNextDepth];\r\n      TComDataCU* pcSubTempPartCU     = m_ppcTempCU[uhNextDepth];\r\n\r\n      for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx &lt; 4; uiPartUnitIdx++ )\/\/\u6bcf\u6b21\u5206\u6210\u56db\u4e2a\u66f4\u5c0f\u7684CU     {         pcSubBestPartCU-&gt;initSubCU( rpcTempCU, uiPartUnitIdx, uhNextDepth, iQP );           \/\/ clear sub partition datas or init.\r\n        pcSubTempPartCU-&gt;initSubCU( rpcTempCU, uiPartUnitIdx, uhNextDepth, iQP );           \/\/ clear sub partition datas or init.\r\n\r\n        Bool bInSlice = pcSubBestPartCU-&gt;getSCUAddr()+pcSubBestPartCU-&gt;getTotalNumPart()&gt;pcSlice-&gt;getDependentSliceCurStartCUAddr()&amp;&amp;pcSubBestPartCU-&gt;getSCUAddr()getDependentSliceCurEndCUAddr();\r\n        if(bInSlice &amp;&amp; ( pcSubBestPartCU-&gt;getCUPelX() &lt; pcSlice-&gt;getSPS()-&gt;getPicWidthInLumaSamples() ) &amp;&amp; ( pcSubBestPartCU-&gt;getCUPelY() &lt; pcSlice-&gt;getSPS()-&gt;getPicHeightInLumaSamples() ) )\r\n        {\r\n          if( m_bUseSBACRD )\r\n          {\r\n            if ( 0 == uiPartUnitIdx) \/\/initialize RD with previous depth buffer\r\n            {\r\n              m_pppcRDSbacCoder[uhNextDepth][CI_CURR_BEST]-&gt;load(m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST]);\r\n            }\r\n            else\r\n            {\r\n              m_pppcRDSbacCoder[uhNextDepth][CI_CURR_BEST]-&gt;load(m_pppcRDSbacCoder[uhNextDepth][CI_NEXT_BEST]);\r\n            }\r\n          }\r\n\r\n#if AMP_ENC_SPEEDUP\r\n          if ( rpcBestCU-&gt;isIntra(0) )\r\n          {\r\n            xCompressCU( pcSubBestPartCU, pcSubTempPartCU, uhNextDepth, SIZE_NONE );\/\/\u9012\u5f52\u51fd\u6570\r\n          }\r\n          else\r\n          {\r\n            xCompressCU( pcSubBestPartCU, pcSubTempPartCU, uhNextDepth, rpcBestCU-&gt;getPartitionSize(0) );\/\/\u9012\u5f52\u51fd\u6570\r\n          }\r\n#else\r\n          xCompressCU( pcSubBestPartCU, pcSubTempPartCU, uhNextDepth );         \r\n#endif\r\n\r\n          rpcTempCU-&gt;copyPartFrom( pcSubBestPartCU, uiPartUnitIdx, uhNextDepth );         \/\/ Keep best part data to current temporary data.\r\n          xCopyYuv2Tmp( pcSubBestPartCU-&gt;getTotalNumPart()*uiPartUnitIdx, uhNextDepth );\r\n        }\r\n        else if (bInSlice)\r\n        {\r\n          pcSubBestPartCU-&gt;copyToPic( uhNextDepth );\r\n          rpcTempCU-&gt;copyPartFrom( pcSubBestPartCU, uiPartUnitIdx, uhNextDepth );\r\n        }\r\n      }<\/pre>\n<p>\u65e2\u7136\u5df2\u7ecf\u77e5\u9053\uff0cCU\u7684\u5206\u5272\u662f\u901a\u8fc7\u9012\u5f52\u5b9e\u73b0\u7684\uff0c\u90a3\u4e48\u600e\u4e48\u786e\u5b9a\u54ea\u4e2auiDepth\u7684CU\u4e3arpcBestCU\u5462\uff1f<br \/>\n\u4e0a\u8ff0\u9012\u5f52\u51fd\u6570\u7ed3\u675f\u540e\uff0c\u7136\u540e\u518d\u901a\u8fc7xCheckBestMode( rpcBestCU, rpcTempCU, uiDepth);\u5224\u65ad\u51b3\u5b9a\u662f\u5426\u9009\u62e9\u672c\u5c42CU\u8fd8\u662f\u4e0b\u5c42CU.<\/p>\n<p>\u4ee5\u4e0b\u662f\u7f16\u7a0b\u5b9e\u73b0\u8f93\u51fa\u4e00\u4e2aLCU\u7684\u5206\u5272\u6a21\u5f0f\uff1a<\/p>\n<pre lang=\"cpp\" line=\"1\" escaped=\"true\">  \/\/ We need to split, so don't try these modes.\r\n  if(!bSliceEnd &amp;&amp; !bSliceStart &amp;&amp; bInsidePicture )\r\n  {\r\n    for (Int iQP=iMinQP; iQP&lt;=iMaxQP; iQP++)     {       if (isAddLowestQP &amp;&amp; (iQP == iMinQP))       {         iQP = lowestQP;       }       \/\/ variables for fast encoder decision       bEarlySkip  = false;       bTrySplit    = true;       fRD_Skip    = MAX_DOUBLE;       rpcTempCU-&gt;initEstData( uiDepth, iQP );\r\n     \/\/==\u8f93\u51fa\u5206\u533a\u6df1\u5ea6\u4fe1\u606fdepth==\/\/\r\n      cout&lt;&lt;\"Depth:\";\r\n      for(Int i=0;i&lt;=uiDepth;i++)\r\n       cout&lt;&lt;\"-&gt;\";\r\n       cout&lt;&lt;uiDepth&lt;&lt;endl;\r\n\r\n      \/\/ do inter modes, SKIP and 2Nx2N\r\n<\/pre>\n<p>\u6253\u5370\u8f93\u51fa\u7684\u7ed3\u6784\u4e3a\uff1a<br \/>\n&nbsp;<\/p>\n<p>Depth:-&gt;0<br \/>\nDepth:-&gt;-&gt;1<br \/>\nDepth:-&gt;-&gt;-&gt;2<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;2<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;2<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;2<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;1<br \/>\nDepth:-&gt;-&gt;-&gt;2<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;2<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;2<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;2<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;1<br \/>\nDepth:-&gt;-&gt;-&gt;2<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;2<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;2<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;2<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;1<br \/>\nDepth:-&gt;-&gt;-&gt;2<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;2<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;2<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;2<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<br \/>\nDepth:-&gt;-&gt;-&gt;-&gt;3<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\uff0c\u5bf9\u4e8e\u56db\u53c9\u6811\u7684\u5206\u5272\u5f62\u5f0f\uff0c\u5927\u5bb6\u60f3\u5fc5\u90fd\u5df2\u7ecf\u4e86\u89e3\u4e86\uff0c\u8fd9\u91cc\u5c31\u4e0d\u8fdb\u884c\u8fc7\u591a\u7684\u8d58\u8ff0\uff0c\u4e0b\u9762\u662f&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[59,57,58,60],"class_list":["post-399","post","type-post","status-publish","format-standard","hentry","category-4","tag-h-265","tag-hevc","tag-hm","tag-lcu"],"_links":{"self":[{"href":"https:\/\/www.fujiangyun.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fujiangyun.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fujiangyun.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fujiangyun.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fujiangyun.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=399"}],"version-history":[{"count":19,"href":"https:\/\/www.fujiangyun.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/399\/revisions"}],"predecessor-version":[{"id":418,"href":"https:\/\/www.fujiangyun.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/399\/revisions\/418"}],"wp:attachment":[{"href":"https:\/\/www.fujiangyun.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fujiangyun.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fujiangyun.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}