Changeset 5 in 3DVCSoftware for trunk/source/Lib/TLibEncoder


Ignore:
Timestamp:
12 Dec 2011, 18:35:44 (13 years ago)
Author:
hhi
Message:

Clean version with cfg-files

Location:
trunk/source/Lib/TLibEncoder
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibEncoder/SEIwrite.cpp

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
  • trunk/source/Lib/TLibEncoder/SEIwrite.h

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
  • trunk/source/Lib/TLibEncoder/TEncAdaptiveLoopFilter.cpp

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
  • trunk/source/Lib/TLibEncoder/TEncAdaptiveLoopFilter.h

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
  • trunk/source/Lib/TLibEncoder/TEncAnalyze.h

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
  • trunk/source/Lib/TLibEncoder/TEncBinCoder.h

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
  • trunk/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
  • trunk/source/Lib/TLibEncoder/TEncBinCoderCABAC.h

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
  • trunk/source/Lib/TLibEncoder/TEncCavlc.cpp

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
     
    258291  xWriteFlag  ( (pcSPS->getUseALF ()) ? 1 : 0 );
    259292  xWriteFlag  ( (pcSPS->getUseDQP ()) ? 1 : 0 );
    260 #if !SB_NO_LowDelayCoding
     293#if !HHI_NO_LowDelayCoding
    261294  xWriteFlag  ( (pcSPS->getUseLDC ()) ? 1 : 0 );
    262295#endif
     
    302335      xWriteUvlc( pcSPS->getViewId() );
    303336      xWriteSvlc( pcSPS->getViewOrderIdx() );
    304 #if HHI_DMM_INTRA
    305       xWriteFlag( pcSPS->getUseDepthModelModes() ? 1 : 0 );
    306 #endif
     337#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     338      xWriteFlag( pcSPS->getUseDMM() ? 1 : 0 );
     339#endif
     340#if HHI_MPI
    307341      xWriteFlag( pcSPS->getUseMVI() ? 1 : 0 );
     342#endif
    308343    }
    309344    else
     
    324359        }
    325360      }
     361#if DEPTH_MAP_GENERATION
    326362      xWriteUvlc( pcSPS->getPredDepthMapGeneration() );
    327363      if( pcSPS->getPredDepthMapGeneration() )
     
    333369          xWriteSvlc( pcSPS->getPdmOffset       ()[ uiId ] );
    334370        }
     371#if HHI_INTER_VIEW_MOTION_PRED
    335372        xWriteUvlc  ( pcSPS->getMultiviewMvPredMode() );
     373#endif
     374#if HHI_INTER_VIEW_RESIDUAL_PRED
    336375        xWriteFlag  ( pcSPS->getMultiviewResPredMode() );
    337       }
     376#endif
     377      }
     378#endif
    338379    }
    339380  }
     
    686727
    687728
     729#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
    688730Void
    689731TEncCavlc::codeMergeIndexMV( TComDataCU* pcCU, UInt uiAbsPartIdx )
     
    691733  UInt uiNumCand  = 0;
    692734  UInt uiMergeIdx = pcCU->getMergeIndex( uiAbsPartIdx );
    693 #if MW_MVI_SIGNALLING_MODE == 1
     735#if HHI_MPI
    694736  const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE;
    695   const UInt uiMviMergePos = bMVIAvailable ? MVI_MERGE_POS : MRG_MAX_NUM_CANDS;
     737  const UInt uiMviMergePos = bMVIAvailable ? HHI_MPI_MERGE_POS : MRG_MAX_NUM_CANDS;
    696738  if( bMVIAvailable )
    697739  {
     
    699741    const Bool bUseMVI = pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1;
    700742    if( bUseMVI )
    701       uiMergeIdx = MVI_MERGE_POS;
    702     else if( uiMergeIdx >= MVI_MERGE_POS )
     743      uiMergeIdx = HHI_MPI_MERGE_POS;
     744    else if( uiMergeIdx >= HHI_MPI_MERGE_POS )
    703745      uiMergeIdx++;
    704746  }
     
    754796  }
    755797}
    756 
     798#endif
    757799
    758800
     
    764806Void TEncCavlc::codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx )
    765807{
    766 #if MW_MVI_SIGNALLING_MODE == 1
     808#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
     809#if HHI_INTER_VIEW_MOTION_PRED && HHI_MPI
    767810  if( ( pcCU->getSlice()->getSPS()->getViewId() > 0 && ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE ) ||
    768811      ( pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) )
     812#elif HHI_MPI
     813  if( pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N )
    769814#else
    770815  if( pcCU->getSlice()->getSPS()->getViewId() > 0 && ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE )
     
    774819    return;
    775820  }
     821#endif
    776822
    777823  Bool bLeftInvolved = false;
     
    833879
    834880
     881#if HHI_INTER_VIEW_RESIDUAL_PRED
    835882Void
    836883TEncCavlc::codeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
     
    839886  xWriteFlag( uiSymbol );
    840887}
    841 
     888#endif
    842889
    843890Void TEncCavlc::codeAlfCtrlFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
     
    940987#endif
    941988}
    942 
    943 #if MW_MVI_SIGNALLING_MODE == 0
    944 Void TEncCavlc::codeMvInheritanceFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    945 {
    946   const Int iTextureModeDepth = pcCU->getTextureModeDepth( uiAbsPartIdx );
    947   if( iTextureModeDepth != -1 && uiDepth > iTextureModeDepth )
    948     return;
    949   UInt uiSymbol = iTextureModeDepth == uiDepth ? 1 : 0;
    950   xWriteFlag( uiSymbol );
    951 }
    952 #endif
    953989
    954990Void TEncCavlc::codeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
  • trunk/source/Lib/TLibEncoder/TEncCavlc.h

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
     
    193226#endif
    194227  Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    195 #if MW_MVI_SIGNALLING_MODE == 0
    196   Void codeMvInheritanceFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    197 #endif
    198228  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    199229  Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     230#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
    200231  Void codeMergeIndexMV  ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     232#endif
     233#if HHI_INTER_VIEW_RESIDUAL_PRED
    201234  Void codeResPredFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     235#endif
    202236  Void codeAlfCtrlFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    203237#if TSB_ALF_HEADER
  • trunk/source/Lib/TLibEncoder/TEncCfg.h

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235/** \file     TEncCfg.h
     
    4174  Int       m_iRateGOPSize;
    4275
    43   // SB
    4476  std::string     m_cInputFormatString ;
    4577
     
    75107  Int       m_iMaxDeltaQP;                      //  Max. absolute delta QP (1:default)
    76108
    77 //GT VSO
     109#if HHI_VSO
    78110  //====== View Synthesis Optimization ======
    79111  Bool      m_bForceLambdaScale;
    80 #if RDO_DIST_INT
     112#if HHI_VSO_DIST_INT
    81113  Bool      m_bAllowNegDist;
    82114#endif
    83115  Double    m_dLambdaScaleVSO;
    84116  UInt      m_uiVSOMode;
    85 //GT VSO end
     117#endif
    86118
    87119  //====== Tool list ========
     
    98130#endif
    99131  Bool      m_bUseRDOQ;
    100 #if !SB_NO_LowDelayCoding
     132#if !HHI_NO_LowDelayCoding
    101133  Bool      m_bUseLDC;
    102134#endif
     
    104136  Bool      m_bUseFastEnc;
    105137
    106 //GT VSO
     138#if HHI_VSO
    107139  Bool      m_bUseVSO;
    108 //GT VSO end
    109 
    110   Bool      m_bOmitUnusedBlocks;
     140#endif 
    111141  Bool      m_bUseMRG; // SOPH:
    112142#if LM_CHROMA
     
    126156  Bool      m_bUseConstrainedIntraPred;
    127157#endif
    128 #if HHI_DMM_INTRA
    129   Bool m_bUseDepthModelModes;
    130 #endif
     158#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     159  Bool m_bUseDMM;
     160#endif
     161#if HHI_MPI
    131162  Bool m_bUseMVI;
     163#endif
    132164
    133165  //====== Slice ========
     
    160192  Int**       m_aaiCodedOffset;
    161193
     194#if DEPTH_MAP_GENERATION
    162195  UInt        m_uiPredDepthMapGeneration;
    163   UInt        m_uiMultiviewMvPredMode;
    164196  UInt        m_uiPdmPrecision;
    165197  Int**       m_aaiPdmScaleNomDelta;
    166198  Int**       m_aaiPdmOffset;
     199#endif
     200#if HHI_INTER_VIEW_MOTION_PRED
     201  UInt        m_uiMultiviewMvPredMode;
    167202  UInt        m_uiMultiviewMvRegMode;
    168203  Double      m_dMultiviewMvRegLambdaScale;
     204#endif
     205#if HHI_INTER_VIEW_RESIDUAL_PRED
    169206  UInt        m_uiMultiviewResPredMode;
     207#endif
    170208
    171209  PicOrderCnt m_iQpChangeFrame;
    172210  Int         m_iQpChangeOffsetVideo;
    173211  Int         m_iQpChangeOffsetDepth;
    174 #if SB_INTERVIEW_SKIP
     212#if HHI_INTERVIEW_SKIP
    175213  UInt        m_uiInterViewSkip;
    176 #if SB_INTERVIEW_SKIP_LAMBDA_SCALE
     214#if HHI_INTERVIEW_SKIP_LAMBDA_SCALE
    177215  Double      m_dInterViewSkipLambdaScale;
    178216#endif
     
    205243  Void      setCodedOffset                  ( Int** p )      { m_aaiCodedOffset         = p; }
    206244
     245#if DEPTH_MAP_GENERATION
    207246  Void      setPredDepthMapGeneration       ( UInt  u )      { m_uiPredDepthMapGeneration   = u; }
    208   Void      setMultiviewMvPredMode          ( UInt  u )      { m_uiMultiviewMvPredMode      = u; }
    209247  Void      setPdmPrecision                 ( UInt  u )      { m_uiPdmPrecision             = u; }
    210248  Void      setPdmScaleNomDelta             ( Int** p )      { m_aaiPdmScaleNomDelta        = p; }
    211249  Void      setPdmOffset                    ( Int** p )      { m_aaiPdmOffset               = p; }
     250#endif
     251#if HHI_INTER_VIEW_MOTION_PRED
     252  Void      setMultiviewMvPredMode          ( UInt  u )      { m_uiMultiviewMvPredMode      = u; }
    212253  Void      setMultiviewMvRegMode           ( UInt  u )      { m_uiMultiviewMvRegMode       = u; }
    213254  Void      setMultiviewMvRegLambdaScale    ( Double d)      { m_dMultiviewMvRegLambdaScale = d; }
     255#endif
     256#if HHI_INTER_VIEW_RESIDUAL_PRED
    214257  Void      setMultiviewResPredMode         ( UInt  u )      { m_uiMultiviewResPredMode     = u; }
    215 
    216 #if SB_INTERVIEW_SKIP
     258#endif
     259
     260#if HHI_INTERVIEW_SKIP
    217261  Void      setInterViewSkip            ( UInt  u )       { m_uiInterViewSkip         = u; }
    218   Bool      getInterViewSkip            ( )       { return bool(m_uiInterViewSkip) ;}
    219 #if SB_INTERVIEW_SKIP_LAMBDA_SCALE
     262  Bool      getInterViewSkip            ( )       { return (m_uiInterViewSkip?true:false) ;}
     263#if HHI_INTERVIEW_SKIP_LAMBDA_SCALE
    220264  Void      setInterViewSkipLambdaScale ( UInt  u )       { m_dInterViewSkipLambdaScale = u; }
    221265  Double      getInterViewSkipLambdaScale ()                { return m_dInterViewSkipLambdaScale; }
     
    254298  Void      setMaxDeltaQP                   ( Int   i )      { m_iMaxDeltaQP = i; }
    255299
    256 //GT VSO
     300#if HHI_VSO
    257301 //==== VSO  ==========
    258302  Void      setVSOMode                      ( UInt  ui )    { m_uiVSOMode   = ui; }
    259303  Void      setForceLambdaScaleVSO          ( Bool  b )     { m_bForceLambdaScale = b; };
    260304  Void      setLambdaScaleVSO               ( Double d )    { m_dLambdaScaleVSO   = d; };
    261 #if RDO_DIST_INT
     305#if HHI_VSO_DIST_INT
    262306  Void      setAllowNegDist                 ( Bool b  )     { m_bAllowNegDist     = b; };
    263307#endif
    264 //GT VSO end
     308#endif
    265309
    266310  //====== Sequence ========
     
    306350  Int       getMaxDeltaQP                   ()      { return  m_iMaxDeltaQP; }
    307351
     352#if HHI_INTER_VIEW_MOTION_PRED
    308353  UInt      getMultiviewMvRegMode           ()      { return  m_uiMultiviewMvRegMode; }
    309354  Double    getMultiviewMvRegLambdaScale    ()      { return  m_dMultiviewMvRegLambdaScale; }
    310 
    311 //GT VSO
     355#endif
     356
     357#if HHI_VSO
    312358  //==== VSO  ==========
    313359  UInt      getVSOMode                      ()      { return m_uiVSOMode; }
    314360  Bool      getForceLambdaScaleVSO          ()      { return m_bForceLambdaScale; }
    315361  Double    getLambdaScaleVSO               ()      { return m_dLambdaScaleVSO;   }
    316 #if RDO_DIST_INT
     362#if HHI_VSO_DIST_INT
    317363  Bool      getAllowNegDist                 ()      { return m_bAllowNegDist;     }
    318364#endif
    319 
    320 //GT VSO end
     365#endif
    321366
    322367  //==== Tool list ========
     
    330375#endif
    331376  Void      setUseRDOQ                      ( Bool  b )     { m_bUseRDOQ    = b; }
    332 #if !SB_NO_LowDelayCoding
     377#if !HHI_NO_LowDelayCoding
    333378  Void      setUseLDC                       ( Bool  b )     { m_bUseLDC     = b; }
    334379#endif
    335380  Void      setUsePAD                       ( Bool  b )     { m_bUsePAD     = b; }
    336381  Void      setUseFastEnc                   ( Bool  b )     { m_bUseFastEnc = b; }
    337   //GT VSO
     382#if HHI_VSO
    338383  Void      setUseVSO                       ( Bool  b )     { m_bUseVSO     = b; }
    339   //GT VSO end
     384#endif
    340385  Void      setUseMRG                       ( Bool  b )     { m_bUseMRG     = b; } // SOPH:
    341386#if CONSTRAINED_INTRA_PRED
     
    344389  Void      setdQPs                         ( Int*  p )     { m_aidQP       = p; }
    345390  Void      setDeltaQpRD                    ( UInt  u )     {m_uiDeltaQpRD  = u; }
    346 
    347   Void      setOmitUnusedBlocks             ( Bool b )       { m_bOmitUnusedBlocks = b; }
    348391
    349392  Bool      getUseSBACRD                    ()      { return m_bUseSBACRD;  }
     
    360403#endif
    361404  Bool      getUseRDOQ                      ()      { return m_bUseRDOQ;    }
    362 #if !SB_NO_LowDelayCoding
     405#if !HHI_NO_LowDelayCoding
    363406  Bool      getUseLDC                       ()      { return m_bUseLDC;     }
    364407#endif
     
    366409  Bool      getUseFastEnc                   ()      { return m_bUseFastEnc; }
    367410
    368 //GT VSO
     411#if HHI_VSO
    369412  Bool      getUseVSO                       ()      { return m_bUseVSO;     }
    370 //GT VSO end
     413#endif
    371414  Bool      getUseMRG                       ()      { return m_bUseMRG;     } // SOPH:
    372415#if CONSTRAINED_INTRA_PRED
    373416  Bool      getUseConstrainedIntraPred      ()      { return m_bUseConstrainedIntraPred; }
    374417#endif
    375 #if HHI_DMM_INTRA
    376   Void setUseDepthModelModes( Bool b) { m_bUseDepthModelModes = b;    }
    377   Bool getUseDepthModelModes()        { return m_bUseDepthModelModes; }
    378 #endif
    379 
    380   Bool getOmitUnusedBlocks             ()      { return m_bOmitUnusedBlocks; }
     418#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     419  Void setUseDMM( Bool b) { m_bUseDMM = b;    }
     420  Bool getUseDMM()        { return m_bUseDMM; }
     421#endif
    381422
    382423#if LM_CHROMA
     
    413454  Bool      getUseSAO                  ()              {return m_bUseSAO;}
    414455#endif
     456#if HHI_MPI
    415457  Void      setUseMVI                  (Bool bVal)     {m_bUseMVI = bVal;}
     458#endif
    416459
    417460  void setPictureDigestEnabled(bool b) { m_pictureDigestEnabled = b; }
  • trunk/source/Lib/TLibEncoder/TEncCu.cpp

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
    133
    234
     
    3668  m_ppcResPredTmp  = new TComYuv*[m_uhTotalDepth-1];
    3769
    38 #if MW_MVI_SIGNALLING_MODE == 1
     70#if HHI_MPI
    3971  m_puhDepthSaved  = new UChar[1ll<<( ( m_uhTotalDepth - 1 )<<1 )];
    4072  m_puhWidthSaved  = new UChar[1ll<<( ( m_uhTotalDepth - 1 )<<1 )];
     
    77109  Int i;
    78110
    79 #if MW_MVI_SIGNALLING_MODE == 1
     111#if HHI_MPI
    80112  delete[] m_puhDepthSaved;  m_puhDepthSaved  = NULL;
    81113  delete[] m_puhWidthSaved;  m_puhWidthSaved  = NULL;
     
    245277
    246278
    247 //GT VSO
     279#if HHI_VSO
    248280      if ( m_pcRdCost->getUseLambdaScaleVSO() )
    249281      {
     
    251283      }
    252284      else
     285#endif
    253286      {
    254287        m_ppcBestCU[0]->getTotalCost()  = m_pcRdCost->calcRdCost( m_ppcBestCU[0]->getTotalBits(), m_ppcBestCU[0]->getTotalDistortion() );
    255288      }
    256 //GT VSO end
     289
    257290      fBestCost = m_ppcBestCU[0]->getTotalCost();
    258291
     
    276309        m_ppcBestCU[0]->getTotalBits() += m_pcEntropyCoder->getNumberOfWrittenBits(); // dQP bits
    277310
    278         //GT VSO
     311#if HHI_VSO
    279312        if (m_pcRdCost->getUseLambdaScaleVSO())
    280313        {
     
    282315        }
    283316        else
     317#endif
    284318        {
    285319          m_ppcBestCU[0]->getTotalCost()  = m_pcRdCost->calcRdCost( m_ppcBestCU[0]->getTotalBits(), m_ppcBestCU[0]->getTotalDistortion() );
    286320        }
    287         //GT VSO end
    288321
    289322        if ( fBestCost > m_ppcBestCU[0]->getTotalCost() )
     
    309342      m_ppcBestCU[0]->getTotalBits() += m_pcEntropyCoder->getNumberOfWrittenBits(); // dQP bits
    310343
    311       //GT VSO
     344#if HHI_VSO
    312345      if (m_pcRdCost->getUseLambdaScaleVSO())
    313346      {
     
    315348      }
    316349      else
     350#endif
    317351      {
    318352        m_ppcBestCU[0]->getTotalCost()  = m_pcRdCost->calcRdCost( m_ppcBestCU[0]->getTotalBits(), m_ppcBestCU[0]->getTotalDistortion() );
    319353      }
    320      //GT VSO end
    321354    }
    322355  }
     
    415448  UInt uiBPelY   = uiTPelY + rpcBestCU->getHeight(0) - 1;
    416449
    417 #if ( SB_INTERVIEW_SKIP)
     450#if ( HHI_INTERVIEW_SKIP)
    418451  Bool bFullyRenderedSec = true ;
    419452  if( m_pcEncCfg->getInterViewSkip() )
     
    445478    bFullyRenderedSec = false ;
    446479  }
    447 #if SB_INTERVIEW_SKIP_LAMBDA_SCALE
     480#if HHI_INTERVIEW_SKIP_LAMBDA_SCALE
    448481  if( bFullyRenderedSec )
    449482  {
     
    463496    if( rpcBestCU->getSlice()->getSliceType() != I_SLICE )
    464497    {
     498#if HHI_INTER_VIEW_RESIDUAL_PRED
    465499      // check availability of residual prediction
    466500      Bool  bResPredAvailable   = false;
     
    476510      {
    477511        Bool bResPredFlag  = ( uiResPrdId > 0 );
     512#endif
    478513
    479514      // SKIP
     
    483518      {
    484519#if !HHI_MRG_SKIP
     520#if HHI_INTER_VIEW_RESIDUAL_PRED
    485521        rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
     522#endif
    486523        xCheckRDCostAMVPSkip ( rpcBestCU, rpcTempCU );        rpcTempCU->initEstData();
    487524#endif
     525#if HHI_INTER_VIEW_RESIDUAL_PRED
    488526        rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    489 #if SB_INTERVIEW_SKIP
     527#endif
     528#if HHI_INTERVIEW_SKIP
    490529        xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU, bFullyRenderedSec );            rpcTempCU->initEstData();
    491530#else
     
    495534      else
    496535      {
     536#if HHI_INTER_VIEW_RESIDUAL_PRED
    497537        rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
     538#endif
    498539        xCheckRDCostAMVPSkip ( rpcBestCU, rpcTempCU );        rpcTempCU->initEstData();
    499540      }
     
    514555      {
    515556#if HHI_DISABLE_INTER_NxN_SPLIT
     557#if HHI_INTER_VIEW_RESIDUAL_PRED
    516558        rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    517 #if SB_INTERVIEW_SKIP
     559#endif
     560#if HHI_INTERVIEW_SKIP
    518561        xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFullyRenderedSec );  rpcTempCU->initEstData();
    519562#else
     
    522565        if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
    523566        {
     567#if HHI_INTER_VIEW_RESIDUAL_PRED
    524568          rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    525 #if SB_INTERVIEW_SKIP
     569#endif
     570#if HHI_INTERVIEW_SKIP
    526571          xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFullyRenderedSec );  rpcTempCU->initEstData();
    527572#else
     
    530575        }
    531576#else
     577#if HHI_INTER_VIEW_RESIDUAL_PRED
    532578        rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    533 #if SB_INTERVIEW_SKIP
     579#endif
     580#if HHI_INTERVIEW_SKIP
    534581        xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFullyRenderedSec );  rpcTempCU->initEstData();
    535582#else
    536583        xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N );  rpcTempCU->initEstData();
    537584#endif
     585#if HHI_INTER_VIEW_RESIDUAL_PRED
    538586        rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    539 #if SB_INTERVIEW_SKIP
     587#endif
     588#if HHI_INTERVIEW_SKIP
    540589        xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN, bFullyRenderedSec   );  rpcTempCU->initEstData();
    541590#else
     
    549598#endif
    550599      { // 2NxN, Nx2N
     600#if HHI_INTER_VIEW_RESIDUAL_PRED
    551601        rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    552 #if SB_INTERVIEW_SKIP
     602#endif
     603#if HHI_INTERVIEW_SKIP
    553604        xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_Nx2N, bFullyRenderedSec  );  rpcTempCU->initEstData();
    554605#else
    555606        xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_Nx2N  );  rpcTempCU->initEstData();
    556607#endif
     608#if HHI_INTER_VIEW_RESIDUAL_PRED
    557609        rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    558 #if SB_INTERVIEW_SKIP
     610#endif
     611#if HHI_INTERVIEW_SKIP
    559612        xCheckRDCostInter      ( rpcBestCU, rpcTempCU, SIZE_2NxN, bFullyRenderedSec  );  rpcTempCU->initEstData();
    560613#else
     
    563616      }
    564617
     618#if HHI_INTER_VIEW_RESIDUAL_PRED
    565619    } // uiResPrdId
     620#endif
    566621    }
    567622
     
    570625    {
    571626      // speedup for inter frames
    572 #if SB_INTERVIEW_SKIP
     627#if HHI_INTERVIEW_SKIP
    573628      if( ( rpcBestCU->getSlice()->getSliceType() == I_SLICE ||
    574629               rpcBestCU->getCbf( 0, TEXT_LUMA     ) != 0   ||
     
    596651
    597652    m_pcEntropyCoder->resetBits();
    598 #if MW_MVI_SIGNALLING_MODE == 0
    599     if( rpcBestCU->getSlice()->getSPS()->getUseMVI() && rpcBestCU->getSlice()->getSliceType() != I_SLICE )
    600       m_pcEntropyCoder->encodeMvInheritanceFlag( rpcBestCU, 0, uiDepth, true );
    601 #endif
    602653    m_pcEntropyCoder->encodeSplitFlag( rpcBestCU, 0, uiDepth, true );
    603654    rpcBestCU->getTotalBits() += m_pcEntropyCoder->getNumberOfWrittenBits(); // split bits
    604655
    605     //GT VSO
     656#if HHI_VSO
    606657    if (m_pcRdCost->getUseLambdaScaleVSO())
    607658    {
     
    609660    }
    610661    else
    611     {
    612 #if SB_INTERVIEW_SKIP
     662#endif
     663    {
     664#if HHI_INTERVIEW_SKIP
    613665  if(  m_pcEncCfg->getInterViewSkip())
    614666      {
     
    631683      rpcBestCU->getTotalCost()  = m_pcRdCost->calcRdCost( rpcBestCU->getTotalBits(), rpcBestCU->getTotalDistortion() );
    632684    }
    633     //GT VSO end
     685   
    634686
    635687    // accumulate statistics for early skip
     
    643695      }
    644696    }
    645 #if MW_MVI_SIGNALLING_MODE == 0
    646     if( rpcBestCU->getSlice()->getSPS()->getUseMVI() && rpcBestCU->getSlice()->getSliceType() != I_SLICE )
    647     {
    648       xCheckRDCostMvInheritance( rpcBestCU, rpcTempCU, uiDepth, false );  rpcTempCU->initEstData();
    649     }
    650 #elif MW_MVI_SIGNALLING_MODE == 1
     697#if HHI_MPI
    651698    if( rpcBestCU->getSlice()->getSPS()->getUseMVI() && rpcBestCU->getSlice()->getSliceType() != I_SLICE )
    652699    {
     
    666713  if( bTrySplit && uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth )
    667714  {
     715#if HHI_VSO
    668716    // reset Model
    669717    if( m_pcRdCost->getUseRenModel() )
     
    675723      m_pcRdCost->setRenModelData( m_ppcBestCU[uiDepth], 0, piSrc, uiSrcStride, uiWidth, uiHeight );
    676724    }
     725#endif
    677726
    678727    UChar       uhNextDepth         = uiDepth+1;
     
    701750        xCompressCU( pcSubBestPartCU, pcSubTempPartCU, uhNextDepth );
    702751
     752#if HHI_VSO
    703753        if( m_pcRdCost->getUseRenModel() )
    704754        {
     
    709759          m_pcRdCost->setRenModelData( pcSubBestPartCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
    710760        }
     761#endif
    711762        rpcTempCU->copyPartFrom( pcSubBestPartCU, uiPartUnitIdx, uhNextDepth );         // Keep best part data to current temporary data.
    712763        xCopyYuv2Tmp( pcSubBestPartCU->getTotalNumPart()*uiPartUnitIdx, uhNextDepth );
     
    718769      m_pcEntropyCoder->resetBits();
    719770      m_pcEntropyCoder->encodeSplitFlag( rpcTempCU, 0, uiDepth, true );
    720 #if MW_MVI_SIGNALLING_MODE == 0
    721       if( rpcBestCU->getSlice()->getSPS()->getUseMVI() && rpcBestCU->getSlice()->getSliceType() != I_SLICE )
    722         m_pcEntropyCoder->encodeMvInheritanceFlag( rpcTempCU, 0, uiDepth, true );
    723 #endif
    724771
    725772      rpcTempCU->getTotalBits() += m_pcEntropyCoder->getNumberOfWrittenBits(); // split bits
    726773    }
    727774
    728 #if SB_INTERVIEW_SKIP_LAMBDA_SCALE
     775#if HHI_INTERVIEW_SKIP_LAMBDA_SCALE
    729776    if( bFullyRenderedSec )
    730777    {
     
    736783    }
    737784#endif
    738 //GT VSO
     785#if HHI_VSO
    739786    if ( m_pcRdCost->getUseLambdaScaleVSO())
    740787    {
     
    742789    }
    743790    else
     791#endif
    744792    {
    745793      rpcTempCU->getTotalCost()  = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
    746794    }
    747 //GT VSO end
    748795
    749796    if( m_bUseSBACRD )
     
    753800    xCheckBestMode( rpcBestCU, rpcTempCU, uiDepth );                                          // RD compare current larger prediction
    754801
     802#if HHI_VSO
    755803    if( m_pcRdCost->getUseRenModel() )
    756804    {
     
    761809      m_pcRdCost->setRenModelData( rpcBestCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
    762810    }
     811#endif
    763812  }                                                                                  // with sub partitioned prediction.
    764813
     
    793842  UInt uiBPelY   = uiTPelY + (g_uiMaxCUHeight>>uiDepth) - 1;
    794843
    795 #if MW_MVI_SIGNALLING_MODE == 0
    796   if( pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE )
    797   {
    798     m_pcEntropyCoder->encodeMvInheritanceFlag( pcCU, uiAbsPartIdx, uiDepth );
    799   }
    800 #endif
    801844  if( ( uiRPelX < pcCU->getSlice()->getSPS()->getWidth() ) && ( uiBPelY < pcCU->getSlice()->getSPS()->getHeight() ) )
    802845  {
     846#if HHI_MPI
    803847    if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth < pcCU->getTextureModeDepth( uiAbsPartIdx ) )
     848#endif
    804849      m_pcEntropyCoder->encodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth );
    805850  }
     
    809854  }
    810855
    811 #if MW_MVI_SIGNALLING_MODE == 1
     856#if HHI_MPI
    812857  if( uiDepth == pcCU->getTextureModeDepth( uiAbsPartIdx ) )
    813858  {
     
    870915#endif
    871916
     917#if HHI_MPI
    872918  if( !pcCU->getSlice()->isIntra() && pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 )
     919#else
     920  if( !pcCU->getSlice()->isIntra() )
     921#endif
    873922  {
    874923    m_pcEntropyCoder->encodeSkipFlag( pcCU, uiAbsPartIdx );
     
    889938    }
    890939#endif
     940#if HHI_INTER_VIEW_RESIDUAL_PRED
    891941    m_pcEntropyCoder->encodeResPredFlag( pcCU, uiAbsPartIdx, 0 );
     942#endif
    892943    return;
    893944  }
     945#if HHI_MPI
    894946  if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 )
    895947  {
     948#endif
    896949    m_pcEntropyCoder->encodePredMode( pcCU, uiAbsPartIdx );
    897950
     
    901954    m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx );
    902955
     956#if HHI_INTER_VIEW_RESIDUAL_PRED
    903957    if( !pcCU->isIntra( uiAbsPartIdx ) )
    904958    {
    905959      m_pcEntropyCoder->encodeResPredFlag( pcCU, uiAbsPartIdx, 0 );
    906960    }
    907   }
     961#endif
     962#if HHI_MPI
     963  }
     964#endif
    908965
    909966  // Encode Coefficients
     
    915972  UChar uhDepth = rpcTempCU->getDepth( 0 );
    916973
     974#if HHI_VSO
    917975  if( m_pcRdCost->getUseRenModel() )
    918976  {
     
    923981    m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
    924982  }
     983#endif
    925984
    926985  rpcTempCU->setPredModeSubParts( MODE_SKIP,   0, uhDepth );
     
    9501009 * \returns Void
    9511010 */
    952 #if SB_INTERVIEW_SKIP
     1011#if HHI_INTERVIEW_SKIP
    9531012Void TEncCu::xCheckRDCostMerge2Nx2N( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bSkipRes )
    9541013#else
     
    9611020  UInt uiNeighbourCandIdx[MRG_MAX_NUM_CANDS]; //MVs with same idx => same cand
    9621021
     1022#if HHI_INTER_VIEW_RESIDUAL_PRED
    9631023  Bool  bResPrdAvail  = rpcTempCU->getResPredAvail( 0 );
    9641024  Bool  bResPrdFlag   = rpcTempCU->getResPredFlag ( 0 );
     1025#endif
    9651026
    9661027  for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ++ui )
     
    9711032  UChar uhDepth = rpcTempCU->getDepth( 0 );
    9721033
     1034#if HHI_VSO
    9731035  if( m_pcRdCost->getUseRenModel() )
    9741036  {
     
    9791041    m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
    9801042  }
     1043#endif
    9811044
    9821045  rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level
     
    9901053#if HHI_MRG_SKIP
    9911054      TComYuv* pcPredYuvTemp = NULL;
    992 #if SB_INTERVIEW_SKIP
     1055#if HHI_INTERVIEW_SKIP
    9931056      for( UInt uiNoResidual = (bSkipRes ? 1:0); uiNoResidual < 2; ++uiNoResidual )
    9941057#else
     
    10151078      rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand].getMv(), cMvFieldNeighbours[1 + 2*uiMergeCand].getRefIdx(), SIZE_2Nx2N, 0, 0, 0 ); // interprets depth relative to rpcTempCU level
    10161079
     1080#if HHI_INTER_VIEW_RESIDUAL_PRED
    10171081      rpcTempCU->setResPredAvailSubParts( bResPrdAvail, 0, 0, uhDepth );
    10181082      rpcTempCU->setResPredFlagSubParts ( bResPrdFlag,  0, 0, uhDepth );
     1083#endif
    10191084
    10201085#if HHI_MRG_SKIP
    10211086      // do MC
    1022 #if SB_INTERVIEW_SKIP
     1087#if HHI_INTERVIEW_SKIP
    10231088      if ( (uiNoResidual == 0) || bSkipRes ){
    10241089#else
     
    10361101        }
    10371102      }
    1038 
     1103#if HHI_VSO
    10391104      if( m_pcRdCost->getUseRenModel() )
    10401105      { //Reset
     
    10451110        m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
    10461111      }
     1112#endif
    10471113
    10481114      // estimate residual and encode everything
     
    10821148}
    10831149
    1084 #if SB_INTERVIEW_SKIP
     1150#if HHI_INTERVIEW_SKIP
    10851151Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bSkipRes)
    10861152#else
     
    10901156  UChar uhDepth = rpcTempCU->getDepth( 0 );
    10911157
     1158#if HHI_VSO
    10921159  if( m_pcRdCost->getUseRenModel() )
    10931160  {
     
    10981165    m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
    10991166  }
     1167#endif
    11001168
    11011169  rpcTempCU->setDepthSubParts( uhDepth, 0 );
    11021170
     1171#if HHI_INTER_VIEW_RESIDUAL_PRED
    11031172  Bool  bResPrdAvail  = rpcTempCU->getResPredAvail( 0 );
    11041173  Bool  bResPrdFlag   = rpcTempCU->getResPredFlag ( 0 );
     1174#endif
    11051175  rpcTempCU->setPartSizeSubParts    ( SIZE_2Nx2N,   0,    uhDepth );
     1176#if HHI_INTER_VIEW_RESIDUAL_PRED
    11061177  rpcTempCU->setResPredAvailSubParts( bResPrdAvail, 0, 0, uhDepth );
    11071178  rpcTempCU->setResPredFlagSubParts ( bResPrdFlag,  0, 0, uhDepth );
     1179#endif
    11081180  rpcTempCU->setPartSizeSubParts    ( ePartSize,    0,    uhDepth );
    11091181  rpcTempCU->setPredModeSubParts    ( MODE_INTER,   0,    uhDepth );
    11101182
     1183#if HHI_INTER_VIEW_RESIDUAL_PRED
    11111184  if( rpcTempCU->getResPredFlag( 0 ) )
    11121185  { // subtract residual prediction from original in motion search
    11131186    m_ppcOrigYuv[uhDepth]->add( m_ppcResPredTmp [uhDepth], rpcTempCU->getWidth( 0 ), rpcTempCU->getHeight( 0 ), true );
    11141187  }
    1115   #if SB_INTERVIEW_SKIP
     1188#endif
     1189#if HHI_INTERVIEW_SKIP
    11161190  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes );
    11171191#else
    11181192  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] );
    11191193#endif
     1194#if HHI_INTER_VIEW_RESIDUAL_PRED
    11201195  if( rpcTempCU->getResPredFlag( 0 ) )
    11211196  { // add residual prediction to original again
    11221197    m_ppcOrigYuv[uhDepth]->add( m_ppcResPredTmp [uhDepth], rpcTempCU->getWidth( 0 ), rpcTempCU->getHeight( 0 ) );
    11231198  }
     1199#endif
    11241200
    11251201#if PART_MRG
     
    11291205  }
    11301206#endif
    1131 #if SB_INTERVIEW_SKIP
     1207#if HHI_INTERVIEW_SKIP
    11321208  m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], m_ppcResPredTmp [uhDepth],bSkipRes );
    11331209#else
    11341210  m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], m_ppcResPredTmp [uhDepth], false );
    11351211#endif
    1136 //GT VSO
     1212
     1213#if HHI_VSO
    11371214  if( m_pcRdCost->getUseLambdaScaleVSO() )
    11381215  {
     
    11401217  }
    11411218  else
     1219#endif
    11421220  {
    11431221    rpcTempCU->getTotalCost()  = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
    11441222  }
    1145 //GT VSO end
    11461223
    11471224  xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth );
     
    11521229  UInt uiDepth = rpcTempCU->getDepth( 0 );
    11531230
    1154   // reset Model
     1231#if HHI_VSO
    11551232  if( m_pcRdCost->getUseRenModel() )
    11561233  {
     
    11611238    m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
    11621239  }
     1240#endif
    11631241
    11641242  rpcTempCU->setPartSizeSubParts( eSize, 0, uiDepth );
     
    11911269
    11921270  rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits();
    1193 //GT VSO
     1271#if HHI_VSO
    11941272  if( m_pcRdCost->getUseLambdaScaleVSO())
    11951273  {
     
    11971275  }
    11981276  else
     1277#endif
    11991278  {
    12001279    rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
    12011280  }
    1202 //GT VSO end
    12031281
    12041282  xCheckBestMode( rpcBestCU, rpcTempCU, uiDepth );
     
    12391317  UChar uhDepth = rpcTempCU->getDepth(0);
    12401318
     1319#if HHI_INTER_VIEW_RESIDUAL_PRED
    12411320  Bool  bResPrdAvail  = rpcTempCU->getResPredAvail( 0 );
    12421321  Bool  bResPrdFlag   = rpcTempCU->getResPredFlag ( 0 );
     1322#endif
    12431323
    12441324  AMVPInfo cAMVPInfo0;
     
    12781358      rpcTempCU->setPredModeSubParts( MODE_SKIP, 0, uhDepth );
    12791359      rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N,  0, uhDepth );
     1360#if HHI_INTER_VIEW_RESIDUAL_PRED
    12801361      rpcTempCU->setResPredAvailSubParts( bResPrdAvail, 0, 0, uhDepth );
    12811362      rpcTempCU->setResPredFlagSubParts ( bResPrdFlag,  0, 0, uhDepth );
     1363#endif
    12821364
    12831365      if (rpcTempCU->getSlice()->isInterB())
     
    13171399}
    13181400
    1319 #if MW_MVI_SIGNALLING_MODE == 0
    1320 Void TEncCu::xCheckRDCostMvInheritance( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, UChar uhTextureModeDepth, Bool bRecursiveCall )
    1321 #elif MW_MVI_SIGNALLING_MODE == 1
     1401#if HHI_MPI
    13221402Void TEncCu::xCheckRDCostMvInheritance( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, UChar uhTextureModeDepth, Bool bSkipResidual, Bool bRecursiveCall )
    1323 #else
    1324 #error
    1325 #endif
    13261403{
    13271404  assert( rpcTempCU->getSlice()->getSPS()->isDepth() );
     
    13421419  }
    13431420
     1421#if HHI_VSO
    13441422  if( m_pcRdCost->getUseRenModel() && !bRecursiveCall)
    13451423  {
     
    13501428    m_pcRdCost->setRenModelData( m_ppcTempCU[uhDepth], 0, piSrc, uiSrcStride, uiWidth, uiHeight );
    13511429  }
     1430#endif
    13521431
    13531432  Bool bSplit = uhDepth < pcTextureCU->getDepth( rpcTempCU->getZorderIdxInCU() );
     
    13771456        }
    13781457
    1379 #if MW_MVI_SIGNALLING_MODE == 0
    1380         xCheckRDCostMvInheritance( pcSubBestPartCU, pcSubTempPartCU, uhTextureModeDepth, true );
    1381 #elif MW_MVI_SIGNALLING_MODE == 1
    13821458        xCheckRDCostMvInheritance( pcSubBestPartCU, pcSubTempPartCU, uhTextureModeDepth, bSkipResidual, true );
    1383 #endif
    13841459
    13851460        rpcTempCU->copyPartFrom( pcSubBestPartCU, uiPartUnitIdx, uhNextDepth );         // Keep best part data to current temporary data.
     
    14081483      assert( rpcTempCU->getPredictionMode( ui ) != MODE_NONE );
    14091484    }
    1410 #if MW_MVI_SIGNALLING_MODE == 0
    1411     if( rpcTempCU->getPredictionMode( 0 ) == MODE_SKIP )
    1412     {
    1413       rpcTempCU->setPredModeSubParts( MODE_INTER, 0, uhDepth );
    1414     }
    1415 #elif MW_MVI_SIGNALLING_MODE == 1
    14161485    rpcTempCU->setPredModeSubParts( bSkipResidual ? MODE_SKIP : MODE_INTER, 0, uhDepth );
    1417 #endif
    14181486    m_pcPredSearch->motionCompensation( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
    14191487
    14201488    // get Original YUV data from picture
    14211489    m_ppcOrigYuv[uhDepth]->copyFromPicYuv( rpcBestCU->getPic()->getPicYuvOrg(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() );
    1422 #if MW_MVI_SIGNALLING_MODE == 0
    1423     m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], m_ppcResPredTmp [uhDepth], false );
    1424 #elif MW_MVI_SIGNALLING_MODE == 1
    14251490    m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], m_ppcResPredTmp [uhDepth], bSkipResidual );
    1426 #endif
    14271491
    14281492    if( uhDepth == uhTextureModeDepth )
     
    14311495    }
    14321496  }
    1433   //GT VSO
     1497
     1498#if HHI_VSO
    14341499  if( m_pcRdCost->getUseLambdaScaleVSO() )
    14351500  {
     
    14371502  }
    14381503  else
     1504#endif
    14391505  {
    14401506    rpcTempCU->getTotalCost()  = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
    14411507  }
    1442   //GT VSO end
    14431508
    14441509  xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth );
    14451510
     1511#if HHI_VSO
    14461512  if( !bSplit && bRecursiveCall && m_pcRdCost->getUseRenModel() )
    14471513  {
     
    14521518    m_pcRdCost->setRenModelData( rpcBestCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
    14531519  }
     1520#endif
    14541521}
    14551522
     
    14581525  const UChar uhDepth = pcCU->getTextureModeDepth( 0 );
    14591526  m_pcEntropyCoder->resetBits();
    1460 #if MW_MVI_SIGNALLING_MODE == 0
    1461   m_pcEntropyCoder->encodeMvInheritanceFlag( pcCU, 0, uhDepth, true );
    1462 #elif MW_MVI_SIGNALLING_MODE == 1
    14631527  xSaveDepthWidthHeight( pcCU );
    14641528  pcCU->setSizeSubParts( g_uiMaxCUWidth>>uhDepth, g_uiMaxCUHeight>>uhDepth, 0, uhDepth );
     
    15271591  }
    15281592  xRestoreDepthWidthHeight( pcCU );
    1529 #endif
    15301593
    15311594  pcCU->getTotalBits() += m_pcEntropyCoder->getNumberOfWrittenBits();
    15321595}
    15331596
    1534 #if MW_MVI_SIGNALLING_MODE == 1
    15351597Void TEncCu::xSaveDepthWidthHeight( TComDataCU* pcCU )
    15361598{
  • trunk/source/Lib/TLibEncoder/TEncCu.h

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
     
    68101  Bool                    m_bUseSBACRD;
    69102 
    70 #if MW_MVI_SIGNALLING_MODE == 1
     103#if HHI_MPI
    71104  UChar *m_puhDepthSaved;
    72105  UChar *m_puhWidthSaved;
     
    99132  Void  xCheckRDCostAMVPSkip( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU                      );
    100133 
    101 #if SB_INTERVIEW_SKIP
     134#if HHI_INTERVIEW_SKIP
    102135  Void xCheckRDCostMerge2Nx2N( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bFullyRendered ) ;
    103136#else
     
    106139 
    107140  Void  xCheckRDCostSkip    ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bBSkipRes      );
    108 #if SB_INTERVIEW_SKIP
     141#if HHI_INTERVIEW_SKIP
    109142  Void xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bFullyRendered ) ;
    110143#else
     
    118151  Void  xCopyYuv2Tmp        ( UInt uhPartUnitIdx, UInt uiDepth );
    119152  Void  xAddMVISignallingBits( TComDataCU* pcCU );
    120 #if MW_MVI_SIGNALLING_MODE == 0
    121   Void  xCheckRDCostMvInheritance( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, UChar uhTextureModeDepth, Bool bRecursiveCall );
    122 #elif MW_MVI_SIGNALLING_MODE == 1
     153#if HHI_MPI
    123154  Void  xCheckRDCostMvInheritance( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, UChar uhTextureModeDepth, Bool bSkipResidual, Bool bRecursiveCall );
    124155  Void  xSaveDepthWidthHeight( TComDataCU* pcCU );
  • trunk/source/Lib/TLibEncoder/TEncEntropy.cpp

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
     
    408441    }
    409442  }
    410 #if MW_MVI_SIGNALLING_MODE == 1
     443#if HHI_MPI
    411444  if( pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N )
    412445    uiNumCand++;
     
    419452
    420453
     454#if HHI_INTER_VIEW_RESIDUAL_PRED
    421455Void
    422456TEncEntropy::encodeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD )
     
    437471  m_pcEntropyCoderIf->codeResPredFlag( pcCU, uiAbsPartIdx );
    438472}
     473#endif
    439474
    440475
     
    517552  m_pcEntropyCoderIf->codeSplitFlag( pcCU, uiAbsPartIdx, uiDepth );
    518553}
    519 
    520 #if MW_MVI_SIGNALLING_MODE == 0
    521 Void TEncEntropy::encodeMvInheritanceFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD )
    522 {
    523   if( bRD )
    524     uiAbsPartIdx = 0;
    525   m_pcEntropyCoderIf->codeMvInheritanceFlag( pcCU, uiAbsPartIdx, uiDepth );
    526 }
    527 #endif
    528554
    529555/** encode partition size
     
    15681594    {
    15691595#if  HHI_MRG_SKIP
    1570 #if MW_MVI_SIGNALLING_MODE == 1
     1596#if HHI_MPI
    15711597      if( !(pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N &&
    15721598            ( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth == pcCU->getTextureModeDepth( uiAbsPartIdx ) ) ) )
  • trunk/source/Lib/TLibEncoder/TEncEntropy.h

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
     
    5790 
    5891  virtual Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    59 #if MW_MVI_SIGNALLING_MODE == 0
    60   virtual Void codeMvInheritanceFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    61 #endif
    6292  virtual Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    6393  virtual Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     94#if HHI_INTER_VIEW_RESIDUAL_PRED
    6495  virtual Void codeResPredFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     96#endif
    6597  virtual Void codeSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    6698 
     
    138170  Void encodeSplitFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false );
    139171  Void encodeSkipFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    140 #if MW_MVI_SIGNALLING_MODE == 0
    141   Void encodeMvInheritanceFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false );
    142 #endif
    143172  Void encodePUWise       ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    144173  Void encodeInterDirPU   ( TComDataCU* pcSubCU, UInt uiAbsPartIdx  );
     
    152181  Void encodeMergeIndex   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx );
    153182#endif
     183#if HHI_INTER_VIEW_RESIDUAL_PRED
    154184  Void encodeResPredFlag  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD = false );
     185#endif
    155186  Void encodeAlfCtrlFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    156187#if TSB_ALF_HEADER
  • trunk/source/Lib/TLibEncoder/TEncFormattedStringParser.cpp

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235#include "TEncFormattedStringParser.h"
  • trunk/source/Lib/TLibEncoder/TEncFormattedStringParser.h

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134#if !defined(AFX_TEncFormattedStringParser_H__268768B8_4D1D_484A_904E_586985833BAC__INCLUDED_)
    235#define AFX_TEncFormattedStringParser_H__268768B8_4D1D_484A_904E_586985833BAC__INCLUDED_
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
     
    1346#include <time.h>
    1447
    15 // SB
    1648#include "../../App/TAppEncoder/TAppEncTop.h"
    1749
     
    2557  m_pcSliceEncoder      = NULL;
    2658  m_pcListPic           = NULL;
    27  
     59
    2860  m_pcEntropyCoder      = NULL;
    2961  m_pcCavlcCoder        = NULL;
    3062  m_pcSbacCoder         = NULL;
    3163  m_pcBinCABAC          = NULL;
     64#if DEPTH_MAP_GENERATION
    3265  m_pcDepthMapGenerator = NULL;
     66#endif
     67#if HHI_INTER_VIEW_RESIDUAL_PRED
    3368  m_pcResidualGenerator = NULL;
    34  
     69#endif
     70
    3571#if DCM_DECODING_REFRESH
    3672  m_bRefreshPending     = 0;
     
    69105  m_pcSliceEncoder       = pcTEncTop->getSliceEncoder();
    70106  m_pcListPic            = pcTEncTop->getListPic();
    71  
     107
    72108  m_pcEntropyCoder       = pcTEncTop->getEntropyCoder();
    73109  m_pcCavlcCoder         = pcTEncTop->getCavlcCoder();
     
    76112  m_pcLoopFilter         = pcTEncTop->getLoopFilter();
    77113  m_pcBitCounter         = pcTEncTop->getBitCounter();
     114#if DEPTH_MAP_GENERATION
    78115  m_pcDepthMapGenerator  = pcTEncTop->getDepthMapGenerator();
     116#endif
     117#if HHI_INTER_VIEW_RESIDUAL_PRED
    79118  m_pcResidualGenerator  = pcTEncTop->getResidualGenerator();
    80  
     119#endif
     120
    81121  // Adaptive Loop filter
    82122  m_pcAdaptiveLoopFilter = pcTEncTop->getAdaptiveLoopFilter();
     
    97137{
    98138  TComSlice*      pcSlice;
    99  
     139
    100140      //-- For time output for each slice
    101141      long iBeforeTime = clock();
     
    104144      pcBitstreamOut->resetBits();
    105145      pcBitstreamOut->rewindStreamPacket();
    106      
     146
    107147      //  Slice data initialization
    108148      pcPic->clearSliceBuffer();
     
    112152      m_pcSliceEncoder->initEncSlice ( pcPic, pcSlice );
    113153      pcSlice->setSliceIdx(0);
    114      
     154
    115155      //  Set SPS
    116156      pcSlice->setSPS( m_pcEncTop->getSPS() );
     
    120160  // set mutliview parameters
    121161      pcSlice->initMultiviewSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() );
    122      
     162
    123163#if DCM_DECODING_REFRESH
    124164      // Set the nal unit type
     
    129169
    130170      //pcSlice->setNalUnitType(getNalUnitType(uiPOCCurr));
    131       // Do decoding refresh marking if any 
     171      // Do decoding refresh marking if any
    132172      pcSlice->decodingRefreshMarking(m_uiPOCCDR, m_bRefreshPending, rcListPic);
    133173#endif
     
    140180
    141181  pcSlice->setRefPicListFromGOPSTring( rcListPic, apcSpatRefPics );
     182
     183#if HHI_VSO
    142184  m_pcEncTop->getEncTop()->setMVDPic(pcPic->getViewIdx(), pcSlice->getPOC(), pcPic->getMVDReferenceInfo() );
    143185
    144 //GT VSO
    145   Bool bUseVSO = m_pcEncTop->getUseVSO(); 
     186
     187  Bool bUseVSO = m_pcEncTop->getUseVSO();
    146188  m_pcRdCost->setUseVSO( bUseVSO );
    147189
    148190  if ( bUseVSO )
    149   { 
     191  {
    150192    Int iVSOMode = m_pcEncTop->getVSOMode();
    151     m_pcRdCost->setVSOMode( iVSOMode  );   
    152 #if RDO_DIST_INT
    153     m_pcRdCost->setAllowNegDist( m_pcEncTop->getAllowNegDist() ); 
     193    m_pcRdCost->setVSOMode( iVSOMode  );
     194#if HHI_VSO_DIST_INT
     195    m_pcRdCost->setAllowNegDist( m_pcEncTop->getAllowNegDist() );
    154196#endif
    155197
    156198    if ( iVSOMode == 4 )
    157199    {
    158       m_pcEncTop->getEncTop()->setupRenModel( pcSlice->getPOC(), pcPic->getViewIdx(), m_pcEncTop->isDepthCoder() ? 1 : 0 ); 
     200      m_pcEncTop->getEncTop()->setupRenModel( pcSlice->getPOC(), pcPic->getViewIdx(), m_pcEncTop->isDepthCoder() ? 1 : 0 );
    159201    }
    160202    else
     
    163205  }
    164206  }
    165 //GT VSO end
    166 
    167   if ( m_pcEncTop->getOmitUnusedBlocks() )
    168   {
    169     m_pcEncTop->getEncTop()->getUsedPelsMap( pcPic->getViewIdx(), pcPic->getPOC(), pcPic->getUsedPelsMap() );
    170   }
    171      
     207#endif
     208
     209#if HHI_INTERVIEW_SKIP
     210  if ( m_pcEncTop->getInterViewSkip() )
     211  {
     212    m_pcEncTop->getEncTop()->getUsedPelsMap( pcPic->getViewIdx(), pcPic->getPOC(), pcPic->getUsedPelsMap() );
     213  }
     214#endif
     215
    172216      pcSlice->setNoBackPredFlag( false );
    173217#if DCM_COMB_LIST
     
    183227          for ( i=0; i < pcSlice->getNumRefIdx(RefPicList( 1 ) ); i++ )
    184228          {
    185             if ( pcSlice->getRefPOC(RefPicList(1), i) != pcSlice->getRefPOC(RefPicList(0), i) ) 
     229            if ( pcSlice->getRefPOC(RefPicList(1), i) != pcSlice->getRefPOC(RefPicList(0), i) )
    186230            {
    187231              pcSlice->setNoBackPredFlag( false );
     
    199243      pcSlice->generateCombinedList();
    200244#endif
    201      
     245
    202246      /////////////////////////////////////////////////////////////////////////////////////////////////// Compress a slice
    203247      //  Slice compression
     
    237281      m_uiStoredStartCUAddrForEncodingEntropySlice[uiStartCUAddrEntropySliceIdx++]  = uiNextCUAddr;
    238282
     283#if DEPTH_MAP_GENERATION
    239284      // init view component and predict virtual depth map
    240285      m_pcDepthMapGenerator->initViewComponent( pcPic );
    241286      m_pcDepthMapGenerator->predictDepthMap  ( pcPic );
     287#if HHI_INTER_VIEW_MOTION_PRED
    242288      m_pcDepthMapGenerator->covertOrgDepthMap( pcPic );
     289#endif
     290#if HHI_INTER_VIEW_RESIDUAL_PRED
    243291      m_pcResidualGenerator->initViewComponent( pcPic );
     292#endif
     293#endif
    244294
    245295      while(uiNextCUAddr<pcPic->getPicSym()->getNumberOfCUsInFrame()) // determine slice boundaries
     
    262312            m_uiStoredStartCUAddrForEncodingEntropySlice[uiStartCUAddrEntropySliceIdx++]  = uiStartCUAddrSlice;
    263313          }
    264          
     314
    265315          if (uiStartCUAddrSlice < pcPic->getPicSym()->getNumberOfCUsInFrame())
    266316          {
    267             pcPic->allocateNewSlice();         
     317            pcPic->allocateNewSlice();
    268318            pcPic->setCurrSliceIdx                  ( uiStartCUAddrSliceIdx-1 );
    269319            m_pcSliceEncoder->setSliceIdx           ( uiStartCUAddrSliceIdx-1 );
     
    286336          uiStartCUAddrSlice                                                            = pcSlice->getSliceCurEndCUAddr();
    287337          uiStartCUAddrEntropySlice                                                     = pcSlice->getEntropySliceCurEndCUAddr();
    288         }       
     338        }
    289339
    290340        uiNextCUAddr = (uiStartCUAddrSlice > uiStartCUAddrEntropySlice) ? uiStartCUAddrSlice : uiStartCUAddrEntropySlice;
     
    292342      m_uiStoredStartCUAddrForEncodingSlice[uiStartCUAddrSliceIdx++]                = pcSlice->getSliceCurEndCUAddr();
    293343      m_uiStoredStartCUAddrForEncodingEntropySlice[uiStartCUAddrEntropySliceIdx++]  = pcSlice->getSliceCurEndCUAddr();
    294      
     344
    295345      pcSlice = pcPic->getSlice(0);
    296346#if MTK_SAO  // PRE_DF
     
    298348#endif
    299349
     350#if HHI_INTER_VIEW_RESIDUAL_PRED
    300351      // set residual picture
    301352      m_pcResidualGenerator->setRecResidualPic( pcPic );
    302 
     353#endif
     354#if DEPTH_MAP_GENERATION
    303355      // update virtual depth map
    304356      m_pcDepthMapGenerator->updateDepthMap( pcPic );
     357#endif
    305358
    306359      //-- Loop filter
     
    329382            for(UInt i=0; i< uiNumSlices ; i++)
    330383            {
    331               (*m_pcAdaptiveLoopFilter)[i].create(pcPic, i, 
    332                                                   m_uiStoredStartCUAddrForEncodingSlice[i], 
     384              (*m_pcAdaptiveLoopFilter)[i].create(pcPic, i,
     385                                                  m_uiStoredStartCUAddrForEncodingSlice[i],
    333386                                                  m_uiStoredStartCUAddrForEncodingSlice[i+1]-1
    334387                                                  );
     
    359412        // generate start code
    360413        bs_SPS_PPS_SEI.write( 1, 32);
    361        
     414
    362415        m_pcEntropyCoder->encodePPS( pcSlice->getPPS() );
    363416        bs_SPS_PPS_SEI.write( 1, 1 );
     
    367420        rbSeqFirst = false;
    368421      }
    369      
     422
    370423      /* use the main bitstream buffer for storing the marshalled picture */
    371424      m_pcEntropyCoder->setBitstream(pcBitstreamOut);
    372425
    373426      uiStartCUAddrSliceIdx = 0;
    374       uiStartCUAddrSlice    = 0; 
     427      uiStartCUAddrSlice    = 0;
    375428      pcBitstreamOut->allocateMemoryForSliceLocations( pcPic->getPicSym()->getNumberOfCUsInFrame() ); // Assuming number of slices <= number of LCU. Needs to be changed for sub-LCU slice coding.
    376429      pcBitstreamOut->setSliceCount( 0 );                                      // intialize number of slices to zero, used while converting RBSP to NALU
    377430
    378431      uiStartCUAddrEntropySliceIdx = 0;
    379       uiStartCUAddrEntropySlice    = 0; 
     432      uiStartCUAddrEntropySlice    = 0;
    380433      uiNextCUAddr                 = 0;
    381434      pcSlice = pcPic->getSlice(uiStartCUAddrSliceIdx);
     
    401454          uiStartCUAddrSliceIdx++;
    402455          uiStartCUAddrEntropySliceIdx++;
    403         } 
     456        }
    404457        else if (uiNextCUAddr == m_uiStoredStartCUAddrForEncodingEntropySlice[uiStartCUAddrEntropySliceIdx])
    405458        {
     
    422475
    423476      // write SliceHeader
    424 #if SB_DEBUG
    425       g_bEncoding = true ;
    426 #endif
    427477      m_pcEntropyCoder->encodeSliceHeader ( pcSlice                 );
    428 #if SB_DEBUG
    429       g_bEncoding = false ;
    430 #endif
    431      
     478
    432479      // is it needed?
    433480      if ( pcSlice->getSymbolMode() )
     
    437484        m_pcEntropyCoder->resetEntropy    ();
    438485      }
    439      
     486
    440487        if (uiNextCUAddr==0)  // Compute ALF params and write only for first slice header
    441488        {
     
    452499#endif
    453500            m_pcAdaptiveLoopFilter->allocALFParam(&cAlfParam);
    454            
     501
    455502            // set entropy coder for RD
    456503            if ( pcSlice->getSymbolMode() )
     
    464511            m_pcEntropyCoder->resetEntropy    ();
    465512            m_pcEntropyCoder->setBitstream    ( m_pcBitCounter );
    466            
     513
    467514            m_pcAdaptiveLoopFilter->startALFEnc(pcPic, m_pcEntropyCoder );
    468515#if MTK_SAO  // PostDF
     
    478525#endif
    479526            UInt uiMaxAlfCtrlDepth;
    480            
     527
    481528            UInt64 uiDist, uiBits;
    482529#if MTK_SAO
     
    489536#endif
    490537            m_pcAdaptiveLoopFilter->endALFEnc();
    491            
     538
    492539            // set entropy coder for writing
    493540            m_pcSbacCoder->init( (TEncBinIf*)m_pcBinCABAC );
    494 #if SB_DEBUG
    495             g_bEncoding = true;
    496 #endif           
    497541            if ( pcSlice->getSymbolMode() )
    498542            {
     
    527571#endif
    528572            m_pcEntropyCoder->encodeAlfParam(&cAlfParam);
    529            
     573
    530574#if TSB_ALF_HEADER
    531575            if(cAlfParam.cu_control_flag)
     
    534578            }
    535579#endif
    536             g_bEncoding = false;
    537580            m_pcAdaptiveLoopFilter->freeALFParam(&cAlfParam);
    538581          }
    539582        }
    540        
     583
    541584        // File writing
    542 #if SB_DEBUG
    543         g_bEncoding = true ;
    544 #endif
    545585        m_pcSliceEncoder->encodeSlice( pcPic, pcBitstreamOut );
    546 #if SB_DEBUG
    547         g_bEncoding = false ;
    548 #endif
    549        
     586
    550587        //  End of bitstream & byte align
    551588        pcBitstreamOut->write( 1, 1 );
    552589        pcBitstreamOut->writeAlignZero();
    553        
     590
    554591        UInt uiBoundingAddrSlice, uiBoundingAddrEntropySlice;
    555         uiBoundingAddrSlice        = m_uiStoredStartCUAddrForEncodingSlice[uiStartCUAddrSliceIdx];         
    556         uiBoundingAddrEntropySlice = m_uiStoredStartCUAddrForEncodingEntropySlice[uiStartCUAddrEntropySliceIdx];         
     592        uiBoundingAddrSlice        = m_uiStoredStartCUAddrForEncodingSlice[uiStartCUAddrSliceIdx];
     593        uiBoundingAddrEntropySlice = m_uiStoredStartCUAddrForEncodingEntropySlice[uiStartCUAddrEntropySliceIdx];
    557594        uiNextCUAddr               = min(uiBoundingAddrSlice, uiBoundingAddrEntropySlice);
    558595        if (uiNextCUAddr < pcPic->getPicSym()->getNumberOfCUsInFrame())   // if more slices to be encoded insert start code
     
    564601        }
    565602      } // end iteration over slices
    566      
    567      
     603
     604
    568605#if MTK_NONCROSS_INLOOP_FILTER
    569606      if(pcSlice->getSPS()->getUseALF())
     
    572609          m_pcAdaptiveLoopFilter->destroySlice();
    573610      }
    574 #endif 
    575      
    576      
     611#endif
     612
     613
    577614      pcBitstreamOut->flushBuffer();
    578615      pcBitstreamOut->convertRBSPToPayload(0);
    579      
     616
    580617/*#if AMVP_BUFFERCOMPRESS
    581618      pcPic->compressMotion(); // moved to end of access unit
    582619#endif */
    583620      pcBitstreamOut->freeMemoryAllocatedForSliceLocations();
    584      
     621
    585622      //-- For time output for each slice
    586623      Double dEncTime = (double)(clock()-iBeforeTime) / CLOCKS_PER_SEC;
    587      
     624
    588625      xCalculateAddPSNR( pcPic, pcPic->getPicYuvRec(), pcBitstreamOut->getNumberOfWrittenBits(), dEncTime );
    589 
    590 #if GERHARD_RM_DEBUG_MM
    591       if (m_pcRdCost->getUseRenModel() )
    592       {     
    593         TRenModel*  pcMMCheckModel = m_pcEncTop->getEncTop()->getMMCheckModel();
    594         TRenModel*  pcRenModel     = m_pcEncTop->getEncTop()->getRenModel    ();
    595         TComPicYuv* pcPicYuvRec    = pcPic->getPicYuvRec();         
    596         pcMMCheckModel->setData(0,0, pcPicYuvRec->getWidth(), pcPicYuvRec->getHeight(), pcPicYuvRec->getStride(), pcPicYuvRec->getLumaAddr());
    597         Bool bEqual = pcRenModel->compare( pcMMCheckModel );
    598 
    599         if ( !bEqual )
    600         {
    601           std::cout << "Mismatch in Renderer Model !" << std::endl;
    602         }     
    603       }
    604 #endif
    605626
    606627#if FIXED_ROUNDING_FRAME_MEMORY
     
    643664      pcBitstreamOut->insertAt(bs_SPS_PPS_SEI, 0);
    644665
    645 #if SB_MEM_FIX
    646666      bs_SPS_PPS_SEI.destroy();
    647 #endif
    648667      pcPic->getPicYuvRec()->copyToPic(pcPicYuvRecOut);
    649      
     668
    650669      pcPic->setReconMark   ( true );
    651      
     670
    652671}
    653672
     
    656675  TComSlice* pcSlice = pcPic->getSlice(pcPic->getCurrSliceIdx());
    657676  Bool bCalcDist = false;
    658  
     677
    659678  m_pcLoopFilter->setCfg(pcSlice->getLoopFilterDisable(), m_pcCfg->getLoopFilterAlphaC0Offget(), m_pcCfg->getLoopFilterBetaOffget());
    660679  m_pcLoopFilter->loopFilterPic( pcPic );
    661  
     680
    662681  m_pcEntropyCoder->setEntropyCoder ( m_pcEncTop->getRDGoOnSbacCoder(), pcSlice );
    663682  m_pcEntropyCoder->resetEntropy    ();
    664683  m_pcEntropyCoder->setBitstream    ( m_pcBitCounter );
    665  
     684
    666685  // Adaptive Loop filter
    667686  if( pcSlice->getSPS()->getUseALF() )
     
    672691#endif
    673692    m_pcAdaptiveLoopFilter->allocALFParam(&cAlfParam);
    674    
     693
    675694    m_pcAdaptiveLoopFilter->startALFEnc(pcPic, m_pcEntropyCoder);
    676    
     695
    677696    UInt uiMaxAlfCtrlDepth;
    678697    m_pcAdaptiveLoopFilter->ALFProcess(&cAlfParam, pcSlice->getLambda(), ruiDist, ruiBits, uiMaxAlfCtrlDepth );
     
    680699    m_pcAdaptiveLoopFilter->freeALFParam(&cAlfParam);
    681700  }
    682  
     701
    683702  m_pcEntropyCoder->resetEntropy    ();
    684703  ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
    685  
     704
    686705  if (!bCalcDist)
    687706    ruiDist = xFindDistortionFrame(pcPic->getPicYuvOrg(), pcPic->getPicYuvRec());
     
    704723#endif
    705724  Int   iTemp;
    706  
     725
    707726  Int   iStride = pcPic0->getStride();
    708727  Int   iWidth  = pcPic0->getWidth();
    709728  Int   iHeight = pcPic0->getHeight();
    710  
     729
    711730  UInt64  uiTotalDiff = 0;
    712  
     731
    713732  for( y = 0; y < iHeight; y++ )
    714733  {
     
    724743    pSrc1 += iStride;
    725744  }
    726  
     745
    727746  iHeight >>= 1;
    728747  iWidth  >>= 1;
    729748  iStride >>= 1;
    730  
     749
    731750  pSrc0  = pcPic0->getCbAddr();
    732751  pSrc1  = pcPic1->getCbAddr();
    733  
     752
    734753  for( y = 0; y < iHeight; y++ )
    735754  {
     
    745764    pSrc1 += iStride;
    746765  }
    747  
     766
    748767  pSrc0  = pcPic0->getCrAddr();
    749768  pSrc1  = pcPic1->getCrAddr();
    750  
     769
    751770  for( y = 0; y < iHeight; y++ )
    752771  {
     
    762781    pSrc1 += iStride;
    763782  }
    764  
     783
    765784  return uiTotalDiff;
    766785}
     
    772791  UInt64 uiSSDU  = 0;
    773792  UInt64 uiSSDV  = 0;
    774  
     793
    775794  Double  dYPSNR  = 0.0;
    776795  Double  dUPSNR  = 0.0;
    777796  Double  dVPSNR  = 0.0;
    778  
     797
    779798  //===== calculate PSNR =====
    780799  Pel*  pOrg    = pcPic ->getPicYuvOrg()->getLumaAddr();
    781800  Pel*  pRec    = pcPicD->getLumaAddr();
    782801  Int   iStride = pcPicD->getStride();
    783  
     802
    784803  Int   iWidth;
    785804  Int   iHeight;
    786  
     805
    787806  iWidth  = pcPicD->getWidth () - m_pcEncTop->getPad(0);
    788807  iHeight = pcPicD->getHeight() - m_pcEncTop->getPad(1);
    789  
     808
    790809  Int   iSize   = iWidth*iHeight;
    791  
     810
    792811  UInt   maxval = 255 * (1<<(g_uiBitDepth + g_uiBitIncrement -8));
    793812  Double fRefValueY = (double) maxval * maxval * iSize;
     
    804823    pRec += iStride;
    805824  }
    806  
    807 
     825
     826#if HHI_VSO
    808827  if ( m_pcRdCost->getUseRenModel() )
    809828  {
    810     TRenModel*  pcRenModel = m_pcEncTop->getEncTop()->getRenModel();       
    811     Int64 iDistVSOY, iDistVSOU, iDistVSOV; 
    812     pcRenModel->getTotalSSE( iDistVSOY, iDistVSOU, iDistVSOV ); 
     829    TRenModel*  pcRenModel = m_pcEncTop->getEncTop()->getRenModel();
     830    Int64 iDistVSOY, iDistVSOU, iDistVSOV;
     831    pcRenModel->getTotalSSE( iDistVSOY, iDistVSOU, iDistVSOV );
    813832    dYPSNR = ( iDistVSOY ? 10.0 * log10( fRefValueY / (Double) iDistVSOY ) : 99.99 );
    814833    dUPSNR = ( iDistVSOU ? 10.0 * log10( fRefValueC / (Double) iDistVSOU ) : 99.99 );
     
    816835  }
    817836  else
    818   {   
     837#endif
     838  {
    819839  iHeight >>= 1;
    820840  iWidth  >>= 1;
     
    822842  pOrg  = pcPic ->getPicYuvOrg()->getCbAddr();
    823843  pRec  = pcPicD->getCbAddr();
    824  
     844
    825845  for( y = 0; y < iHeight; y++ )
    826846  {
     
    833853    pRec += iStride;
    834854  }
    835  
     855
    836856  pOrg  = pcPic ->getPicYuvOrg()->getCrAddr();
    837857  pRec  = pcPicD->getCrAddr();
    838  
     858
    839859  for( y = 0; y < iHeight; y++ )
    840860  {
     
    851871  dVPSNR            = ( uiSSDV ? 10.0 * log10( fRefValueC / (Double)uiSSDV ) : 99.99 );
    852872  }
    853  
    854873  // fix: total bits should consider slice size bits (32bit)
    855874  uibits += 32;
    856  
     875
    857876#if RVM_VCEGAM10
    858877  m_vRVM_RP.push_back( uibits );
     
    906925  printf( "[Y %6.4lf dB    U %6.4lf dB    V %6.4lf dB]  ", dYPSNR, dUPSNR, dVPSNR );
    907926  printf ("[ET %5.0f ] ", dEncTime );
    908  
     927
    909928  for (Int iRefList = 0; iRefList < 2; iRefList++)
    910929  {
     
    972991{
    973992  Double dRVM = 0;
    974  
     993
    975994  //if( m_pcCfg->getGOPSize() == 1 && m_pcCfg->getIntraPeriod() != 1 && m_pcCfg->getFrameToBeEncoded() > RVM_VCEGAM10_M * 2 )
    976995  {
     
    980999    vRL.resize( N );
    9811000    vB.resize( N );
    982    
     1001
    9831002    Int i;
    9841003    Double dRavg = 0 , dBavg = 0;
     
    9941013      dBavg += vB[i];
    9951014    }
    996    
     1015
    9971016    dRavg /= ( N - 2 * RVM_VCEGAM10_M );
    9981017    dBavg /= ( N - 2 * RVM_VCEGAM10_M );
    999    
     1018
    10001019    double dSigamB = 0;
    10011020    for( i = RVM_VCEGAM10_M + 1 ; i < N - RVM_VCEGAM10_M + 1 ; i++ )
     
    10051024    }
    10061025    dSigamB = sqrt( dSigamB / ( N - 2 * RVM_VCEGAM10_M ) );
    1007    
     1026
    10081027    double f = sqrt( 12.0 * ( RVM_VCEGAM10_M - 1 ) / ( RVM_VCEGAM10_M + 1 ) );
    1009    
     1028
    10101029    dRVM = dSigamB / dRavg * f;
    10111030  }
    1012  
     1031
    10131032  return( dRVM );
    10141033}
  • trunk/source/Lib/TLibEncoder/TEncGOP.h

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
     
    5790  TEncBinCABAC*           m_pcBinCABAC;
    5891  TComLoopFilter*         m_pcLoopFilter;
     92#if DEPTH_MAP_GENERATION
    5993  TComDepthMapGenerator*  m_pcDepthMapGenerator;
     94#endif
     95#if HHI_INTER_VIEW_RESIDUAL_PRED
    6096  TComResidualGenerator*  m_pcResidualGenerator;
     97#endif
    6198 
    6299  // Adaptive Loop filter
  • trunk/source/Lib/TLibEncoder/TEncSbac.cpp

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
     
    2659, m_uiMaxAlfCtrlDepth         ( 0 )
    2760, m_cCUSplitFlagSCModel       ( 1,             1,               NUM_SPLIT_FLAG_CTX            )
    28 #if MW_MVI_SIGNALLING_MODE == 0
    29 , m_cCUMvInheritanceFlagSCModel(1,             1,               NUM_MVI_FLAG_CTX              )
    30 #endif
    3161, m_cCUSkipFlagSCModel        ( 1,             1,               NUM_SKIP_FLAG_CTX             )
    3262, m_cCUMergeFlagExtSCModel    ( 1,             1,               NUM_MERGE_FLAG_EXT_CTX        )
     
    72102#endif
    73103, m_cViewIdxSCModel           ( 1,             1,               NUM_VIEW_IDX_CTX              )
    74 #if HHI_DMM_INTRA
     104#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    75105, m_cIntraDMMSCModel          ( 1,             1,               NUM_DMM_CTX                   )
    76106, m_cIntraWedgeSCModel        ( 1,             1,               NUM_WEDGE_CTX                 )
     
    94124 
    95125  m_cCUSplitFlagSCModel.initBuffer       ( eSliceType, iQp, (Short*)INIT_SPLIT_FLAG );
    96 #if MW_MVI_SIGNALLING_MODE == 0
    97   m_cCUMvInheritanceFlagSCModel.initBuffer( eSliceType, iQp, (Short*)INIT_MVI_FLAG );
    98 #endif
    99126 
    100127  m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (Short*)INIT_SKIP_FLAG );
     
    137164#endif
    138165  m_cViewIdxSCModel.initBuffer           ( eSliceType, iQp, (Short*)INIT_VIEW_IDX );
    139 #if HHI_DMM_INTRA
     166#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    140167  m_cIntraDMMSCModel.initBuffer          ( eSliceType, iQp, (Short*)INIT_INTRA_DMM );
    141168  m_cIntraWedgeSCModel.initBuffer        ( eSliceType, iQp, (Short*)INIT_INTRA_WEDGELET );
     
    307334  return;
    308335}
    309 #if HHI_DMM_INTRA
     336#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    310337Void TEncSbac::xWriteExGolombLevel( UInt uiSymbol, ContextModel& rcSCModel  )
    311338{
     
    388415 
    389416  this->m_cCUSplitFlagSCModel      .copyFrom( &pSrc->m_cCUSplitFlagSCModel       );
    390 #if MW_MVI_SIGNALLING_MODE == 0
    391   this->m_cCUMvInheritanceFlagSCModel.copyFrom( &pSrc->m_cCUMvInheritanceFlagSCModel );
    392 #endif
    393417  this->m_cCUSkipFlagSCModel       .copyFrom( &pSrc->m_cCUSkipFlagSCModel        );
    394418  this->m_cCUMergeFlagExtSCModel  .copyFrom( &pSrc->m_cCUMergeFlagExtSCModel);
     
    421445  this->m_cMVPIdxSCModel           .copyFrom( &pSrc->m_cMVPIdxSCModel            );
    422446  this->m_cViewIdxSCModel          .copyFrom( &pSrc->m_cViewIdxSCModel           );
    423 #if HHI_DMM_INTRA
     447#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    424448  this->m_cIntraDMMSCModel         .copyFrom( &pSrc->m_cIntraDMMSCModel          );
    425449  this->m_cIntraWedgeSCModel       .copyFrom( &pSrc->m_cIntraWedgeSCModel        );
     
    636660
    637661
     662#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
    638663Void TEncSbac::codeMergeIndexMV( TComDataCU* pcCU, UInt uiAbsPartIdx )
    639664{
     
    641666  Bool  abAvailable[ MRG_MAX_NUM_CANDS ];
    642667  UInt  uiNumCand = 0;
    643 #if MW_MVI_SIGNALLING_MODE == 1
     668#if HHI_MPI
    644669  const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE;
    645   const UInt uiMviMergePos = bMVIAvailable ? MVI_MERGE_POS : MRG_MAX_NUM_CANDS;
     670  const UInt uiMviMergePos = bMVIAvailable ? HHI_MPI_MERGE_POS : MRG_MAX_NUM_CANDS;
    646671#endif
    647672  for( UInt uiIdx = 0; uiIdx < MRG_MAX_NUM_CANDS; uiIdx++ )
    648673  {
    649 #if MW_MVI_SIGNALLING_MODE == 1
     674#if HHI_MPI
    650675    if( uiIdx == uiMviMergePos )
    651676    {
     
    693718  //--- determine unary index ---
    694719  UInt  uiMergeIdx  = pcCU->getMergeIndex( uiAbsPartIdx );
    695 #if MW_MVI_SIGNALLING_MODE == 1
     720#if HHI_MPI
    696721  if( bMVIAvailable )
    697722  {
     
    699724    if( bUseMVI )
    700725    {
    701       uiMergeIdx = MVI_MERGE_POS;
    702     }
    703     else if( uiMergeIdx >= MVI_MERGE_POS )
     726      uiMergeIdx = HHI_MPI_MERGE_POS;
     727    }
     728    else if( uiMergeIdx >= HHI_MPI_MERGE_POS )
    704729    {
    705730      uiMergeIdx++;
     
    748773  DTRACE_CABAC_T( "\n" );
    749774}
    750 
     775#endif
    751776
    752777
     
    758783Void TEncSbac::codeMergeIndex( TComDataCU* pcCU, UInt uiAbsPartIdx )
    759784{
    760 #if MW_MVI_SIGNALLING_MODE == 1
     785#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
     786#if HHI_INTER_VIEW_MOTION_PRED && HHI_MPI
    761787  if( ( pcCU->getSlice()->getSPS()->getViewId() > 0 && ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE ) ||
    762788      ( pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) )
     789#elif HHI_MPI
     790  if( pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N )
    763791#else
    764792  if( pcCU->getSlice()->getSPS()->getViewId() > 0 && ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE )
     
    768796    return;
    769797  }
     798#endif
    770799
    771800  Bool bLeftInvolved = false;
     
    884913
    885914
     915#if HHI_INTER_VIEW_RESIDUAL_PRED
    886916Void
    887917TEncSbac::codeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
     
    891921  m_pcBinIf->encodeBin( uiSymbol, m_cResPredFlagSCModel.get( 0, 0, uiCtx ) );
    892922}
     923#endif
    893924
    894925
     
    907938  return;
    908939}
    909 
    910 #if MW_MVI_SIGNALLING_MODE == 0
    911 Void TEncSbac::codeMvInheritanceFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    912 {
    913   const Int iTextureModeDepth = pcCU->getTextureModeDepth( uiAbsPartIdx );
    914   if( iTextureModeDepth != -1 && uiDepth > iTextureModeDepth )
    915     return;
    916 
    917   UInt uiCtx    = pcCU->getCtxMvInheritanceFlag( uiAbsPartIdx, uiDepth );
    918   UInt uiSymbol = iTextureModeDepth == uiDepth ? 1 : 0;
    919 
    920   assert( uiCtx < 3 );
    921   m_pcBinIf->encodeBin( uiSymbol, m_cCUMvInheritanceFlagSCModel.get( 0, 0, uiCtx ) );
    922 }
    923 #endif
    924940
    925941Void TEncSbac::codeTransformSubdivFlag( UInt uiSymbol, UInt uiCtx )
     
    935951}
    936952
    937 #if HHI_DMM_INTRA
     953#if HHI_DMM_WEDGE_INTRA
    938954Void TEncSbac::xCodeWedgeFullInfo( TComDataCU* pcCU, UInt uiAbsPartIdx )
    939955{
     
    10311047  }
    10321048}
    1033 
     1049#endif
     1050#if HHI_DMM_PRED_TEX
    10341051Void TEncSbac::xCodeWedgePredTexDeltaInfo( TComDataCU* pcCU, UInt uiAbsPartIdx )
    10351052{
     
    10761093  UInt uiDir = pcCU->getLumaIntraDir( uiAbsPartIdx );
    10771094
    1078 #if HHI_DMM_INTRA
    1079   if ( pcCU->getSlice()->getSPS()->isDepth() && pcCU->getSlice()->getSPS()->getUseDepthModelModes() && pcCU->getWidth( uiAbsPartIdx ) < 64 )
     1095#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     1096  if ( pcCU->getSlice()->getSPS()->isDepth() && pcCU->getSlice()->getSPS()->getUseDMM() && pcCU->getWidth( uiAbsPartIdx ) < 64 )
    10801097  {
    10811098    m_pcBinIf->encodeBin( uiDir > MAX_MODE_ID_INTRA_DIR, m_cIntraDMMSCModel.get(0, 0, 0) );
     
    10861103    UInt uiDMMode = uiDir - (MAX_MODE_ID_INTRA_DIR+1);
    10871104
    1088     if( !pcCU->getTextureModeAllowance( uiAbsPartIdx ) )
    1089     {
     1105#if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
     1106    m_pcBinIf->encodeBin( (uiDMMode & 0x01),      m_cIntraDMMSCModel.get(0, 0, 1) );
     1107    m_pcBinIf->encodeBin( (uiDMMode & 0x02) >> 1, m_cIntraDMMSCModel.get(0, 0, 1) );
     1108
    10901109      if ( pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_NxN && pcCU->getWidth( uiAbsPartIdx ) > 4 )
    10911110      {
    1092         if( uiDMMode > 1 )
    1093         {
    1094           uiDMMode -= 4;
     1111      m_pcBinIf->encodeBin( (uiDMMode & 0x04) >> 2, m_cIntraDMMSCModel.get(0, 0, 1) );
    10951112        }
     1113#else
    10961114                                  m_pcBinIf->encodeBin( (uiDMMode & 0x01),      m_cIntraDMMSCModel.get(0, 0, 1) );
    1097     if( DMM_INTRA_MODE_BITS > 1 ) m_pcBinIf->encodeBin( (uiDMMode & 0x02) >> 1, m_cIntraDMMSCModel.get(0, 0, 1) );
    1098       }
    1099       else
    1100     {
    1101         m_pcBinIf->encodeBin( (uiDMMode & 0x01),      m_cIntraDMMSCModel.get(0, 0, 1) );
    1102     }
    1103     }
    1104     else
    1105     {
    1106                                   m_pcBinIf->encodeBin( (uiDMMode & 0x01),      m_cIntraDMMSCModel.get(0, 0, 1) );
    1107     if( DMM_INTRA_MODE_BITS > 1 ) m_pcBinIf->encodeBin( (uiDMMode & 0x02) >> 1, m_cIntraDMMSCModel.get(0, 0, 1) );
    11081115
    11091116    if ( pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_NxN && pcCU->getWidth( uiAbsPartIdx ) > 4 )
    11101117    {
    1111       if( DMM_INTRA_MODE_BITS > 2 ) m_pcBinIf->encodeBin( (uiDMMode & 0x04) >> 2, m_cIntraDMMSCModel.get(0, 0, 1) );
    1112     }
    1113   }
    1114 
     1118      m_pcBinIf->encodeBin( (uiDMMode & 0x02) >> 1, m_cIntraDMMSCModel.get(0, 0, 1) );
     1119    }
     1120#endif
     1121#if HHI_DMM_WEDGE_INTRA
    11151122    if( uiDir == DMM_WEDGE_FULL_IDX )          { xCodeWedgeFullInfo          ( pcCU, uiAbsPartIdx ); }
    11161123    if( uiDir == DMM_WEDGE_FULL_D_IDX )        { xCodeWedgeFullDeltaInfo     ( pcCU, uiAbsPartIdx ); }
    11171124    if( uiDir == DMM_WEDGE_PREDDIR_IDX )       { xCodeWedgePredDirInfo       ( pcCU, uiAbsPartIdx ); }
    11181125    if( uiDir == DMM_WEDGE_PREDDIR_D_IDX )     { xCodeWedgePredDirDeltaInfo  ( pcCU, uiAbsPartIdx ); }
     1126#endif
     1127#if HHI_DMM_PRED_TEX
    11191128    if( uiDir == DMM_WEDGE_PREDTEX_D_IDX )     { xCodeWedgePredTexDeltaInfo  ( pcCU, uiAbsPartIdx ); }
    11201129    if( uiDir == DMM_CONTOUR_PREDTEX_D_IDX )   { xCodeContourPredTexDeltaInfo( pcCU, uiAbsPartIdx ); }
     1130#endif
    11211131  }
    11221132  else
     
    12041214{
    12051215  UInt uiDir = pcCU->getLumaIntraDir( uiAbsPartIdx );
    1206 #if HHI_DMM_INTRA
    1207   if ( pcCU->getSlice()->getSPS()->isDepth() && pcCU->getSlice()->getSPS()->getUseDepthModelModes() && pcCU->getWidth( uiAbsPartIdx ) < 64 )
     1216#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     1217  if ( pcCU->getSlice()->getSPS()->isDepth() && pcCU->getSlice()->getSPS()->getUseDMM() && pcCU->getWidth( uiAbsPartIdx ) < 64 )
    12081218  {
    12091219    m_pcBinIf->encodeBin( uiDir > MAX_MODE_ID_INTRA_DIR, m_cIntraDMMSCModel.get(0, 0, 0) );
     
    12141224    UInt uiDMMode = uiDir - (MAX_MODE_ID_INTRA_DIR+1);
    12151225
    1216     if( !pcCU->getTextureModeAllowance( uiAbsPartIdx ) )
    1217     {
     1226#if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX
     1227    m_pcBinIf->encodeBin( (uiDMMode & 0x01),      m_cIntraDMMSCModel.get(0, 0, 1) );
     1228    m_pcBinIf->encodeBin( (uiDMMode & 0x02) >> 1, m_cIntraDMMSCModel.get(0, 0, 1) );
     1229
    12181230      if ( pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_NxN && pcCU->getWidth( uiAbsPartIdx ) > 4 )
    12191231      {
    1220         if( uiDMMode > 1 )
    1221         {
    1222           uiDMMode -= 4;
     1232      m_pcBinIf->encodeBin( (uiDMMode & 0x04) >> 2, m_cIntraDMMSCModel.get(0, 0, 1) );
    12231233        }
     1234#else
    12241235        m_pcBinIf->encodeBin( (uiDMMode & 0x01),      m_cIntraDMMSCModel.get(0, 0, 1) );
    1225         if( DMM_INTRA_MODE_BITS > 1 ) m_pcBinIf->encodeBin( (uiDMMode & 0x02) >> 1, m_cIntraDMMSCModel.get(0, 0, 1) );
    1226       }
    1227       else
    1228       {
    1229         m_pcBinIf->encodeBin( (uiDMMode & 0x01),      m_cIntraDMMSCModel.get(0, 0, 1) );
    1230       }
    1231     }
    1232     else
    1233     {
    1234       m_pcBinIf->encodeBin( (uiDMMode & 0x01),      m_cIntraDMMSCModel.get(0, 0, 1) );
    1235       if( DMM_INTRA_MODE_BITS > 1 ) m_pcBinIf->encodeBin( (uiDMMode & 0x02) >> 1, m_cIntraDMMSCModel.get(0, 0, 1) );
    12361236
    12371237      if ( pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_NxN && pcCU->getWidth( uiAbsPartIdx ) > 4 )
    12381238      {
    1239         if( DMM_INTRA_MODE_BITS > 2 ) m_pcBinIf->encodeBin( (uiDMMode & 0x04) >> 2, m_cIntraDMMSCModel.get(0, 0, 1) );
    1240       }
    1241     }
    1242 
     1239      m_pcBinIf->encodeBin( (uiDMMode & 0x02) >> 1, m_cIntraDMMSCModel.get(0, 0, 1) );
     1240      }
     1241#endif
     1242#if HHI_DMM_WEDGE_INTRA
    12431243    if( uiDir == DMM_WEDGE_FULL_IDX )          { xCodeWedgeFullInfo          ( pcCU, uiAbsPartIdx ); }
    12441244    if( uiDir == DMM_WEDGE_FULL_D_IDX )        { xCodeWedgeFullDeltaInfo     ( pcCU, uiAbsPartIdx ); }
    12451245    if( uiDir == DMM_WEDGE_PREDDIR_IDX )       { xCodeWedgePredDirInfo       ( pcCU, uiAbsPartIdx ); }
    12461246    if( uiDir == DMM_WEDGE_PREDDIR_D_IDX )     { xCodeWedgePredDirDeltaInfo  ( pcCU, uiAbsPartIdx ); }
     1247#endif
     1248#if HHI_DMM_PRED_TEX
    12471249    if( uiDir == DMM_WEDGE_PREDTEX_D_IDX )     { xCodeWedgePredTexDeltaInfo  ( pcCU, uiAbsPartIdx ); }
    12481250    if( uiDir == DMM_CONTOUR_PREDTEX_D_IDX )   { xCodeContourPredTexDeltaInfo( pcCU, uiAbsPartIdx ); }
     1251#endif
    12491252  }
    12501253  else
  • trunk/source/Lib/TLibEncoder/TEncSbac.h

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
     
    85118#if E253
    86119  Void  xWriteGoRiceExGolomb ( UInt uiSymbol, UInt &ruiGoRiceParam );
    87 #if HHI_DMM_INTRA
     120#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    88121  Void  xWriteExGolombLevel  ( UInt uiSymbol, ContextModel& rcSCModel  );
    89122#endif
     
    103136  Void  xCopyFrom            ( TEncSbac* pSrc );
    104137 
    105 #if HHI_DMM_INTRA
     138#if HHI_DMM_WEDGE_INTRA
    106139  Void  xCodeWedgeFullInfo   ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    107140  Void  xCodeWedgeFullDeltaInfo     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     141
    108142  Void  xCodeWedgePredDirInfo       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    109143  Void  xCodeWedgePredDirDeltaInfo  ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     144#endif
     145#if HHI_DMM_PRED_TEX
    110146  Void  xCodeWedgePredTexDeltaInfo  ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    111147  Void  xCodeContourPredTexDeltaInfo( TComDataCU* pcCU, UInt uiAbsPartIdx );
     
    130166  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    131167  Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     168#if HHI_INTER_VIEW_MOTION_PRED || HHI_MPI
    132169  Void codeMergeIndexMV  ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     170#endif
     171#if HHI_INTER_VIEW_RESIDUAL_PRED
    133172  Void codeResPredFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     173#endif
    134174  Void codeSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    135 #if MW_MVI_SIGNALLING_MODE == 0
    136   Void codeMvInheritanceFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    137 #endif
    138175  Void codeMVPIdx        ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList );
    139176 
     
    182219  UInt                 m_uiLastQp;
    183220  ContextModel3DBuffer m_cCUSplitFlagSCModel;
    184 #if MW_MVI_SIGNALLING_MODE == 0
    185   ContextModel3DBuffer m_cCUMvInheritanceFlagSCModel;
    186 #endif
    187221  ContextModel3DBuffer m_cCUSkipFlagSCModel;
    188222  ContextModel3DBuffer m_cCUMergeFlagExtSCModel;
     
    227261#endif
    228262  ContextModel3DBuffer m_cViewIdxSCModel;
    229 #if HHI_DMM_INTRA
     263#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    230264  ContextModel3DBuffer m_cIntraDMMSCModel;
    231265  ContextModel3DBuffer m_cIntraWedgeSCModel;
  • trunk/source/Lib/TLibEncoder/TEncSearch.cpp

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235/** \file     TEncSearch.cpp
     
    911944                            Bool         bLuma,
    912945                            Bool         bChroma,
    913                             Bool         bRealCoeff /* just for test */ )
     946                            Bool         bRealCoeff /* just for test */
     947                            )
    914948{
    915949  m_pcEntropyCoder->resetBits();
    916950  xEncIntraHeader ( pcCU, uiTrDepth, uiAbsPartIdx, bLuma, bChroma );
    917951  xEncSubdivCbfQT ( pcCU, uiTrDepth, uiAbsPartIdx, bLuma, bChroma );
    918 
     952 
    919953  if( bLuma )
    920954  {
     
    940974                                TComYuv*    pcResiYuv,
    941975                                Dist&       ruiDist
    942 #if DMM_RES_CHECK_INTRA
    943                                 ,
    944                                 Bool        bCheckNoRes
    945 #endif
    946976                                )
    947977{
     
    9731003  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, uiTrDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
    9741004
    975 #if HHI_DMM_INTRA
     1005#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    9761006  if( uiLumaPredMode > MAX_MODE_ID_INTRA_DIR )
    9771007  {
     
    9841014    predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail );
    9851015  }
    986 
    987 #if DMM_RES_CHECK_INTRA
    988   if ( bCheckNoRes )
    989   {
    990     //prediction signal is already filled in this case
    991     //===== update distortion =====
    992     //GT VSO
    993     if ( m_pcRdCost->getUseVSO() )
    994     {
    995       ruiDist += m_pcRdCost->getDistVS  ( pcCU, uiAbsPartIdx, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false, 0 );
    996 
    997 #if GERHARD_VQM_XCHECK
    998       UInt uiDist1 = m_pcRdCost->getDistVS  ( pcCU, uiAbsPartIdx, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight, false, 0 );
    999       UInt uiDist2 = m_pcRdCost->getDistPart( piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight );
    1000       assert(uiDist1 == uiDist2);
    1001 #endif
    1002     }
    1003     else
    1004     {
    1005       ruiDist += m_pcRdCost->getDistPart( piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight );
    1006     }
    1007     //GT VSO end
    1008 
    1009     pcCU->setCbfSubParts( 0, TEXT_LUMA, uiAbsPartIdx, uiFullDepth );
    1010     return;
    1011   }
    1012 #endif
    10131016
    10141017  //===== get residual signal =====
     
    10881091
    10891092  //===== update distortion =====
    1090   //GT VSO
     1093#if HHI_VSO
    10911094  if ( m_pcRdCost->getUseVSO() )
    10921095  {
    10931096    ruiDist += m_pcRdCost->getDistVS  ( pcCU, uiAbsPartIdx, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight, false, 0 );
    1094 
    1095   #if GERHARD_VQM_XCHECK
    1096     UInt uiDist1 = m_pcRdCost->getDistVS  ( pcCU, uiAbsPartIdx, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight, false, 0 );
    1097     UInt uiDist2 = m_pcRdCost->getDistPart( piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight );
    1098     assert(uiDist1 == uiDist2);
    1099   #endif
    11001097  }
    11011098  else
     1099#endif
    11021100  {
    11031101    ruiDist += m_pcRdCost->getDistPart( piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight );
    11041102  }
    1105   //GT VSO end
    11061103}
    1107 
    1108 #if DMM_RES_CHECK_INTRA
    1109 Void
    1110 TEncSearch::xSetIntraNoResi( TComDataCU* pcCU,
    1111                              UInt        uiTrDepth,
    1112                              UInt        uiAbsPartIdx,
    1113                              TComYuv*    pcPredYuv,
    1114                              TComYuv*    pcResiYuv,
    1115                              Bool        bNoRes
    1116                             )
    1117 {
    1118   UInt    uiFullDepth       = pcCU     ->getDepth   ( 0 )  + uiTrDepth;
    1119   UInt    uiWidth           = pcCU     ->getWidth   ( 0 ) >> uiTrDepth;
    1120   UInt    uiHeight          = pcCU     ->getHeight  ( 0 ) >> uiTrDepth;
    1121   UInt    uiStride          = pcPredYuv->getStride  ();
    1122   Pel*    piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
    1123   Pel*    piResi            = pcResiYuv->getLumaAddr( uiAbsPartIdx );
    1124   Pel*    piReco            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
    1125 
    1126   UInt    uiLog2TrSize      = g_aucConvertToBit[ pcCU->getSlice()->getSPS()->getMaxCUWidth() >> uiFullDepth ] + 2;
    1127   UInt    uiQTLayer         = pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() - uiLog2TrSize;
    1128   UInt    uiNumCoeffPerInc  = pcCU->getSlice()->getSPS()->getMaxCUWidth() * pcCU->getSlice()->getSPS()->getMaxCUHeight() >> ( pcCU->getSlice()->getSPS()->getMaxCUDepth() << 1 );
    1129   TCoeff* pcCoeff           = m_ppcQTTempCoeffY[ uiQTLayer ] + uiNumCoeffPerInc * uiAbsPartIdx;
    1130   Pel*    piRecQt           = m_pcQTTempTComYuv[ uiQTLayer ].getLumaAddr( uiAbsPartIdx );
    1131   UInt    uiRecQtStride     = m_pcQTTempTComYuv[ uiQTLayer ].getStride  ();
    1132 
    1133   UInt    uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
    1134   Pel*    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
    1135   UInt    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
    1136 
    1137   if ( bNoRes )
    1138   {
    1139     pcCU->setCbfSubParts( 0, TEXT_LUMA, uiAbsPartIdx, uiFullDepth );
    1140 
    1141     Pel* pResi = piResi;
    1142     memset( pcCoeff, 0, sizeof( TCoeff ) * uiWidth * uiHeight );
    1143     for( UInt uiY = 0; uiY < uiHeight; uiY++ )
    1144     {
    1145       memset( pResi, 0, sizeof( Pel ) * uiWidth );
    1146       pResi += uiStride;
    1147     }
    1148   }
    1149   else
    1150   {
    1151     pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_LUMA, uiAbsPartIdx, uiFullDepth );
    1152   }
    1153 
    1154   //===== reconstruction =====
    1155   {
    1156     Pel* pPred      = piPred;
    1157     Pel* pResi      = piResi;
    1158     Pel* pReco      = piReco;
    1159     Pel* pRecQt     = piRecQt;
    1160     Pel* pRecIPred  = piRecIPred;
    1161     for( UInt uiY = 0; uiY < uiHeight; uiY++ )
    1162     {
    1163       for( UInt uiX = 0; uiX < uiWidth; uiX++ )
    1164       {
    1165         pReco    [ uiX ] = Clip( pPred[ uiX ] + pResi[uiX] );
    1166         pRecQt   [ uiX ] = pReco[ uiX ];
    1167         pRecIPred[ uiX ] = pReco[ uiX ];
    1168       }
    1169       pPred     += uiStride;
    1170       pResi     += uiStride;
    1171       pReco     += uiStride;
    1172       pRecQt    += uiRecQtStride;
    1173       pRecIPred += uiRecIPredStride;
    1174     }
    1175   }
    1176 }
    1177 #endif
    11781104
    11791105Void
     
    13621288  }
    13631289#endif
    1364 #if HHI_DMM_INTRA
     1290#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    13651291  if( pcCU->getLumaIntraDir( uiAbsPartIdx ) > MAX_MODE_ID_INTRA_DIR )
    13661292  {
     
    13781304  {
    13791305    //----- store original entropy coding status -----
    1380 #if DMM_RES_CHECK_INTRA
    1381     if( m_bUseSBACRD && ( bCheckSplit || pcCU->getSlice()->getSPS()->isDepth() ) )
     1306    if( m_bUseSBACRD && bCheckSplit )
    13821307    {
    13831308      m_pcRDGoOnSbacCoder->store( m_pppcRDSbacCoder[ uiFullDepth ][ CI_QT_TRAFO_ROOT ] );
    13841309    }
    1385 #else
    1386     if( m_bUseSBACRD && bCheckSplit )
    1387     {
    1388       m_pcRDGoOnSbacCoder->store( m_pppcRDSbacCoder[ uiFullDepth ][ CI_QT_TRAFO_ROOT ] );
    1389     }
    1390 #endif
     1310
    13911311    //----- code luma block with given intra prediction mode and store Cbf-----
    13921312    dSingleCost   = 0.0;
     
    14091329    //----- determine rate and r-d cost -----
    14101330    UInt uiSingleBits = xGetIntraBitsQT( pcCU, uiTrDepth, uiAbsPartIdx, true, !bLumaOnly, false );
    1411 //GT VSO
     1331
     1332#if HHI_VSO
    14121333    if ( m_pcRdCost->getUseLambdaScaleVSO())
    14131334    {
     
    14181339      dSingleCost = m_pcRdCost->calcRdCost( uiSingleBits, uiSingleDistY + uiSingleDistC );
    14191340    }
    1420 //GT VSO end
    1421 
    1422 #if DMM_RES_CHECK_INTRA
    1423     if ( pcCU->getSlice()->getSPS()->isDepth() && pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth ) == 1 && pcCU->getLumaIntraDir( uiAbsPartIdx ) > MAX_MODE_ID_INTRA_DIR )
    1424     {
    1425       m_pcRDGoOnSbacCoder->load ( m_pppcRDSbacCoder[ uiFullDepth ][ CI_QT_TRAFO_ROOT ] );
    1426 
    1427       Double dSingleCostNoRes = MAX_DOUBLE;
    1428       Dist uiSingleDistYNoRes = 0;
    1429       //save cbf and coeffs
    1430       xIntraCodingLumaBlk( pcCU, uiTrDepth, uiAbsPartIdx, pcOrgYuv, pcPredYuv, pcResiYuv, uiSingleDistYNoRes, true );
    1431 
    1432       //----- determine rate and r-d cost -----
    1433       UInt uiSingleBitsNoRes = xGetIntraBitsQT( pcCU, uiTrDepth, uiAbsPartIdx, true, !bLumaOnly, false );
    1434       //GT VSO
    1435       if ( m_pcRdCost->getUseLambdaScaleVSO())
    1436       {
    1437         dSingleCostNoRes = m_pcRdCost->calcRdCostVSO( uiSingleBitsNoRes, uiSingleDistYNoRes + uiSingleDistC );
    1438       }
    1439       else
    1440       {
    1441         dSingleCostNoRes = m_pcRdCost->calcRdCost( uiSingleBitsNoRes, uiSingleDistYNoRes + uiSingleDistC );
    1442       }
    1443       //GT VSO end
    1444 
    1445       if ( dSingleCostNoRes < dSingleCost )
    1446       {
    1447         xSetIntraNoResi( pcCU, uiTrDepth, uiAbsPartIdx, pcPredYuv, pcResiYuv, true );
    1448         dSingleCost = dSingleCostNoRes;
    1449         uiSingleCbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth );
    1450 
    1451       }
    1452       else
    1453       {
    1454         xSetIntraNoResi( pcCU, uiTrDepth, uiAbsPartIdx, pcPredYuv, pcResiYuv, false );
    1455         uiSingleCbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth );
    1456       }
    1457     }
     1341#else
     1342    dSingleCost = m_pcRdCost->calcRdCost( uiSingleBits, uiSingleDistY + uiSingleDistC );
    14581343#endif
    14591344  }
     
    15201405    //----- determine rate and r-d cost -----
    15211406    UInt uiSplitBits = xGetIntraBitsQT( pcCU, uiTrDepth, uiAbsPartIdx, true, !bLumaOnly, false );
    1522 //GT VSO
     1407#if HHI_VSO
    15231408    if( m_pcRdCost->getUseLambdaScaleVSO() )
    15241409    {
     
    15291414      dSplitCost       = m_pcRdCost->calcRdCost( uiSplitBits, uiSplitDistY + uiSplitDistC );
    15301415    }
    1531 //GT VSO end
     1416#else
     1417    dSplitCost       = m_pcRdCost->calcRdCost( uiSplitBits, uiSplitDistY + uiSplitDistC );
     1418#endif
    15321419
    15331420    //===== compare and set best =====
     
    16011488  }
    16021489
     1490#if HHI_VSO
    16031491  if ( m_pcRdCost->getUseRenModel() && bCheckFull )
    16041492  {
     
    16111499    m_pcRdCost->setRenModelData( pcCU, uiAbsPartIdx, piSrc, (Int) uiSrcStride, (Int) uiWidth, (Int) uiHeight );
    16121500  }
     1501#endif
    16131502
    16141503  ruiDistY += uiSingleDistY;
     
    18581747    uiMaxMode += 1;
    18591748#endif
    1860 #if HHI_DMM_INTRA
     1749#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    18611750    Bool bTestDmm = false;
    1862     if ( m_pcEncCfg->isDepthCoder() && m_pcEncCfg->getUseDepthModelModes() )
     1751    if ( m_pcEncCfg->isDepthCoder() && m_pcEncCfg->getUseDMM() )
    18631752      bTestDmm = true;
    18641753#endif
     
    19001789      // use hadamard transform here
    19011790      Dist uiSad;
    1902 //GT VSO
     1791#if HHI_VSO
    19031792      if ( m_pcRdCost->getUseVSO() )
    19041793      {
    19051794        Bool bSad = !m_pcRdCost->getUseRenModel();
    19061795        uiSad = m_pcRdCost->getDistVS(pcCU, uiPartOffset, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, bSad, 0 );
    1907 #if GERHARD_VQM_XCHECK
    1908         UInt uiDist1 = m_pcRdCost->getDistVS  ( pcCU, uiPartOffset, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false, 0 );
    1909         UInt uiDist2 = m_pcRdCost->getDistPart( piOrg, uiStride, piPred, uiStride, uiWidth, uiHeight );
    1910         assert(uiDist1 == uiDist2);
    1911 #endif
    19121796      }
    19131797      else
     
    19151799        uiSad = (Dist) m_pcRdCost->calcHAD( piOrg, uiStride, piPred, uiStride, uiWidth, uiHeight );
    19161800      }
    1917 //GT VSO end
     1801#else
     1802        uiSad = (Dist) m_pcRdCost->calcHAD( piOrg, uiStride, piPred, uiStride, uiWidth, uiHeight );
     1803#endif
    19181804
    19191805      UInt   iModeBits = xModeBitsIntra( pcCU, uiMode, uiPU, uiPartOffset, uiDepth, uiInitTrDepth );
    1920 //GT VSO
     1806
    19211807      Double dLambda;
    1922 
     1808#if HHI_VSO
    19231809      if ( m_pcRdCost->getUseLambdaScaleVSO() )
    19241810      {
    19251811        dLambda = m_pcRdCost->getUseRenModel() ? m_pcRdCost->getLambdaVSO() : m_pcRdCost->getSqrtLambdaVSO();
     1812        //GT: Sad is SSE for VSO4
    19261813      }
    19271814      else
     
    19291816        dLambda = m_pcRdCost->getSqrtLambda();
    19301817      }
    1931 
    1932       //GT: Sad is SSE for VSO4
     1818#else
     1819      dLambda = m_pcRdCost->getSqrtLambda();
     1820#endif
     1821
    19331822      Double cost = (Double)uiSad + (Double)iModeBits *  dLambda;
    1934 //GT VSO end
     1823
    19351824      CandNum += xUpdateCandList( uiMode, cost, uiFastCandNum, CandModeList, CandCostList );
    1936 #if HHI_DMM_INTRA
     1825#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    19371826      if ( bTestDmm ) bTestDmm = uiSad ? true : false;
    19381827#endif
     
    20041893    }
    20051894
    2006 #if HHI_DMM_INTRA
    2007     if( m_pcEncCfg->isDepthCoder() && uiWidth >= 4 && uiWidth < 64 && m_pcEncCfg->getUseDepthModelModes() && bTestDmm )
    2008     {
    2009 #if DMM_NO_TEXTURE_MODES
    2010       pcCU->setTextureModeAllowanceSubParts( false, uiPartOffset, uiDepth + uiInitTrDepth );
    2011 #else
    2012       UInt uiPartAddr = 0;
    2013       Int  iBlockWidth, iBlockHeight;
    2014 
    2015       pcCU->getPartIndexAndSize( uiPU, uiPartAddr, iBlockWidth, iBlockHeight );
    2016 
    2017       TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getTexturePic()->getPicYuvRec();
    2018       Int         iRefStride = pcPicYuvRef->getStride();
    2019       Pel*        piRefY     = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr );
    2020 
    2021       TComYuv cTempYuv; cTempYuv.create( pcCU->getWidth(0), pcCU->getHeight(0) ); cTempYuv.clear();
    2022       UInt uiTempStride = cTempYuv.getStride();
    2023       Pel* piTempY      = cTempYuv.getLumaAddr( uiPU, uiWidth );
    2024 
    2025       for ( Int y = 0; y < uiHeight; y++ )
    2026       {
    2027         ::memcpy(piTempY, piRefY, sizeof(Pel)*uiWidth);
    2028         piTempY += uiTempStride;
    2029         piRefY += iRefStride;
    2030       }
    2031 
    2032       UInt64 uiDCSAD = cTempYuv.getLumaDistDCSAD( uiPartAddr, uiWidth );
     1895#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     1896    if( m_pcEncCfg->isDepthCoder() && uiWidth >= 4 && uiWidth < 64 && m_pcEncCfg->getUseDMM() && bTestDmm && uiWidth == uiHeight )
     1897    {
     1898#if HHI_DMM_WEDGE_INTRA
     1899      UInt uiTabIdx  = 0;
     1900      Int  iDeltaDC1 = 0;
     1901      Int  iDeltaDC2 = 0;
     1902      findWedgeFullMinDist( pcCU, uiPartOffset, piOrg, piPred, uiStride, uiWidth, uiHeight, uiTabIdx, iDeltaDC1, iDeltaDC2, bAboveAvail, bLeftAvail, WedgeDist_SAD );
     1903      pcCU->setWedgeFullTabIdxSubParts  ( uiTabIdx,  uiPartOffset, uiDepth + uiInitTrDepth );
     1904      pcCU->setWedgeFullDeltaDC1SubParts( iDeltaDC1, uiPartOffset, uiDepth + uiInitTrDepth );
     1905      pcCU->setWedgeFullDeltaDC2SubParts( iDeltaDC2, uiPartOffset, uiDepth + uiInitTrDepth );
     1906
     1907      uiRdModeList[ uiNewMaxMode++ ] = DMM_WEDGE_FULL_IDX;
     1908      uiRdModeList[ uiNewMaxMode++ ] = DMM_WEDGE_FULL_D_IDX;
     1909
     1910      if ( uiWidth > 4 )
     1911      {
     1912        Int  iWedgeDeltaEnd = 0;
     1913
     1914        iDeltaDC1 = 0;
     1915        iDeltaDC2 = 0;
     1916
     1917        findWedgePredDirMinDist( pcCU, uiPartOffset, piOrg, piPred, uiStride, uiWidth, uiHeight, uiTabIdx, iWedgeDeltaEnd, iDeltaDC1, iDeltaDC2, bAboveAvail, bLeftAvail, WedgeDist_SAD );
     1918        pcCU->setWedgePredDirTabIdxSubParts  ( uiTabIdx,       uiPartOffset, uiDepth + uiInitTrDepth );
     1919        pcCU->setWedgePredDirDeltaEndSubParts( iWedgeDeltaEnd, uiPartOffset, uiDepth + uiInitTrDepth );
     1920        pcCU->setWedgePredDirDeltaDC1SubParts( iDeltaDC1,      uiPartOffset, uiDepth + uiInitTrDepth );
     1921        pcCU->setWedgePredDirDeltaDC2SubParts( iDeltaDC2,      uiPartOffset, uiDepth + uiInitTrDepth );
     1922
     1923        uiRdModeList[ uiNewMaxMode++ ] = DMM_WEDGE_PREDDIR_IDX;
     1924        uiRdModeList[ uiNewMaxMode++ ] = DMM_WEDGE_PREDDIR_D_IDX;
     1925      }
     1926#endif
     1927#if HHI_DMM_PRED_TEX
     1928      TComYuv cTempYuv; cTempYuv.create( uiWidth, uiHeight ); cTempYuv.clear();
     1929      Pel* piTempY      = cTempYuv.getLumaAddr();
     1930
     1931      fillTexturePicTempBlock( pcCU, uiPartOffset, piTempY, uiWidth, uiHeight );
     1932
     1933      piTempY = cTempYuv.getLumaAddr();
     1934
     1935      UInt uiTexTabIdx  = 0;
     1936      Int  iTexDeltaDC1 = 0;
     1937      Int  iTexDeltaDC2 = 0;
     1938      findWedgeTexMinDist( pcCU, uiPartOffset, piOrg, piPred, uiStride, uiWidth, uiHeight, uiTexTabIdx, iTexDeltaDC1, iTexDeltaDC2, bAboveAvail, bLeftAvail, WedgeDist_SAD, piTempY );
     1939      pcCU->setWedgePredTexTabIdxSubParts  ( uiTexTabIdx,  uiPartOffset, uiDepth + uiInitTrDepth );
     1940      pcCU->setWedgePredTexDeltaDC1SubParts( iTexDeltaDC1, uiPartOffset, uiDepth + uiInitTrDepth );
     1941      pcCU->setWedgePredTexDeltaDC2SubParts( iTexDeltaDC2, uiPartOffset, uiDepth + uiInitTrDepth );
     1942
     1943      uiRdModeList[ uiNewMaxMode++ ] = DMM_WEDGE_PREDTEX_IDX;
     1944      uiRdModeList[ uiNewMaxMode++ ] = DMM_WEDGE_PREDTEX_D_IDX;
     1945
     1946      if ( uiWidth > 4 )
     1947      {
     1948        piTempY = cTempYuv.getLumaAddr();
     1949
     1950        iTexDeltaDC1 = 0;
     1951        iTexDeltaDC2 = 0;
     1952
     1953        findContourPredTex( pcCU, uiPartOffset, piOrg, piPred, uiStride, uiWidth, uiHeight, iTexDeltaDC1, iTexDeltaDC2, bAboveAvail, bLeftAvail, piTempY );
     1954        pcCU->setContourPredTexDeltaDC1SubParts( iTexDeltaDC1, uiPartOffset, uiDepth + uiInitTrDepth );
     1955        pcCU->setContourPredTexDeltaDC2SubParts( iTexDeltaDC2, uiPartOffset, uiDepth + uiInitTrDepth );
     1956
     1957        uiRdModeList[ uiNewMaxMode++ ] = DMM_CONTOUR_PREDTEX_IDX;
     1958        uiRdModeList[ uiNewMaxMode++ ] = DMM_CONTOUR_PREDTEX_D_IDX;
     1959      }
    20331960
    20341961      cTempYuv.destroy();
    2035 
    2036       if ( uiDCSAD < (UInt)(pcCU->getQP(0))/2 )
    2037       {
    2038         pcCU->setTextureModeAllowanceSubParts( false, uiPartOffset, uiDepth + uiInitTrDepth );
    2039       }
    2040       else
    2041       {
    2042         pcCU->setTextureModeAllowanceSubParts( true, uiPartOffset, uiDepth + uiInitTrDepth );
    2043       }
    2044 #endif
    2045       UChar uhNumAdd = 0;
    2046       if ( uiWidth > 4 )
    2047       {
    2048         uhNumAdd = 8;
    2049       }
    2050       else
    2051       {
    2052         uhNumAdd = 4;
    2053       }
    2054       Bool bWedgePredFull  = false;
    2055       Bool bWedgePredDir   = false;
    2056       Bool bWedgePredTex   = false;
    2057       Bool bContourPredTex = false;
    2058 
    2059       for ( Int i = 0; i < uhNumAdd; i++ )
    2060       {
    2061         UInt uiDMMid = g_aucAdditionalIntraModeList[i];
    2062 
    2063         if( !predIntraLumaDMMAvailable( uiDMMid, bAboveAvail, bLeftAvail, uiWidth, uiHeight, pcCU, uiPartOffset ) )
    2064           continue;
    2065 
    2066         if( uiDMMid >= DMM_WEDGE_PREDTEX_IDX && uiDMMid <= DMM_CONTOUR_PREDTEX_D_IDX && pcCU->getTextureModeAllowance( uiPartOffset ) == false )
    2067         {
    2068           continue;
    2069         }
    2070         if( !bWedgePredFull && (uiDMMid == DMM_WEDGE_FULL_IDX || uiDMMid == DMM_WEDGE_FULL_D_IDX) )
    2071         {
    2072           UInt uiTabIdx  = 0;
    2073           Int  iDeltaDC1 = 0;
    2074           Int  iDeltaDC2 = 0;
    2075           findWedgeFullMinDist( pcCU, uiPU, piOrg, piPred, uiStride, uiWidth, uiHeight, uiTabIdx, iDeltaDC1, iDeltaDC2, bAboveAvail, bLeftAvail, WedgeDist_SAD );
    2076           pcCU->setWedgeFullTabIdxSubParts  ( uiTabIdx,  uiPartOffset, uiDepth + uiInitTrDepth );
    2077           pcCU->setWedgeFullDeltaDC1SubParts( iDeltaDC1, uiPartOffset, uiDepth + uiInitTrDepth );
    2078           pcCU->setWedgeFullDeltaDC2SubParts( iDeltaDC2, uiPartOffset, uiDepth + uiInitTrDepth );
    2079           bWedgePredFull = true;
    2080         }
    2081 
    2082         if( !bWedgePredDir && (uiDMMid == DMM_WEDGE_PREDDIR_IDX || uiDMMid == DMM_WEDGE_PREDDIR_D_IDX) )
    2083         {
    2084           UInt uiTabIdx       = 0;
    2085           Int  iWedgeDeltaEnd = 0;
    2086           Int  iDeltaDC1      = 0;
    2087           Int  iDeltaDC2      = 0;
    2088           findWedgePredDirMinDist( pcCU, uiPU, piOrg, piPred, uiStride, uiWidth, uiHeight, uiTabIdx, iWedgeDeltaEnd, iDeltaDC1, iDeltaDC2, bAboveAvail, bLeftAvail, WedgeDist_SAD );
    2089           pcCU->setWedgePredDirTabIdxSubParts  ( uiTabIdx,       uiPartOffset, uiDepth + uiInitTrDepth );
    2090           pcCU->setWedgePredDirDeltaEndSubParts( iWedgeDeltaEnd, uiPartOffset, uiDepth + uiInitTrDepth );
    2091           pcCU->setWedgePredDirDeltaDC1SubParts( iDeltaDC1,      uiPartOffset, uiDepth + uiInitTrDepth );
    2092           pcCU->setWedgePredDirDeltaDC2SubParts( iDeltaDC2,      uiPartOffset, uiDepth + uiInitTrDepth );
    2093           bWedgePredDir = true;
    2094         }
    2095 
    2096         if( !bWedgePredTex && (uiDMMid == DMM_WEDGE_PREDTEX_IDX || uiDMMid == DMM_WEDGE_PREDTEX_D_IDX) )
    2097         {
    2098           UInt uiTabIdx  = 0;
    2099           Int  iDeltaDC1 = 0;
    2100           Int  iDeltaDC2 = 0;
    2101           findWedgeTexMinDist( pcCU, uiPU, piOrg, piPred, uiStride, uiWidth, uiHeight, uiTabIdx, iDeltaDC1, iDeltaDC2, bAboveAvail, bLeftAvail, WedgeDist_SAD );
    2102           pcCU->setWedgePredTexTabIdxSubParts  ( uiTabIdx,  uiPartOffset, uiDepth + uiInitTrDepth );
    2103           pcCU->setWedgePredTexDeltaDC1SubParts( iDeltaDC1, uiPartOffset, uiDepth + uiInitTrDepth );
    2104           pcCU->setWedgePredTexDeltaDC2SubParts( iDeltaDC2, uiPartOffset, uiDepth + uiInitTrDepth );
    2105           bWedgePredTex = true;
    2106         }
    2107 
    2108         if( !bContourPredTex && (uiDMMid == DMM_CONTOUR_PREDTEX_IDX || uiDMMid == DMM_CONTOUR_PREDTEX_D_IDX) )
    2109         {
    2110           Int  iDeltaDC1 = 0;
    2111           Int  iDeltaDC2 = 0;
    2112           findContourPredTex( pcCU, uiPU, piOrg, piPred, uiStride, uiWidth, uiHeight, iDeltaDC1, iDeltaDC2, bAboveAvail, bLeftAvail );
    2113           pcCU->setContourPredTexDeltaDC1SubParts( iDeltaDC1, uiPartOffset, uiDepth + uiInitTrDepth );
    2114           pcCU->setContourPredTexDeltaDC2SubParts( iDeltaDC2, uiPartOffset, uiDepth + uiInitTrDepth );
    2115           bContourPredTex = true;
    2116         }
    2117 
    2118         uiRdModeList[ uiNewMaxMode ] = uiDMMid;
    2119         uiNewMaxMode++;
    2120       }
     1962#endif
    21211963    }
    21221964#endif
     
    21371979
    21381980#if (!REFERENCE_SAMPLE_PADDING)
    2139 #if HHI_DMM_INTRA
     1981#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    21401982      if ( !predIntraLumaDirAvailable( uiOrgMode, uiWidthBit, bAboveAvail, bLeftAvail, uiWidth, uiHeight, pcCU, uiPartOffset ) )
    21411983        continue;
     
    21451987#endif
    21461988#else
    2147 #if HHI_DMM_INTRA
    2148       if( m_pcEncCfg->isDepthCoder() && !predIntraLumaDMMAvailable( uiOrgMode, bAboveAvail, bLeftAvail, uiWidth, uiHeight, pcCU, uiPartOffset ) )
     1989#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     1990      if( m_pcEncCfg->isDepthCoder() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight ) )
    21491991        continue;
    21501992#endif
     
    21662008
    21672009      // reset Model
     2010#if HHI_VSO
    21682011      if( m_pcRdCost->getUseRenModel() )
    21692012      {
    21702013        m_pcRdCost->setRenModelData( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight );
    21712014      }
     2015#endif
    21722016
    21732017#if HHI_RQT_INTRA_SPEEDUP
     
    22232067
    22242068#if (!REFERENCE_SAMPLE_PADDING)
    2225 #if HHI_DMM_INTRA
     2069#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    22262070      if ( !predIntraLumaDirAvailable( uiOrgMode, uiWidthBit, bAboveAvail, bLeftAvail, uiWidth, uiHeight, pcCU, uiPartOffset ) )
    22272071        continue;
     
    22312075#endif
    22322076#else
    2233 #if HHI_DMM_INTRA
    2234       if( m_pcEncCfg->isDepthCoder() && !predIntraLumaDMMAvailable( uiOrgMode, bAboveAvail, bLeftAvail, uiWidth, uiHeight, pcCU, uiPartOffset ) )
     2077#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     2078      if( m_pcEncCfg->isDepthCoder() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight ) )
    22352079        continue;
    22362080#endif
     
    22502094      Double dPUCost   = 0.0;
    22512095
     2096#if HHI_VSO
    22522097      // reset Model
    22532098      if( m_pcRdCost->getUseRenModel() )
     
    22552100        m_pcRdCost->setRenModelData( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight );
    22562101      }
     2102#endif
    22572103
    22582104      xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, false, dPUCost );
     
    23172163      }
    23182164
     2165#if HHI_VSO
    23192166      // set model
    23202167      if( m_pcRdCost->getUseRenModel() )
     
    23232170        m_pcRdCost->setRenModelData( pcCU, uiPartOffset, piSrc, uiSrcStride, uiCompWidth, uiCompHeight);
    23242171      }
     2172#endif
    23252173
    23262174      if( !bLumaOnly && !bSkipChroma )
     
    24832331    }
    24842332#endif
    2485 #if HHI_DMM_INTRA
     2333#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    24862334#if ADD_PLANAR_MODE
    24872335    if ( uiModeList[uiMode] == 4 && pcCU->getLumaIntraDir(0) > MAX_MODE_ID_INTRA_DIR )
     
    25452393
    25462394#if (!REFERENCE_SAMPLE_PADDING)
    2547 #if HHI_DMM_INTRA
     2395#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    25482396Bool TEncSearch::predIntraLumaDirAvailable( UInt uiMode, UInt uiWidthBit, Bool bAboveAvail, Bool bLeftAvail, UInt uiWidth, UInt uiHeight, TComDataCU* pcCU, UInt uiAbsPartIdx   )
    25492397#else
     
    25522400{
    25532401  Bool bDirAvailable;
    2554 #if HHI_DMM_INTRA
     2402#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    25552403  if( uiMode > MAX_MODE_ID_INTRA_DIR )
    25562404  {
    2557     return predIntraLumaDMMAvailable( uiMode, bAboveAvail, bLeftAvail, uiWidth, uiHeight, pcCU, uiAbsPartIdx );
     2405    return predIntraLumaDMMAvailable( uiMode, bAboveAvail, bLeftAvail, uiWidth, uiHeight );
    25582406  }
    25592407  else
     
    25722420#endif
    25732421
    2574 #if HHI_DMM_INTRA
    2575 Void TEncSearch::xSearchWedgeFullMinDist( TComDataCU* pcCU, UInt uiAbsPtIdx, WedgeList* pacWedgeList, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx )
    2576 {
    2577   ruiTabIdx = 0;
    2578 
    2579   // local pred buffer
    2580   TComYuv cPredYuv;
    2581   cPredYuv.create( uiWidth, uiHeight );
    2582   cPredYuv.clear();
    2583 
    2584   UInt uiPredStride = cPredYuv.getStride();
    2585   Pel* piPred       = cPredYuv.getLumaAddr();
    2586 
    2587   Int  iDC1 = 0;
    2588   Int  iDC2 = 0;
    2589   // regular wedge search
    2590   Dist uiBestDist   = RDO_DIST_MAX;
    2591   UInt uiBestTabIdx = 0;
    2592 
    2593   for( UInt uiIdx = 0; uiIdx < pacWedgeList->size(); uiIdx++ )
    2594   {
    2595     calcWedgeDCs       ( &(pacWedgeList->at(uiIdx)), piRef,  uiRefStride,  iDC1, iDC2 );
    2596     assignWedgeDCs2Pred( &(pacWedgeList->at(uiIdx)), piPred, uiPredStride, iDC1, iDC2 );
    2597 
    2598     Dist uiActDist = RDO_DIST_MAX;
    2599     if( m_pcRdCost->getUseVSO() )
    2600     {
    2601       uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, 0 );
    2602     }
    2603     else
    2604     {
    2605       uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, DF_SAD );
    2606     }
    2607 
    2608     if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX )
    2609     {
    2610       uiBestDist   = uiActDist;
    2611       uiBestTabIdx = uiIdx;
    2612     }
    2613   }
    2614   ruiTabIdx = uiBestTabIdx;
    2615 
    2616   cPredYuv.destroy();
    2617   return;
    2618 }
    2619 
    2620 Void TEncSearch::xSearchWedgePredDirMinDist( TComDataCU* pcCU, UInt uiAbsPtIdx, WedgeList* pacWedgeList, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Int& riWedgeDeltaEnd )
    2621 {
    2622   ruiTabIdx       = 0;
    2623   riWedgeDeltaEnd = 0;
    2624 
    2625   // local pred buffer
    2626   TComYuv cPredYuv;
    2627   cPredYuv.create( uiWidth, uiHeight );
    2628   cPredYuv.clear();
    2629 
    2630   UInt uiPredStride = cPredYuv.getStride();
    2631   Pel* piPred       = cPredYuv.getLumaAddr();
    2632 
    2633   Int  iDC1 = 0;
    2634   Int  iDC2 = 0;
    2635 
    2636   // regular wedge search
    2637   Dist uiBestDist    = RDO_DIST_MAX;
    2638   UInt uiBestTabIdx  = 0;
    2639   Int  iBestDeltaEnd = 0;
    2640 
    2641   UInt uiIdx = 0;
    2642   for( Int iTestDeltaEnd = -DMM_WEDGE_PREDDIR_DELTAEND_MAX; iTestDeltaEnd <= DMM_WEDGE_PREDDIR_DELTAEND_MAX; iTestDeltaEnd++ )
    2643   {
    2644     uiIdx = getBestContinueWedge( pcCU, uiAbsPtIdx, uiWidth, uiHeight, iTestDeltaEnd );
    2645     calcWedgeDCs       ( &(pacWedgeList->at(uiIdx)), piRef,  uiRefStride,  iDC1, iDC2 );
    2646     assignWedgeDCs2Pred( &(pacWedgeList->at(uiIdx)), piPred, uiPredStride, iDC1, iDC2 );
    2647 
    2648     Dist uiActDist = RDO_DIST_MAX;
    2649     if( m_pcRdCost->getUseVSO() )
    2650     {
    2651       uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, 0 );
    2652     }
    2653     else
    2654     {
    2655       uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, DF_SAD );
    2656     }
    2657 
    2658     if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX )
    2659     {
    2660       uiBestDist    = uiActDist;
    2661       uiBestTabIdx  = uiIdx;
    2662       iBestDeltaEnd = iTestDeltaEnd;
    2663     }
    2664     else if( uiIdx == uiBestTabIdx && abs(iTestDeltaEnd) < abs(iBestDeltaEnd) )
    2665     {
    2666       iBestDeltaEnd = iTestDeltaEnd;
    2667     }
    2668   }
    2669 
    2670   ruiTabIdx       = uiBestTabIdx;
    2671   riWedgeDeltaEnd = iBestDeltaEnd;
    2672 
    2673   cPredYuv.destroy();
    2674   return;
    2675 }
    2676 
    2677 Bool TEncSearch::predIntraLumaDMMAvailable( UInt uiMode, Bool bAboveAvail, Bool bLeftAvail, UInt uiWidth, UInt uiHeight, TComDataCU* pcCU, UInt uiAbsPartIdx )
    2678 {
    2679   if( uiMode <= MAX_MODE_ID_INTRA_DIR ) return true;
    2680 
    2681   Bool bDMMAvailable = m_pcEncCfg->getUseDepthModelModes();
    2682 
    2683   if( uiMode == DMM_WEDGE_FULL_IDX        ||
    2684       uiMode == DMM_WEDGE_FULL_D_IDX      ||
    2685       uiMode == DMM_WEDGE_PREDTEX_IDX     ||
    2686       uiMode == DMM_WEDGE_PREDTEX_D_IDX   ||
    2687       uiMode == DMM_CONTOUR_PREDTEX_IDX   ||
    2688       uiMode == DMM_CONTOUR_PREDTEX_D_IDX ||
    2689       uiMode == DMM_WEDGE_PREDDIR_IDX     ||
    2690       uiMode == DMM_WEDGE_PREDDIR_D_IDX     )
    2691   {
    2692     if( (uiWidth != uiHeight) || (uiWidth < DMM_WEDGEMODEL_MIN_SIZE) || (uiWidth > DMM_WEDGEMODEL_MAX_SIZE) )
    2693     {
    2694       bDMMAvailable = false;
    2695     }
    2696   }
    2697 
    2698   return bDMMAvailable;
    2699 }
    2700 
     2422#if HHI_DMM_WEDGE_INTRA
    27012423Void TEncSearch::findWedgeFullMinDist( TComDataCU*  pcCU,
    2702                                        UInt         uiAbsPtIdx,
    2703                                        Pel*         piOrig,
    2704                                        Pel*         piPredic,
    2705                                        UInt         uiStride,
    2706                                        UInt         uiWidth,
    2707                                        UInt         uiHeight,
    2708                                        UInt&        ruiTabIdx,
    2709                                        Int&         riDeltaDC1,
    2710                                        Int&         riDeltaDC2,
    2711                                        Bool         bAbove,
    2712                                        Bool         bLeft,
    2713                                        WedgeDist    eWedgeDist
    2714                                      )
    2715 {
    2716   assert( uiWidth >= DMM_WEDGEMODEL_MIN_SIZE && uiWidth <= DMM_WEDGEMODEL_MAX_SIZE );
    2717 
    2718   WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];
    2719   xSearchWedgeFullMinDist( pcCU, uiAbsPtIdx, pacWedgeList, piOrig, uiStride, uiWidth, uiHeight, ruiTabIdx );
    2720 
    2721   TComWedgelet* pcBestWedgelet = &(pacWedgeList->at(ruiTabIdx));
    2722   xGetWedgeDeltaDCsMinDist( pcBestWedgelet, pcCU, uiAbsPtIdx, piOrig, piPredic, uiStride, uiWidth, uiHeight, riDeltaDC1, riDeltaDC2, bAbove, bLeft );
    2723 }
    2724 
    2725 Void TEncSearch::findWedgePredDirMinDist( TComDataCU*  pcCU,
    2726                                           UInt         uiAbsPtIdx,
    2727                                           Pel*         piOrig,
    2728                                           Pel*         piPredic,
    2729                                           UInt         uiStride,
    2730                                           UInt         uiWidth,
    2731                                           UInt         uiHeight,
    2732                                           UInt&        ruiTabIdx,
    2733                                           Int&         riWedgeDeltaEnd,
    2734                                           Int&         riDeltaDC1,
    2735                                           Int&         riDeltaDC2,
    2736                                           Bool         bAbove,
    2737                                           Bool         bLeft,
    2738                                           WedgeDist    eWedgeDist )
    2739 {
    2740   assert( uiWidth >= DMM_WEDGEMODEL_MIN_SIZE && uiWidth <= DMM_WEDGEMODEL_MAX_SIZE );
    2741   WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];
    2742 
    2743   ruiTabIdx       = 0;
    2744   riWedgeDeltaEnd = 0;
    2745 
    2746   xSearchWedgePredDirMinDist( pcCU, uiAbsPtIdx, pacWedgeList, piOrig, uiStride, uiWidth, uiHeight, ruiTabIdx, riWedgeDeltaEnd );
    2747 
    2748   TComWedgelet* pcBestWedgelet = &(pacWedgeList->at(ruiTabIdx));
    2749   xGetWedgeDeltaDCsMinDist( pcBestWedgelet, pcCU, uiAbsPtIdx, piOrig, piPredic, uiStride, uiWidth, uiHeight, riDeltaDC1, riDeltaDC2, bAbove, bLeft );
    2750 }
    2751 
    2752 Void TEncSearch::findWedgeTexMinDist( TComDataCU*  pcCU,
    27532424                                      UInt         uiAbsPtIdx,
    27542425                                      Pel*         piOrig,
     
    27632434                                      Bool         bLeft,
    27642435                                      WedgeDist    eWedgeDist
    2765                                     )
    2766   {
     2436                                      )
     2437{
     2438  assert( uiWidth >= DMM_WEDGEMODEL_MIN_SIZE && uiWidth <= DMM_WEDGEMODEL_MAX_SIZE );
     2439
     2440  WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];
     2441  xSearchWedgeFullMinDist( pcCU, uiAbsPtIdx, pacWedgeList, piOrig, uiStride, uiWidth, uiHeight, ruiTabIdx );
     2442
     2443  TComWedgelet* pcBestWedgelet = &(pacWedgeList->at(ruiTabIdx));
     2444  xGetWedgeDeltaDCsMinDist( pcBestWedgelet, pcCU, uiAbsPtIdx, piOrig, piPredic, uiStride, uiWidth, uiHeight, riDeltaDC1, riDeltaDC2, bAbove, bLeft );
     2445}
     2446
     2447Void TEncSearch::xSearchWedgeFullMinDist( TComDataCU* pcCU, UInt uiAbsPtIdx, WedgeList* pacWedgeList, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx )
     2448{
     2449  ruiTabIdx = 0;
     2450
     2451  // local pred buffer
     2452  TComYuv cPredYuv;
     2453  cPredYuv.create( uiWidth, uiHeight );
     2454  cPredYuv.clear();
     2455
     2456  UInt uiPredStride = cPredYuv.getStride();
     2457  Pel* piPred       = cPredYuv.getLumaAddr();
     2458
     2459  Int  iDC1 = 0;
     2460  Int  iDC2 = 0;
     2461  // regular wedge search
     2462  Dist uiBestDist   = RDO_DIST_MAX;
     2463  UInt uiBestTabIdx = 0;
     2464
     2465  for( UInt uiIdx = 0; uiIdx < pacWedgeList->size(); uiIdx++ )
     2466  {
     2467    calcWedgeDCs       ( &(pacWedgeList->at(uiIdx)), piRef,  uiRefStride,  iDC1, iDC2 );
     2468    assignWedgeDCs2Pred( &(pacWedgeList->at(uiIdx)), piPred, uiPredStride, iDC1, iDC2 );
     2469
     2470    Dist uiActDist = RDO_DIST_MAX;
     2471#if HHI_VSO
     2472    if( m_pcRdCost->getUseVSO() )
     2473    {
     2474      uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, 0 );
     2475    }
     2476    else
     2477    {
     2478      uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, DF_SAD );
     2479    }
     2480#else
     2481    uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, DF_SAD );
     2482#endif
     2483
     2484    if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX )
     2485    {
     2486      uiBestDist   = uiActDist;
     2487      uiBestTabIdx = uiIdx;
     2488    }
     2489  }
     2490  ruiTabIdx = uiBestTabIdx;
     2491
     2492  cPredYuv.destroy();
     2493  return;
     2494}
     2495
     2496Void TEncSearch::findWedgePredDirMinDist( TComDataCU*  pcCU,
     2497                                         UInt         uiAbsPtIdx,
     2498                                         Pel*         piOrig,
     2499                                         Pel*         piPredic,
     2500                                         UInt         uiStride,
     2501                                         UInt         uiWidth,
     2502                                         UInt         uiHeight,
     2503                                         UInt&        ruiTabIdx,
     2504                                         Int&         riWedgeDeltaEnd,
     2505                                         Int&         riDeltaDC1,
     2506                                         Int&         riDeltaDC2,
     2507                                         Bool         bAbove,
     2508                                         Bool         bLeft,
     2509                                         WedgeDist    eWedgeDist )
     2510{
    27672511  assert( uiWidth >= DMM_WEDGEMODEL_MIN_SIZE && uiWidth <= DMM_WEDGEMODEL_MAX_SIZE );
    27682512  WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];
    27692513
    2770   ruiTabIdx = getBestWedgeFromText( pcCU, uiAbsPtIdx, uiWidth, uiHeight );
     2514  ruiTabIdx       = 0;
     2515  riWedgeDeltaEnd = 0;
     2516
     2517  xSearchWedgePredDirMinDist( pcCU, uiAbsPtIdx, pacWedgeList, piOrig, uiStride, uiWidth, uiHeight, ruiTabIdx, riWedgeDeltaEnd );
     2518
     2519  TComWedgelet* pcBestWedgelet = &(pacWedgeList->at(ruiTabIdx));
     2520  xGetWedgeDeltaDCsMinDist( pcBestWedgelet, pcCU, uiAbsPtIdx, piOrig, piPredic, uiStride, uiWidth, uiHeight, riDeltaDC1, riDeltaDC2, bAbove, bLeft );
     2521}
     2522
     2523Void TEncSearch::xSearchWedgePredDirMinDist( TComDataCU* pcCU, UInt uiAbsPtIdx, WedgeList* pacWedgeList, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Int& riWedgeDeltaEnd )
     2524{
     2525  ruiTabIdx       = 0;
     2526  riWedgeDeltaEnd = 0;
     2527
     2528  // local pred buffer
     2529  TComYuv cPredYuv;
     2530  cPredYuv.create( uiWidth, uiHeight );
     2531  cPredYuv.clear();
     2532
     2533  UInt uiPredStride = cPredYuv.getStride();
     2534  Pel* piPred       = cPredYuv.getLumaAddr();
     2535
     2536  Int  iDC1 = 0;
     2537  Int  iDC2 = 0;
     2538
     2539  // regular wedge search
     2540  Dist uiBestDist    = RDO_DIST_MAX;
     2541  UInt uiBestTabIdx  = 0;
     2542  Int  iBestDeltaEnd = 0;
     2543
     2544  UInt uiIdx = 0;
     2545  for( Int iTestDeltaEnd = -DMM_WEDGE_PREDDIR_DELTAEND_MAX; iTestDeltaEnd <= DMM_WEDGE_PREDDIR_DELTAEND_MAX; iTestDeltaEnd++ )
     2546  {
     2547    uiIdx = getBestContinueWedge( pcCU, uiAbsPtIdx, uiWidth, uiHeight, iTestDeltaEnd );
     2548    calcWedgeDCs       ( &(pacWedgeList->at(uiIdx)), piRef,  uiRefStride,  iDC1, iDC2 );
     2549    assignWedgeDCs2Pred( &(pacWedgeList->at(uiIdx)), piPred, uiPredStride, iDC1, iDC2 );
     2550
     2551    Dist uiActDist = RDO_DIST_MAX;
     2552#if HHI_VSO
     2553    if( m_pcRdCost->getUseVSO() )
     2554    {
     2555      uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, 0 );
     2556    }
     2557    else
     2558    {
     2559      uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, DF_SAD );
     2560    }
     2561#else
     2562    uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, DF_SAD );
     2563#endif
     2564
     2565    if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX )
     2566    {
     2567      uiBestDist    = uiActDist;
     2568      uiBestTabIdx  = uiIdx;
     2569      iBestDeltaEnd = iTestDeltaEnd;
     2570    }
     2571    else if( uiIdx == uiBestTabIdx && abs(iTestDeltaEnd) < abs(iBestDeltaEnd) )
     2572    {
     2573      iBestDeltaEnd = iTestDeltaEnd;
     2574    }
     2575  }
     2576
     2577  ruiTabIdx       = uiBestTabIdx;
     2578  riWedgeDeltaEnd = iBestDeltaEnd;
     2579
     2580  cPredYuv.destroy();
     2581  return;
     2582}
     2583#endif
     2584
     2585#if HHI_DMM_PRED_TEX
     2586Void TEncSearch::findWedgeTexMinDist( TComDataCU*  pcCU,
     2587                                      UInt         uiAbsPtIdx,
     2588                                      Pel*         piOrig,
     2589                                      Pel*         piPredic,
     2590                                      UInt         uiStride,
     2591                                      UInt         uiWidth,
     2592                                      UInt         uiHeight,
     2593                                      UInt&        ruiTabIdx,
     2594                                      Int&         riDeltaDC1,
     2595                                      Int&         riDeltaDC2,
     2596                                      Bool         bAbove,
     2597                                      Bool         bLeft,
     2598                                      WedgeDist    eWedgeDist,
     2599                                      Pel*         piTextureRef
     2600                                    )
     2601  {
     2602  assert( uiWidth >= DMM_WEDGEMODEL_MIN_SIZE && uiWidth <= DMM_WEDGEMODEL_MAX_SIZE );
     2603  WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];
     2604
     2605  ruiTabIdx = getBestWedgeFromText( pcCU, uiAbsPtIdx, uiWidth, uiHeight, eWedgeDist, piTextureRef );
    27712606
    27722607  TComWedgelet* pcBestWedgelet = &(pacWedgeList->at(ruiTabIdx));
     
    27842619                                     Int&         riDeltaDC2,
    27852620                                     Bool         bAbove,
    2786                                      Bool         bLeft )
     2621                                     Bool         bLeft,
     2622                                     Pel*         piTextureRef )
    27872623{
    27882624  // get contour pattern
    27892625  TComWedgelet* pcContourWedge = new TComWedgelet( uiWidth, uiHeight );
    2790   getBestContourFromText( pcCU, uiAbsPtIdx, uiWidth, uiHeight, pcContourWedge );
     2626  getBestContourFromText( pcCU, uiAbsPtIdx, uiWidth, uiHeight, pcContourWedge, piTextureRef );
    27912627
    27922628  xGetWedgeDeltaDCsMinDist( pcContourWedge, pcCU, uiAbsPtIdx, piOrig, piPredic, uiStride, uiWidth, uiHeight, riDeltaDC1, riDeltaDC2, bAbove, bLeft );
     
    27952631  delete pcContourWedge;
    27962632}
    2797 
     2633#endif
     2634#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    27982635Void TEncSearch::xGetWedgeDeltaDCsMinDist( TComWedgelet* pcWedgelet,
    27992636                                           TComDataCU*   pcCU,
     
    28242661  riDeltaDC2 = iDC2 - iPredDC2;
    28252662
     2663#if HHI_VSO
    28262664  if( m_pcRdCost->getUseVSO() )
    28272665  {
     
    28752713    riDeltaDC2 = iFullDeltaDC2;
    28762714  }
     2715#endif
    28772716
    28782717  xDeltaDCQuantScaleDown( pcCU, riDeltaDC1 );
    28792718  xDeltaDCQuantScaleDown( pcCU, riDeltaDC2 );
     2719}
     2720
     2721Bool TEncSearch::predIntraLumaDMMAvailable( UInt uiMode, UInt uiWidth, UInt uiHeight )
     2722{
     2723  if( uiMode <= MAX_MODE_ID_INTRA_DIR ) return true;
     2724
     2725  Bool bDMMAvailable = m_pcEncCfg->getUseDMM();
     2726
     2727#if HHI_DMM_WEDGE_INTRA
     2728  if( uiMode == DMM_WEDGE_FULL_IDX        ||
     2729      uiMode == DMM_WEDGE_FULL_D_IDX      ||
     2730      uiMode == DMM_WEDGE_PREDDIR_IDX     ||
     2731      uiMode == DMM_WEDGE_PREDDIR_D_IDX )
     2732  {
     2733    if( (uiWidth != uiHeight) || (uiWidth < DMM_WEDGEMODEL_MIN_SIZE) || (uiWidth > DMM_WEDGEMODEL_MAX_SIZE) || ( ( uiMode == DMM_WEDGE_PREDDIR_IDX || uiMode == DMM_WEDGE_PREDDIR_D_IDX ) && uiWidth == 4 ) )
     2734    {
     2735      bDMMAvailable = false;
     2736    }
     2737  }
     2738#endif
     2739#if HHI_DMM_PRED_TEX
     2740  if( uiMode == DMM_WEDGE_PREDTEX_IDX     ||
     2741      uiMode == DMM_WEDGE_PREDTEX_D_IDX   ||
     2742      uiMode == DMM_CONTOUR_PREDTEX_IDX   ||
     2743      uiMode == DMM_CONTOUR_PREDTEX_D_IDX )
     2744  {
     2745    if( (uiWidth != uiHeight) || (uiWidth < DMM_WEDGEMODEL_MIN_SIZE) || (uiWidth > DMM_WEDGEMODEL_MAX_SIZE) || ( ( uiMode == DMM_CONTOUR_PREDTEX_IDX || uiMode == DMM_CONTOUR_PREDTEX_D_IDX ) && uiWidth == 4 ) )
     2746    {
     2747      bDMMAvailable = false;
     2748    }
     2749  }
     2750
     2751#endif
     2752
     2753  return bDMMAvailable;
    28802754}
    28812755
     
    40333907  uiCost = ruiDist + m_pcRdCost->getCost( m_auiMVPIdxCost[iMVPIdx][iMVPNum] );
    40343908#else
    4035 //GT VSO
     3909#if HHI_VSO
    40363910  if ( false /*m_pcRdCost->getUseVSO()*/ ) // GT: currently disabled
    40373911  {
    4038   #if GERHARD_VQM_XCHECK
    4039     UInt uiCost1 = m_pcRdCost->getDistVS  ( pcCU, uiPartAddr,  pcTemplateCand->getLumaAddr(uiPartAddr), pcTemplateCand->getStride(), pcOrgYuv->getLumaAddr(uiPartAddr), pcOrgYuv->getStride(), iSizeX, iSizeY, true, 0);
    4040     UInt uiCost2 = m_pcRdCost->getDistPart( pcTemplateCand->getLumaAddr(uiPartAddr), pcTemplateCand->getStride(), pcOrgYuv->getLumaAddr(uiPartAddr), pcOrgYuv->getStride(), iSizeX, iSizeY, DF_SAD );
    4041     assert(uiCost1 == uiCost2);
    4042   #endif
    40433912    uiCost = m_pcRdCost->getDistVS  ( pcCU, uiPartAddr,  pcTemplateCand->getLumaAddr(uiPartAddr), pcTemplateCand->getStride(), pcOrgYuv->getLumaAddr(uiPartAddr), pcOrgYuv->getStride(), iSizeX, iSizeY, true, 0);
    40443913    uiCost = (UInt) m_pcRdCost->calcRdCostVSO( m_auiMVPIdxCost[iMVPIdx][iMVPNum], uiCost, false, DF_SAD );
    40453914  }
    40463915  else
     3916#endif
    40473917  {
    40483918    uiCost = m_pcRdCost->getDistPart( pcTemplateCand->getLumaAddr(uiPartAddr), pcTemplateCand->getStride(), pcOrgYuv->getLumaAddr(uiPartAddr), pcOrgYuv->getStride(), iSizeX, iSizeY, DF_SAD );
    40493919    uiCost = (UInt) m_pcRdCost->calcRdCost( m_auiMVPIdxCost[iMVPIdx][iMVPNum], uiCost, false, DF_SAD );
    40503920  }
    4051 //GT VSO end
    40523921#endif
    40533922  return uiCost;
     
    41233992
    41243993  m_pcRdCost->setPredictor  ( *pcMvPred );
    4125 #if MW_DEPTH_MAP_INTERP_FILTER == 2 && MW_FULL_PEL_DEPTH_MAP_MV_SIGNALLING
     3994#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    41263995  if( pcCU->getSlice()->getSPS()->isDepth() )
    41273996    m_pcRdCost->setCostScale  ( 0 );
     
    41303999  m_pcRdCost->setCostScale  ( 2 );
    41314000
     4001#if HHI_INTER_VIEW_MOTION_PRED
    41324002  { // init inter-view regularization
    41334003    TComMv  cOrgDepthMapMv;
    41344004    Bool    bMultiviewReg = pcCU->getIViewOrgDepthMvPred( iPartIdx, eRefPicList, iRefIdxPred, cOrgDepthMapMv );
    4135 #if MW_DEPTH_MAP_INTERP_FILTER == 2 && MW_FULL_PEL_DEPTH_MAP_MV_SIGNALLING
     4005#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    41364006    if( bMultiviewReg && pcCU->getSlice()->getSPS()->isDepth() )
    41374007    {
     
    41464016    }
    41474017  }
     4018#endif
    41484019
    41494020  //  Do integer search
     
    41794050
    41804051  m_pcRdCost->getMotionCost( 1, 0 );
    4181 #if MW_DEPTH_MAP_INTERP_FILTER == 2 && MW_FULL_PEL_DEPTH_MAP_MV_SIGNALLING
     4052#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    41824053  if( ! pcCU->getSlice()->getSPS()->isDepth() )
    41834054  {
     
    42034074  rcMv += (cMvHalf <<= 1);
    42044075  rcMv +=  cMvQter;
    4205 #if MW_DEPTH_MAP_INTERP_FILTER == 2 && MW_FULL_PEL_DEPTH_MAP_MV_SIGNALLING
     4076#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    42064077  }
    42074078#endif
    42084079
    42094080  UInt uiMvBits = m_pcRdCost->getBits( rcMv.getHor(), rcMv.getVer() );
    4210 #if MW_DEPTH_MAP_INTERP_FILTER == 2 && MW_FULL_PEL_DEPTH_MAP_MV_SIGNALLING
     4081#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    42114082  if( pcCU->getSlice()->getSPS()->isDepth() )
    42124083    ruiCost += m_pcRdCost->getCost( uiMvBits );
     
    42214092{
    42224093  Int  iMvShift = 2;
    4223 #if MW_DEPTH_MAP_INTERP_FILTER == 2 && MW_FULL_PEL_DEPTH_MAP_MV_SIGNALLING
     4094#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    42244095  if( pcCU->getSlice()->getSPS()->isDepth() )
    42254096    iMvShift = 0;
     
    43944265  UInt uiSearchRange = m_iSearchRange;
    43954266  pcCU->clipMv( rcMv );
    4396 #if MW_DEPTH_MAP_INTERP_FILTER == 2 && MW_FULL_PEL_DEPTH_MAP_MV_SIGNALLING
     4267#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    43974268  if( ! pcCU->getSlice()->getSPS()->isDepth() )
    43984269#endif
     
    44144285      TComMv cMv = m_acMvPredictors[index];
    44154286      pcCU->clipMv( cMv );
    4416 #if MW_DEPTH_MAP_INTERP_FILTER == 2 && MW_FULL_PEL_DEPTH_MAP_MV_SIGNALLING
     4287#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    44174288      if( ! pcCU->getSlice()->getSPS()->isDepth() )
    44184289#endif
     
    47264597    pcYuvPred->copyToPartYuv( rpcYuvRec, 0 );
    47274598
     4599#if HHI_INTER_VIEW_RESIDUAL_PRED
    47284600    // add residual prediction
    47294601    if( pcCU->getResPredFlag( 0 ) )
     
    47324604      rpcYuvRec->clip( uiWidth, uiHeight );
    47334605    }
    4734 
    4735     //GT VSO
     4606#endif
     4607
     4608#if HHI_VSO   
    47364609    if ( m_pcRdCost->getUseVSO() )
    47374610    {
    4738   #if GERHARD_VQM_XCHECK
    4739       UInt uiDistortion1 = m_pcRdCost->getDistPart( rpcYuvRec->getLumaAddr(), rpcYuvRec->getStride(),  pcYuvOrg->getLumaAddr(), pcYuvOrg->getStride(),  uiWidth,      uiHeight );
    4740       UInt uiDistortion2 = m_pcRdCost->getDistVS( pcCU, 0, rpcYuvRec->getLumaAddr(), rpcYuvRec->getStride(),  pcYuvOrg->getLumaAddr(), pcYuvOrg->getStride(),  uiWidth,      uiHeight     , false, 0 );
    4741       assert( uiDistortion1 == uiDistortion2 );
    4742   #endif
    47434611      uiDistortion = m_pcRdCost->getDistVS( pcCU, 0, rpcYuvRec->getLumaAddr(), rpcYuvRec->getStride(),  pcYuvOrg->getLumaAddr(), pcYuvOrg->getStride(),  uiWidth,      uiHeight     , false, 0 );
    47444612    }
    47454613    else
     4614#endif
    47464615    {
    47474616      uiDistortion = m_pcRdCost->getDistPart( rpcYuvRec->getLumaAddr(), rpcYuvRec->getStride(),  pcYuvOrg->getLumaAddr(), pcYuvOrg->getStride(),  uiWidth,      uiHeight      )
     
    47494618      + m_pcRdCost->getDistPart( rpcYuvRec->getCrAddr(),   rpcYuvRec->getCStride(), pcYuvOrg->getCrAddr(),   pcYuvOrg->getCStride(), uiWidth >> 1, uiHeight >> 1 );
    47504619    }
    4751     //GT VSO end
     4620   
    47524621
    47534622    if( m_bUseSBACRD )
     
    47554624
    47564625    m_pcEntropyCoder->resetBits();
    4757 #if MW_MVI_SIGNALLING_MODE == 1
     4626#if HHI_MPI
    47584627    if( pcCU->getTextureModeDepth( 0 ) == -1 )
    47594628    {
     
    47724641    }
    47734642#endif
     4643#if HHI_INTER_VIEW_RESIDUAL_PRED
    47744644    m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
    4775 #if MW_MVI_SIGNALLING_MODE == 1
     4645#endif
     4646#if HHI_MPI
    47764647    }
    47774648#endif
     
    47804651    pcCU->getTotalBits()       = uiBits;
    47814652    pcCU->getTotalDistortion() = uiDistortion;
    4782     //GT VSO
     4653
     4654#if HHI_VSO
    47834655    if ( m_pcRdCost->getUseLambdaScaleVSO() )
    47844656    {
     
    47864658    }
    47874659    else
     4660#endif
    47884661    {
    47894662      pcCU->getTotalCost() = m_pcRdCost->calcRdCost( uiBits, uiDistortion );
    47904663    }
    4791     //GT VSO end
    47924664
    47934665    if( m_bUseSBACRD )
     
    47974669    pcCU->setTrIdxSubParts( 0, 0, pcCU->getDepth(0) );
    47984670
     4671#if HHI_VSO
    47994672    // set Model
    48004673    if( m_pcRdCost->getUseRenModel() )
     
    48044677      m_pcRdCost->setRenModelData( pcCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
    48054678    }
     4679#endif
    48064680
    48074681    return;
     
    48284702  pcYuvPred->copyToPartYuv( rpcYuvRec, 0 );
    48294703
     4704#if HHI_INTER_VIEW_RESIDUAL_PRED
    48304705  // add residual prediction
    48314706  if( pcCU->getResPredFlag( 0 ) )
     
    48334708    rpcYuvRec->add( rpcYuvResPrd, uiWidth, uiHeight );
    48344709  }
    4835   #if SB_INTERVIEW_SKIP
     4710#endif
     4711#if HHI_INTERVIEW_SKIP
    48364712  if( bSkipRes)
    48374713  {
     
    48584734
    48594735    Dist uiZeroDistortion = 0;
    4860 //GT VSO
     4736#if HHI_VSO
    48614737    if ( m_pcRdCost->getUseVSO() )
    48624738    {
    48634739      m_cYuvRecTemp.create( pcYuvPred->getWidth(), pcYuvPred->getHeight()  );
    48644740    }
     4741#endif
    48654742
    48664743    xEstimateResidualQT( pcCU, 0, 0, pcYuvOrg, rpcYuvRec, rpcYuvResi,  pcCU->getDepth(0), dCost, uiBits, uiDistortion, &uiZeroDistortion );
    48674744
     4745#if HHI_VSO
    48684746    if ( m_pcRdCost->getUseVSO() )
    48694747    {
    48704748      m_cYuvRecTemp.destroy();
    48714749    }
    4872 //GT VSO end
     4750#endif
     4751
    48734752
    48744753    double dZeroCost;
     4754#if HHI_VSO
    48754755    if( m_pcRdCost->getUseLambdaScaleVSO() )
    48764756    {
     
    48784758    }
    48794759    else
     4760#endif
    48804761    {
    48814762      dZeroCost = m_pcRdCost->calcRdCost( 0, uiZeroDistortion );
     
    49264807
    49274808    Double dExactCost;
     4809#if HHI_VSO
    49284810    if( m_pcRdCost->getUseLambdaScaleVSO() )
    49294811    {
     
    49314813    }
    49324814    else
     4815#endif
    49334816    {
    49344817      dExactCost = m_pcRdCost->calcRdCost( uiBits, uiDistortion );
     
    49704853    }
    49714854
     4855#if HHI_VSO
    49724856    // reset Model
    49734857    if( m_pcRdCost->getUseRenModel() )
     
    49774861      m_pcRdCost->setRenModelData( pcCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
    49784862    }
     4863#endif
    49794864  }
    49804865
     
    50024887  // update with clipped distortion and cost (qp estimation loop uses unclipped values)
    50034888
    5004   //GT VSO
     4889#if HHI_VSO
    50054890  if ( m_pcRdCost->getUseVSO() )
    50064891  {
    5007   #if GERHARD_VQM_XCHECK
    5008     UInt uiDistortionBest1 = m_pcRdCost->getDistVS  ( pcCU, 0, rpcYuvRec->getLumaAddr(), rpcYuvRec->getStride(),  pcYuvOrg->getLumaAddr(), pcYuvOrg->getStride(),  uiWidth,      uiHeight, false, 0    );
    5009     UInt uiDistortionBest2 = m_pcRdCost->getDistPart( rpcYuvRec->getLumaAddr(), rpcYuvRec->getStride(),  pcYuvOrg->getLumaAddr(), pcYuvOrg->getStride(),  uiWidth,      uiHeight      );
    5010     assert( uiDistortionBest1 == uiDistortionBest2 );
    5011   #endif
    50124892    uiDistortionBest = m_pcRdCost->getDistVS  ( pcCU, 0, rpcYuvRec->getLumaAddr(), rpcYuvRec->getStride(),  pcYuvOrg->getLumaAddr(), pcYuvOrg->getStride(),  uiWidth,      uiHeight, false, 0    );
    50134893  }
    50144894  else
     4895#endif
    50154896  {
    50164897    uiDistortionBest = m_pcRdCost->getDistPart( rpcYuvRec->getLumaAddr(), rpcYuvRec->getStride(),  pcYuvOrg->getLumaAddr(), pcYuvOrg->getStride(),  uiWidth,      uiHeight      )
     
    50184899    + m_pcRdCost->getDistPart( rpcYuvRec->getCrAddr(),   rpcYuvRec->getCStride(), pcYuvOrg->getCrAddr(),   pcYuvOrg->getCStride(), uiWidth >> 1, uiHeight >> 1 );
    50194900  }
    5020 //GT VSO end
    5021 
    5022 //GT VSO
     4901
     4902#if HHI_VSO
    50234903  if ( m_pcRdCost->getUseLambdaScaleVSO() )
    50244904  {
     
    50264906  }
    50274907  else
     4908#endif
    50284909  {
    50294910    dCostBest = m_pcRdCost->calcRdCost( uiBitsBest, uiDistortionBest );
    50304911  }
    5031 //GT VSO end
    50324912
    50334913  pcCU->getTotalBits()       = uiBitsBest;
     
    50444924
    50454925  // set Model
     4926#if HHI_VSO
    50464927  if( m_pcRdCost->getUseRenModel() )
    50474928  {
     
    50504931    m_pcRdCost->setRenModelData( pcCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
    50514932  }
     4933#endif
    50524934}
    50534935
     
    51675049    ::memset( m_pTempPel, 0, sizeof( Pel ) * uiNumSamplesLuma ); // not necessary needed for inside of recursion (only at the beginning)
    51685050
     5051#if HHI_VSO
    51695052    if ( m_pcRdCost->getUseVSO() )
    51705053    {
    51715054      uiDistY = m_pcRdCost->getDistVS  ( pcCU, uiAbsPartIdx, pcPred->getLumaAddr( uiAbsPartIdx ), pcPred->getStride(), pcOrg->getLumaAddr( uiAbsPartIdx), pcOrg->getStride(), 1<< uiLog2TrSize, 1<< uiLog2TrSize, false, 0 ); // initialized with zero residual distortion
    5172 
    5173   #if GERHARD_VQM_XCHECK
    5174       UInt uiDist1 = m_pcRdCost->getDistPart( pcOrg->getLumaAddr( uiAbsPartIdx), pcOrg->getStride(), pcPred->getLumaAddr( uiAbsPartIdx ), pcPred->getStride(), 1<< uiLog2TrSize, 1<< uiLog2TrSize ); // initialized with zero residual distortion
    5175       UInt uiDist2  = m_pcRdCost->getDistPart( m_pTempPel, 1<< uiLog2TrSize, pcResi->getLumaAddr( uiAbsPartIdx ), pcResi->getStride(), 1<< uiLog2TrSize, 1<< uiLog2TrSize ); // initialized with zero residual distortion
    5176       assert( uiDist1 == uiDist2 );
    5177   #endif
    51785055    }
    51795056    else
     5057#endif
    51805058    {
    51815059#if IBDI_DISTORTION
     
    51855063#endif
    51865064    }
    5187 //GT VSO end
     5065
    51885066
    51895067    if ( puiZeroDist )
     
    52035081      Dist uiNonzeroDistY;
    52045082
    5205       //GT VSO
     5083#if HHI_VSO     
    52065084      if ( m_pcRdCost->getUseVSO() )
    52075085      {
     
    52095087        uiNonzeroDistY = m_pcRdCost->getDistVS( pcCU, uiAbsPartIdx, m_cYuvRecTemp.getLumaAddr(uiAbsPartIdx), m_cYuvRecTemp.getStride(),
    52105088                                                pcOrg->getLumaAddr( uiAbsPartIdx ), pcOrg->getStride(), 1<< uiLog2TrSize,   1<< uiLog2TrSize, false, 0 );
    5211 
    5212   #if GERHARD_VQM_XCHECK
    5213         UInt uiDist1 = m_pcRdCost->getDistPart( m_cYuvRecTemp.getLumaAddr(uiAbsPartIdx), m_cYuvRecTemp.getStride(),
    5214                                                 pcOrg->getLumaAddr( uiAbsPartIdx ), pcOrg->getStride(), 1<< uiLog2TrSize,    1<< uiLog2TrSize );
    5215 
    5216         UInt uiDist2 = m_pcRdCost->getDistPart( m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr( uiAbsPartIdx ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),
    5217                                                 pcResi->getLumaAddr( uiAbsPartIdx ), pcResi->getStride(), 1<< uiLog2TrSize,    1<< uiLog2TrSize );
    5218         assert( uiDist1 == uiDist2);
    5219   #endif
    52205089      }
    52215090      else
     5091#endif
    52225092      {
    52235093        uiNonzeroDistY = m_pcRdCost->getDistPart( m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr( uiAbsPartIdx ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(),
    52245094                                                  pcResi->getLumaAddr( uiAbsPartIdx ), pcResi->getStride(), 1<< uiLog2TrSize,    1<< uiLog2TrSize );
    52255095      }
    5226       //GT VSO end
    52275096
    52285097      Double dSingleCostY;
    52295098      Double dNullCostY;
    52305099
    5231       //GT VSO
     5100#if HHI_VSO     
    52325101      if ( m_pcRdCost->getUseLambdaScaleVSO())
    52335102      {
     
    52365105      }
    52375106      else
     5107#endif
    52385108      {
    52395109        dSingleCostY = m_pcRdCost->calcRdCost( uiSingleBitsY, uiNonzeroDistY );
    52405110        dNullCostY   = m_pcRdCost->calcRdCost( 0, uiDistY );
    52415111      }
    5242       //GT VSO end
    52435112
    52445113
     
    54065275
    54075276    uiSingleDist = uiDistY + uiDistU + uiDistV;
    5408 //GT VSO
     5277#if HHI_VSO
    54095278    if ( m_pcRdCost->getUseLambdaScaleVSO())
    54105279    {
     
    54125281    }
    54135282    else
     5283#endif
    54145284    {
    54155285      dSingleCost = m_pcRdCost->calcRdCost( uiSingleBits, uiSingleDist );
    54165286    }
    5417 //GT VSO end
    54185287  }
    54195288
     
    54675336    uiSubdivBits = m_pcEntropyCoder->getNumberOfWrittenBits();
    54685337
    5469 //GT VSO
     5338#if HHI_VSO
    54705339    if ( m_pcRdCost->getUseLambdaScaleVSO())
    54715340    {
     
    54735342    }
    54745343    else
     5344#endif
    54755345    {
    54765346      dSubdivCost  = m_pcRdCost->calcRdCost( uiSubdivBits, uiSubdivDist );
    54775347    }
    5478 //GT VSO end
    54795348
    54805349    if( uiYCbf || uiUCbf || uiVCbf || !bCheckFull )
     
    54955364  }
    54965365
     5366#if HHI_VSO
    54975367  if ( m_pcRdCost->getUseRenModel() )
    54985368  {
     
    55155385      uiSrcStride = pcPred->getStride  ();
    55165386    }
     5387
    55175388    m_pcRdCost->setRenModelData( pcCU, uiAbsPartIdx, piSrc, (Int) uiSrcStride, (Int) uiWidth, (Int) uiHeight );
    55185389  }
     5390#endif
    55195391
    55205392  rdCost += dSingleCost;
     
    57625634  if ( pcCU->isSkipped( 0 ) )
    57635635  {
    5764 #if MW_MVI_SIGNALLING_MODE == 0
    5765     assert( pcCU->getTextureModeDepth( 0 ) == -1 );
    5766 #elif MW_MVI_SIGNALLING_MODE == 1
     5636#if HHI_MPI
    57675637    if( pcCU->getTextureModeDepth( 0 ) != -1 )
    57685638    {
     
    57875657    }
    57885658#endif
     5659#if HHI_INTER_VIEW_RESIDUAL_PRED
    57895660    m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
     5661#endif
    57905662    ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
    57915663  }
     
    57935665  {
    57945666    m_pcEntropyCoder->resetBits();
    5795 #if MW_MVI_SIGNALLING_MODE == 1
     5667#if HHI_MPI
    57965668    if( pcCU->getTextureModeDepth( 0 ) == -1 )
    57975669    {
    57985670#endif
    5799     m_pcEntropyCoder->encodeSkipFlag ( pcCU, 0, true );
     5671      m_pcEntropyCoder->encodeSkipFlag ( pcCU, 0, true );
    58005672#if HHI_MRG_SKIP
    5801     if (pcCU->getPredictionMode(0) == MODE_SKIP)
    5802     {
    5803       pcCU->setPredModeSubParts( MODE_INTER, 0, pcCU->getDepth(0) );
    5804     }
    5805 #endif
    5806 #if MW_MVI_SIGNALLING_MODE == 0
    5807     if( pcCU->getTextureModeDepth( 0 ) == -1 )
    5808     {
     5673      if (pcCU->getPredictionMode(0) == MODE_SKIP)
     5674      {
     5675        pcCU->setPredModeSubParts( MODE_INTER, 0, pcCU->getDepth(0) );
     5676      }
    58095677#endif
    58105678      m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
     
    58125680      m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
    58135681
     5682#if HHI_INTER_VIEW_RESIDUAL_PRED
    58145683      m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
    5815     }
     5684#endif
     5685#if HHI_MPI
     5686    }
     5687#endif
    58165688    m_pcEntropyCoder->encodeCoeff   ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0) );
    58175689
  • trunk/source/Lib/TLibEncoder/TEncSearch.h

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
     
    71104 
    72105
    73 //GT VSO
     106#if HHI_VSO
    74107  TComYuv         m_cYuvRecTemp;
    75 //GT VSO end
     108#endif
    76109 
    77110  // AMVP cost computation
     
    104137 
    105138#if (!REFERENCE_SAMPLE_PADDING)
    106 #if HHI_DMM_INTRA
     139#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    107140  Bool predIntraLumaDirAvailable( UInt uiMode, UInt uiWidthBit, Bool bAboveAvail, Bool bLeftAvail, UInt uiWidth, UInt uiHeight, TComDataCU* pcCU, UInt uiAbsPartIdx );
    108141#else
     
    111144#endif
    112145
    113 #if HHI_DMM_INTRA
     146#if HHI_DMM_WEDGE_INTRA
    114147  Void xSearchWedgeFullMinDist   ( TComDataCU* pcCU, UInt uiAbsPtIdx, WedgeList* pacWedgeList, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx );
    115148  Void xSearchWedgePredDirMinDist( TComDataCU* pcCU, UInt uiAbsPtIdx, WedgeList* pacWedgeList, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Int& riWedgeDeltaEnd );
    116 
     149#endif
     150#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    117151  Void xGetWedgeDeltaDCsMinDist  ( TComWedgelet* pcWedgelet,
    118152                                   TComDataCU*   pcCU,
     
    170204                                  Dist        uiPreCalcDistC );
    171205 
    172 #if HHI_DMM_INTRA
     206#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    173207  Bool predIntraLumaDMMAvailable( UInt         uiMode,
    174                                   Bool         bAboveAvail,
    175                                   Bool         bLeftAvail,
    176208                                  UInt         uiWidth,
    177                                   UInt         uiHeight,
    178                                   TComDataCU*  pcCU,
    179                                   UInt         uiAbsPartIdx );
     209                                  UInt         uiHeight );
     210#endif
     211#if HHI_DMM_WEDGE_INTRA
    180212  Void findWedgeFullMinDist     ( TComDataCU*  pcCU,
    181213                                  UInt         uiAbsPtIdx,
     
    205237                                  Bool         bLeft,
    206238                                  WedgeDist    eWedgeDist );
     239#endif
     240#if HHI_DMM_PRED_TEX
    207241  Void findWedgeTexMinDist      ( TComDataCU*  pcCU,
    208242                                  UInt         uiAbsPtIdx,
     
    217251                                  Bool         bAbove,
    218252                                  Bool         bLeft,
    219                                   WedgeDist    eWedgeDist );
     253                                  WedgeDist    eWedgeDist,
     254                                  Pel*         piTextureRef = NULL );
     255
    220256  Void findContourPredTex       ( TComDataCU*  pcCU,
    221257                                  UInt         uiAbsPtIdx,
     
    228264                                  Int&         riDeltaDC2,
    229265                                  Bool         bAbove,
    230                                   Bool         bLeft );
    231 
     266                                  Bool         bLeft,
     267                                  Pel*         piTextureRef = NULL );
    232268#endif
    233269 
     
    286322                                    Bool         bLuma,
    287323                                    Bool         bChroma,
    288                                     Bool         bRealCoeff );
     324                                    Bool         bRealCoeff
     325                                  );
    289326 
    290327  Void  xIntraCodingLumaBlk       ( TComDataCU*  pcCU,
     
    295332                                    TComYuv*     pcResiYuv,
    296333                                    Dist&        ruiDist
    297 #if DMM_RES_CHECK_INTRA
    298                                     ,
    299                                     Bool         bCheckNoRes = false
    300 #endif
    301334                                   );
    302 
    303 #if DMM_RES_CHECK_INTRA
    304   Void  xSetIntraNoResi           ( TComDataCU* pcCU,
    305                                     UInt        uiTrDepth,
    306                                     UInt        uiAbsPartIdx,
    307                                     TComYuv*    pcPredYuv,
    308                                     TComYuv*    pcResiYuv,
    309                                     Bool        bNoRes
    310                                    );
    311 #endif
    312335
    313336  Void  xIntraCodingChromaBlk     ( TComDataCU*  pcCU,
  • trunk/source/Lib/TLibEncoder/TEncSeqStructure.cpp

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
  • trunk/source/Lib/TLibEncoder/TEncSeqStructure.h

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
     
    841#include <vector>
    942
    10 //SB
    1143#include <map>
    1244
  • trunk/source/Lib/TLibEncoder/TEncSlice.cpp

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
     33
    134
    235
     
    1649  m_apcPicYuvPred = NULL;
    1750  m_apcPicYuvResi = NULL;
    18  
     51
    1952  m_pdRdPicLambda = NULL;
    2053  m_pdRdPicQp     = NULL;
     
    3467    m_apcPicYuvPred->create( iWidth, iHeight, iMaxCUWidth, iMaxCUHeight, uhTotalDepth );
    3568  }
    36  
     69
    3770  // create residual picture
    3871  if( m_apcPicYuvResi == NULL )
     
    5285    m_apcPicYuvPred  = NULL;
    5386  }
    54  
     87
    5588  // destroy residual picture
    5689  if ( m_apcPicYuvResi )
     
    6093    m_apcPicYuvResi  = NULL;
    6194  }
    62  
     95
    6396  // free lambda and QP arrays
    6497  if ( m_pdRdPicLambda ) { xFree( m_pdRdPicLambda ); m_pdRdPicLambda = NULL; }
     
    71104  m_pcCfg             = pcEncTop;
    72105  m_pcListPic         = pcEncTop->getListPic();
    73  
    74   //SB
     106
    75107  m_pcPicEncoder      = pcEncTop->getPicEncoder();
    76108  m_pcCuEncoder       = pcEncTop->getCuEncoder();
    77109  m_pcPredSearch      = pcEncTop->getPredSearch();
    78  
     110
    79111  m_pcEntropyCoder    = pcEncTop->getEntropyCoder();
    80112  m_pcCavlcCoder      = pcEncTop->getCavlcCoder();
     
    82114  m_pcBinCABAC        = pcEncTop->getBinCABAC();
    83115  m_pcTrQuant         = pcEncTop->getTrQuant();
    84  
     116
    85117  m_pcBitCounter      = pcEncTop->getBitCounter();
    86118  m_pcRdCost          = pcEncTop->getRdCost();
    87119  m_pppcRDSbacCoder   = pcEncTop->getRDSbacCoder();
    88120  m_pcRDGoOnSbacCoder = pcEncTop->getRDGoOnSbacCoder();
    89  
     121
    90122  // create lambda and QP arrays
    91123  m_pdRdPicLambda     = (Double*)xMalloc( Double, m_pcCfg->getDeltaQpRD() * 2 + 1 );
     
    111143  Double dQP;
    112144  Double dLambda;
    113  
     145
    114146  rpcSlice = pcPic->getSlice(0);
    115147  rpcSlice->setSliceBits(0);
     
    117149  rpcSlice->initSlice();
    118150  rpcSlice->setPOC( pcPic->getPOC() );
    119  
     151
    120152  // slice type
    121153  SliceType eSliceType  = pcPic->getSliceType()  ;
    122154  rpcSlice->setSliceType    ( eSliceType );
    123  
     155
    124156  // ------------------------------------------------------------------------------------------------------------------
    125157  // Non-referenced frame marking
    126158  // ------------------------------------------------------------------------------------------------------------------
    127  
     159
    128160  rpcSlice->setReferenced(pcPic->getReferenced()) ;
    129  
     161
    130162  // ------------------------------------------------------------------------------------------------------------------
    131163  // QP setting
     
    133165
    134166  Double dOrigQP = double(pcPic->getQP());
    135  
     167
    136168  // ------------------------------------------------------------------------------------------------------------------
    137169  // Lambda computation
    138170  // ------------------------------------------------------------------------------------------------------------------
    139  
     171
    140172  Int iQP;
    141173
     
    149181    // compute QP value
    150182    dQP = dOrigQP + ((iDQpIdx+1)>>1)*(iDQpIdx%2 ? -1 : 1);
    151    
     183
    152184    // compute lambda value
    153185    Int    NumberBFrames = ( m_pcCfg->getRateGOPSize() - 1 );
     
    206238    // if hadamard is used in ME process
    207239    if ( !m_pcCfg->getUseHADME() ) dLambda *= 0.95;
    208    
     240
    209241    iQP = Max( MIN_QP, Min( MAX_QP, (Int)floor( dQP + 0.5 ) ) );
    210    
     242
    211243    m_pdRdPicLambda[iDQpIdx] = dLambda;
    212244    m_pdRdPicQp    [iDQpIdx] = dQP;
    213245    m_piRdPicQp    [iDQpIdx] = iQP;
    214246  }
    215  
     247
    216248  // obtain dQP = 0 case
    217249  dLambda = m_pdRdPicLambda[0];
    218250  dQP     = m_pdRdPicQp    [0];
    219251  iQP     = m_piRdPicQp    [0];
    220  
     252
    221253  // store lambda
    222 //GT VSO
    223   m_pcRdCost->setUseLambdaScaleVSO  ( (m_pcCfg->getUseVSO() ||  m_pcCfg->getForceLambdaScaleVSO()) && m_pcCfg->isDepthCoder()  );   
    224   m_pcRdCost->setLambdaVSO( dLambda * m_pcCfg->getLambdaScaleVSO() ); 
    225 //GT VSO end
     254#if HHI_VSO
     255  m_pcRdCost->setUseLambdaScaleVSO  ( (m_pcCfg->getUseVSO() ||  m_pcCfg->getForceLambdaScaleVSO()) && m_pcCfg->isDepthCoder()  );
     256  m_pcRdCost->setLambdaVSO( dLambda * m_pcCfg->getLambdaScaleVSO() );
     257#endif
    226258
    227259  m_pcRdCost ->setLambda      ( dLambda );
    228260  m_pcTrQuant->setLambda      ( dLambda );
    229261  rpcSlice   ->setLambda      ( dLambda );
     262#if HHI_INTER_VIEW_MOTION_PRED
    230263  m_pcRdCost ->setLambdaMVReg ( dLambda * m_pcCfg->getMultiviewMvRegLambdaScale() );
    231  
     264#endif
     265
    232266//#if HB_LAMBDA_FOR_LDC
    233267//  // restore original slice type
     
    237271//  }
    238272//  eSliceType = (iPOCLast == 0 || uiPOCCurr % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType;
    239 // 
     273//
    240274//  rpcSlice->setSliceType        ( eSliceType );
    241275//#endif
    242  
     276
    243277  rpcSlice->setSliceQp          ( iQP );
    244278  rpcSlice->setSliceQpDelta     ( 0 );
    245279  rpcSlice->setNumRefIdx        ( REF_PIC_LIST_0, eSliceType == I_SLICE ? 0 : pcPic->getNumRefs(REF_PIC_LIST_0) ) ;
    246280  rpcSlice->setNumRefIdx        ( REF_PIC_LIST_1, eSliceType == I_SLICE ? 0 : pcPic->getNumRefs(REF_PIC_LIST_1) ) ;
    247  
     281
    248282  rpcSlice->setSymbolMode       ( m_pcCfg->getSymbolMode());
    249283  rpcSlice->setLoopFilterDisable( m_pcCfg->getLoopFilterDisable() );
    250  
     284
    251285  rpcSlice->setDepth            ( 0 );
    252286  rpcSlice->setViewIdx          ( pcPic->getViewIdx() );
     
    256290  assert( m_apcPicYuvPred );
    257291  assert( m_apcPicYuvResi );
    258  
     292
    259293  pcPic->setPicYuvPred( m_apcPicYuvPred );
    260294  pcPic->setPicYuvResi( m_apcPicYuvResi );
     
    277311  Int iMaxSR = m_pcCfg->getSearchRange();
    278312  Int iNumPredDir = pcSlice->isInterP() ? 1 : 2;
    279  
     313
    280314  for (Int iDir = 0; iDir <= iNumPredDir; iDir++)
    281315  {
     
    299333  // if deltaQP RD is not used, simply return
    300334  if ( m_pcCfg->getDeltaQpRD() == 0 ) return;
    301  
     335
    302336  TComSlice* pcSlice        = rpcPic->getSlice(getSliceIdx());
    303337  Double     dPicRdCostBest = MAX_DOUBLE;
     
    306340  UInt64     uiPicBitsBest;
    307341  UInt       uiQpIdxBest = 0;
    308  
     342
    309343  Double dFrameLambda;
    310344#if FULL_NBIT
     
    313347  Int    SHIFT_QP = 12;
    314348#endif
    315  
     349
    316350  // set frame lambda
    317351  if (m_pcCfg->getGOPSize() > 1)
     
    324358  }
    325359  m_pcRdCost      ->setFrameLambda(dFrameLambda);
    326   m_pcRdCost      ->setFrameLambdaVSO( dFrameLambda * m_pcCfg->getLambdaScaleVSO() );
    327  
     360#if HHI_VSO
     361  m_pcRdCost      ->setFrameLambdaVSO( dFrameLambda * m_pcCfg->getLambdaScaleVSO() );
     362#endif
     363
    328364  // for each QP candidate
    329365  for ( UInt uiQpIdx = 0; uiQpIdx < 2 * m_pcCfg->getDeltaQpRD() + 1; uiQpIdx++ )
     
    333369    m_pcTrQuant   ->setLambda              ( m_pdRdPicLambda[uiQpIdx] );
    334370    pcSlice       ->setLambda              ( m_pdRdPicLambda[uiQpIdx] );
     371#if HHI_INTER_VIEW_MOTION_PRED
    335372    m_pcRdCost    ->setLambdaMVReg         ( m_pdRdPicLambda[uiQpIdx] * m_pcCfg->getMultiviewMvRegLambdaScale() );
    336    
     373#endif
     374
    337375    // try compress
    338376    compressSlice   ( rpcPic );
    339    
     377
    340378    Double dPicRdCost;
    341379    UInt64 uiPicDist        = m_uiPicDist;
    342380    UInt64 uiALFBits        = 0;
    343    
     381
    344382    m_pcPicEncoder->preLoopFilterPicAll( rpcPic, uiPicDist, uiALFBits );
    345    
     383
    346384    // compute RD cost and choose the best
    347385    dPicRdCost = m_pcRdCost->calcRdCost64( m_uiPicTotalBits + uiALFBits, uiPicDist, true, DF_SSE_FRAME);
    348    
     386
    349387    if ( dPicRdCost < dPicRdCostBest )
    350388    {
     
    352390      dPicRdCostBest = dPicRdCost;
    353391      dSumCURdCostBest = m_dPicRdCost;
    354      
     392
    355393      uiPicBitsBest = m_uiPicTotalBits + uiALFBits;
    356394      uiPicDistBest = uiPicDist;
    357395    }
    358396  }
    359  
     397
    360398  // set best values
    361399  pcSlice       ->setSliceQp             ( m_piRdPicQp    [uiQpIdxBest] );
     
    363401  m_pcTrQuant   ->setLambda              ( m_pdRdPicLambda[uiQpIdxBest] );
    364402  pcSlice       ->setLambda              ( m_pdRdPicLambda[uiQpIdxBest] );
     403#if HHI_INTER_VIEW_MOTION_PRED
    365404  m_pcRdCost    ->setLambdaMVReg         ( m_pdRdPicLambda[uiQpIdxBest] * m_pcCfg->getMultiviewMvRegLambdaScale() );
     405#endif
    366406}
    367407
     
    377417  TComSlice* pcSlice            = rpcPic->getSlice(getSliceIdx());
    378418  xDetermineStartAndBoundingCUAddr ( uiStartCUAddr, uiBoundingCUAddr, rpcPic, false );
    379  
     419
    380420#ifdef WEIGHT_PRED
    381421  //------------------------------------------------------------------------------
     
    411451  m_dPicRdCost      = 0;
    412452  m_uiPicDist       = 0;
    413  
     453
    414454  // set entropy coder
    415455  if( m_pcCfg->getUseSBACRD() )
     
    430470    m_pcEntropyCoder->setBitstream    ( m_pcBitCounter );
    431471  }
    432  
     472
    433473  // initialize ALF parameters
    434474  m_pcEntropyCoder->setAlfCtrl(false);
    435475  m_pcEntropyCoder->setMaxAlfCtrlDepth(0); //unnecessary
    436  
     476
    437477  // for every CU in slice
    438478  for(  uiCUAddr = uiStartCUAddr; uiCUAddr < uiBoundingCUAddr; uiCUAddr++  )
     
    443483    TComDataCU*& pcCU = rpcPic->getCU( uiCUAddr );
    444484    pcCU->initCU( rpcPic, uiCUAddr );
    445    
     485
    446486    // if RD based on SBAC is used
    447487    if( m_pcCfg->getUseSBACRD() )
     
    450490      m_pcEntropyCoder->setEntropyCoder ( m_pcRDGoOnSbacCoder, pcSlice );
    451491      m_pcEntropyCoder->setBitstream    ( m_pcBitCounter );
    452      
     492
    453493      // run CU encoder
    454494      m_pcCuEncoder->compressCU( pcCU );
    455      
     495
    456496      // restore entropy coder to an initial stage
    457497      m_pcEntropyCoder->setEntropyCoder ( m_pppcRDSbacCoder[0][CI_CURR_BEST], pcSlice );
    458498      m_pcEntropyCoder->setBitstream    ( m_pcBitCounter );
    459499      pppcRDSbacCoder->setBinCountingEnableFlag( true );
    460      
     500
    461501      m_pcCuEncoder->encodeCU( pcCU );
    462502
     
    474514        break;
    475515      }
    476      
     516
    477517      UInt uiBinsCoded = pppcRDSbacCoder->getBinsCoded();
    478518      if (m_pcCfg->getEntropySliceMode()==SHARP_MULTIPLE_CONSTRAINT_BASED_ENTROPY_SLICE && uiBinsCoded > m_pcCfg->getEntropySliceArgument())
     
    494534      m_pcCavlcCoder ->setAdaptFlag(true);
    495535      m_pcCuEncoder->encodeCU( pcCU );
    496      
     536
    497537      uiBitsCoded += m_pcBitCounter->getNumberOfWrittenBits();
    498538      if (m_pcCfg->getSliceMode()==AD_HOC_SLICES_FIXED_NUMBER_OF_BYTES_IN_SLICE && ( ( pcSlice->getSliceBits() + uiBitsCoded ) >> 3 ) > m_pcCfg->getSliceArgument())
     
    521561      m_pcCavlcCoder ->setAdaptFlag(false);
    522562    }
    523    
     563
    524564    m_uiPicTotalBits += pcCU->getTotalBits();
    525565    m_dPicRdCost     += pcCU->getTotalCost();
     
    556596    m_pcEntropyCoder->resetEntropy();
    557597  }
    558  
     598
    559599  // set bitstream
    560600  m_pcEntropyCoder->setBitstream( rpcBitstream );
     
    588628#if ENC_DEC_TRACE
    589629    g_bJustDoIt = g_bEncDecTraceDisable;
    590 #endif   
     630#endif
    591631  }
    592632}
     
    603643  UInt uiNumberOfCUsInFrame = rpcPic->getNumCUsInFrame();
    604644  uiBoundingCUAddrSlice     = uiNumberOfCUsInFrame;
    605   if (bEncodeSlice) 
     645  if (bEncodeSlice)
    606646  {
    607647    UInt uiCUAddrIncrement;
     
    620660      uiBoundingCUAddrSlice    = uiNumberOfCUsInFrame;
    621661      break;
    622     } 
     662    }
    623663    pcSlice->setSliceCurEndCUAddr( uiBoundingCUAddrSlice );
    624664  }
     
    636676      uiBoundingCUAddrSlice    = uiNumberOfCUsInFrame;
    637677      break;
    638     } 
     678    }
    639679    pcSlice->setSliceCurEndCUAddr( uiBoundingCUAddrSlice );
    640680  }
     
    644684  uiStartCUAddrEntropySlice    = pcSlice->getEntropySliceCurStartCUAddr();
    645685  uiBoundingCUAddrEntropySlice = uiNumberOfCUsInFrame;
    646   if (bEncodeSlice) 
     686  if (bEncodeSlice)
    647687  {
    648688    UInt uiCUAddrIncrement;
     
    661701      uiBoundingCUAddrEntropySlice    = uiNumberOfCUsInFrame;
    662702      break;
    663     } 
     703    }
    664704    pcSlice->setEntropySliceCurEndCUAddr( uiBoundingCUAddrEntropySlice );
    665705  }
     
    677717      uiBoundingCUAddrEntropySlice    = uiNumberOfCUsInFrame;
    678718      break;
    679     } 
     719    }
    680720    pcSlice->setEntropySliceCurEndCUAddr( uiBoundingCUAddrEntropySlice );
    681721  }
  • trunk/source/Lib/TLibEncoder/TEncSlice.h

    r2 r5  
     1/* The copyright in this software is being made available under the BSD
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license.
     5 *
     6 * Copyright (c) 2010-2011, ISO/IEC
     7 * All rights reserved.
     8 *