Changeset 5 in 3DVCSoftware for trunk/source/Lib/TLibCommon
- Timestamp:
- 12 Dec 2011, 18:35:44 (15 years ago)
- Location:
- trunk/source/Lib/TLibCommon
- Files:
-
- 55 edited
-
CommonDef.h (modified) (7 diffs)
-
ContextModel.cpp (modified) (1 diff)
-
ContextModel.h (modified) (1 diff)
-
ContextModel3DBuffer.cpp (modified) (1 diff)
-
ContextModel3DBuffer.h (modified) (1 diff)
-
ContextTables.h (modified) (5 diffs)
-
SEI.h (modified) (1 diff)
-
TComAdaptiveLoopFilter.cpp (modified) (4 diffs)
-
TComAdaptiveLoopFilter.h (modified) (3 diffs)
-
TComBitCounter.h (modified) (1 diff)
-
TComBitStream.cpp (modified) (1 diff)
-
TComBitStream.h (modified) (1 diff)
-
TComCABACTables.cpp (modified) (1 diff)
-
TComCABACTables.h (modified) (1 diff)
-
TComDataCU.cpp (modified) (78 diffs)
-
TComDataCU.h (modified) (14 diffs)
-
TComDepthMapGenerator.cpp (modified) (7 diffs)
-
TComDepthMapGenerator.h (modified) (5 diffs)
-
TComList.h (modified) (1 diff)
-
TComLoopFilter.cpp (modified) (1 diff)
-
TComLoopFilter.h (modified) (1 diff)
-
TComMVDRefData.cpp (modified) (5 diffs)
-
TComMVDRefData.h (modified) (6 diffs)
-
TComMotionInfo.cpp (modified) (1 diff)
-
TComMotionInfo.h (modified) (1 diff)
-
TComMv.h (modified) (1 diff)
-
TComPattern.cpp (modified) (13 diffs)
-
TComPattern.h (modified) (6 diffs)
-
TComPic.cpp (modified) (17 diffs)
-
TComPic.h (modified) (11 diffs)
-
TComPicSym.h (modified) (1 diff)
-
TComPicYuv.h (modified) (1 diff)
-
TComPicYuvMD5.cpp (modified) (1 diff)
-
TComPredFilter.cpp (modified) (1 diff)
-
TComPredFilter.h (modified) (1 diff)
-
TComPrediction.cpp (modified) (17 diffs)
-
TComPrediction.h (modified) (5 diffs)
-
TComRdCost.cpp (modified) (35 diffs)
-
TComRdCost.h (modified) (9 diffs)
-
TComRdCostWeightPrediction.cpp (modified) (3 diffs)
-
TComRdCostWeightPrediction.h (modified) (1 diff)
-
TComResidualGenerator.cpp (modified) (3 diffs)
-
TComResidualGenerator.h (modified) (3 diffs)
-
TComRom.cpp (modified) (9 diffs)
-
TComRom.h (modified) (9 diffs)
-
TComSlice.cpp (modified) (26 diffs)
-
TComSlice.h (modified) (32 diffs)
-
TComTrQuant.cpp (modified) (1 diff)
-
TComTrQuant.h (modified) (1 diff)
-
TComWedgelet.cpp (modified) (2 diffs)
-
TComWedgelet.h (modified) (1 diff)
-
TComWeightPrediction.cpp (modified) (1 diff)
-
TComYuv.cpp (modified) (4 diffs)
-
TComYuv.h (modified) (3 diffs)
-
TypeDef.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/CommonDef.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 1 34 2 35 … … 15 48 #include "TComRom.h" 16 49 17 // SB18 50 #include <string> 19 51 #include <assert.h> … … 26 58 27 59 #define HM_VERSION "3.0rc2" ///< Current software version 28 #define NV_VERSION "0.3 1r4" ///< Current software version60 #define NV_VERSION "0.37" ///< Current software version 29 61 30 62 // ==================================================================================================================== … … 70 102 71 103 72 #define SEBASTIAN 173 #if SEBASTIAN74 #define SB_INTERVIEW_SKIP 175 #define SB_INTERVIEW_SKIP_LAMBDA_SCALE 176 #define SB_MEM_FIX 177 #define SB_NO_LowDelayCoding 0 // noch offen in motionestimation78 #endif79 80 #define GERHARD 181 #if GERHARD82 #define GERHARD_VQM_XCHECK 083 #define GERHARD_RM_DEBUG_MM 084 #define GERHARD_RM_HOLE_EXT 085 #define GERHARD_RM_COLOR_PLANES 186 #define GERHARD_RM_SPLAT 187 #endif88 89 90 104 // ==================================================================================================================== 91 105 // Common constants … … 116 130 #define STD_CAM_PARAMETERS_PRECISION 5 ///< quarter luma sample accuarcy for derived disparities (as default) 117 131 118 // SB119 132 #define MAX_INPUT_VIEW_NUM 10 ///< max. number of input view for multiview coding 120 133 121 // GT 134 #if HHI_VSO 122 135 #define MAX_ERREF_VIEW_NUM 15 ///< max. number of virtual external reference views 136 #endif 123 137 #define LOG2_DISP_PREC_LUT 2 ///< log2 of disparity precision used in integer disparity LUTs 124 138 139 140 #if ( HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED ) 141 #define DEPTH_MAP_GENERATION 1 142 #else 143 #define DEPTH_MAP_GENERATION 0 144 #endif 125 145 126 146 //>>>>> generation and usage of virtual prediction depth maps >>>>> … … 151 171 #define OUTPUT_RESIDUAL_PICTURES 0 // output residual pictures (for debugging) 152 172 153 #define MVI_MERGE_POS 0 // position of mvi in merge list (0..5)173 #define HHI_MPI_MERGE_POS 0 // position of mvi in merge list (0..5) 154 174 155 175 … … 298 318 #endif 299 319 300 // SB from ViCo for formatted string parsing301 320 302 321 class VideoCodecException -
trunk/source/Lib/TLibCommon/ContextModel.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/ContextModel.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/ContextModel3DBuffer.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/ContextModel3DBuffer.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/ContextTables.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 1 34 2 35 … … 14 47 15 48 #define NUM_SPLIT_FLAG_CTX 3 ///< number of context models for split flag 16 #if MW_MVI_SIGNALLING_MODE == 017 #define NUM_MVI_FLAG_CTX 3 ///< number of context models for motion inheritance flag18 #endif19 49 #define NUM_SKIP_FLAG_CTX 3 ///< number of context models for skip flag 20 50 … … 72 102 #define NUM_VIEW_IDX_CTX 6 73 103 74 #if HHI_DMM_ INTRA104 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 75 105 #define NUM_DMM_CTX 2 76 106 #define NUM_WEDGE_CTX 4 … … 120 150 } 121 151 }; 122 123 #if MW_MVI_SIGNALLING_MODE == 0124 // initial probability for skip flag125 static const Short126 INIT_MVI_FLAG[3][NUM_MVI_FLAG_CTX][2] =127 {128 {129 { 0, 64 }, { 0, 64 }, { 0, 64 }130 },131 {132 { 0, 64 }, { 0, 64 }, { 0, 64 }133 },134 {135 { 0, 64 }, { 0, 64 }, { 0, 64 }136 }137 };138 #endif139 152 140 153 // initial probability for skip flag … … 1324 1337 }; 1325 1338 1326 #if HHI_DMM_ INTRA1339 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1327 1340 static const Short 1328 1341 INIT_INTRA_DMM[3][NUM_DMM_CTX][2] = -
trunk/source/Lib/TLibCommon/SEI.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComAdaptiveLoopFilter.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 1 34 2 35 … … 278 311 m_bUseNonCrossALF = false; 279 312 #endif 280 #if SB_MEM_FIX281 313 m_bIsCreated = false; 282 #endif283 314 } 284 315 … … 471 502 Void TComAdaptiveLoopFilter::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ) 472 503 { 473 #if SB_MEM_FIX474 504 m_bIsCreated = true; 475 #endif476 505 if ( !m_pcTempPicYuv ) 477 506 { … … 514 543 Void TComAdaptiveLoopFilter::destroy() 515 544 { 516 #if SB_MEM_FIX517 545 m_bIsCreated = false ; 518 #endif519 546 if ( m_pcTempPicYuv ) 520 547 { -
trunk/source/Lib/TLibCommon/TComAdaptiveLoopFilter.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 1 34 2 35 … … 336 369 Bool m_bIsFirstDecodedSlice; 337 370 338 #if SB_MEM_FIX339 371 Bool m_bIsCreated; 340 #endif341 372 Void xFilterOneSlice (CAlfSlice* pSlice, imgpel* pDec, imgpel* pRest, Int iStride, ALFParam* pcAlfParam); 342 373 Void calcVarforOneSlice (CAlfSlice* pSlice, imgpel **imgY_var, imgpel *imgY_pad, Int pad_size, Int fl, Int img_stride); … … 408 439 Void destroy (); 409 440 410 #if SB_MEM_FIX411 441 Bool isCreated() { return m_bIsCreated;} 412 #endif413 442 // alloc & free & set functions 414 443 Void allocALFParam ( ALFParam* pAlfParam ); -
trunk/source/Lib/TLibCommon/TComBitCounter.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComBitStream.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComBitStream.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComCABACTables.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComCABACTables.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComDataCU.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 1 34 2 35 … … 20 53 m_pcSlice = NULL; 21 54 m_puhDepth = NULL; 55 #if HHI_MPI 22 56 m_piTextureModeDepth = NULL; 57 #endif 23 58 24 59 m_pePartSize = NULL; … … 31 66 m_pbMergeFlag = NULL; 32 67 m_puhMergeIndex = NULL; 68 #if HHI_INTER_VIEW_RESIDUAL_PRED 33 69 m_pbResPredAvailable = NULL; 34 70 m_pbResPredFlag = NULL; 71 #endif 35 72 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ui++ ) 36 73 { … … 71 108 #endif//SNY_DQP 72 109 73 #if HHI_DMM_ INTRA110 #if HHI_DMM_WEDGE_INTRA 74 111 m_puiWedgeFullTabIdx = NULL; 75 112 m_piWedgeFullDeltaDC1 = NULL; … … 80 117 m_piWedgePredDirDeltaDC2 = NULL; 81 118 m_piWedgePredDirDeltaEnd = NULL; 82 119 #endif 120 #if HHI_DMM_PRED_TEX 83 121 m_puiWedgePredTexTabIdx = NULL; 84 122 m_piWedgePredTexDeltaDC1 = NULL; … … 87 125 m_piContourPredTexDeltaDC1 = NULL; 88 126 m_piContourPredTexDeltaDC2 = NULL; 89 90 m_pbTextureModesAllowed = NULL;91 127 #endif 92 128 } … … 108 144 m_phQP = (UChar* )xMalloc(UChar, uiNumPartition); 109 145 m_puhDepth = (UChar* )xMalloc(UChar, uiNumPartition); 146 #if HHI_MPI 110 147 m_piTextureModeDepth = (Int* )xMalloc(Int, uiNumPartition); 148 #endif 111 149 m_puhWidth = (UChar* )xMalloc(UChar, uiNumPartition); 112 150 m_puhHeight = (UChar* )xMalloc(UChar, uiNumPartition); … … 118 156 m_pbMergeFlag = (Bool* )xMalloc(Bool, uiNumPartition); 119 157 m_puhMergeIndex = (UChar* )xMalloc(UChar, uiNumPartition); 158 #if HHI_INTER_VIEW_RESIDUAL_PRED 120 159 m_pbResPredAvailable = (Bool* )xMalloc(Bool, uiNumPartition); 121 160 m_pbResPredFlag = (Bool* )xMalloc(Bool, uiNumPartition); 161 #endif 122 162 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ui++ ) 123 163 { … … 147 187 m_acCUMvField[1].create( uiNumPartition ); 148 188 149 #if HHI_DMM_ INTRA150 m_puiWedgeFullTabIdx = (UInt* )xMalloc(UInt,uiNumPartition);189 #if HHI_DMM_WEDGE_INTRA 190 m_puiWedgeFullTabIdx = (UInt*)xMalloc(UInt, uiNumPartition); 151 191 m_piWedgeFullDeltaDC1 = (Int* )xMalloc(Int, uiNumPartition); 152 192 m_piWedgeFullDeltaDC2 = (Int* )xMalloc(Int, uiNumPartition); … … 156 196 m_piWedgePredDirDeltaDC2 = (Int* )xMalloc(Int, uiNumPartition); 157 197 m_piWedgePredDirDeltaEnd = (Int* )xMalloc(Int, uiNumPartition); 158 198 #endif 199 #if HHI_DMM_PRED_TEX 159 200 m_puiWedgePredTexTabIdx = (UInt*)xMalloc(UInt, uiNumPartition); 160 201 m_piWedgePredTexDeltaDC1 = (Int* )xMalloc(Int, uiNumPartition); … … 163 204 m_piContourPredTexDeltaDC1 = (Int* )xMalloc(Int, uiNumPartition); 164 205 m_piContourPredTexDeltaDC2 = (Int* )xMalloc(Int, uiNumPartition); 165 166 m_pbTextureModesAllowed = (Bool*)xMalloc(Bool, uiNumPartition);167 206 #endif 168 207 } … … 203 242 if ( m_phQP ) { xFree(m_phQP); m_phQP = NULL; } 204 243 if ( m_puhDepth ) { xFree(m_puhDepth); m_puhDepth = NULL; } 244 #if HHI_MPI 205 245 if ( m_piTextureModeDepth ) { xFree(m_piTextureModeDepth); m_piTextureModeDepth= NULL; } 246 #endif 206 247 if ( m_puhWidth ) { xFree(m_puhWidth); m_puhWidth = NULL; } 207 248 if ( m_puhHeight ) { xFree(m_puhHeight); m_puhHeight = NULL; } … … 215 256 if ( m_pbMergeFlag ) { xFree(m_pbMergeFlag); m_pbMergeFlag = NULL; } 216 257 if ( m_puhMergeIndex ) { xFree(m_puhMergeIndex); m_puhMergeIndex = NULL; } 258 #if HHI_INTER_VIEW_RESIDUAL_PRED 217 259 if ( m_pbResPredAvailable ) { xFree(m_pbResPredAvailable); m_pbResPredAvailable= NULL; } 218 260 if ( m_pbResPredFlag ) { xFree(m_pbResPredFlag); m_pbResPredFlag = NULL; } 261 #endif 219 262 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ui++ ) 220 263 { … … 235 278 m_acCUMvField[1].destroy(); 236 279 237 #if HHI_DMM_ INTRA280 #if HHI_DMM_WEDGE_INTRA 238 281 if ( m_puiWedgeFullTabIdx ) { xFree(m_puiWedgeFullTabIdx); m_puiWedgeFullTabIdx = NULL; } 239 282 if ( m_piWedgeFullDeltaDC1 ) { xFree(m_piWedgeFullDeltaDC1); m_piWedgeFullDeltaDC1 = NULL; } … … 244 287 if ( m_piWedgePredDirDeltaDC1 ) { xFree(m_piWedgePredDirDeltaDC1); m_piWedgePredDirDeltaDC1 = NULL; } 245 288 if ( m_piWedgePredDirDeltaDC2 ) { xFree(m_piWedgePredDirDeltaDC2); m_piWedgePredDirDeltaDC2 = NULL; } 246 289 #endif 290 #if HHI_DMM_PRED_TEX 247 291 if ( m_puiWedgePredTexTabIdx ) { xFree(m_puiWedgePredTexTabIdx); m_puiWedgePredTexTabIdx = NULL; } 248 292 if ( m_piWedgePredTexDeltaDC1 ) { xFree(m_piWedgePredTexDeltaDC1); m_piWedgePredTexDeltaDC1 = NULL; } … … 251 295 if ( m_piContourPredTexDeltaDC1 ) { xFree(m_piContourPredTexDeltaDC1); m_piContourPredTexDeltaDC1 = NULL; } 252 296 if ( m_piContourPredTexDeltaDC2 ) { xFree(m_piContourPredTexDeltaDC2); m_piContourPredTexDeltaDC2 = NULL; } 253 254 if ( m_pbTextureModesAllowed ) { xFree(m_pbTextureModesAllowed ); m_pbTextureModesAllowed = NULL; }255 297 #endif 256 298 } … … 308 350 memset( m_pbMergeFlag, 0, iSizeInBool ); 309 351 memset( m_puhMergeIndex, 0, iSizeInUchar ); 352 #if HHI_INTER_VIEW_RESIDUAL_PRED 310 353 memset( m_pbResPredAvailable, 0, iSizeInBool ); 311 354 memset( m_pbResPredFlag, 0, iSizeInBool ); 355 #endif 312 356 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ui++ ) 313 357 { … … 322 366 memset( m_puhCbf[2], 0, iSizeInUchar ); 323 367 memset( m_puhDepth, 0, iSizeInUchar ); 368 #if HHI_MPI 324 369 memset( m_piTextureModeDepth,-1, iSizeInInt ); 370 #endif 325 371 326 372 UChar uhWidth = g_uiMaxCUWidth; … … 390 436 } 391 437 392 #if HHI_DMM_ INTRA438 #if HHI_DMM_WEDGE_INTRA 393 439 memset( m_puiWedgeFullTabIdx, 0, iSizeInUInt ); 394 440 memset( m_piWedgeFullDeltaDC1, 0, iSizeInInt ); … … 399 445 memset( m_piWedgePredDirDeltaDC2, 0, iSizeInInt ); 400 446 memset( m_piWedgePredDirDeltaEnd, 0, iSizeInInt ); 401 447 #endif 448 #if HHI_DMM_PRED_TEX 402 449 memset( m_puiWedgePredTexTabIdx, 0, iSizeInUInt ); 403 450 memset( m_piWedgePredTexDeltaDC1, 0, iSizeInInt ); … … 406 453 memset( m_piContourPredTexDeltaDC1, 0, iSizeInInt ); 407 454 memset( m_piContourPredTexDeltaDC2, 0, iSizeInInt ); 408 409 memset( m_pbTextureModesAllowed, false, iSizeInBool );410 455 #endif 411 456 } … … 426 471 memset( m_pbMergeFlag, 0, iSizeInBool ); 427 472 memset( m_puhMergeIndex, 0, iSizeInUchar ); 473 #if HHI_INTER_VIEW_RESIDUAL_PRED 428 474 memset( m_pbResPredAvailable, 0, iSizeInBool ); 429 475 memset( m_pbResPredFlag, 0, iSizeInBool ); 476 #endif 430 477 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ui++ ) 431 478 { … … 461 508 m_acCUMvField[1].clearMvField(); 462 509 463 #if HHI_DMM_ INTRA510 #if HHI_DMM_WEDGE_INTRA 464 511 memset( m_puiWedgeFullTabIdx, 0, iSizeInUInt ); 465 512 memset( m_piWedgeFullDeltaDC1, 0, iSizeInInt ); … … 470 517 memset( m_piWedgePredDirDeltaDC2, 0, iSizeInInt ); 471 518 memset( m_piWedgePredDirDeltaEnd, 0, iSizeInInt ); 472 519 #endif 520 #if HHI_DMM_PRED_TEX 473 521 memset( m_puiWedgePredTexTabIdx, 0, iSizeInUInt ); 474 522 memset( m_piWedgePredTexDeltaDC1, 0, iSizeInInt ); … … 477 525 memset( m_piContourPredTexDeltaDC1, 0, iSizeInInt ); 478 526 memset( m_piContourPredTexDeltaDC2, 0, iSizeInInt ); 479 480 memset( m_pbTextureModesAllowed, false, iSizeInBool );481 527 #endif 482 528 529 #if HHI_MPI 483 530 memset( m_piTextureModeDepth, -1, iSizeInInt ); 531 #endif 484 532 } 485 533 … … 513 561 memset( m_pbMergeFlag, 0, iSizeInBool ); 514 562 memset( m_puhMergeIndex, 0, iSizeInUchar ); 563 #if HHI_INTER_VIEW_RESIDUAL_PRED 515 564 memset( m_pbResPredAvailable, 0, iSizeInBool ); 516 565 memset( m_pbResPredFlag, 0, iSizeInBool ); 566 #endif 517 567 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ui++ ) 518 568 { … … 527 577 memset( m_puhCbf[2], 0, iSizeInUchar ); 528 578 memset( m_puhDepth, uiDepth, iSizeInUchar ); 579 #if HHI_MPI 529 580 memset( m_piTextureModeDepth, -1, iSizeInInt ); 581 #endif 530 582 531 583 UChar uhWidth = g_uiMaxCUWidth >> uiDepth; … … 565 617 m_uiEntropySliceStartCU = pcCU->getEntropySliceStartCU(); 566 618 567 #if HHI_DMM_ INTRA619 #if HHI_DMM_WEDGE_INTRA 568 620 memset( m_puiWedgeFullTabIdx, 0, iSizeInUInt ); 569 621 memset( m_piWedgeFullDeltaDC1, 0, iSizeInInt ); … … 574 626 memset( m_piWedgePredDirDeltaDC2, 0, iSizeInInt ); 575 627 memset( m_piWedgePredDirDeltaEnd, 0, iSizeInInt ); 576 628 #endif 629 #if HHI_DMM_PRED_TEX 577 630 memset( m_puiWedgePredTexTabIdx, 0, iSizeInUInt ); 578 631 memset( m_piWedgePredTexDeltaDC1, 0, iSizeInInt ); … … 581 634 memset( m_piContourPredTexDeltaDC1, 0, iSizeInInt ); 582 635 memset( m_piContourPredTexDeltaDC2, 0, iSizeInInt ); 583 584 memset( m_pbTextureModesAllowed, false, iSizeInBool );585 636 #endif 586 637 } … … 611 662 m_pbMergeFlag = pcCU->getMergeFlag() + uiPart; 612 663 m_puhMergeIndex = pcCU->getMergeIndex() + uiPart; 664 #if HHI_INTER_VIEW_RESIDUAL_PRED 613 665 m_pbResPredAvailable = pcCU->getResPredAvail() + uiPart; 614 666 m_pbResPredFlag = pcCU->getResPredFlag () + uiPart; 667 #endif 615 668 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ui++ ) 616 669 { … … 630 683 m_puhWidth=pcCU->getWidth() + uiPart; 631 684 m_puhHeight=pcCU->getHeight() + uiPart; 685 #if HHI_MPI 632 686 m_piTextureModeDepth=pcCU->getTextureModeDepth()+ uiPart; 687 #endif 633 688 634 689 m_apiMVPIdx[0]=pcCU->getMVPIdx(REF_PIC_LIST_0) + uiPart; … … 667 722 m_uiEntropySliceStartCU = pcCU->getEntropySliceStartCU(); 668 723 669 #if HHI_DMM_ INTRA724 #if HHI_DMM_WEDGE_INTRA 670 725 m_puiWedgeFullTabIdx = pcCU->getWedgeFullTabIdx() + uiPart; 671 726 m_piWedgeFullDeltaDC1 = pcCU->getWedgeFullDeltaDC1() + uiPart; … … 676 731 m_piWedgePredDirDeltaDC2 = pcCU->getWedgePredDirDeltaDC2() + uiPart; 677 732 m_piWedgePredDirDeltaEnd = pcCU->getWedgePredDirDeltaEnd() + uiPart; 678 733 #endif 734 #if HHI_DMM_PRED_TEX 679 735 m_puiWedgePredTexTabIdx = pcCU->getWedgePredTexTabIdx() + uiPart; 680 736 m_piWedgePredTexDeltaDC1 = pcCU->getWedgePredTexDeltaDC1() + uiPart; … … 683 739 m_piContourPredTexDeltaDC1 = pcCU->getContourPredTexDeltaDC1() + uiPart; 684 740 m_piContourPredTexDeltaDC2 = pcCU->getContourPredTexDeltaDC2() + uiPart; 685 686 m_pbTextureModesAllowed = pcCU->getTextureModeAllowance() + uiPart;687 741 #endif 688 742 } … … 718 772 m_pbMergeFlag = pcCU->getMergeFlag() + uiAbsPartIdx; 719 773 m_puhMergeIndex = pcCU->getMergeIndex() + uiAbsPartIdx; 774 #if HHI_INTER_VIEW_RESIDUAL_PRED 720 775 m_pbResPredAvailable = pcCU->getResPredAvail() + uiAbsPartIdx; 721 776 m_pbResPredFlag = pcCU->getResPredFlag () + uiAbsPartIdx; 777 #endif 722 778 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ui ++ ) 723 779 { … … 731 787 m_acCUMvField[eRefPicList].setMvdPtr(pcCU->getCUMvField(eRefPicList)->getMvd() + uiAbsPartIdx); 732 788 m_acCUMvField[eRefPicList].setRefIdxPtr(pcCU->getCUMvField(eRefPicList)->getRefIdx() + uiAbsPartIdx); 789 #if HHI_MPI 733 790 m_piTextureModeDepth = pcCU->getTextureModeDepth() + uiAbsPartIdx; 791 #endif 734 792 735 793 m_uiSliceStartCU = pcCU->getSliceStartCU(); … … 762 820 memcpy( m_pbMergeFlag + uiOffset, pcCU->getMergeFlag(), iSizeInBool ); 763 821 memcpy( m_puhMergeIndex + uiOffset, pcCU->getMergeIndex(), iSizeInUchar ); 822 #if HHI_INTER_VIEW_RESIDUAL_PRED 764 823 memcpy( m_pbResPredAvailable + uiOffset, pcCU->getResPredAvail(), iSizeInBool ); 765 824 memcpy( m_pbResPredFlag + uiOffset, pcCU->getResPredFlag(), iSizeInBool ); 825 #endif 766 826 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ui++ ) 767 827 { … … 807 867 m_uiEntropySliceStartCU = pcCU->getEntropySliceStartCU(); 808 868 809 #if HHI_DMM_ INTRA869 #if HHI_DMM_WEDGE_INTRA 810 870 memcpy( m_puiWedgeFullTabIdx + uiOffset, pcCU->getWedgeFullTabIdx(), iSizeInUInt ); 811 871 memcpy( m_piWedgeFullDeltaDC1 + uiOffset, pcCU->getWedgeFullDeltaDC1(), iSizeInInt ); … … 816 876 memcpy( m_piWedgePredDirDeltaDC2 + uiOffset, pcCU->getWedgePredDirDeltaDC2(), iSizeInInt ); 817 877 memcpy( m_piWedgePredDirDeltaEnd + uiOffset, pcCU->getWedgePredDirDeltaEnd(), iSizeInInt ); 818 878 #endif 879 #if HHI_DMM_PRED_TEX 819 880 memcpy( m_puiWedgePredTexTabIdx + uiOffset, pcCU->getWedgePredTexTabIdx(), iSizeInUInt ); 820 881 memcpy( m_piWedgePredTexDeltaDC1 + uiOffset, pcCU->getWedgePredTexDeltaDC1(), iSizeInInt ); … … 823 884 memcpy( m_piContourPredTexDeltaDC1 + uiOffset, pcCU->getContourPredTexDeltaDC1(), iSizeInInt ); 824 885 memcpy( m_piContourPredTexDeltaDC2 + uiOffset, pcCU->getContourPredTexDeltaDC2(), iSizeInInt ); 825 826 memcpy( m_pbTextureModesAllowed + uiOffset, pcCU->getTextureModeAllowance(), iSizeInBool ); 827 #endif 828 886 #endif 887 888 #if HHI_MPI 829 889 memcpy( m_piTextureModeDepth + uiOffset, pcCU->getTextureModeDepth(), iSizeInInt ); 890 #endif 830 891 } 831 892 … … 854 915 memcpy( rpcCU->getMergeFlag() + m_uiAbsIdxInLCU, m_pbMergeFlag, iSizeInBool ); 855 916 memcpy( rpcCU->getMergeIndex() + m_uiAbsIdxInLCU, m_puhMergeIndex, iSizeInUchar ); 917 #if HHI_INTER_VIEW_RESIDUAL_PRED 856 918 memcpy( rpcCU->getResPredAvail() + m_uiAbsIdxInLCU, m_pbResPredAvailable, iSizeInBool ); 857 919 memcpy( rpcCU->getResPredFlag() + m_uiAbsIdxInLCU, m_pbResPredFlag, iSizeInBool ); 920 #endif 858 921 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ui++ ) 859 922 { … … 891 954 rpcCU->setEntropySliceStartCU( m_uiEntropySliceStartCU ); 892 955 893 #if HHI_DMM_ INTRA956 #if HHI_DMM_WEDGE_INTRA 894 957 memcpy( rpcCU->getWedgeFullTabIdx() + m_uiAbsIdxInLCU, m_puiWedgeFullTabIdx, iSizeInUInt ); 895 958 memcpy( rpcCU->getWedgeFullDeltaDC1() + m_uiAbsIdxInLCU, m_piWedgeFullDeltaDC1, iSizeInInt ); … … 900 963 memcpy( rpcCU->getWedgePredDirDeltaDC2() + m_uiAbsIdxInLCU, m_piWedgePredDirDeltaDC2, iSizeInInt ); 901 964 memcpy( rpcCU->getWedgePredDirDeltaEnd() + m_uiAbsIdxInLCU, m_piWedgePredDirDeltaEnd, iSizeInInt ); 902 965 #endif 966 #if HHI_DMM_PRED_TEX 903 967 memcpy( rpcCU->getWedgePredTexTabIdx() + m_uiAbsIdxInLCU, m_puiWedgePredTexTabIdx, iSizeInUInt ); 904 968 memcpy( rpcCU->getWedgePredTexDeltaDC1() + m_uiAbsIdxInLCU, m_piWedgePredTexDeltaDC1, iSizeInInt ); … … 907 971 memcpy( rpcCU->getContourPredTexDeltaDC1() + m_uiAbsIdxInLCU, m_piContourPredTexDeltaDC1, iSizeInInt ); 908 972 memcpy( rpcCU->getContourPredTexDeltaDC2() + m_uiAbsIdxInLCU, m_piContourPredTexDeltaDC2, iSizeInInt ); 909 910 memcpy( rpcCU->getTextureModeAllowance() + m_uiAbsIdxInLCU, m_pbTextureModesAllowed, iSizeInBool ); 911 #endif 912 973 #endif 974 975 #if HHI_MPI 913 976 memcpy( rpcCU->getTextureModeDepth() + m_uiAbsIdxInLCU, m_piTextureModeDepth, iSizeInInt ); 977 #endif 914 978 } 915 979 … … 939 1003 memcpy( rpcCU->getMergeFlag() + uiPartOffset, m_pbMergeFlag, iSizeInBool ); 940 1004 memcpy( rpcCU->getMergeIndex() + uiPartOffset, m_puhMergeIndex, iSizeInUchar ); 1005 #if HHI_INTER_VIEW_RESIDUAL_PRED 941 1006 memcpy( rpcCU->getResPredAvail() + uiPartOffset, m_pbResPredAvailable, iSizeInBool ); 942 1007 memcpy( rpcCU->getResPredFlag() + uiPartOffset, m_pbResPredFlag, iSizeInBool ); 1008 #endif 943 1009 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ui++ ) 944 1010 { … … 975 1041 rpcCU->setEntropySliceStartCU( m_uiEntropySliceStartCU ); 976 1042 977 #if HHI_DMM_ INTRA1043 #if HHI_DMM_WEDGE_INTRA 978 1044 memcpy( rpcCU->getWedgeFullTabIdx() + uiPartOffset, m_puiWedgeFullTabIdx, iSizeInUInt ); 979 1045 memcpy( rpcCU->getWedgeFullDeltaDC1() + uiPartOffset, m_piWedgeFullDeltaDC1, iSizeInInt ); … … 984 1050 memcpy( rpcCU->getWedgePredDirDeltaDC2() + uiPartOffset, m_piWedgePredDirDeltaDC2, iSizeInInt ); 985 1051 memcpy( rpcCU->getWedgePredDirDeltaEnd() + uiPartOffset, m_piWedgePredDirDeltaEnd, iSizeInInt ); 986 1052 #endif 1053 #if HHI_DMM_PRED_TEX 987 1054 memcpy( rpcCU->getWedgePredTexTabIdx() + uiPartOffset, m_puiWedgePredTexTabIdx, iSizeInUInt ); 988 1055 memcpy( rpcCU->getWedgePredTexDeltaDC1() + uiPartOffset, m_piWedgePredTexDeltaDC1, iSizeInInt ); … … 991 1058 memcpy( rpcCU->getContourPredTexDeltaDC1() + uiPartOffset, m_piContourPredTexDeltaDC1, iSizeInInt ); 992 1059 memcpy( rpcCU->getContourPredTexDeltaDC2() + uiPartOffset, m_piContourPredTexDeltaDC2, iSizeInInt ); 993 994 memcpy( rpcCU->getTextureModeAllowance() + uiPartOffset, m_pbTextureModesAllowed, iSizeInBool ); 995 #endif 996 1060 #endif 1061 1062 #if HHI_MPI 997 1063 memcpy( rpcCU->getTextureModeDepth() + uiPartOffset, m_piTextureModeDepth, iSizeInInt ); 1064 #endif 998 1065 } 999 1066 … … 1356 1423 } 1357 1424 1358 1359 #if HHI_DMM_INTRA 1425 #if HHI_DMM_WEDGE_INTRA 1360 1426 Void TComDataCU::setWedgeFullTabIdxSubParts( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth ) 1361 1427 { … … 1427 1493 } 1428 1494 } 1429 1495 #endif 1496 #if HHI_DMM_PRED_TEX 1430 1497 Void TComDataCU::setWedgePredTexTabIdxSubParts( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth ) 1431 1498 { … … 1477 1544 } 1478 1545 } 1479 1480 Void TComDataCU::setTextureModeAllowanceSubParts ( Bool bTMAllowed, UInt uiAbsPartIdx, UInt uiDepth ) 1481 { 1482 UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1); 1483 1484 memset( m_pbTextureModesAllowed + uiAbsPartIdx, bTMAllowed, sizeof(Bool)*uiCurrPartNumb ); 1485 } 1486 #endif 1487 1546 #endif 1547 1548 #if HHI_INTER_VIEW_MOTION_PRED 1488 1549 Int 1489 1550 TComDataCU::getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ) … … 1511 1572 return pcDepthMapGenerator->getIViewOrgDepthMvPred( this, uiPartIdx, eRefPicList, iRefIdx, rcMv ); 1512 1573 } 1513 1574 #endif 1575 1576 1577 #if HHI_INTER_VIEW_RESIDUAL_PRED 1514 1578 Bool 1515 1579 TComDataCU::getResidualSamples( UInt uiPartIdx, TComYuv* pcYuv ) … … 1519 1583 return pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv ); 1520 1584 } 1585 #endif 1521 1586 1522 1587 … … 1533 1598 mapPlanartoDC( iLeftIntraDir ); 1534 1599 #endif 1535 #if HHI_DMM_ INTRA1600 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1536 1601 mapDMMtoDC( iLeftIntraDir ); 1537 1602 #endif … … 1543 1608 mapPlanartoDC( iAboveIntraDir ); 1544 1609 #endif 1545 #if HHI_DMM_ INTRA1610 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1546 1611 mapDMMtoDC( iAboveIntraDir ); 1547 1612 #endif … … 1578 1643 mapPlanartoDC( iLeftIntraDir ); 1579 1644 #endif 1580 #if HHI_DMM_ INTRA1645 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1581 1646 mapDMMtoDC( iLeftIntraDir ); 1582 1647 #endif … … 1588 1653 mapPlanartoDC( iAboveIntraDir ); 1589 1654 #endif 1590 #if HHI_DMM_ INTRA1655 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1591 1656 mapDMMtoDC( iAboveIntraDir ); 1592 1657 #endif … … 1693 1758 } 1694 1759 1695 #if MW_MVI_SIGNALLING_MODE == 01696 UInt TComDataCU::getCtxMvInheritanceFlag( UInt uiAbsPartIdx, UInt uiDepth )1697 {1698 // return 0; // MW1699 TComDataCU* pcTempCU;1700 UInt uiTempPartIdx;1701 UInt uiCtx;1702 // Get left split flag1703 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );1704 uiCtx = ( pcTempCU ) ? ( ( pcTempCU->getTextureModeDepth( uiTempPartIdx ) == uiDepth ) ? 1 : 0 ) : 0;1705 1706 // Get above split flag1707 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );1708 uiCtx += ( pcTempCU ) ? ( ( pcTempCU->getTextureModeDepth( uiTempPartIdx ) == uiDepth ) ? 1 : 0 ) : 0;1709 1710 return uiCtx;1711 }1712 #endif1713 1714 1760 UInt TComDataCU::getCtxIntraDirChroma( UInt uiAbsPartIdx ) 1715 1761 { … … 2148 2194 } 2149 2195 2196 #if HHI_INTER_VIEW_RESIDUAL_PRED 2150 2197 Void TComDataCU::setResPredAvailSubParts( Bool bResPredAvailable, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2151 2198 { … … 2157 2204 setSubPartBool( bResPredFlag, m_pbResPredFlag, uiAbsPartIdx, uiDepth, uiPartIdx ); 2158 2205 } 2206 #endif 2159 2207 2160 2208 Void TComDataCU::setChromIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ) … … 2632 2680 { 2633 2681 UInt uiAbsPartAddr = m_uiAbsIdxInLCU + uiAbsPartIdx; 2682 #if HHI_INTER_VIEW_MOTION_PRED 2634 2683 Bool bNoPdmMerge = ( m_pcSlice->getSPS()->getViewId() == 0 || ( m_pcSlice->getSPS()->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) != PDM_USE_FOR_MERGE ); 2635 2684 UInt uiPdmMergePos = ( bNoPdmMerge ? 5 : PDM_MERGE_POS ); … … 2640 2689 UInt uiCorBLAddr = ( uiPdmMergePos < 5 ? 5 : 4 ); 2641 2690 UInt uiPdmAddr = uiPdmMergePos; 2691 #else 2692 UInt uiLeftAddr = 0; 2693 UInt uiAboveAddr = 1; 2694 UInt uiColocAddr = 2; 2695 UInt uiCorRTAddr = 3; 2696 UInt uiCorBLAddr = 4; 2697 #endif 2642 2698 2643 2699 bool abCandIsInter[ MRG_MAX_NUM_CANDS ]; … … 3099 3155 3100 3156 3157 #if HHI_INTER_VIEW_MOTION_PRED 3101 3158 //===== add merge with predicted depth maps ===== 3102 3159 TComMv acPdmMv [2]; … … 3124 3181 } 3125 3182 } 3183 #endif 3126 3184 3127 3185 … … 3320 3378 Int iLeftIdx = -1; 3321 3379 3380 #if HHI_INTER_VIEW_MOTION_PRED 3322 3381 #if ( PDM_AMVP_POS == 0 ) 3323 3382 // get inter-view mv predictor (at position 0) … … 3328 3387 pInfo->m_acMvCand[ pInfo->iN++ ] = cPdmMvPred; 3329 3388 } 3389 #endif 3330 3390 #endif 3331 3391 … … 3388 3448 3389 3449 3450 #if HHI_INTER_VIEW_MOTION_PRED 3390 3451 #if ( PDM_AMVP_POS == 1 ) 3391 3452 // get inter-view mv predictor (at position 1) … … 3397 3458 } 3398 3459 #endif 3399 3460 #endif 3400 3461 3401 3462 … … 3595 3656 3596 3657 3658 #if HHI_INTER_VIEW_MOTION_PRED 3597 3659 #if ( PDM_AMVP_POS == 2 ) 3598 3660 // get inter-view mv predictor (at position 2) … … 3604 3666 } 3605 3667 #endif 3606 3668 #endif 3607 3669 3608 3670 // Get Temporal Motion Predictor … … 3754 3816 3755 3817 3818 #if HHI_INTER_VIEW_MOTION_PRED 3756 3819 #if ( PDM_AMVP_POS == 3 ) 3757 3820 // get inter-view mv predictor (at position 3) … … 3763 3826 } 3764 3827 #endif 3765 3828 #endif 3766 3829 3767 3830 // Check No MV Candidate … … 3854 3917 { 3855 3918 Int iMvShift = 2; 3856 #if MW_DEPTH_MAP_INTERP_FILTER == 2 && MW_FULL_PEL_DEPTH_MAP_MV_SIGNALLING3919 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 3857 3920 if( getSlice()->getSPS()->isDepth() ) 3858 3921 iMvShift = 0; … … 4676 4739 #endif 4677 4740 4741 #if HHI_MPI 4678 4742 Void TComDataCU::setTextureModeDepthSubParts( Int iTextureModeDepth, UInt uiAbsPartIdx, UInt uiDepth ) 4679 4743 { … … 4692 4756 Int iSizeInUchar = sizeof( UChar ) * uiNumPartition; 4693 4757 Int iSizeInInt = sizeof( Int ) * uiNumPartition; 4694 //#if HHI_MRG 4695 // Int iSizeInBool = sizeof( Bool ) * uiNumPartition; 4696 //#endif 4697 4698 // memcpy( m_pePartSize + uiAbsPartIdxDst, pcCU->getPartitionSize() + uiAbsPartIdxSrc, sizeof( PartSize ) * uiNumPartition ); 4758 4699 4759 memcpy( m_pePredMode + uiAbsPartIdxDst, pcCU->getPredictionMode() + uiAbsPartIdxSrc, sizeof( PredMode ) * uiNumPartition ); 4700 4760 memcpy( m_puhInterDir + uiAbsPartIdxDst, pcCU->getInterDir() + uiAbsPartIdxSrc, iSizeInUchar ); 4701 4702 //#if HHI_MRG4703 // m_pbMergeFlag = pcCU->getMergeFlag() + uiAbsPartIdx;4704 // m_puhMergeIndex = pcCU->getMergeIndex() + uiAbsPartIdx;4705 // for( UInt ui = 0; ui < HHI_NUM_MRG_CAND; ui ++ )4706 // {4707 // m_apuhNeighbourCandIdx[ui] = pcCU->getNeighbourCandIdx( ui ) + uiAbsPartIdx;4708 // }4709 //#endif4710 4761 4711 4762 memcpy( m_apiMVPIdx[0] + uiAbsPartIdxDst, pcCU->getMVPIdx(REF_PIC_LIST_0) + uiAbsPartIdxSrc, iSizeInInt ); … … 4714 4765 memcpy( m_apiMVPNum[1] + uiAbsPartIdxDst, pcCU->getMVPNum(REF_PIC_LIST_1) + uiAbsPartIdxSrc, iSizeInInt ); 4715 4766 4716 // m_acCUMvField[0].copyFrom( pcCU->getCUMvField( REF_PIC_LIST_0 ), pcCU->getTotalNumPart(), 0 );4717 // m_acCUMvField[1].copyFrom( pcCU->getCUMvField( REF_PIC_LIST_1 ), pcCU->getTotalNumPart(), 0 );4718 4719 4767 pcCU->getCUMvField( REF_PIC_LIST_0 )->copyTo( &m_acCUMvField[0], -Int(uiAbsPartIdxSrc) + uiAbsPartIdxDst, uiAbsPartIdxSrc, uiNumPartition ); 4720 4768 pcCU->getCUMvField( REF_PIC_LIST_1 )->copyTo( &m_acCUMvField[1], -Int(uiAbsPartIdxSrc) + uiAbsPartIdxDst, uiAbsPartIdxSrc, uiNumPartition ); 4721 #if MW_DEPTH_MAP_INTERP_FILTER == 2 && MW_FULL_PEL_DEPTH_MAP_MV_SIGNALLING4769 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 4722 4770 for( UInt ui = 0; ui < uiNumPartition; ui++ ) 4723 4771 { … … 4736 4784 #endif 4737 4785 } 4786 #endif 4738 4787 4739 4788 Void TComDataCU::getPosInPic( UInt uiAbsPartIndex, Int& riPosX, Int& riPosY ) -
trunk/source/Lib/TLibCommon/TComDataCU.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 1 34 2 35 … … 51 84 UChar* m_puhHeight; ///< array of heights 52 85 UChar* m_puhDepth; ///< array of depths 86 #if HHI_MPI 53 87 Int* m_piTextureModeDepth; ///< at which depth is prediction data inherited from texture picture ( -1 : none ) 88 #endif 54 89 55 90 // ------------------------------------------------------------------------------------------------------------------- … … 90 125 Bool* m_pbMergeFlag; ///< array of merge flags 91 126 UChar* m_puhMergeIndex; ///< array of merge candidate indices 127 #if HHI_INTER_VIEW_RESIDUAL_PRED 92 128 Bool* m_pbResPredAvailable; ///< array of residual prediction available flags 93 129 Bool* m_pbResPredFlag; ///< array of residual prediction flags 130 #endif 94 131 UChar* m_apuhNeighbourCandIdx[ MRG_MAX_NUM_CANDS ];///< array of motion vector predictor candidates indices 95 132 UChar* m_puhLumaIntraDir; ///< array of intra directions (luma) … … 100 137 UInt* m_puiAlfCtrlFlag; ///< array of ALF flags 101 138 UInt* m_puiTmpAlfCtrlFlag; ///< temporal array of ALF flags 102 #if HHI_DMM_ INTRA139 #if HHI_DMM_WEDGE_INTRA 103 140 UInt* m_puiWedgeFullTabIdx; 104 141 Int* m_piWedgeFullDeltaDC1; … … 109 146 Int* m_piWedgePredDirDeltaDC2; 110 147 Int* m_piWedgePredDirDeltaEnd; 111 148 #endif 149 #if HHI_DMM_PRED_TEX 112 150 UInt* m_puiWedgePredTexTabIdx; 113 151 Int* m_piWedgePredTexDeltaDC1; … … 116 154 Int* m_piContourPredTexDeltaDC1; 117 155 Int* m_piContourPredTexDeltaDC2; 118 119 Bool* m_pbTextureModesAllowed;120 156 #endif 121 157 … … 201 237 Void setDepth ( UInt uiIdx, UChar uh ) { m_puhDepth[uiIdx] = uh; } 202 238 239 #if HHI_MPI 203 240 Int* getTextureModeDepth () { return m_piTextureModeDepth; } 204 241 Int getTextureModeDepth ( UInt uiIdx ) { return m_piTextureModeDepth[uiIdx]; } … … 206 243 Void setTextureModeDepthSubParts( Int iTextureModeDepth, UInt uiAbsPartIdx, UInt uiDepth ); 207 244 Void copyTextureMotionDataFrom( TComDataCU* pcCU, UInt uiDepth, UInt uiAbsPartIdxSrc, UInt uiAbsPartIdxDst = 0 ); 245 #endif 208 246 209 247 Void setDepthSubParts ( UInt uiDepth, UInt uiAbsPartIdx ); … … 291 329 Void setNeighbourCandIdxSubParts ( UInt uiCandIdx, UChar uhNumCands, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 292 330 331 #if HHI_INTER_VIEW_RESIDUAL_PRED 293 332 Bool* getResPredAvail () { return m_pbResPredAvailable; } 294 333 Bool getResPredAvail ( UInt uiIdx ) { return m_pbResPredAvailable[uiIdx]; } … … 302 341 303 342 Void setResPredIndicator ( Bool bAv, Bool bRP ) { m_pbResPredAvailable[0] = bAv; m_pbResPredFlag[0] = bRP; } 343 #endif 304 344 305 345 Void setSubPartBool ( Bool bParameter, Bool* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); … … 331 371 Void copyAlfCtrlFlagFromTmp(); 332 372 333 #if HHI_DMM_ INTRA373 #if HHI_DMM_WEDGE_INTRA 334 374 UInt* getWedgeFullTabIdx () { return m_puiWedgeFullTabIdx; } 335 375 UInt getWedgeFullTabIdx ( UInt uiIdx ) { return m_puiWedgeFullTabIdx[uiIdx]; } … … 366 406 Void setWedgePredDirDeltaEnd ( UInt uiIdx, Int iD ) { m_piWedgePredDirDeltaEnd[uiIdx] = iD; } 367 407 Void setWedgePredDirDeltaEndSubParts( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth ); 368 408 #endif 409 #if HHI_DMM_PRED_TEX 369 410 UInt* getWedgePredTexTabIdx () { return m_puiWedgePredTexTabIdx; } 370 411 UInt getWedgePredTexTabIdx ( UInt uiIdx ) { return m_puiWedgePredTexTabIdx[uiIdx]; } … … 391 432 Void setContourPredTexDeltaDC2 ( UInt uiIdx, Int i ) { m_piContourPredTexDeltaDC2[uiIdx] = i; } 392 433 Void setContourPredTexDeltaDC2SubParts( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth ); 393 394 Bool* getTextureModeAllowance () { return m_pbTextureModesAllowed; } 395 Bool getTextureModeAllowance ( UInt uiIdx ) { return m_pbTextureModesAllowed[uiIdx]; } 396 Void setTextureModeAllowance ( UInt uiIdx, Bool b ) { m_pbTextureModesAllowed[uiIdx] = b; } 397 Void setTextureModeAllowanceSubParts ( Bool bTMAllowed, UInt uiAbsPartIdx, UInt uiDepth ); 398 #endif 399 434 #endif 435 436 #if HHI_INTER_VIEW_MOTION_PRED 400 437 Int getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ); 401 438 Bool getPdmMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge = false ); 402 439 Bool getIViewOrgDepthMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv ); 440 #endif 441 #if HHI_INTER_VIEW_RESIDUAL_PRED 403 442 Bool getResidualSamples( UInt uiPartIdx, TComYuv* pcYuv = 0 ); 443 #endif 404 444 405 445 // ------------------------------------------------------------------------------------------------------------------- … … 517 557 518 558 UInt getCtxSplitFlag ( UInt uiAbsPartIdx, UInt uiDepth ); 519 #if MW_MVI_SIGNALLING_MODE == 0520 UInt getCtxMvInheritanceFlag ( UInt uiAbsPartIdx, UInt uiDepth );521 #endif522 559 UInt getCtxCbf ( UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth ); 523 560 UInt getCtxQtCbf ( UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth ); -
trunk/source/Lib/TLibCommon/TComDepthMapGenerator.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 1 34 2 35 … … 10 43 #include "TComDepthMapGenerator.h" 11 44 45 46 #if DEPTH_MAP_GENERATION 12 47 13 48 … … 462 497 463 498 499 #if HHI_INTER_VIEW_MOTION_PRED 464 500 Void 465 501 TComDepthMapGenerator::covertOrgDepthMap( TComPic* pcPic ) … … 483 519 } 484 520 } 485 521 #endif 486 522 487 523 Int … … 501 537 502 538 539 #if HHI_INTER_VIEW_MOTION_PRED 503 540 Int 504 541 TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ) … … 674 711 return true; 675 712 } 676 713 #endif 677 714 678 715 … … 1409 1446 } 1410 1447 1448 #endif // DEPTH_MAP_GENERATION 1449 -
trunk/source/Lib/TLibCommon/TComDepthMapGenerator.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 1 34 2 35 … … 15 48 #include "TComSlice.h" 16 49 50 51 #if DEPTH_MAP_GENERATION 17 52 18 53 … … 29 64 30 65 UInt getPdm () { if( m_aacActiveSPS[0][1] ) { return m_aacActiveSPS[0][1]->getPredDepthMapGeneration(); } return 0; } 66 #if HHI_INTER_VIEW_RESIDUAL_PRED 31 67 UInt getResPrd () { if( m_aacActiveSPS[0][1] ) { return m_aacActiveSPS[0][1]->getMultiviewResPredMode (); } return 0; } 68 #endif 32 69 33 70 private: … … 84 121 Void dumpDepthMap ( TComPic* pcPic, char* pFilenameBase ); 85 122 123 #if HHI_INTER_VIEW_MOTION_PRED 86 124 Void covertOrgDepthMap ( TComPic* pcPic ); 125 #endif 87 126 88 127 UInt getBaseViewId ( UInt uiIdx ) { AOF( uiIdx < m_auiBaseIdList.size() ); return m_auiBaseIdList[uiIdx]; } 89 128 Int getDisparity ( TComPic* pcPic, Int iPosX, Int iPosY, UInt uiRefViewId ); 129 #if HHI_INTER_VIEW_MOTION_PRED 90 130 Int getPdmMergeCandidate ( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ); 91 131 Bool getPdmMvPred ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge ); 92 132 Bool getIViewOrgDepthMvPred( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv ); 133 #endif 93 134 94 135 TComPrediction* getPrediction () { return m_pcPrediction; } … … 177 218 }; 178 219 220 221 #endif // DEPTH_MAP_GENERATION 222 179 223 #endif // __TCOM_DEPTH_MAP_GENERATOR__ 180 224 -
trunk/source/Lib/TLibCommon/TComList.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComLoopFilter.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComLoopFilter.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComMVDRefData.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 1 34 2 35 … … 9 42 #include <fstream> 10 43 44 #if HHI_VSO 11 45 Void TComMVDRefData::setPicYuvBaseView( InterViewReference eView, Bool bDepth, TComPicYuv* pcOrgView, TComPicYuv* pcRecView ) 12 46 { … … 31 65 TComMVDRefData::TComMVDRefData() 32 66 { 33 //GT VSO34 67 m_adERViewShiftLUT = 0; 35 68 m_aiERViewShiftLUT = 0; 36 69 m_apcExternalReferenceViews.resize(0); 37 //GT VSO end38 70 39 71 for (UInt uiView = 0; uiView < 3; uiView++) … … 44 76 m_apcDepthRec[uiView] = NULL; 45 77 46 //GT VSO47 78 m_adBaseViewShiftLUT [uiView] = NULL; 48 79 m_aiBaseViewShiftLUT [uiView] = NULL; 49 //GT VSO end 80 50 81 }; 51 82 } 52 83 53 //GT VSO54 84 Void TComMVDRefData::getRefPicYuvAndLUT( TComPicYuv**& rpacDistRefPicList, Int***& rppaiShiftLut ) 55 85 { 56 //GT57 58 86 UInt uiNextEntry = 0; 59 87 for ( UInt uiViewIdx = 0; uiViewIdx < m_aiExtViewRefInd.size(); uiViewIdx++ ) … … 78 106 rppaiShiftLut[2] = m_aiBaseViewShiftLUT[ NEXTVIEW ]; 79 107 80 //GT: Only orginals of this view needed for Mode 1;81 108 rpacDistRefPicList[0] = NULL; 82 109 rpacDistRefPicList[1] = NULL; 83 110 rpacDistRefPicList[2] = NULL; 84 111 } 85 //GT VSO end 86 87 88 89 90 //Void TComMVDRefData::render( TComPicYuv* pOut ) 91 ////Void TComMVDRefData::render( TComPicYuv* pIn, TComPicYuv* pOut, TComPicYuv* pDepth, Long** aalLUT ) 92 //{ 93 // 94 // std::cout << "InRender" << std::endl; 95 // 96 // TComPicYuv* pIn = getPicYuvOrgVideo(CURRVIEW); 97 // // TComPicYuv* pOut = getRecVideo(CURRVIEW); 98 // TComPicYuv* pDepth = getPicYuvOrgDepth(CURRVIEW); 99 // 100 // Int** aaiLUT = getShiftLUTIERView(0); 101 // 102 // Int iHeight = (Int) pIn->getHeight(); 103 // Int iWidth = (Int) pIn->getWidth(); 104 // 105 // Pel* piSourceLumaData = pIn ->getLumaAddr(); 106 // Pel* piTargetLumaData = pOut ->getLumaAddr(); 107 // Pel* piDepthData = pDepth->getLumaAddr(); 108 // 109 // Int iSourceLumaStride = pIn ->getStride(); 110 // Int iTargetLumaStride = pOut ->getStride(); 111 // Int iDepthStride = pDepth->getStride(); 112 // 113 // 114 // for (Int iY = 0; iY < iHeight; iY++) 115 // { 116 // for (Int iX = 0; iX < iWidth; iX++) 117 // { 118 // piTargetLumaData[iX] = 0; 119 // } 120 // piTargetLumaData += iTargetLumaStride; 121 // } 122 // 123 // piTargetLumaData = pOut ->getLumaAddr(); 124 // 125 // Int iNewPos; 126 // for (Int iY = 0; iY < iHeight; iY++) 127 // { 128 // for (Int iX = 0; iX < iWidth; iX++) 129 // { 130 // iNewPos = iX - aaiLUT[0][(piDepthData[iX] >> g_uiBitIncrement)]; 131 // iNewPos = (iNewPos < 0 ) ? 0 : iNewPos; 132 // iNewPos = (iNewPos >= iWidth) ? iWidth - 1 : iNewPos; 133 // 134 // piTargetLumaData[iNewPos] = piSourceLumaData[iX]; 135 // } 136 // piSourceLumaData += iSourceLumaStride; 137 // piTargetLumaData += iTargetLumaStride; 138 // piDepthData += iDepthStride; 139 // } 140 //} 141 // 142 // 143 // 144 // 145 //TComRendererModel::TComRendererModel() 146 //{ 147 // m_pcInputSamples = NULL; 148 // m_pcOutputSamples = NULL; 149 // m_ppiShiftLUT = NULL; 150 //} 151 // 152 //TComRendererModel::~TComRendererModel() 153 //{ 154 // if ( m_pcOutputSamples ) 155 // delete[] m_pcOutputSamples; 156 // 157 // if ( m_pcInputSamples ) 158 // delete[] m_pcInputSamples; 159 // 160 //} 161 // 162 //Void TComRendererModel::createModel( TComPicYuv* pcYuvDepth, TComPicYuv* pcYuvVideo, TComPicYuv* pcYuvRef, Int** ppiShiftLUT ) 163 //{ 164 // createModel(pcYuvDepth->getLumaAddr(), pcYuvDepth->getStride(), pcYuvVideo->getLumaAddr(), pcYuvVideo->getStride(), pcYuvVideo->getCbAddr(), pcYuvVideo->getCrAddr(), pcYuvVideo->getCStride(), pcYuvVideo->getWidth(), pcYuvVideo->getHeight(), ppiShiftLUT ); 165 //} 166 // 167 //Void TComRendererModel::createModel( TComPicYuv* pcYuvDepth, TComPicYuv* pcYuvVideo, Int** ppiShiftLUT ) 168 //{ 169 // 170 //} 171 // 172 //Void TComRendererModel::createModel( Pel* pcPelDisp, Int iStrideDisp, Pel* pcPelY, Int iStrideY, Pel* pcPelU, Pel* pcPelV, Int iStrideC, Int iWidth, Int iHeight, Int** ppiShiftLUT ) 173 //{ 174 // 175 //} 176 // 177 //Void TComRendererModel::xCreateRenderedView( Pel* pcPelDisp, Int iDispStride, Pel* pcPelY, Int iLStride, Pel* pcPelU, Pel* pcPelV, Int iCStride, Int iWidth, Int iHeight, Int** ppiShiftLUT,Bool bSAD ) 178 //{ 179 // m_ppiShiftLUT = ppiShiftLUT; 180 // m_iWidth = iWidth; 181 // m_iHeight = iHeight; 182 // m_iStride = iWidth; 183 // 184 // m_pcOutputSamples = new RendererOutputSample[ iWidth * iHeight]; 185 // m_pcInputSamples = new RendererInputSample [ iWidth * iHeight]; 186 // 187 // RendererInputSample* pcInputSamples = m_pcInputSamples ; 188 // RendererOutputSample* pcOutputSamples = m_pcOutputSamples ; 189 // 190 // for ( Int iRow = 0; iRow < iHeight; iRow++ ) 191 // { 192 // for ( Int iCol = 0; iCol < iWidth; iCol++ ) 193 // { 194 // pcInputSamples[iCol].m_uiPosX = iCol; 195 // pcInputSamples[iCol].m_uiY = pcPelY[ iCol ]; 196 // pcInputSamples[iCol].m_uiU = pcPelU[ iCol >> 1 ]; 197 // pcInputSamples[iCol].m_uiV = pcPelV[ iCol >> 1 ]; 198 // pcOutputSamples[iCol].m_iErr = 0; 199 // 200 // pcInputSamples[iCol].m_iPosShifted = iCol + m_ppiShiftLUT[0][ pcPelDisp[ iCol ] ]; 201 // pcInputSamples[iCol].m_uiDisp = pcPelDisp[ iCol ]; 202 // 203 // } 204 // 205 // pcInputSamples += m_iStride; 206 // pcOutputSamples += m_iStride; 207 // pcPelY += iLStride; 208 // pcPelDisp += iDispStride; 209 // 210 // if ( iRow & 1 ) 211 // { 212 // pcPelU += iCStride; 213 // pcPelV += iCStride; 214 // } 215 // 216 // } 217 // 218 // m_lErr = 0; 219 // Long lDump; 220 // changeModel(0,0,m_iWidth, m_iHeight, pcPelDisp, iDispStride, lDump, bSAD); 221 //} 222 // 223 //Void TComRendererModel::changeModel( Int iPosX, Int iPosY, Int iWidth, Int iHeight, Pel* pcPelDisp, Int iDispStride, Long& rlErr, Bool bSAD ) 224 //{ 225 // RendererInputSample* pcInputSamples = m_pcInputSamples ; 226 // RendererOutputSample* pcOutputSamples = m_pcOutputSamples ; 227 // 228 // Int iMinChangedPosition = 0; 229 // Int iMaxChangedPosition = m_iWidth - 1; 230 // 231 // rlErr = 0; 232 // 233 // for ( Int iRow = iPosX; iRow < iHeight; iRow++ ) 234 // { 235 // // Add and Remove samples (Update Model) 236 // for ( Int iCol = iPosY; iCol < iWidth; iCol++ ) 237 // { 238 // // Remove from old position 239 // Int iOldPosShifted = pcInputSamples[iCol].m_iPosShifted; 240 // 241 // iMinChangedPosition = Min( iOldPosShifted, iMinChangedPosition ); 242 // iMaxChangedPosition = Max( iOldPosShifted, iMaxChangedPosition ); 243 // 244 // pcOutputSamples[ iOldPosShifted ].removeInputSample( &(pcInputSamples[iCol]) ); 245 // 246 // // Add to new position 247 // Int iShift = m_ppiShiftLUT[0][ pcPelDisp[ iCol ] ]; 248 // 249 // Int iPosShifted = iPosX + iShift; 250 // 251 // iPosShifted = Min(Max(iPosShifted, 0), m_iWidth - 1); 252 // iMinChangedPosition = Min(iPosShifted, iMinChangedPosition); 253 // iMaxChangedPosition = Max(iPosShifted, iMaxChangedPosition); 254 // 255 // pcInputSamples[iCol].m_uiDisp = pcPelDisp[ iCol ]; 256 // pcInputSamples[iCol].m_iPosShifted = iPosShifted; 257 // 258 // pcOutputSamples[ iPosShifted ].addInputSample( &(pcInputSamples[iCol]) ); 259 // } 260 // 261 // // ReRender 262 // 263 // // Get Top Plane 264 // Int iMaxInd = -1; 265 // 266 // if ( pcOutputSamples[iMinChangedPosition].m_pcTopSample ) 267 // { 268 // iMaxInd = pcOutputSamples[iMinChangedPosition].m_pcTopSample->m_uiPosX; 269 // } 270 // 271 // if ( iMinChangedPosition > 0 && pcOutputSamples[iMinChangedPosition].m_pcTopSample ) 272 // { 273 // iMaxInd = Max( iMaxInd, pcOutputSamples[iMinChangedPosition-1].m_pcTopSample->m_uiPosX ); 274 // } 275 // 276 // for ( Int iCol = iMinChangedPosition; iCol <= iMaxChangedPosition; iCol++ ) 277 // { 278 // if ( pcOutputSamples[iCol].m_pcTopSample == NULL ) 279 // { 280 // if ( pcOutputSamples[iCol+1].m_pcTopSample == NULL ) 281 // { 282 // // Hole Filling 283 // Int iFillStartCol = iCol; 284 // iCol++; 285 // 286 // while( ( pcOutputSamples[iCol].m_pcTopSample == NULL ) && (iMinChangedPosition < iMaxChangedPosition) ) iCol++; 287 // 288 // for ( int iFillCol = iFillStartCol; iFillCol < iCol; iFillCol++ ) 289 // { 290 // pcOutputSamples[iFillCol].assignValues( pcOutputSamples[iCol], rlErr, bSAD ); 291 // } 292 // 293 // if ( iMaxInd == -1 ) 294 // { 295 // iMaxInd = pcOutputSamples[iCol].m_pcTopSample->m_uiPosX; 296 // } 297 // } 298 // else 299 // { 300 // // Fill Gap here 301 // pcOutputSamples[iCol].assignValues( pcOutputSamples[iCol-1], rlErr, bSAD ); 302 // 303 // }; 304 // } 305 // else 306 // { 307 // if ( pcOutputSamples[iCol].m_pcTopSample->m_uiPosX > iMaxInd) 308 // { 309 // iMaxInd = pcOutputSamples[iCol].m_pcTopSample->m_uiPosX; 310 // 311 // //assign this Sample 312 // pcOutputSamples[iCol].assignValues( pcOutputSamples[iCol], rlErr, bSAD ); 313 // } 314 // else 315 // { 316 // //assign last sample 317 // pcOutputSamples[iCol].assignValues( pcOutputSamples[iCol-1], rlErr, bSAD ); 318 // } 319 // } 320 // } 321 // 322 // pcInputSamples += m_iStride; 323 // pcPelDisp += iDispStride; 324 // 325 // } 326 //} 327 // 328 //Void RendererOutputSample::assignValues( RendererOutputSample& rpcOutputSample, Long& rlErr, Bool bSAD ) 329 //{ 330 // m_uiY = rpcOutputSample.m_uiYRef; 331 // m_uiU = rpcOutputSample.m_uiURef; 332 // m_uiV = rpcOutputSample.m_uiVRef; 333 // 334 // rlErr -= m_iErr; 335 // 336 // int iErr = m_uiY - m_uiYRef; 337 // 338 // if (bSAD) 339 // { 340 // rlErr += abs(iErr); 341 // } 342 // else 343 // { 344 // rlErr += iErr * iErr; 345 // } 346 //} 347 // 348 //Void RendererOutputSample::addInputSample( RendererInputSample* pcInputSample ) 349 //{ 350 // if ( m_acInputSamples.size() == 0 ) 351 // { 352 // m_acInputSamples.push_back( pcInputSample ); 353 // m_pcTopSample = pcInputSample; 354 // pcInputSample->cIter = m_acInputSamples.begin(); 355 // } 356 // else 357 // { 358 // std::vector <RendererInputSample*>::iterator cIter; 359 // 360 // for ( cIter = m_acInputSamples.begin( ) ; cIter != m_acInputSamples.end( ) ; cIter++ ) 361 // { 362 // if ( (*cIter)->m_uiPosX <= pcInputSample->m_uiPosX ) break; 363 // } 364 // 365 // m_acInputSamples.insert( cIter, 1, pcInputSample ); 366 // 367 // pcInputSample->cIter = cIter; 368 // 369 // if ( cIter == m_acInputSamples.begin() ) 370 // { 371 // m_pcTopSample = pcInputSample; 372 // } 373 // } 374 //} 375 // 376 //RendererOutputSample::RendererOutputSample() 377 //{ 378 // m_pcTopSample = 0; 379 //} 380 // 381 //Void RendererOutputSample::removeInputSample( RendererInputSample* pcInputSample ) 382 //{ 383 // m_acInputSamples.erase( pcInputSample->cIter ); 384 //} 385 // 112 #endif -
trunk/source/Lib/TLibCommon/TComMVDRefData.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 1 34 2 35 … … 4 37 #define __TCOMMVDREFDATA__ 5 38 39 6 40 // Include files 41 7 42 #include "CommonDef.h" 8 43 #include "TComPicYuv.h" 9 44 #include <vector> 10 45 #if HHI_VSO 11 46 // ==================================================================================================================== 12 47 // Class definition … … 27 62 Int** m_aiBaseViewShiftLUT[3]; 28 63 29 30 //GT VSO31 64 //PicYuvs 32 65 std::vector<TComPicYuv*> m_apcExternalReferenceViews; … … 40 73 std::vector<Int> m_aiExtViewRefInd; 41 74 std::vector<Int> m_aiExtViewRefLUTInd; 42 43 //GT VSO end44 75 45 76 public: … … 64 95 // Void render( TComPicYuv* pOut ) /*Void render( TComPicYuv* pIn, TComPicYuv* pOut, TComPicYuv* pDepth, Long** aalLUT ) */; 65 96 66 //GT VSO 97 67 98 // PicYuvs 68 99 TComPicYuv* getPicYuvERView ( UInt uiReferenceNum ) { return m_apcExternalReferenceViews[uiReferenceNum]; }; … … 82 113 Void getRefPicYuvAndLUT ( TComPicYuv**& rpacDistRefPicList, Int***& rppalShiftLut); 83 114 Void getRefPicYuvAndLUTMode1( TComPicYuv**& rpacDistRefPicList, Int***& rppaiShiftLut ); 84 //GT VSO end85 115 86 116 }; // END CLASS DEFINITION TComMVDRefData 87 117 #endif // HHI_VSO 88 118 #endif // __TCOMMVDREFDATA__ 89 119 -
trunk/source/Lib/TLibCommon/TComMotionInfo.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComMotionInfo.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComMv.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComPattern.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 1 34 2 35 … … 91 124 Int iOffsetBottom, 92 125 UInt uiPartDepth, 93 UInt uiAbsPartIdx, 94 Bool bPrdDepthMap ) 126 UInt uiAbsPartIdx 127 #if DEPTH_MAP_GENERATION 128 ,Bool bPrdDepthMap 129 #endif 130 ) 95 131 { 96 132 m_iOffsetLeft = iOffsetLeft; … … 104 140 UInt uiAbsZorderIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 105 141 142 #if DEPTH_MAP_GENERATION 106 143 TComPicYuv* pcPic = ( bPrdDepthMap ? pcCU->getPic()->getPredDepthMap() : pcCU->getPic()->getPicYuvRec() ); 144 #else 145 TComPicYuv* pcPic = pcCU->getPic()->getPicYuvRec(); 146 #endif 107 147 if ( iComp == 0 ) 108 148 { … … 142 182 } 143 183 144 Void TComPattern::initPattern( TComDataCU* pcCU, UInt uiPartDepth, UInt uiAbsPartIdx, Bool bPrdDepthMap ) 184 Void TComPattern::initPattern( TComDataCU* pcCU, UInt uiPartDepth, UInt uiAbsPartIdx 185 #if DEPTH_MAP_GENERATION 186 , Bool bPrdDepthMap 187 #endif 188 ) 145 189 { 146 190 Int uiOffsetLeft = 0; … … 185 229 #endif 186 230 231 #if DEPTH_MAP_GENERATION 187 232 m_cPatternY .setPatternParamCU( pcCU, 0, uiWidth, uiHeight, uiOffsetLeft, uiOffsetRight, uiOffsetAbove, 0, uiPartDepth, uiAbsPartIdx, bPrdDepthMap ); 188 233 m_cPatternCb.setPatternParamCU( pcCU, 1, uiWidth >> 1, uiHeight >> 1, uiOffsetLeft, uiOffsetRight, uiOffsetAbove, 0, uiPartDepth, uiAbsPartIdx, bPrdDepthMap ); 189 234 m_cPatternCr.setPatternParamCU( pcCU, 2, uiWidth >> 1, uiHeight >> 1, uiOffsetLeft, uiOffsetRight, uiOffsetAbove, 0, uiPartDepth, uiAbsPartIdx, bPrdDepthMap ); 190 } 191 192 Void TComPattern::initAdiPattern( TComDataCU* pcCU, UInt uiZorderIdxInPart, UInt uiPartDepth, Int* piAdiBuf, Int iOrgBufStride, Int iOrgBufHeight, Bool& bAbove, Bool& bLeft, Bool bPrdDepthMap ) 235 #else 236 m_cPatternY .setPatternParamCU( pcCU, 0, uiWidth, uiHeight, uiOffsetLeft, uiOffsetRight, uiOffsetAbove, 0, uiPartDepth, uiAbsPartIdx ); 237 m_cPatternCb.setPatternParamCU( pcCU, 1, uiWidth >> 1, uiHeight >> 1, uiOffsetLeft, uiOffsetRight, uiOffsetAbove, 0, uiPartDepth, uiAbsPartIdx ); 238 m_cPatternCr.setPatternParamCU( pcCU, 2, uiWidth >> 1, uiHeight >> 1, uiOffsetLeft, uiOffsetRight, uiOffsetAbove, 0, uiPartDepth, uiAbsPartIdx ); 239 #endif 240 } 241 242 Void TComPattern::initAdiPattern( TComDataCU* pcCU, UInt uiZorderIdxInPart, UInt uiPartDepth, Int* piAdiBuf, Int iOrgBufStride, Int iOrgBufHeight, Bool& bAbove, Bool& bLeft 243 #if DEPTH_MAP_GENERATION 244 , Bool bPrdDepthMap 245 #endif 246 ) 193 247 { 194 248 Pel* piRoiOrigin; … … 330 384 piAdiTemp = piAdiBuf; 331 385 386 #if DEPTH_MAP_GENERATION 332 387 if( bPrdDepthMap ) 333 388 { … … 338 393 #endif 339 394 } 340 341 342 #if REFERENCE_SAMPLE_PADDING 395 #endif 396 397 398 #if REFERENCE_SAMPLE_PADDING 399 #if DEPTH_MAP_GENERATION 343 400 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride, bPrdDepthMap ); 401 #else 402 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride ); 403 #endif 344 404 delete [] bNeighborFlags; 345 405 bNeighborFlags = NULL; … … 586 646 587 647 #if REFERENCE_SAMPLE_PADDING 648 #if DEPTH_MAP_GENERATION 588 649 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride, false ); 650 #else 651 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride ); 652 #endif 589 653 #else // REFERENCE_SAMPLE_PADDING 590 654 for (i=0;i<uiWidth;i++) … … 648 712 649 713 #if REFERENCE_SAMPLE_PADDING 714 #if DEPTH_MAP_GENERATION 650 715 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride, false ); 716 #else 717 fillReferenceSamples ( pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitSize, iNumUnitsInCu, iTotalUnits, uiCuWidth, uiCuHeight, uiWidth, uiHeight, iPicStride ); 718 #endif 651 719 delete [] bNeighborFlags; 652 720 bNeighborFlags = NULL; … … 709 777 710 778 #if REFERENCE_SAMPLE_PADDING 711 Void TComPattern::fillReferenceSamples( TComDataCU* pcCU, Pel* piRoiOrigin, Int* piAdiTemp, Bool* bNeighborFlags, Int iNumIntraNeighbor, Int iUnitSize, Int iNumUnitsInCu, Int iTotalUnits, UInt uiCuWidth, UInt uiCuHeight, UInt uiWidth, UInt uiHeight, Int iPicStride, Bool bPrdDepthMap ) 779 Void TComPattern::fillReferenceSamples( TComDataCU* pcCU, Pel* piRoiOrigin, Int* piAdiTemp, Bool* bNeighborFlags, Int iNumIntraNeighbor, Int iUnitSize, Int iNumUnitsInCu, Int iTotalUnits, UInt uiCuWidth, UInt uiCuHeight, UInt uiWidth, UInt uiHeight, Int iPicStride 780 #if DEPTH_MAP_GENERATION 781 , Bool bPrdDepthMap 782 #endif 783 ) 712 784 { 713 785 Pel* piRoiTemp; 714 786 Int i, j; 787 #if DEPTH_MAP_GENERATION 715 788 Int iDCValue = ( bPrdDepthMap ? PDM_UNDEFINED_DEPTH : ( 1<<( g_uiBitDepth + g_uiBitIncrement - 1) ) ); 789 #else 790 Int iDCValue = ( 1<<( g_uiBitDepth + g_uiBitIncrement - 1) ); 791 #endif 716 792 717 793 if (iNumIntraNeighbor == 0) … … 885 961 886 962 #if QC_MDIS 887 #if HHI_DISABLE_INTRA_SMOOTHING_DEPTH888 Int* TComPattern::getPredictorPtr ( UInt uiDirMode, UInt uiWidthBits, Int iCuWidth, Int iCuHeight, Int* piAdiBuf, Bool bDepth )889 #else890 963 Int* TComPattern::getPredictorPtr ( UInt uiDirMode, UInt uiWidthBits, Int iCuWidth, Int iCuHeight, Int* piAdiBuf ) 891 #endif892 964 { 893 965 #if MN_MDIS_SIMPLIFICATION … … 919 991 mapPlanartoDC( uiDirMode ); 920 992 #endif 921 #if HHI_DISABLE_INTRA_SMOOTHING_DEPTH 922 UChar ucFiltIdx = 0; 923 if ( !bDepth ) 924 { 925 ucFiltIdx = g_aucIntraFilter[uiWidthBits][uiDirMode]; 926 } 927 #else 928 #if HHI_DMM_INTRA 993 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 929 994 UChar ucFiltIdx = 0; 930 995 if ( uiDirMode < 34 ) … … 934 999 #else 935 1000 UChar ucFiltIdx = g_aucIntraFilter[uiWidthBits][uiDirMode]; 936 #endif937 1001 #endif 938 1002 -
trunk/source/Lib/TLibCommon/TComPattern.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 1 34 2 35 … … 62 95 Int iOffsetBottom, 63 96 UInt uiPartDepth, 64 UInt uiAbsZorderIdx, 65 Bool bPrdDepthMap = false ); 97 UInt uiAbsZorderIdx 98 #if DEPTH_MAP_GENERATION 99 ,Bool bPrdDepthMap = false 100 #endif 101 ); 66 102 }; 67 103 … … 101 137 102 138 #if QC_MDIS 103 #if HHI_DISABLE_INTRA_SMOOTHING_DEPTH104 Int* getPredictorPtr ( UInt uiDirMode, UInt uiWidthBits, Int iCuWidth, Int iCuHeight, Int* piAdiBuf, Bool bDepth = false );105 #else106 139 Int* getPredictorPtr ( UInt uiDirMode, UInt uiWidthBits, Int iCuWidth, Int iCuHeight, Int* piAdiBuf ); 107 #endif108 140 #endif //QC_MDIS 109 141 // ------------------------------------------------------------------------------------------------------------------- … … 126 158 Void initPattern ( TComDataCU* pcCU, 127 159 UInt uiPartDepth, 128 UInt uiAbsPartIdx, 129 Bool bPrdDepthMap = false ); 160 UInt uiAbsPartIdx 161 #if DEPTH_MAP_GENERATION 162 ,Bool bPrdDepthMap = false 163 #endif 164 ); 130 165 131 166 /// set luma parameters from CU data for accessing ADI data … … 137 172 Int iOrgBufHeight, 138 173 Bool& bAbove, 139 Bool& bLeft, 140 Bool bPrdDepthMap = false ); 174 Bool& bLeft 175 #if DEPTH_MAP_GENERATION 176 ,Bool bPrdDepthMap = false 177 #endif 178 ); 141 179 142 180 /// set chroma parameters from CU data for accessing ADI data … … 160 198 #if REFERENCE_SAMPLE_PADDING 161 199 /// padding of unavailable reference samples for intra prediction 162 Void fillReferenceSamples ( TComDataCU* pcCU, Pel* piRoiOrigin, Int* piAdiTemp, Bool* bNeighborFlags, Int iNumIntraNeighbor, Int iUnitSize, Int iNumUnitsInCu, Int iTotalUnits, UInt uiCuWidth, UInt uiCuHeight, UInt uiWidth, UInt uiHeight, Int iPicStride, Bool bPrdDepthMap ); 200 Void fillReferenceSamples ( TComDataCU* pcCU, Pel* piRoiOrigin, Int* piAdiTemp, Bool* bNeighborFlags, Int iNumIntraNeighbor, Int iUnitSize, Int iNumUnitsInCu, Int iTotalUnits, UInt uiCuWidth, UInt uiCuHeight, UInt uiWidth, UInt uiHeight, Int iPicStride 201 #if DEPTH_MAP_GENERATION 202 , Bool bPrdDepthMap 203 #endif 204 ); 163 205 #endif 164 206 #if CONSTRAINED_INTRA_PRED -
trunk/source/Lib/TLibCommon/TComPic.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 1 34 2 35 … … 17 50 m_apcPicYuv[0] = NULL; 18 51 m_apcPicYuv[1] = NULL; 52 #if DEPTH_MAP_GENERATION 19 53 m_pcPredDepthMap = NULL; 54 #endif 55 #if HHI_INTER_VIEW_MOTION_PRED 20 56 m_pcOrgDepthMap = NULL; 57 #endif 58 #if HHI_INTER_VIEW_RESIDUAL_PRED 21 59 m_pcResidual = NULL; 60 #endif 22 61 m_pcPicYuvPred = NULL; 23 62 m_pcPicYuvResi = NULL; 63 #if HHI_INTERVIEW_SKIP 24 64 m_pcUsedPelsMap = NULL; 65 #endif 25 66 26 67 #if PARALLEL_MERGED_DEBLK … … 76 117 } 77 118 119 #if DEPTH_MAP_GENERATION 78 120 if( m_pcPredDepthMap ) 79 121 { … … 82 124 m_pcPredDepthMap = NULL; 83 125 } 84 126 #endif 127 128 #if HHI_INTER_VIEW_MOTION_PRED 85 129 if( m_pcOrgDepthMap ) 86 130 { … … 89 133 m_pcOrgDepthMap = NULL; 90 134 } 91 135 #endif 136 137 #if HHI_INTER_VIEW_RESIDUAL_PRED 92 138 if( m_pcResidual ) 93 139 { … … 96 142 m_pcResidual = NULL; 97 143 } 98 144 #endif 145 146 #if HHI_INTERVIEW_SKIP 99 147 if( m_pcUsedPelsMap ) 100 148 { … … 103 151 m_pcUsedPelsMap = NULL; 104 152 } 153 #endif 105 154 106 155 #if PARALLEL_MERGED_DEBLK … … 160 209 #endif 161 210 211 #if DEPTH_MAP_GENERATION 162 212 Void 163 213 TComPic::addPrdDepthMapBuffer() … … 173 223 m_pcPredDepthMap ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); 174 224 } 175 225 #endif 226 227 #if HHI_INTER_VIEW_MOTION_PRED 176 228 Void 177 229 TComPic::addOrgDepthMapBuffer() … … 187 239 m_pcOrgDepthMap ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); 188 240 } 189 241 #endif 242 243 #if HHI_INTER_VIEW_RESIDUAL_PRED 190 244 Void 191 245 TComPic::addResidualBuffer() … … 201 255 m_pcResidual ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); 202 256 } 203 257 #endif 258 259 #if HHI_INTERVIEW_SKIP 204 260 Void 205 261 TComPic::addUsedPelsMapBuffer() … … 215 271 m_pcUsedPelsMap ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); 216 272 } 273 #endif 217 274 218 275 Void … … 240 297 #endif 241 298 299 #if DEPTH_MAP_GENERATION 242 300 Void 243 301 TComPic::removePrdDepthMapBuffer() … … 250 308 } 251 309 } 252 310 #endif 311 312 #if HHI_INTER_VIEW_MOTION_PRED 253 313 Void 254 314 TComPic::removeOrgDepthMapBuffer() … … 261 321 } 262 322 } 263 323 #endif 324 325 #if HHI_INTER_VIEW_RESIDUAL_PRED 264 326 Void 265 327 TComPic::removeResidualBuffer() … … 272 334 } 273 335 } 274 336 #endif 337 338 #if HHI_INTERVIEW_SKIP 275 339 Void 276 340 TComPic::removeUsedPelsMapBuffer() … … 283 347 } 284 348 } 285 349 #endif 350 -
trunk/source/Lib/TLibCommon/TComPic.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 1 34 2 35 … … 26 59 private: 27 60 TComPicSym* m_apcPicSym; // Symbol 28 61 29 62 TComPicYuv* m_apcPicYuv[2]; // Texture, 0:org / 1:rec 63 #if DEPTH_MAP_GENERATION 30 64 TComPicYuv* m_pcPredDepthMap; // estimated depth map 65 #endif 66 #if HHI_INTER_VIEW_MOTION_PRED 31 67 TComPicYuv* m_pcOrgDepthMap; // original depth map 68 #endif 69 #if HHI_INTER_VIEW_RESIDUAL_PRED 32 70 TComPicYuv* m_pcResidual; // residual buffer (coded or inter-view predicted residual) 33 71 #endif 72 34 73 TComPicYuv* m_pcPicYuvPred; // Prediction 35 74 TComPicYuv* m_pcPicYuvResi; // Residual … … 39 78 Bool m_bReconstructed; 40 79 UInt m_uiCurrSliceIdx; // Index of current slice 41 80 42 81 SEImessages* m_SEIs; ///< Any SEI messages that have been received. If !NULL we own the object. 43 82 44 // SB //GT; Why? can be accesed by getSlice()->getXXX?45 83 SliceType m_eSliceType; 46 84 double m_dQP; … … 55 93 Int** m_aaiCodedOffset; 56 94 57 //GT 95 #if HHI_VSO 58 96 TComMVDRefData m_cReferenceInfo; 59 TComPicYuv* m_pcUsedPelsMap; 97 #endif 98 #if HHI_INTERVIEW_SKIP 99 TComPicYuv* m_pcUsedPelsMap; 100 #endif 60 101 61 102 … … 63 104 TComPic(); 64 105 virtual ~TComPic(); 65 106 66 107 67 108 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth ); 68 109 Void destroy(); 69 110 70 111 TComPicSym* getPicSym() { return m_apcPicSym; } 71 112 TComSlice* getSlice(Int i) { return m_apcPicSym->getSlice(i); } … … 78 119 #endif 79 120 TComDataCU*& getCU( UInt uiCUAddr ) { return m_apcPicSym->getCU( uiCUAddr ); } 80 81 // SB 121 82 122 SliceType getSliceType() { return m_eSliceType ;} 83 123 double getQP() { return m_dQP ;} … … 86 126 TComPicYuv* getPicYuvOrg() { return m_apcPicYuv[0]; } 87 127 TComPicYuv* getPicYuvRec() { return m_apcPicYuv[1]; } 88 128 129 #if DEPTH_MAP_GENERATION 89 130 TComPicYuv* getPredDepthMap() { return m_pcPredDepthMap; } 131 #endif 132 #if HHI_INTER_VIEW_MOTION_PRED 90 133 TComPicYuv* getOrgDepthMap() { return m_pcOrgDepthMap; } 134 #endif 135 #if HHI_INTER_VIEW_RESIDUAL_PRED 91 136 TComPicYuv* getResidual() { return m_pcResidual; } 137 #endif 138 139 #if HHI_INTERVIEW_SKIP 92 140 TComPicYuv* getUsedPelsMap() { return m_pcUsedPelsMap; } 141 #endif 93 142 94 143 … … 97 146 Void setPicYuvPred( TComPicYuv* pcPicYuv ) { m_pcPicYuvPred = pcPicYuv; } 98 147 Void setPicYuvResi( TComPicYuv* pcPicYuv ) { m_pcPicYuvResi = pcPicYuv; } 99 // SB100 148 Void setQP( double dQP ) { m_dQP = dQP; } 101 149 Void setSliceType( SliceType eSliceType ) { m_eSliceType = eSliceType; } … … 116 164 Int** getCodedOffset() { return m_aaiCodedOffset; } 117 165 118 //GT 166 #if HHI_VSO 119 167 TComMVDRefData* getMVDReferenceInfo() { return &m_cReferenceInfo; } 120 168 #endif 169 121 170 UInt getNumCUsInFrame() { return m_apcPicSym->getNumberOfCUsInFrame(); } 122 171 UInt getNumPartInWidth() { return m_apcPicSym->getNumPartInWidth(); } … … 127 176 UInt getMinCUWidth() { return m_apcPicSym->getMinCUWidth(); } 128 177 UInt getMinCUHeight() { return m_apcPicSym->getMinCUHeight(); } 129 178 130 179 UInt getParPelX(UChar uhPartIdx) { return getParPelX(uhPartIdx); } 131 180 UInt getParPelY(UChar uhPartIdx) { return getParPelX(uhPartIdx); } 132 181 133 182 Int getStride() { return m_apcPicYuv[1]->getStride(); } 134 183 Int getCStride() { return m_apcPicYuv[1]->getCStride(); } 135 184 136 185 Void setReconMark (Bool b) { m_bReconstructed = b; } 137 186 Bool getReconMark () { return m_bReconstructed; } 138 187 139 188 #if AMVP_BUFFERCOMPRESS 140 Void compressMotion(); 141 #endif 189 Void compressMotion(); 190 #endif 142 191 UInt getCurrSliceIdx() { return m_uiCurrSliceIdx; } 143 192 Void setCurrSliceIdx(UInt i) { m_uiCurrSliceIdx = i; } … … 150 199 Void addDeblockBuffer (); 151 200 #endif 201 #if DEPTH_MAP_GENERATION 152 202 Void addPrdDepthMapBuffer (); 203 #endif 204 #if HHI_INTER_VIEW_MOTION_PRED 153 205 Void addOrgDepthMapBuffer (); 206 #endif 207 #if HHI_INTER_VIEW_RESIDUAL_PRED 154 208 Void addResidualBuffer (); 209 #endif 210 211 #if HHI_INTERVIEW_SKIP 155 212 Void addUsedPelsMapBuffer (); 156 213 #endif 214 157 215 Void removeOriginalBuffer (); 158 216 #if PARALLEL_MERGED_DEBLK 159 217 Void removeDeblockBuffer (); 160 218 #endif 219 #if DEPTH_MAP_GENERATION 161 220 Void removePrdDepthMapBuffer (); 221 #endif 222 #if HHI_INTER_VIEW_MOTION_PRED 162 223 Void removeOrgDepthMapBuffer (); 224 #endif 225 #if HHI_INTER_VIEW_RESIDUAL_PRED 163 226 Void removeResidualBuffer (); 227 #endif 228 #if HHI_INTERVIEW_SKIP 164 229 Void removeUsedPelsMapBuffer (); 165 230 #endif 231 166 232 #if PARALLEL_MERGED_DEBLK 167 233 TComPicYuv* getPicYuvDeblkBuf() { return m_pcPicYuvDeblkBuf; } -
trunk/source/Lib/TLibCommon/TComPicSym.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComPicYuv.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComPicYuvMD5.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComPredFilter.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComPredFilter.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComPrediction.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 1 34 2 35 … … 268 301 269 302 #if QC_MDIS 270 #if HHI_DISABLE_INTRA_SMOOTHING_DEPTH271 ptrSrc = pcTComPattern->getPredictorPtr( uiDirMode, g_aucConvertToBit[ iWidth ] + 1, iWidth, iHeight, m_piYuvExt, pcCU->getSlice()->getSPS()->isDepth() );272 #else273 303 ptrSrc = pcTComPattern->getPredictorPtr( uiDirMode, g_aucConvertToBit[ iWidth ] + 1, iWidth, iHeight, m_piYuvExt ); 274 #endif275 304 #else 276 305 ptrSrc = pcTComPattern->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); … … 433 462 } 434 463 435 #if HHI_DMM_ INTRA464 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 436 465 Void TComPrediction::predIntraLumaDMM( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder ) 437 466 { 467 #if HHI_DMM_WEDGE_INTRA 438 468 if( uiMode == DMM_WEDGE_FULL_IDX ) { xPredIntraWedgeFull ( pcCU, uiAbsPartIdx, piPred, uiStride, iWidth, iHeight, bAbove, bLeft, bEncoder, false, pcCU->getWedgeFullTabIdx ( uiAbsPartIdx ) ); } 439 469 if( uiMode == DMM_WEDGE_FULL_D_IDX ) { xPredIntraWedgeFull ( pcCU, uiAbsPartIdx, piPred, uiStride, iWidth, iHeight, bAbove, bLeft, bEncoder, true, pcCU->getWedgeFullTabIdx( uiAbsPartIdx ), pcCU->getWedgeFullDeltaDC1( uiAbsPartIdx ), pcCU->getWedgeFullDeltaDC2( uiAbsPartIdx ) ); } 440 470 if( uiMode == DMM_WEDGE_PREDDIR_IDX ) { xPredIntraWedgeDir ( pcCU, uiAbsPartIdx, piPred, uiStride, iWidth, iHeight, bAbove, bLeft, bEncoder, false, pcCU->getWedgePredDirDeltaEnd( uiAbsPartIdx ) ); } 441 471 if( uiMode == DMM_WEDGE_PREDDIR_D_IDX ) { xPredIntraWedgeDir ( pcCU, uiAbsPartIdx, piPred, uiStride, iWidth, iHeight, bAbove, bLeft, bEncoder, true, pcCU->getWedgePredDirDeltaEnd( uiAbsPartIdx ), pcCU->getWedgePredDirDeltaDC1( uiAbsPartIdx ), pcCU->getWedgePredDirDeltaDC2( uiAbsPartIdx ) ); } 472 #endif 473 #if HHI_DMM_PRED_TEX 442 474 if( uiMode == DMM_WEDGE_PREDTEX_IDX ) { xPredIntraWedgeTex ( pcCU, uiAbsPartIdx, piPred, uiStride, iWidth, iHeight, bAbove, bLeft, bEncoder, false ); } 443 475 if( uiMode == DMM_WEDGE_PREDTEX_D_IDX ) { xPredIntraWedgeTex ( pcCU, uiAbsPartIdx, piPred, uiStride, iWidth, iHeight, bAbove, bLeft, bEncoder, true, pcCU->getWedgePredTexDeltaDC1( uiAbsPartIdx ), pcCU->getWedgePredTexDeltaDC2( uiAbsPartIdx ) ); } 444 476 if( uiMode == DMM_CONTOUR_PREDTEX_IDX ) { xPredIntraContourTex ( pcCU, uiAbsPartIdx, piPred, uiStride, iWidth, iHeight, bAbove, bLeft, bEncoder, false ); } 445 477 if( uiMode == DMM_CONTOUR_PREDTEX_D_IDX ) { xPredIntraContourTex ( pcCU, uiAbsPartIdx, piPred, uiStride, iWidth, iHeight, bAbove, bLeft, bEncoder, true, pcCU->getContourPredTexDeltaDC1( uiAbsPartIdx ), pcCU->getContourPredTexDeltaDC2( uiAbsPartIdx ) ); } 446 } 478 #endif 479 } 447 480 448 481 Void TComPrediction::xDeltaDCQuantScaleUp( TComDataCU* pcCU, Int& riDeltaDC ) … … 459 492 } 460 493 461 Void TComPrediction::xPredIntraWedgeFull( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, UInt uiTabIdx, Int iDeltaDC1, Int iDeltaDC2 )462 {463 assert( iWidth >= DMM_WEDGEMODEL_MIN_SIZE && iWidth <= DMM_WEDGEMODEL_MAX_SIZE );464 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[iWidth])];465 TComWedgelet* pcWedgelet = &(pacWedgeList->at(uiTabIdx));466 467 // get wedge pred DCs468 Int iPredDC1 = 0;469 Int iPredDC2 = 0;470 471 Int* piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt );472 Int iMaskStride = ( iWidth<<1 ) + 1;473 piMask += iMaskStride+1;474 getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );475 476 if( bDelta )477 {478 xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 );479 xDeltaDCQuantScaleUp( pcCU, iDeltaDC2 );480 }481 482 // assign wedge pred DCs to prediction483 if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); }484 else { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); }485 }486 487 Void TComPrediction::getWedgePredDCs( TComWedgelet* pcWedgelet, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2, Bool bAbove, Bool bLeft )488 {489 riPredDC1 = ( 1<<( g_uiBitDepth + g_uiBitIncrement - 1) ); //pred val, if no neighbors are available490 riPredDC2 = ( 1<<( g_uiBitDepth + g_uiBitIncrement - 1) );491 492 if( !bAbove && !bLeft ) { return; }493 494 UInt uiNumSmpDC1 = 0, uiNumSmpDC2 = 0;495 Int iPredDC1 = 0, iPredDC2 = 0;496 497 Bool* pabWedgePattern = pcWedgelet->getPattern();498 UInt uiWedgeStride = pcWedgelet->getStride();499 500 if( bAbove )501 {502 for( Int k = 0; k < pcWedgelet->getWidth(); k++ )503 {504 if( true == pabWedgePattern[k] )505 {506 iPredDC2 += piMask[k-iMaskStride];507 uiNumSmpDC2++;508 }509 else510 {511 iPredDC1 += piMask[k-iMaskStride];512 uiNumSmpDC1++;513 }514 }515 }516 if( bLeft )517 {518 for( Int k = 0; k < pcWedgelet->getHeight(); k++ )519 {520 if( true == pabWedgePattern[k*uiWedgeStride] )521 {522 iPredDC2 += piMask[k*iMaskStride-1];523 uiNumSmpDC2++;524 }525 else526 {527 iPredDC1 += piMask[k*iMaskStride-1];528 uiNumSmpDC1++;529 }530 }531 }532 533 if( uiNumSmpDC1 > 0 )534 {535 iPredDC1 /= uiNumSmpDC1;536 riPredDC1 = iPredDC1;537 }538 if( uiNumSmpDC2 > 0 )539 {540 iPredDC2 /= uiNumSmpDC2;541 riPredDC2 = iPredDC2;542 }543 }544 545 Void TComPrediction::getBestContourFromText( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge )546 {547 pcContourWedge->clear();548 Bool* pabContourPattern = pcContourWedge->getPattern();549 550 // get copy of according texture luma block551 UInt uiPartAddr = 0;552 Int iBlockWidth, iBlockHeight;553 554 pcCU->getPartIndexAndSize( uiAbsPartIdx, uiPartAddr, iBlockWidth, iBlockHeight );555 556 TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getTexturePic()->getPicYuvRec();557 Int iRefStride = pcPicYuvRef->getStride();558 Pel* piRefY = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr );559 560 TComYuv cTempYuv; cTempYuv.create( pcCU->getWidth(0), pcCU->getHeight(0) ); cTempYuv.clear();561 UInt uiTempStride = cTempYuv.getStride();562 Pel* piTempY = cTempYuv.getLumaAddr( uiAbsPartIdx, uiWidth );563 564 for ( Int y = 0; y < iBlockHeight; y++ )565 {566 ::memcpy(piTempY, piRefY, sizeof(Pel)*iBlockWidth);567 piTempY += uiTempStride;568 piRefY += iRefStride;569 }570 piTempY = cTempYuv.getLumaAddr( uiAbsPartIdx, uiWidth );571 572 // find contour for texture luma block573 UInt iDC = 0;574 for( UInt k = 0; k < (iBlockWidth*iBlockHeight); k++ ) { iDC += piTempY[k]; }575 iDC /= (iBlockWidth*iBlockHeight);576 577 for( UInt k = 0; k < (iBlockWidth*iBlockHeight); k++ )578 {579 pabContourPattern[k] = (piTempY[k] > iDC) ? true : false;580 }581 582 cTempYuv.destroy();583 }584 585 UInt TComPrediction::getBestContinueWedge( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Int iDeltaEnd )586 {587 UInt uiThisBlockSize = uiWidth;588 assert( uiThisBlockSize >= DMM_WEDGEMODEL_MIN_SIZE && uiThisBlockSize <= DMM_WEDGEMODEL_MAX_SIZE );589 WedgeList* pacContDWedgeList = &g_aacWedgeLists [(g_aucConvertToBit[uiThisBlockSize])];590 WedgeRefList* pacContDWedgeRefList = &g_aacWedgeRefLists[(g_aucConvertToBit[uiThisBlockSize])];591 592 UInt uiPredDirWedgeTabIdx = 0;593 TComDataCU* pcTempCU;594 UInt uiTempPartIdx;595 // 1st: try continue above wedgelet596 pcTempCU = pcCU->getPUAbove( uiTempPartIdx, pcCU->getZorderIdxInCU() + uiAbsPartIdx );597 if( pcTempCU )598 {599 UChar uhLumaIntraDir = pcTempCU->getLumaIntraDir( uiTempPartIdx );600 if( DMM_WEDGE_FULL_IDX == uhLumaIntraDir ||601 DMM_WEDGE_FULL_D_IDX == uhLumaIntraDir ||602 DMM_WEDGE_PREDDIR_IDX == uhLumaIntraDir ||603 DMM_WEDGE_PREDDIR_D_IDX == uhLumaIntraDir ||604 DMM_WEDGE_PREDTEX_IDX == uhLumaIntraDir ||605 DMM_WEDGE_PREDTEX_D_IDX == uhLumaIntraDir )606 {607 UInt uiRefWedgeSize = (UInt)g_aucIntraSizeIdxToWedgeSize[pcTempCU->getIntraSizeIdx( uiTempPartIdx )];608 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiRefWedgeSize])];609 610 // get offset between current and reference block611 UInt uiOffsetX = 0;612 UInt uiOffsetY = 0;613 xGetBlockOffset( pcCU, uiAbsPartIdx, pcTempCU, uiTempPartIdx, uiOffsetX, uiOffsetY );614 615 // get reference wedgelet616 UInt uiRefWedgeTabIdx = 0;617 switch( uhLumaIntraDir )618 {619 case( DMM_WEDGE_FULL_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgeFullTabIdx ( uiTempPartIdx ); } break;620 case( DMM_WEDGE_FULL_D_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgeFullTabIdx ( uiTempPartIdx ); } break;621 case( DMM_WEDGE_PREDDIR_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgePredDirTabIdx( uiTempPartIdx ); } break;622 case( DMM_WEDGE_PREDDIR_D_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgePredDirTabIdx( uiTempPartIdx ); } break;623 case( DMM_WEDGE_PREDTEX_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgePredTexTabIdx( uiTempPartIdx ); } break;624 case( DMM_WEDGE_PREDTEX_D_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgePredTexTabIdx( uiTempPartIdx ); } break;625 default: { assert( 0 ); return uiPredDirWedgeTabIdx; }626 }627 TComWedgelet* pcRefWedgelet;628 pcRefWedgelet = &(pacWedgeList->at( uiRefWedgeTabIdx ));629 630 // find reference wedgelet, if direction is suitable for continue wedge631 if( pcRefWedgelet->checkPredDirAbovePossible( uiThisBlockSize, uiOffsetX ) )632 {633 UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye;634 pcRefWedgelet->getPredDirStartEndAbove( uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, uiThisBlockSize, uiOffsetX, iDeltaEnd );635 getWedgeListIdx( pacContDWedgeList, pacContDWedgeRefList, uiPredDirWedgeTabIdx, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye );636 return uiPredDirWedgeTabIdx;637 }638 }639 }640 641 // 2nd: try continue left wedglelet642 pcTempCU = pcCU->getPULeft( uiTempPartIdx, pcCU->getZorderIdxInCU() + uiAbsPartIdx );643 if( pcTempCU )644 {645 UChar uhLumaIntraDir = pcTempCU->getLumaIntraDir( uiTempPartIdx );646 if( DMM_WEDGE_FULL_IDX == uhLumaIntraDir ||647 DMM_WEDGE_FULL_D_IDX == uhLumaIntraDir ||648 DMM_WEDGE_PREDDIR_IDX == uhLumaIntraDir ||649 DMM_WEDGE_PREDDIR_D_IDX == uhLumaIntraDir ||650 DMM_WEDGE_PREDTEX_IDX == uhLumaIntraDir ||651 DMM_WEDGE_PREDTEX_D_IDX == uhLumaIntraDir )652 {653 UInt uiRefWedgeSize = (UInt)g_aucIntraSizeIdxToWedgeSize[pcTempCU->getIntraSizeIdx( uiTempPartIdx )];654 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiRefWedgeSize])];655 656 // get offset between current and reference block657 UInt uiOffsetX = 0;658 UInt uiOffsetY = 0;659 xGetBlockOffset( pcCU, uiAbsPartIdx, pcTempCU, uiTempPartIdx, uiOffsetX, uiOffsetY );660 661 // get reference wedgelet662 UInt uiRefWedgeTabIdx = 0;663 switch( uhLumaIntraDir )664 {665 case( DMM_WEDGE_FULL_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgeFullTabIdx ( uiTempPartIdx ); } break;666 case( DMM_WEDGE_FULL_D_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgeFullTabIdx ( uiTempPartIdx ); } break;667 case( DMM_WEDGE_PREDDIR_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgePredDirTabIdx( uiTempPartIdx ); } break;668 case( DMM_WEDGE_PREDDIR_D_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgePredDirTabIdx( uiTempPartIdx ); } break;669 case( DMM_WEDGE_PREDTEX_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgePredTexTabIdx( uiTempPartIdx ); } break;670 case( DMM_WEDGE_PREDTEX_D_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgePredTexTabIdx( uiTempPartIdx ); } break;671 default: { assert( 0 ); return uiPredDirWedgeTabIdx; }672 }673 TComWedgelet* pcRefWedgelet;674 pcRefWedgelet = &(pacWedgeList->at( uiRefWedgeTabIdx ));675 676 // find reference wedgelet, if direction is suitable for continue wedge677 if( pcRefWedgelet->checkPredDirLeftPossible( uiThisBlockSize, uiOffsetY ) )678 {679 UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye;680 pcRefWedgelet->getPredDirStartEndLeft( uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, uiThisBlockSize, uiOffsetY, iDeltaEnd );681 getWedgeListIdx( pacContDWedgeList, pacContDWedgeRefList, uiPredDirWedgeTabIdx, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye );682 return uiPredDirWedgeTabIdx;683 }684 }685 }686 687 // 3rd: (default) make wedglet from intra dir and max slope point688 Int iSlopeX = 0;689 Int iSlopeY = 0;690 UInt uiStartPosX = 0;691 UInt uiStartPosY = 0;692 if( xGetWedgeIntraDirPredData( pcCU, uiAbsPartIdx, uiThisBlockSize, iSlopeX, iSlopeY, uiStartPosX, uiStartPosY ) )693 {694 UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye;695 xGetWedgeIntraDirStartEnd( pcCU, uiAbsPartIdx, uiThisBlockSize, iSlopeX, iSlopeY, uiStartPosX, uiStartPosY, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, iDeltaEnd );696 getWedgeListIdx( pacContDWedgeList, pacContDWedgeRefList, uiPredDirWedgeTabIdx, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye );697 return uiPredDirWedgeTabIdx;698 }699 700 return uiPredDirWedgeTabIdx;701 }702 703 Void TComPrediction::xGetBlockOffset( TComDataCU* pcCU, UInt uiAbsPartIdx, TComDataCU* pcRefCU, UInt uiRefAbsPartIdx, UInt& ruiOffsetX, UInt& ruiOffsetY )704 {705 ruiOffsetX = 0;706 ruiOffsetY = 0;707 708 // get offset between current and above/left block709 UInt uiThisOriginX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];710 UInt uiThisOriginY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];711 712 UInt uiNumPartInRefCU = pcRefCU->getTotalNumPart();713 UInt uiMaxDepthRefCU = 0;714 while( uiNumPartInRefCU > 1 )715 {716 uiNumPartInRefCU >>= 2;717 uiMaxDepthRefCU++;718 }719 720 UInt uiDepthRefPU = (pcRefCU->getDepth(uiRefAbsPartIdx)) + (pcRefCU->getPartitionSize(uiRefAbsPartIdx) == SIZE_2Nx2N ? 0 : 1);721 UInt uiShifts = (uiMaxDepthRefCU - uiDepthRefPU)*2;722 UInt uiRefBlockOriginPartIdx = (uiRefAbsPartIdx>>uiShifts)<<uiShifts;723 724 UInt uiRefOriginX = pcRefCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiRefBlockOriginPartIdx] ];725 UInt uiRefOriginY = pcRefCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiRefBlockOriginPartIdx] ];726 727 if( (uiThisOriginX - uiRefOriginX) > 0 ) { ruiOffsetX = (UInt)(uiThisOriginX - uiRefOriginX); }728 if( (uiThisOriginY - uiRefOriginY) > 0 ) { ruiOffsetY = (UInt)(uiThisOriginY - uiRefOriginY); }729 }730 731 Bool TComPrediction::xGetWedgeIntraDirPredData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int& riSlopeX, Int& riSlopeY, UInt& ruiStartPosX, UInt& ruiStartPosY )732 {733 riSlopeX = 0;734 riSlopeY = 0;735 ruiStartPosX = 0;736 ruiStartPosY = 0;737 738 // 1st step: get wedge start point (max. slope)739 Int* piSource = pcCU->getPattern()->getAdiOrgBuf( uiBlockSize, uiBlockSize, m_piYuvExt );740 Int iSourceStride = ( uiBlockSize<<1 ) + 1;741 742 UInt uiSlopeMaxAbove = 0;743 UInt uiPosSlopeMaxAbove = 0;744 for( UInt uiPosHor = 0; uiPosHor < (uiBlockSize-1); uiPosHor++ )745 {746 if( abs( piSource[uiPosHor+1] - piSource[uiPosHor] ) > uiSlopeMaxAbove )747 {748 uiSlopeMaxAbove = abs( piSource[uiPosHor+1] - piSource[uiPosHor] );749 uiPosSlopeMaxAbove = uiPosHor;750 }751 }752 753 UInt uiSlopeMaxLeft = 0;754 UInt uiPosSlopeMaxLeft = 0;755 for( UInt uiPosVer = 0; uiPosVer < (uiBlockSize-1); uiPosVer++ )756 {757 if( abs( piSource[(uiPosVer+1)*iSourceStride] - piSource[uiPosVer*iSourceStride] ) > uiSlopeMaxLeft )758 {759 uiSlopeMaxLeft = abs( piSource[(uiPosVer+1)*iSourceStride] - piSource[uiPosVer*iSourceStride] );760 uiPosSlopeMaxLeft = uiPosVer;761 }762 }763 764 if( uiSlopeMaxAbove == 0 && uiSlopeMaxLeft == 0 )765 {766 return false;767 }768 769 if( uiSlopeMaxAbove > uiSlopeMaxLeft )770 {771 ruiStartPosX = uiPosSlopeMaxAbove;772 ruiStartPosY = 0;773 }774 else775 {776 ruiStartPosX = 0;777 ruiStartPosY = uiPosSlopeMaxLeft;778 }779 780 // 2nd step: derive wedge direction781 Int angTable[9] = {0,2,5,9,13,17,21,26,32};782 783 Int uiPreds[2] = {-1, -1};784 Int uiPredNum = pcCU->getIntraDirLumaPredictor( uiAbsPartIdx, uiPreds );785 786 UInt uiDirMode = 0;787 if( uiPredNum == 1 )788 {789 uiDirMode = g_aucAngIntraModeOrder[uiPreds[0]];790 }791 else if( uiPredNum == 2 )792 {793 uiDirMode = g_aucAngIntraModeOrder[uiPreds[1]];794 }795 796 if( uiDirMode == 0 )797 {798 return false;799 }800 801 Bool modeVer = (uiDirMode < 18);802 Bool modeHor = !modeVer;803 Int intraPredAngle = modeVer ? uiDirMode - 9 : modeHor ? uiDirMode - 25 : 0;804 Int absAng = abs(intraPredAngle);805 Int signAng = intraPredAngle < 0 ? -1 : 1;806 absAng = angTable[absAng];807 intraPredAngle = signAng * absAng;808 809 // 3rd step: set slope for direction810 if( modeHor )811 {812 if( intraPredAngle > 0 )813 {814 riSlopeX = -32;815 riSlopeY = intraPredAngle;816 }817 else818 {819 riSlopeX = 32;820 riSlopeY = -intraPredAngle;821 }822 }823 else if( modeVer )824 {825 if( intraPredAngle > 0 )826 {827 riSlopeX = intraPredAngle;828 riSlopeY = -32;829 }830 else831 {832 riSlopeX = -intraPredAngle;833 riSlopeY = 32;834 }835 }836 837 return true;838 }839 840 Void TComPrediction::xGetWedgeIntraDirStartEnd( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int iDeltaX, Int iDeltaY, UInt uiPMSPosX, UInt uiPMSPosY, UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, Int iDeltaEnd )841 {842 ruhXs = 0;843 ruhYs = 0;844 ruhXe = 0;845 ruhYe = 0;846 UInt uiOri;847 848 // scaling of start pos and block size to wedge resolution849 UInt uiScaledStartPosX = 0;850 UInt uiScaledStartPosY = 0;851 UInt uiScaledBlockSize = 0;852 WedgeResolution eWedgeRes = g_aeWedgeResolutionList[(UInt)g_aucConvertToBit[uiBlockSize]];853 switch( eWedgeRes )854 {855 case( DOUBLE_PEL ): { uiScaledStartPosX = (uiPMSPosX>>1); uiScaledStartPosY = (uiPMSPosY>>1); uiScaledBlockSize = (uiBlockSize>>1); break; }856 case( FULL_PEL ): { uiScaledStartPosX = uiPMSPosX; uiScaledStartPosY = uiPMSPosY; uiScaledBlockSize = uiBlockSize; break; }857 case( HALF_PEL ): { uiScaledStartPosX = (uiPMSPosX<<1); uiScaledStartPosY = (uiPMSPosY<<1); uiScaledBlockSize = (uiBlockSize<<1); break; }858 }859 860 // case above861 if( uiScaledStartPosX > 0 && uiScaledStartPosY == 0 )862 {863 ruhXs = (UChar)uiScaledStartPosX;864 ruhYs = 0;865 866 if( iDeltaY == 0 )867 {868 if( iDeltaX < 0 )869 {870 uiOri = 0;871 ruhXe = 0;872 ruhYe = (UChar)Min( Max( iDeltaEnd, 0 ), (uiScaledBlockSize-1) );873 return;874 }875 else876 {877 uiOri = 1;878 ruhXe = (UChar)(uiScaledBlockSize-1); ;879 ruhYe = (UChar)Min( Max( -iDeltaEnd, 0 ), (uiScaledBlockSize-1) );880 std::swap( ruhXs, ruhXe );881 std::swap( ruhYs, ruhYe );882 return;883 }884 }885 886 // regular case887 Int iVirtualEndX = (Int)ruhXs + roftoi( (Double)(uiScaledBlockSize-1) * ((Double)iDeltaX / (Double)iDeltaY) );888 889 if( iVirtualEndX < 0 )890 {891 Int iYe = roftoi( (Double)(0 - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) + iDeltaEnd;892 if( iYe < (Int)uiScaledBlockSize )893 {894 uiOri = 0;895 ruhXe = 0;896 ruhYe = (UChar)Max( iYe, 0 );897 return;898 }899 else900 {901 uiOri = 4;902 ruhXe = (UChar)Min( (iYe - (uiScaledBlockSize-1)), (uiScaledBlockSize-1) );903 ruhYe = (UChar)(uiScaledBlockSize-1);904 return;905 }906 }907 else if( iVirtualEndX > (uiScaledBlockSize-1) )908 {909 Int iYe = roftoi( (Double)((Int)(uiScaledBlockSize-1) - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) - iDeltaEnd;910 if( iYe < (Int)uiScaledBlockSize )911 {912 uiOri = 1;913 ruhXe = (UChar)(uiScaledBlockSize-1);914 ruhYe = (UChar)Max( iYe, 0 );915 std::swap( ruhXs, ruhXe );916 std::swap( ruhYs, ruhYe );917 return;918 }919 else920 {921 uiOri = 4;922 ruhXe = (UChar)Max( ((uiScaledBlockSize-1) - (iYe - (uiScaledBlockSize-1))), 0 );923 ruhYe = (UChar)(uiScaledBlockSize-1);924 return;925 }926 }927 else928 {929 Int iXe = iVirtualEndX + iDeltaEnd;930 if( iXe < 0 )931 {932 uiOri = 0;933 ruhXe = 0;934 ruhYe = (UChar)Max( ((uiScaledBlockSize-1) + iXe), 0 );935 return;936 }937 else if( iXe > (uiScaledBlockSize-1) )938 {939 uiOri = 1;940 ruhXe = (UChar)(uiScaledBlockSize-1);941 ruhYe = (UChar)Max( ((uiScaledBlockSize-1) - (iXe - (uiScaledBlockSize-1))), 0 );942 std::swap( ruhXs, ruhXe );943 std::swap( ruhYs, ruhYe );944 return;945 }946 else947 {948 uiOri = 4;949 ruhXe = (UChar)iXe;950 ruhYe = (UChar)(uiScaledBlockSize-1);951 return;952 }953 }954 }955 956 // case left957 if( uiScaledStartPosY > 0 && uiScaledStartPosX == 0 )958 {959 ruhXs = 0;960 ruhYs = (UChar)uiScaledStartPosY;961 962 if( iDeltaX == 0 )963 {964 if( iDeltaY < 0 )965 {966 uiOri = 0;967 ruhXe = (UChar)Min( Max( -iDeltaEnd, 0 ), (uiScaledBlockSize-1) );968 ruhYe = 0;969 std::swap( ruhXs, ruhXe );970 std::swap( ruhYs, ruhYe );971 return;972 }973 else974 {975 uiOri = 3;976 ruhXe = (UChar)Min( Max( iDeltaEnd, 0 ), (uiScaledBlockSize-1) );977 ruhYe = (UChar)(uiScaledBlockSize-1);978 return;979 }980 }981 982 // regular case983 Int iVirtualEndY = (Int)ruhYs + roftoi( (Double)(uiScaledBlockSize-1) * ((Double)iDeltaY / (Double)iDeltaX) );984 985 if( iVirtualEndY < 0 )986 {987 Int iXe = roftoi( (Double)(0 - (Int)ruhYs ) * ((Double)iDeltaX / (Double)iDeltaY) ) - iDeltaEnd;988 if( iXe < (Int)uiScaledBlockSize )989 {990 uiOri = 0;991 ruhXe = (UChar)Max( iXe, 0 );992 ruhYe = 0;993 std::swap( ruhXs, ruhXe );994 std::swap( ruhYs, ruhYe );995 return;996 }997 else998 {999 uiOri = 5;1000 ruhXe = (UChar)(uiScaledBlockSize-1);1001 ruhYe = (UChar)Min( (iXe - (uiScaledBlockSize-1)), (uiScaledBlockSize-1) );1002 std::swap( ruhXs, ruhXe );1003 std::swap( ruhYs, ruhYe );1004 return;1005 }1006 }1007 else if( iVirtualEndY > (uiScaledBlockSize-1) )1008 {1009 Int iXe = roftoi( (Double)((Int)(uiScaledBlockSize-1) - (Int)ruhYs ) * ((Double)iDeltaX / (Double)iDeltaY) ) + iDeltaEnd;1010 if( iXe < (Int)uiScaledBlockSize )1011 {1012 uiOri = 3;1013 ruhXe = (UChar)Max( iXe, 0 );1014 ruhYe = (UChar)(uiScaledBlockSize-1);1015 return;1016 }1017 else1018 {1019 uiOri = 5;1020 ruhXe = (UChar)(uiScaledBlockSize-1);1021 ruhYe = (UChar)Max( ((uiScaledBlockSize-1) - (iXe - (uiScaledBlockSize-1))), 0 );1022 std::swap( ruhXs, ruhXe );1023 std::swap( ruhYs, ruhYe );1024 return;1025 }1026 }1027 else1028 {1029 Int iYe = iVirtualEndY - iDeltaEnd;1030 if( iYe < 0 )1031 {1032 uiOri = 0;1033 ruhXe = (UChar)Max( ((uiScaledBlockSize-1) + iYe), 0 );1034 ruhYe = 0;1035 std::swap( ruhXs, ruhXe );1036 std::swap( ruhYs, ruhYe );1037 return;1038 }1039 else if( iYe > (uiScaledBlockSize-1) )1040 {1041 uiOri = 3;1042 ruhXe = (UChar)Max( ((uiScaledBlockSize-1) - (iYe - (uiScaledBlockSize-1))), 0 );1043 ruhYe = (UChar)(uiScaledBlockSize-1);1044 return;1045 }1046 else1047 {1048 uiOri = 5;1049 ruhXe = (UChar)(uiScaledBlockSize-1);1050 ruhYe = (UChar)iYe;1051 std::swap( ruhXs, ruhXe );1052 std::swap( ruhYs, ruhYe );1053 return;1054 }1055 }1056 }1057 1058 // case origin1059 if( uiScaledStartPosX == 0 && uiScaledStartPosY == 0 )1060 {1061 if( iDeltaX*iDeltaY < 0 )1062 {1063 return;1064 }1065 1066 ruhXs = 0;1067 ruhYs = 0;1068 1069 if( iDeltaY == 0 )1070 {1071 uiOri = 1;1072 ruhXe = (UChar)(uiScaledBlockSize-1);1073 ruhYe = 0;1074 std::swap( ruhXs, ruhXe );1075 std::swap( ruhYs, ruhYe );1076 return;1077 }1078 1079 if( iDeltaX == 0 )1080 {1081 uiOri = 0;1082 ruhXe = 0;1083 ruhYe = (UChar)(uiScaledBlockSize-1);1084 return;1085 }1086 1087 Int iVirtualEndX = (Int)ruhXs + roftoi( (Double)(uiScaledBlockSize-1) * ((Double)iDeltaX / (Double)iDeltaY) );1088 1089 if( iVirtualEndX > (uiScaledBlockSize-1) )1090 {1091 Int iYe = roftoi( (Double)((Int)(uiScaledBlockSize-1) - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) - iDeltaEnd;1092 if( iYe < (Int)uiScaledBlockSize )1093 {1094 uiOri = 1;1095 ruhXe = (UChar)(uiScaledBlockSize-1);1096 ruhYe = (UChar)Max( iYe, 0 );1097 std::swap( ruhXs, ruhXe );1098 std::swap( ruhYs, ruhYe );1099 return;1100 }1101 else1102 {1103 uiOri = 3;1104 ruhXe = (UChar)Max( ((uiScaledBlockSize-1) - (iYe - (uiScaledBlockSize-1))), 0 );1105 ruhYe = (UChar)(uiScaledBlockSize-1);1106 return;1107 }1108 }1109 else1110 {1111 Int iXe = iVirtualEndX + iDeltaEnd;1112 if( iXe < 0 )1113 {1114 uiOri = 0;1115 ruhXe = 0;1116 ruhYe = (UChar)Max( ((uiScaledBlockSize-1) + iXe), 0 );1117 return;1118 }1119 else if( iXe > (uiScaledBlockSize-1) )1120 {1121 uiOri = 1;1122 ruhXe = (UChar)(uiScaledBlockSize-1);1123 ruhYe = (UChar)Max( ((uiScaledBlockSize-1) - (iXe - (uiScaledBlockSize-1))), 0 );1124 std::swap( ruhXs, ruhXe );1125 std::swap( ruhYs, ruhYe );1126 return;1127 }1128 else1129 {1130 uiOri = 3;1131 ruhXe = (UChar)iXe;1132 ruhYe = (UChar)(uiScaledBlockSize-1);1133 return;1134 }1135 }1136 }1137 }1138 1139 Bool TComPrediction::getWedgeListIdx( WedgeList* pcWedgeList, WedgeRefList* pcWedgeRefList, UInt& ruiTabIdx, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe )1140 {1141 ruiTabIdx = 0;1142 1143 for( UInt uiIdx = 0; uiIdx < pcWedgeList->size(); uiIdx++ )1144 {1145 TComWedgelet* pcTestWedge = &(pcWedgeList->at(uiIdx));1146 1147 if( pcTestWedge->getStartX() == uhXs &&1148 pcTestWedge->getStartY() == uhYs &&1149 pcTestWedge->getEndX() == uhXe &&1150 pcTestWedge->getEndY() == uhYe )1151 {1152 ruiTabIdx = uiIdx;1153 return true;1154 }1155 }1156 1157 // additionally search in WedgeRef lists of duplicated patterns1158 for( UInt uiIdx = 0; uiIdx < pcWedgeRefList->size(); uiIdx++ )1159 {1160 TComWedgeRef* pcTestWedgeRef = &(pcWedgeRefList->at(uiIdx));1161 1162 if( pcTestWedgeRef->getStartX() == uhXs &&1163 pcTestWedgeRef->getStartY() == uhYs &&1164 pcTestWedgeRef->getEndX() == uhXe &&1165 pcTestWedgeRef->getEndY() == uhYe )1166 {1167 ruiTabIdx = pcTestWedgeRef->getRefIdx();1168 return true;1169 }1170 }1171 1172 return false;1173 }1174 1175 Void TComPrediction::xPredIntraWedgeDir( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, Int iWedgeDeltaEnd, Int iDeltaDC1, Int iDeltaDC2 )1176 {1177 assert( iWidth >= DMM_WEDGEMODEL_MIN_SIZE && iWidth <= DMM_WEDGEMODEL_MAX_SIZE );1178 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[iWidth])];1179 1180 // get wedge pattern1181 UInt uiDirWedgeTabIdx = 0;1182 if( bEncoder )1183 {1184 // encoder: load stored wedge pattern from CU1185 uiDirWedgeTabIdx = pcCU->getWedgePredDirTabIdx( uiAbsPartIdx );1186 }1187 else1188 {1189 uiDirWedgeTabIdx = getBestContinueWedge( pcCU, uiAbsPartIdx, iWidth, iHeight, iWedgeDeltaEnd );1190 1191 UInt uiDepth = (pcCU->getDepth(0)) + (pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1);1192 pcCU->setWedgePredDirTabIdxSubParts( uiDirWedgeTabIdx, uiAbsPartIdx, uiDepth );1193 }1194 TComWedgelet* pcWedgelet = &(pacWedgeList->at(uiDirWedgeTabIdx));1195 1196 // get wedge pred DCs1197 Int iPredDC1 = 0;1198 Int iPredDC2 = 0;1199 1200 Int* piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt );1201 Int iMaskStride = ( iWidth<<1 ) + 1;1202 piMask += iMaskStride+1;1203 getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );1204 1205 if( bDelta )1206 {1207 xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 );1208 xDeltaDCQuantScaleUp( pcCU, iDeltaDC2 );1209 }1210 1211 // assign wedge pred DCs to prediction1212 if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip ( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); }1213 else { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); }1214 }1215 1216 Void TComPrediction::xPredIntraWedgeTex( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, Int iDeltaDC1, Int iDeltaDC2 )1217 {1218 assert( iWidth >= DMM_WEDGEMODEL_MIN_SIZE && iWidth <= DMM_WEDGEMODEL_MAX_SIZE );1219 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[iWidth])];1220 1221 // get wedge pattern1222 UInt uiTextureWedgeTabIdx = 0;1223 if( bEncoder )1224 {1225 // encoder: load stored wedge pattern from CU1226 uiTextureWedgeTabIdx = pcCU->getWedgePredTexTabIdx( uiAbsPartIdx );1227 }1228 else1229 {1230 // decoder: get and store wedge pattern in CU1231 uiTextureWedgeTabIdx = getBestWedgeFromText( pcCU, uiAbsPartIdx, (UInt)iWidth, (UInt)iHeight );1232 UInt uiDepth = (pcCU->getDepth(0)) + (pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1);1233 pcCU->setWedgePredTexTabIdxSubParts( uiTextureWedgeTabIdx, uiAbsPartIdx, uiDepth );1234 }1235 TComWedgelet* pcWedgelet = &(pacWedgeList->at(uiTextureWedgeTabIdx));1236 1237 // get wedge pred DCs1238 Int iPredDC1 = 0;1239 Int iPredDC2 = 0;1240 Int* piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt );1241 Int iMaskStride = ( iWidth<<1 ) + 1;1242 piMask += iMaskStride+1;1243 getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );1244 1245 if( bDelta )1246 {1247 xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 );1248 xDeltaDCQuantScaleUp( pcCU, iDeltaDC2 );1249 }1250 1251 // assign wedge pred DCs to prediction1252 if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip ( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); }1253 else { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); }1254 }1255 1256 Void TComPrediction::xPredIntraContourTex( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, Int iDeltaDC1, Int iDeltaDC2 )1257 {1258 // get contour pattern1259 TComWedgelet* pcContourWedge = new TComWedgelet( iWidth, iHeight );1260 getBestContourFromText( pcCU, uiAbsPartIdx, (UInt)iWidth, (UInt)iHeight, pcContourWedge );1261 1262 // get wedge pred DCs1263 Int iPredDC1 = 0;1264 Int iPredDC2 = 0;1265 Int* piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt );1266 Int iMaskStride = ( iWidth<<1 ) + 1;1267 piMask += iMaskStride+1;1268 getWedgePredDCs( pcContourWedge, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );1269 1270 if( bDelta )1271 {1272 xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 );1273 xDeltaDCQuantScaleUp( pcCU, iDeltaDC2 );1274 }1275 1276 // assign wedge pred DCs to prediction1277 if( bDelta ) { assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, Clip ( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); }1278 else { assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, iPredDC1, iPredDC2 ); }1279 1280 pcContourWedge->destroy();1281 delete pcContourWedge;1282 }1283 #endif1284 #if HHI_DMM_INTRA1285 494 Void TComPrediction::calcWedgeDCs( TComWedgelet* pcWedgelet, Pel* piOrig, UInt uiStride, Int& riDC1, Int& riDC2 ) 1286 495 { … … 1367 576 } 1368 577 else 1369 {578 { 1370 579 piTemp[uiX] = iDC1; 1371 580 } … … 1377 586 } 1378 587 1379 UInt TComPrediction::getBestWedgeFromText( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, WedgeDist eWedgeDist ) 588 Void TComPrediction::getWedgePredDCs( TComWedgelet* pcWedgelet, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2, Bool bAbove, Bool bLeft ) 589 { 590 riPredDC1 = ( 1<<( g_uiBitDepth + g_uiBitIncrement - 1) ); //pred val, if no neighbors are available 591 riPredDC2 = ( 1<<( g_uiBitDepth + g_uiBitIncrement - 1) ); 592 593 if( !bAbove && !bLeft ) { return; } 594 595 UInt uiNumSmpDC1 = 0, uiNumSmpDC2 = 0; 596 Int iPredDC1 = 0, iPredDC2 = 0; 597 598 Bool* pabWedgePattern = pcWedgelet->getPattern(); 599 UInt uiWedgeStride = pcWedgelet->getStride(); 600 601 if( bAbove ) 602 { 603 for( Int k = 0; k < pcWedgelet->getWidth(); k++ ) 604 { 605 if( true == pabWedgePattern[k] ) 606 { 607 iPredDC2 += piMask[k-iMaskStride]; 608 uiNumSmpDC2++; 609 } 610 else 611 { 612 iPredDC1 += piMask[k-iMaskStride]; 613 uiNumSmpDC1++; 614 } 615 } 616 } 617 if( bLeft ) 618 { 619 for( Int k = 0; k < pcWedgelet->getHeight(); k++ ) 620 { 621 if( true == pabWedgePattern[k*uiWedgeStride] ) 622 { 623 iPredDC2 += piMask[k*iMaskStride-1]; 624 uiNumSmpDC2++; 625 } 626 else 627 { 628 iPredDC1 += piMask[k*iMaskStride-1]; 629 uiNumSmpDC1++; 630 } 631 } 632 } 633 634 if( uiNumSmpDC1 > 0 ) 635 { 636 iPredDC1 /= uiNumSmpDC1; 637 riPredDC1 = iPredDC1; 638 } 639 if( uiNumSmpDC2 > 0 ) 640 { 641 iPredDC2 /= uiNumSmpDC2; 642 riPredDC2 = iPredDC2; 643 } 644 } 645 #endif 646 647 #if HHI_DMM_WEDGE_INTRA 648 Void TComPrediction::xPredIntraWedgeFull( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, UInt uiTabIdx, Int iDeltaDC1, Int iDeltaDC2 ) 649 { 650 assert( iWidth >= DMM_WEDGEMODEL_MIN_SIZE && iWidth <= DMM_WEDGEMODEL_MAX_SIZE ); 651 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[iWidth])]; 652 TComWedgelet* pcWedgelet = &(pacWedgeList->at(uiTabIdx)); 653 654 // get wedge pred DCs 655 Int iPredDC1 = 0; 656 Int iPredDC2 = 0; 657 658 Int* piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); 659 Int iMaskStride = ( iWidth<<1 ) + 1; 660 piMask += iMaskStride+1; 661 getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft ); 662 663 if( bDelta ) 664 { 665 xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 ); 666 xDeltaDCQuantScaleUp( pcCU, iDeltaDC2 ); 667 } 668 669 // assign wedge pred DCs to prediction 670 if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); } 671 else { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); } 672 } 673 674 UInt TComPrediction::getBestContinueWedge( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Int iDeltaEnd ) 675 { 676 UInt uiThisBlockSize = uiWidth; 677 assert( uiThisBlockSize >= DMM_WEDGEMODEL_MIN_SIZE && uiThisBlockSize <= DMM_WEDGEMODEL_MAX_SIZE ); 678 WedgeList* pacContDWedgeList = &g_aacWedgeLists [(g_aucConvertToBit[uiThisBlockSize])]; 679 WedgeRefList* pacContDWedgeRefList = &g_aacWedgeRefLists[(g_aucConvertToBit[uiThisBlockSize])]; 680 681 UInt uiPredDirWedgeTabIdx = 0; 682 TComDataCU* pcTempCU; 683 UInt uiTempPartIdx; 684 // 1st: try continue above wedgelet 685 pcTempCU = pcCU->getPUAbove( uiTempPartIdx, pcCU->getZorderIdxInCU() + uiAbsPartIdx ); 686 if( pcTempCU ) 687 { 688 UChar uhLumaIntraDir = pcTempCU->getLumaIntraDir( uiTempPartIdx ); 689 if( DMM_WEDGE_FULL_IDX == uhLumaIntraDir || 690 DMM_WEDGE_FULL_D_IDX == uhLumaIntraDir || 691 DMM_WEDGE_PREDDIR_IDX == uhLumaIntraDir || 692 DMM_WEDGE_PREDDIR_D_IDX == uhLumaIntraDir 693 #if HHI_DMM_PRED_TEX 694 || 695 DMM_WEDGE_PREDTEX_IDX == uhLumaIntraDir || 696 DMM_WEDGE_PREDTEX_D_IDX == uhLumaIntraDir 697 #endif 698 ) 699 { 700 UInt uiRefWedgeSize = (UInt)g_aucIntraSizeIdxToWedgeSize[pcTempCU->getIntraSizeIdx( uiTempPartIdx )]; 701 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiRefWedgeSize])]; 702 703 // get offset between current and reference block 704 UInt uiOffsetX = 0; 705 UInt uiOffsetY = 0; 706 xGetBlockOffset( pcCU, uiAbsPartIdx, pcTempCU, uiTempPartIdx, uiOffsetX, uiOffsetY ); 707 708 // get reference wedgelet 709 UInt uiRefWedgeTabIdx = 0; 710 switch( uhLumaIntraDir ) 711 { 712 case( DMM_WEDGE_FULL_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgeFullTabIdx ( uiTempPartIdx ); } break; 713 case( DMM_WEDGE_FULL_D_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgeFullTabIdx ( uiTempPartIdx ); } break; 714 case( DMM_WEDGE_PREDDIR_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgePredDirTabIdx( uiTempPartIdx ); } break; 715 case( DMM_WEDGE_PREDDIR_D_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgePredDirTabIdx( uiTempPartIdx ); } break; 716 #if HHI_DMM_PRED_TEX 717 case( DMM_WEDGE_PREDTEX_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgePredTexTabIdx( uiTempPartIdx ); } break; 718 case( DMM_WEDGE_PREDTEX_D_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgePredTexTabIdx( uiTempPartIdx ); } break; 719 #endif 720 default: { assert( 0 ); return uiPredDirWedgeTabIdx; } 721 } 722 TComWedgelet* pcRefWedgelet; 723 pcRefWedgelet = &(pacWedgeList->at( uiRefWedgeTabIdx )); 724 725 // find reference wedgelet, if direction is suitable for continue wedge 726 if( pcRefWedgelet->checkPredDirAbovePossible( uiThisBlockSize, uiOffsetX ) ) 727 { 728 UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye; 729 pcRefWedgelet->getPredDirStartEndAbove( uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, uiThisBlockSize, uiOffsetX, iDeltaEnd ); 730 getWedgeListIdx( pacContDWedgeList, pacContDWedgeRefList, uiPredDirWedgeTabIdx, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye ); 731 return uiPredDirWedgeTabIdx; 732 } 733 } 734 } 735 736 // 2nd: try continue left wedglelet 737 pcTempCU = pcCU->getPULeft( uiTempPartIdx, pcCU->getZorderIdxInCU() + uiAbsPartIdx ); 738 if( pcTempCU ) 739 { 740 UChar uhLumaIntraDir = pcTempCU->getLumaIntraDir( uiTempPartIdx ); 741 if( DMM_WEDGE_FULL_IDX == uhLumaIntraDir || 742 DMM_WEDGE_FULL_D_IDX == uhLumaIntraDir || 743 DMM_WEDGE_PREDDIR_IDX == uhLumaIntraDir || 744 DMM_WEDGE_PREDDIR_D_IDX == uhLumaIntraDir 745 #if HHI_DMM_PRED_TEX 746 || 747 DMM_WEDGE_PREDTEX_IDX == uhLumaIntraDir || 748 DMM_WEDGE_PREDTEX_D_IDX == uhLumaIntraDir 749 #endif 750 ) 751 { 752 UInt uiRefWedgeSize = (UInt)g_aucIntraSizeIdxToWedgeSize[pcTempCU->getIntraSizeIdx( uiTempPartIdx )]; 753 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiRefWedgeSize])]; 754 755 // get offset between current and reference block 756 UInt uiOffsetX = 0; 757 UInt uiOffsetY = 0; 758 xGetBlockOffset( pcCU, uiAbsPartIdx, pcTempCU, uiTempPartIdx, uiOffsetX, uiOffsetY ); 759 760 // get reference wedgelet 761 UInt uiRefWedgeTabIdx = 0; 762 switch( uhLumaIntraDir ) 763 { 764 case( DMM_WEDGE_FULL_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgeFullTabIdx ( uiTempPartIdx ); } break; 765 case( DMM_WEDGE_FULL_D_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgeFullTabIdx ( uiTempPartIdx ); } break; 766 case( DMM_WEDGE_PREDDIR_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgePredDirTabIdx( uiTempPartIdx ); } break; 767 case( DMM_WEDGE_PREDDIR_D_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgePredDirTabIdx( uiTempPartIdx ); } break; 768 #if HHI_DMM_PRED_TEX 769 case( DMM_WEDGE_PREDTEX_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgePredTexTabIdx( uiTempPartIdx ); } break; 770 case( DMM_WEDGE_PREDTEX_D_IDX ): { uiRefWedgeTabIdx = pcTempCU->getWedgePredTexTabIdx( uiTempPartIdx ); } break; 771 #endif 772 default: { assert( 0 ); return uiPredDirWedgeTabIdx; } 773 } 774 TComWedgelet* pcRefWedgelet; 775 pcRefWedgelet = &(pacWedgeList->at( uiRefWedgeTabIdx )); 776 777 // find reference wedgelet, if direction is suitable for continue wedge 778 if( pcRefWedgelet->checkPredDirLeftPossible( uiThisBlockSize, uiOffsetY ) ) 779 { 780 UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye; 781 pcRefWedgelet->getPredDirStartEndLeft( uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, uiThisBlockSize, uiOffsetY, iDeltaEnd ); 782 getWedgeListIdx( pacContDWedgeList, pacContDWedgeRefList, uiPredDirWedgeTabIdx, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye ); 783 return uiPredDirWedgeTabIdx; 784 } 785 } 786 } 787 788 // 3rd: (default) make wedglet from intra dir and max slope point 789 Int iSlopeX = 0; 790 Int iSlopeY = 0; 791 UInt uiStartPosX = 0; 792 UInt uiStartPosY = 0; 793 if( xGetWedgeIntraDirPredData( pcCU, uiAbsPartIdx, uiThisBlockSize, iSlopeX, iSlopeY, uiStartPosX, uiStartPosY ) ) 794 { 795 UChar uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye; 796 xGetWedgeIntraDirStartEnd( pcCU, uiAbsPartIdx, uiThisBlockSize, iSlopeX, iSlopeY, uiStartPosX, uiStartPosY, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye, iDeltaEnd ); 797 getWedgeListIdx( pacContDWedgeList, pacContDWedgeRefList, uiPredDirWedgeTabIdx, uhContD_Xs, uhContD_Ys, uhContD_Xe, uhContD_Ye ); 798 return uiPredDirWedgeTabIdx; 799 } 800 801 return uiPredDirWedgeTabIdx; 802 } 803 804 Void TComPrediction::xGetBlockOffset( TComDataCU* pcCU, UInt uiAbsPartIdx, TComDataCU* pcRefCU, UInt uiRefAbsPartIdx, UInt& ruiOffsetX, UInt& ruiOffsetY ) 805 { 806 ruiOffsetX = 0; 807 ruiOffsetY = 0; 808 809 // get offset between current and above/left block 810 UInt uiThisOriginX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; 811 UInt uiThisOriginY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 812 813 UInt uiNumPartInRefCU = pcRefCU->getTotalNumPart(); 814 UInt uiMaxDepthRefCU = 0; 815 while( uiNumPartInRefCU > 1 ) 816 { 817 uiNumPartInRefCU >>= 2; 818 uiMaxDepthRefCU++; 819 } 820 821 UInt uiDepthRefPU = (pcRefCU->getDepth(uiRefAbsPartIdx)) + (pcRefCU->getPartitionSize(uiRefAbsPartIdx) == SIZE_2Nx2N ? 0 : 1); 822 UInt uiShifts = (uiMaxDepthRefCU - uiDepthRefPU)*2; 823 UInt uiRefBlockOriginPartIdx = (uiRefAbsPartIdx>>uiShifts)<<uiShifts; 824 825 UInt uiRefOriginX = pcRefCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiRefBlockOriginPartIdx] ]; 826 UInt uiRefOriginY = pcRefCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiRefBlockOriginPartIdx] ]; 827 828 if( (uiThisOriginX - uiRefOriginX) > 0 ) { ruiOffsetX = (UInt)(uiThisOriginX - uiRefOriginX); } 829 if( (uiThisOriginY - uiRefOriginY) > 0 ) { ruiOffsetY = (UInt)(uiThisOriginY - uiRefOriginY); } 830 } 831 832 Bool TComPrediction::xGetWedgeIntraDirPredData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int& riSlopeX, Int& riSlopeY, UInt& ruiStartPosX, UInt& ruiStartPosY ) 833 { 834 riSlopeX = 0; 835 riSlopeY = 0; 836 ruiStartPosX = 0; 837 ruiStartPosY = 0; 838 839 // 1st step: get wedge start point (max. slope) 840 Int* piSource = pcCU->getPattern()->getAdiOrgBuf( uiBlockSize, uiBlockSize, m_piYuvExt ); 841 Int iSourceStride = ( uiBlockSize<<1 ) + 1; 842 843 UInt uiSlopeMaxAbove = 0; 844 UInt uiPosSlopeMaxAbove = 0; 845 for( UInt uiPosHor = 0; uiPosHor < (uiBlockSize-1); uiPosHor++ ) 846 { 847 if( abs( piSource[uiPosHor+1] - piSource[uiPosHor] ) > uiSlopeMaxAbove ) 848 { 849 uiSlopeMaxAbove = abs( piSource[uiPosHor+1] - piSource[uiPosHor] ); 850 uiPosSlopeMaxAbove = uiPosHor; 851 } 852 } 853 854 UInt uiSlopeMaxLeft = 0; 855 UInt uiPosSlopeMaxLeft = 0; 856 for( UInt uiPosVer = 0; uiPosVer < (uiBlockSize-1); uiPosVer++ ) 857 { 858 if( abs( piSource[(uiPosVer+1)*iSourceStride] - piSource[uiPosVer*iSourceStride] ) > uiSlopeMaxLeft ) 859 { 860 uiSlopeMaxLeft = abs( piSource[(uiPosVer+1)*iSourceStride] - piSource[uiPosVer*iSourceStride] ); 861 uiPosSlopeMaxLeft = uiPosVer; 862 } 863 } 864 865 if( uiSlopeMaxAbove == 0 && uiSlopeMaxLeft == 0 ) 866 { 867 return false; 868 } 869 870 if( uiSlopeMaxAbove > uiSlopeMaxLeft ) 871 { 872 ruiStartPosX = uiPosSlopeMaxAbove; 873 ruiStartPosY = 0; 874 } 875 else 876 { 877 ruiStartPosX = 0; 878 ruiStartPosY = uiPosSlopeMaxLeft; 879 } 880 881 // 2nd step: derive wedge direction 882 Int angTable[9] = {0,2,5,9,13,17,21,26,32}; 883 884 Int uiPreds[2] = {-1, -1}; 885 Int uiPredNum = pcCU->getIntraDirLumaPredictor( uiAbsPartIdx, uiPreds ); 886 887 UInt uiDirMode = 0; 888 if( uiPredNum == 1 ) 889 { 890 uiDirMode = g_aucAngIntraModeOrder[uiPreds[0]]; 891 } 892 else if( uiPredNum == 2 ) 893 { 894 uiDirMode = g_aucAngIntraModeOrder[uiPreds[1]]; 895 } 896 897 if( uiDirMode == 0 ) 898 { 899 return false; 900 } 901 902 Bool modeVer = (uiDirMode < 18); 903 Bool modeHor = !modeVer; 904 Int intraPredAngle = modeVer ? uiDirMode - 9 : modeHor ? uiDirMode - 25 : 0; 905 Int absAng = abs(intraPredAngle); 906 Int signAng = intraPredAngle < 0 ? -1 : 1; 907 absAng = angTable[absAng]; 908 intraPredAngle = signAng * absAng; 909 910 // 3rd step: set slope for direction 911 if( modeHor ) 912 { 913 if( intraPredAngle > 0 ) 914 { 915 riSlopeX = -32; 916 riSlopeY = intraPredAngle; 917 } 918 else 919 { 920 riSlopeX = 32; 921 riSlopeY = -intraPredAngle; 922 } 923 } 924 else if( modeVer ) 925 { 926 if( intraPredAngle > 0 ) 927 { 928 riSlopeX = intraPredAngle; 929 riSlopeY = -32; 930 } 931 else 932 { 933 riSlopeX = -intraPredAngle; 934 riSlopeY = 32; 935 } 936 } 937 938 return true; 939 } 940 941 Void TComPrediction::xGetWedgeIntraDirStartEnd( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int iDeltaX, Int iDeltaY, UInt uiPMSPosX, UInt uiPMSPosY, UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, Int iDeltaEnd ) 942 { 943 ruhXs = 0; 944 ruhYs = 0; 945 ruhXe = 0; 946 ruhYe = 0; 947 UInt uiOri; 948 949 // scaling of start pos and block size to wedge resolution 950 UInt uiScaledStartPosX = 0; 951 UInt uiScaledStartPosY = 0; 952 UInt uiScaledBlockSize = 0; 953 WedgeResolution eWedgeRes = g_aeWedgeResolutionList[(UInt)g_aucConvertToBit[uiBlockSize]]; 954 switch( eWedgeRes ) 955 { 956 case( DOUBLE_PEL ): { uiScaledStartPosX = (uiPMSPosX>>1); uiScaledStartPosY = (uiPMSPosY>>1); uiScaledBlockSize = (uiBlockSize>>1); break; } 957 case( FULL_PEL ): { uiScaledStartPosX = uiPMSPosX; uiScaledStartPosY = uiPMSPosY; uiScaledBlockSize = uiBlockSize; break; } 958 case( HALF_PEL ): { uiScaledStartPosX = (uiPMSPosX<<1); uiScaledStartPosY = (uiPMSPosY<<1); uiScaledBlockSize = (uiBlockSize<<1); break; } 959 } 960 961 // case above 962 if( uiScaledStartPosX > 0 && uiScaledStartPosY == 0 ) 963 { 964 ruhXs = (UChar)uiScaledStartPosX; 965 ruhYs = 0; 966 967 if( iDeltaY == 0 ) 968 { 969 if( iDeltaX < 0 ) 970 { 971 uiOri = 0; 972 ruhXe = 0; 973 ruhYe = (UChar)Min( Max( iDeltaEnd, 0 ), (uiScaledBlockSize-1) ); 974 return; 975 } 976 else 977 { 978 uiOri = 1; 979 ruhXe = (UChar)(uiScaledBlockSize-1); ; 980 ruhYe = (UChar)Min( Max( -iDeltaEnd, 0 ), (uiScaledBlockSize-1) ); 981 std::swap( ruhXs, ruhXe ); 982 std::swap( ruhYs, ruhYe ); 983 return; 984 } 985 } 986 987 // regular case 988 Int iVirtualEndX = (Int)ruhXs + roftoi( (Double)(uiScaledBlockSize-1) * ((Double)iDeltaX / (Double)iDeltaY) ); 989 990 if( iVirtualEndX < 0 ) 991 { 992 Int iYe = roftoi( (Double)(0 - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) + iDeltaEnd; 993 if( iYe < (Int)uiScaledBlockSize ) 994 { 995 uiOri = 0; 996 ruhXe = 0; 997 ruhYe = (UChar)Max( iYe, 0 ); 998 return; 999 } 1000 else 1001 { 1002 uiOri = 4; 1003 ruhXe = (UChar)Min( (iYe - (uiScaledBlockSize-1)), (uiScaledBlockSize-1) ); 1004 ruhYe = (UChar)(uiScaledBlockSize-1); 1005 return; 1006 } 1007 } 1008 else if( iVirtualEndX > (uiScaledBlockSize-1) ) 1009 { 1010 Int iYe = roftoi( (Double)((Int)(uiScaledBlockSize-1) - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) - iDeltaEnd; 1011 if( iYe < (Int)uiScaledBlockSize ) 1012 { 1013 uiOri = 1; 1014 ruhXe = (UChar)(uiScaledBlockSize-1); 1015 ruhYe = (UChar)Max( iYe, 0 ); 1016 std::swap( ruhXs, ruhXe ); 1017 std::swap( ruhYs, ruhYe ); 1018 return; 1019 } 1020 else 1021 { 1022 uiOri = 4; 1023 ruhXe = (UChar)Max( ((uiScaledBlockSize-1) - (iYe - (uiScaledBlockSize-1))), 0 ); 1024 ruhYe = (UChar)(uiScaledBlockSize-1); 1025 return; 1026 } 1027 } 1028 else 1029 { 1030 Int iXe = iVirtualEndX + iDeltaEnd; 1031 if( iXe < 0 ) 1032 { 1033 uiOri = 0; 1034 ruhXe = 0; 1035 ruhYe = (UChar)Max( ((uiScaledBlockSize-1) + iXe), 0 ); 1036 return; 1037 } 1038 else if( iXe > (uiScaledBlockSize-1) ) 1039 { 1040 uiOri = 1; 1041 ruhXe = (UChar)(uiScaledBlockSize-1); 1042 ruhYe = (UChar)Max( ((uiScaledBlockSize-1) - (iXe - (uiScaledBlockSize-1))), 0 ); 1043 std::swap( ruhXs, ruhXe ); 1044 std::swap( ruhYs, ruhYe ); 1045 return; 1046 } 1047 else 1048 { 1049 uiOri = 4; 1050 ruhXe = (UChar)iXe; 1051 ruhYe = (UChar)(uiScaledBlockSize-1); 1052 return; 1053 } 1054 } 1055 } 1056 1057 // case left 1058 if( uiScaledStartPosY > 0 && uiScaledStartPosX == 0 ) 1059 { 1060 ruhXs = 0; 1061 ruhYs = (UChar)uiScaledStartPosY; 1062 1063 if( iDeltaX == 0 ) 1064 { 1065 if( iDeltaY < 0 ) 1066 { 1067 uiOri = 0; 1068 ruhXe = (UChar)Min( Max( -iDeltaEnd, 0 ), (uiScaledBlockSize-1) ); 1069 ruhYe = 0; 1070 std::swap( ruhXs, ruhXe ); 1071 std::swap( ruhYs, ruhYe ); 1072 return; 1073 } 1074 else 1075 { 1076 uiOri = 3; 1077 ruhXe = (UChar)Min( Max( iDeltaEnd, 0 ), (uiScaledBlockSize-1) ); 1078 ruhYe = (UChar)(uiScaledBlockSize-1); 1079 return; 1080 } 1081 } 1082 1083 // regular case 1084 Int iVirtualEndY = (Int)ruhYs + roftoi( (Double)(uiScaledBlockSize-1) * ((Double)iDeltaY / (Double)iDeltaX) ); 1085 1086 if( iVirtualEndY < 0 ) 1087 { 1088 Int iXe = roftoi( (Double)(0 - (Int)ruhYs ) * ((Double)iDeltaX / (Double)iDeltaY) ) - iDeltaEnd; 1089 if( iXe < (Int)uiScaledBlockSize ) 1090 { 1091 uiOri = 0; 1092 ruhXe = (UChar)Max( iXe, 0 ); 1093 ruhYe = 0; 1094 std::swap( ruhXs, ruhXe ); 1095 std::swap( ruhYs, ruhYe ); 1096 return; 1097 } 1098 else 1099 { 1100 uiOri = 5; 1101 ruhXe = (UChar)(uiScaledBlockSize-1); 1102 ruhYe = (UChar)Min( (iXe - (uiScaledBlockSize-1)), (uiScaledBlockSize-1) ); 1103 std::swap( ruhXs, ruhXe ); 1104 std::swap( ruhYs, ruhYe ); 1105 return; 1106 } 1107 } 1108 else if( iVirtualEndY > (uiScaledBlockSize-1) ) 1109 { 1110 Int iXe = roftoi( (Double)((Int)(uiScaledBlockSize-1) - (Int)ruhYs ) * ((Double)iDeltaX / (Double)iDeltaY) ) + iDeltaEnd; 1111 if( iXe < (Int)uiScaledBlockSize ) 1112 { 1113 uiOri = 3; 1114 ruhXe = (UChar)Max( iXe, 0 ); 1115 ruhYe = (UChar)(uiScaledBlockSize-1); 1116 return; 1117 } 1118 else 1119 { 1120 uiOri = 5; 1121 ruhXe = (UChar)(uiScaledBlockSize-1); 1122 ruhYe = (UChar)Max( ((uiScaledBlockSize-1) - (iXe - (uiScaledBlockSize-1))), 0 ); 1123 std::swap( ruhXs, ruhXe ); 1124 std::swap( ruhYs, ruhYe ); 1125 return; 1126 } 1127 } 1128 else 1129 { 1130 Int iYe = iVirtualEndY - iDeltaEnd; 1131 if( iYe < 0 ) 1132 { 1133 uiOri = 0; 1134 ruhXe = (UChar)Max( ((uiScaledBlockSize-1) + iYe), 0 ); 1135 ruhYe = 0; 1136 std::swap( ruhXs, ruhXe ); 1137 std::swap( ruhYs, ruhYe ); 1138 return; 1139 } 1140 else if( iYe > (uiScaledBlockSize-1) ) 1141 { 1142 uiOri = 3; 1143 ruhXe = (UChar)Max( ((uiScaledBlockSize-1) - (iYe - (uiScaledBlockSize-1))), 0 ); 1144 ruhYe = (UChar)(uiScaledBlockSize-1); 1145 return; 1146 } 1147 else 1148 { 1149 uiOri = 5; 1150 ruhXe = (UChar)(uiScaledBlockSize-1); 1151 ruhYe = (UChar)iYe; 1152 std::swap( ruhXs, ruhXe ); 1153 std::swap( ruhYs, ruhYe ); 1154 return; 1155 } 1156 } 1157 } 1158 1159 // case origin 1160 if( uiScaledStartPosX == 0 && uiScaledStartPosY == 0 ) 1161 { 1162 if( iDeltaX*iDeltaY < 0 ) 1163 { 1164 return; 1165 } 1166 1167 ruhXs = 0; 1168 ruhYs = 0; 1169 1170 if( iDeltaY == 0 ) 1171 { 1172 uiOri = 1; 1173 ruhXe = (UChar)(uiScaledBlockSize-1); 1174 ruhYe = 0; 1175 std::swap( ruhXs, ruhXe ); 1176 std::swap( ruhYs, ruhYe ); 1177 return; 1178 } 1179 1180 if( iDeltaX == 0 ) 1181 { 1182 uiOri = 0; 1183 ruhXe = 0; 1184 ruhYe = (UChar)(uiScaledBlockSize-1); 1185 return; 1186 } 1187 1188 Int iVirtualEndX = (Int)ruhXs + roftoi( (Double)(uiScaledBlockSize-1) * ((Double)iDeltaX / (Double)iDeltaY) ); 1189 1190 if( iVirtualEndX > (uiScaledBlockSize-1) ) 1191 { 1192 Int iYe = roftoi( (Double)((Int)(uiScaledBlockSize-1) - (Int)ruhXs) * ((Double)iDeltaY / (Double)iDeltaX) ) - iDeltaEnd; 1193 if( iYe < (Int)uiScaledBlockSize ) 1194 { 1195 uiOri = 1; 1196 ruhXe = (UChar)(uiScaledBlockSize-1); 1197 ruhYe = (UChar)Max( iYe, 0 ); 1198 std::swap( ruhXs, ruhXe ); 1199 std::swap( ruhYs, ruhYe ); 1200 return; 1201 } 1202 else 1203 { 1204 uiOri = 3; 1205 ruhXe = (UChar)Max( ((uiScaledBlockSize-1) - (iYe - (uiScaledBlockSize-1))), 0 ); 1206 ruhYe = (UChar)(uiScaledBlockSize-1); 1207 return; 1208 } 1209 } 1210 else 1211 { 1212 Int iXe = iVirtualEndX + iDeltaEnd; 1213 if( iXe < 0 ) 1214 { 1215 uiOri = 0; 1216 ruhXe = 0; 1217 ruhYe = (UChar)Max( ((uiScaledBlockSize-1) + iXe), 0 ); 1218 return; 1219 } 1220 else if( iXe > (uiScaledBlockSize-1) ) 1221 { 1222 uiOri = 1; 1223 ruhXe = (UChar)(uiScaledBlockSize-1); 1224 ruhYe = (UChar)Max( ((uiScaledBlockSize-1) - (iXe - (uiScaledBlockSize-1))), 0 ); 1225 std::swap( ruhXs, ruhXe ); 1226 std::swap( ruhYs, ruhYe ); 1227 return; 1228 } 1229 else 1230 { 1231 uiOri = 3; 1232 ruhXe = (UChar)iXe; 1233 ruhYe = (UChar)(uiScaledBlockSize-1); 1234 return; 1235 } 1236 } 1237 } 1238 } 1239 1240 Bool TComPrediction::getWedgeListIdx( WedgeList* pcWedgeList, WedgeRefList* pcWedgeRefList, UInt& ruiTabIdx, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe ) 1241 { 1242 ruiTabIdx = 0; 1243 1244 for( UInt uiIdx = 0; uiIdx < pcWedgeList->size(); uiIdx++ ) 1245 { 1246 TComWedgelet* pcTestWedge = &(pcWedgeList->at(uiIdx)); 1247 1248 if( pcTestWedge->getStartX() == uhXs && 1249 pcTestWedge->getStartY() == uhYs && 1250 pcTestWedge->getEndX() == uhXe && 1251 pcTestWedge->getEndY() == uhYe ) 1252 { 1253 ruiTabIdx = uiIdx; 1254 return true; 1255 } 1256 } 1257 1258 // additionally search in WedgeRef lists of duplicated patterns 1259 for( UInt uiIdx = 0; uiIdx < pcWedgeRefList->size(); uiIdx++ ) 1260 { 1261 TComWedgeRef* pcTestWedgeRef = &(pcWedgeRefList->at(uiIdx)); 1262 1263 if( pcTestWedgeRef->getStartX() == uhXs && 1264 pcTestWedgeRef->getStartY() == uhYs && 1265 pcTestWedgeRef->getEndX() == uhXe && 1266 pcTestWedgeRef->getEndY() == uhYe ) 1267 { 1268 ruiTabIdx = pcTestWedgeRef->getRefIdx(); 1269 return true; 1270 } 1271 } 1272 1273 return false; 1274 } 1275 1276 Void TComPrediction::xPredIntraWedgeDir( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, Int iWedgeDeltaEnd, Int iDeltaDC1, Int iDeltaDC2 ) 1277 { 1278 assert( iWidth >= DMM_WEDGEMODEL_MIN_SIZE && iWidth <= DMM_WEDGEMODEL_MAX_SIZE ); 1279 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[iWidth])]; 1280 1281 // get wedge pattern 1282 UInt uiDirWedgeTabIdx = 0; 1283 if( bEncoder ) 1284 { 1285 // encoder: load stored wedge pattern from CU 1286 uiDirWedgeTabIdx = pcCU->getWedgePredDirTabIdx( uiAbsPartIdx ); 1287 } 1288 else 1289 { 1290 uiDirWedgeTabIdx = getBestContinueWedge( pcCU, uiAbsPartIdx, iWidth, iHeight, iWedgeDeltaEnd ); 1291 1292 UInt uiDepth = (pcCU->getDepth(0)) + (pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1); 1293 pcCU->setWedgePredDirTabIdxSubParts( uiDirWedgeTabIdx, uiAbsPartIdx, uiDepth ); 1294 } 1295 TComWedgelet* pcWedgelet = &(pacWedgeList->at(uiDirWedgeTabIdx)); 1296 1297 // get wedge pred DCs 1298 Int iPredDC1 = 0; 1299 Int iPredDC2 = 0; 1300 1301 Int* piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); 1302 Int iMaskStride = ( iWidth<<1 ) + 1; 1303 piMask += iMaskStride+1; 1304 getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft ); 1305 1306 if( bDelta ) 1307 { 1308 xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 ); 1309 xDeltaDCQuantScaleUp( pcCU, iDeltaDC2 ); 1310 } 1311 1312 // assign wedge pred DCs to prediction 1313 if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip ( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); } 1314 else { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); } 1315 } 1316 #endif 1317 1318 #if HHI_DMM_PRED_TEX 1319 Void TComPrediction::xPredIntraWedgeTex( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, Int iDeltaDC1, Int iDeltaDC2 ) 1320 { 1321 assert( iWidth >= DMM_WEDGEMODEL_MIN_SIZE && iWidth <= DMM_WEDGEMODEL_MAX_SIZE ); 1322 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[iWidth])]; 1323 1324 // get wedge pattern 1325 UInt uiTextureWedgeTabIdx = 0; 1326 if( bEncoder ) 1327 { 1328 // encoder: load stored wedge pattern from CU 1329 uiTextureWedgeTabIdx = pcCU->getWedgePredTexTabIdx( uiAbsPartIdx ); 1330 } 1331 else 1332 { 1333 // decoder: get and store wedge pattern in CU 1334 uiTextureWedgeTabIdx = getBestWedgeFromText( pcCU, uiAbsPartIdx, (UInt)iWidth, (UInt)iHeight ); 1335 UInt uiDepth = (pcCU->getDepth(0)) + (pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1); 1336 pcCU->setWedgePredTexTabIdxSubParts( uiTextureWedgeTabIdx, uiAbsPartIdx, uiDepth ); 1337 } 1338 TComWedgelet* pcWedgelet = &(pacWedgeList->at(uiTextureWedgeTabIdx)); 1339 1340 // get wedge pred DCs 1341 Int iPredDC1 = 0; 1342 Int iPredDC2 = 0; 1343 Int* piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); 1344 Int iMaskStride = ( iWidth<<1 ) + 1; 1345 piMask += iMaskStride+1; 1346 getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft ); 1347 1348 if( bDelta ) 1349 { 1350 xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 ); 1351 xDeltaDCQuantScaleUp( pcCU, iDeltaDC2 ); 1352 } 1353 1354 // assign wedge pred DCs to prediction 1355 if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip ( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); } 1356 else { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); } 1357 } 1358 1359 Void TComPrediction::xPredIntraContourTex( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, Int iDeltaDC1, Int iDeltaDC2 ) 1360 { 1361 // get contour pattern 1362 TComWedgelet* pcContourWedge = new TComWedgelet( iWidth, iHeight ); 1363 getBestContourFromText( pcCU, uiAbsPartIdx, (UInt)iWidth, (UInt)iHeight, pcContourWedge ); 1364 1365 // get wedge pred DCs 1366 Int iPredDC1 = 0; 1367 Int iPredDC2 = 0; 1368 Int* piMask = pcCU->getPattern()->getAdiOrgBuf( iWidth, iHeight, m_piYuvExt ); 1369 Int iMaskStride = ( iWidth<<1 ) + 1; 1370 piMask += iMaskStride+1; 1371 getWedgePredDCs( pcContourWedge, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft ); 1372 1373 if( bDelta ) 1374 { 1375 xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 ); 1376 xDeltaDCQuantScaleUp( pcCU, iDeltaDC2 ); 1377 } 1378 1379 // assign wedge pred DCs to prediction 1380 if( bDelta ) { assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, Clip ( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); } 1381 else { assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, iPredDC1, iPredDC2 ); } 1382 1383 pcContourWedge->destroy(); 1384 delete pcContourWedge; 1385 } 1386 1387 Void TComPrediction::getBestContourFromText( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge, Pel* piTextureBlock ) 1388 { 1389 pcContourWedge->clear(); 1390 Bool* pabContourPattern = pcContourWedge->getPattern(); 1391 1392 // get copy of according texture luma block 1393 Pel* piTempY = NULL; 1394 TComYuv cTempYuv; 1395 1396 if ( piTextureBlock ) 1397 { 1398 piTempY = piTextureBlock; 1399 } 1400 else 1401 { 1402 cTempYuv.create( uiWidth, uiHeight ); cTempYuv.clear(); 1403 piTempY = cTempYuv.getLumaAddr(); 1404 1405 fillTexturePicTempBlock( pcCU, uiAbsPartIdx, piTempY, uiWidth, uiHeight ); 1406 1407 piTempY = cTempYuv.getLumaAddr(); 1408 } 1409 1410 // find contour for texture luma block 1411 UInt iDC = 0; 1412 for( UInt k = 0; k < (uiWidth*uiHeight); k++ ) { iDC += piTempY[k]; } 1413 iDC /= (uiWidth*uiHeight); 1414 1415 if ( piTextureBlock ) 1416 { 1417 piTempY = piTextureBlock; 1418 } 1419 else 1420 { 1421 piTempY = cTempYuv.getLumaAddr(); 1422 } 1423 1424 for( UInt k = 0; k < (uiWidth*uiHeight); k++ ) 1425 { 1426 pabContourPattern[k] = (piTempY[k] > iDC) ? true : false; 1427 } 1428 1429 cTempYuv.destroy(); 1430 } 1431 1432 UInt TComPrediction::getBestWedgeFromText( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, WedgeDist eWedgeDist, Pel* piTextureBlock ) 1380 1433 { 1381 1434 assert( uiWidth >= DMM_WEDGEMODEL_MIN_SIZE && uiWidth <= DMM_WEDGEMODEL_MAX_SIZE ); … … 1383 1436 1384 1437 // get copy of according texture luma block 1385 UInt uiPartAddr = 0; 1386 Int iBlockWidth, iBlockHeight; 1438 Pel* piTempY = NULL; 1387 1439 TComYuv cTempYuv; 1388 UInt uiTempStride; 1389 Pel* piTempY; 1390 1391 TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getTexturePic()->getPicYuvRec(); 1392 Int iRefStride = pcPicYuvRef->getStride(); 1393 Pel* piRefY; 1394 1395 pcCU->getPartIndexAndSize( uiAbsPartIdx, uiPartAddr, iBlockWidth, iBlockHeight ); 1396 1397 piRefY = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ); 1398 1399 cTempYuv.create( pcCU->getWidth(0), pcCU->getHeight(0) ); cTempYuv.clear(); 1400 uiTempStride = cTempYuv.getStride(); 1401 piTempY = cTempYuv.getLumaAddr( uiAbsPartIdx, uiWidth ); 1402 1403 for ( Int y = 0; y < iBlockHeight; y++ ) 1404 { 1405 ::memcpy(piTempY, piRefY, sizeof(Pel)*iBlockWidth); 1406 piTempY += uiTempStride; 1407 piRefY += iRefStride; 1408 } 1409 1410 piTempY = cTempYuv.getLumaAddr( uiAbsPartIdx, uiWidth ); 1411 1440 1441 if ( piTextureBlock ) 1442 { 1443 piTempY = piTextureBlock; 1444 } 1445 else 1446 { 1447 cTempYuv.create( uiWidth, uiHeight ); cTempYuv.clear(); 1448 piTempY = cTempYuv.getLumaAddr(); 1449 1450 fillTexturePicTempBlock( pcCU, uiAbsPartIdx, piTempY, uiWidth, uiHeight ); 1451 1452 piTempY = cTempYuv.getLumaAddr(); 1453 } 1454 1412 1455 TComWedgeDist cWedgeDist; 1413 1456 UInt uiTextureWedgeTabIdx = 0; … … 1429 1472 for( UInt uiIdx = 0; uiIdx < pacWedgeList->size(); uiIdx++ ) 1430 1473 { 1431 calcWedgeDCs ( &(pacWedgeList->at(uiIdx)), piTempY, ui TempStride, iDC1, iDC2 );1474 calcWedgeDCs ( &(pacWedgeList->at(uiIdx)), piTempY, uiWidth, iDC1, iDC2 ); 1432 1475 assignWedgeDCs2Pred( &(pacWedgeList->at(uiIdx)), piPred, uiPredStride, iDC1, iDC2 ); 1433 1476 1434 UInt uiActDist = cWedgeDist.getDistPart( piPred, uiPredStride, piTempY, ui TempStride, uiWidth, uiHeight, eWedgeDist );1477 UInt uiActDist = cWedgeDist.getDistPart( piPred, uiPredStride, piTempY, uiWidth, uiWidth, uiHeight, eWedgeDist ); 1435 1478 1436 1479 if( uiActDist < uiBestDist || uiBestDist == MAX_UINT ) … … 1446 1489 return uiTextureWedgeTabIdx; 1447 1490 } 1491 1492 Void TComPrediction::fillTexturePicTempBlock( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piTempBlockY, UInt uiWidth, UInt uiHeight ) 1493 { 1494 TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getTexturePic()->getPicYuvRec(); 1495 Int iRefStride = pcPicYuvRef->getStride(); 1496 Pel* piRefY; 1497 1498 piRefY = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiAbsPartIdx ); 1499 1500 for ( Int y = 0; y < uiHeight; y++ ) 1501 { 1502 ::memcpy(piTempBlockY, piRefY, sizeof(Pel)*uiWidth); 1503 piTempBlockY += uiWidth; 1504 piRefY += iRefStride; 1505 } 1506 } 1448 1507 #endif 1449 1508 … … 1498 1557 1499 1558 #if HIGH_ACCURACY_BI 1559 #if DEPTH_MAP_GENERATION 1500 1560 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, Bool bi ) 1501 1561 #else 1562 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi ) 1563 #endif 1564 #else 1565 #if DEPTH_MAP_GENERATION 1502 1566 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ) 1567 #else 1568 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx ) 1569 #endif 1503 1570 #endif 1504 1571 { … … 1507 1574 pcCU->clipMv(cMv); 1508 1575 1576 #if DEPTH_MAP_GENERATION 1509 1577 if( bPrdDepthMap ) 1510 1578 { … … 1517 1585 return; 1518 1586 } 1519 1520 #if MW_DEPTH_MAP_INTERP_FILTER 1587 #endif 1588 1589 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 1521 1590 if( pcCU->getSlice()->getSPS()->isDepth() ) 1522 1591 { … … 1526 1595 UInt uiRShift = 0; 1527 1596 #endif 1528 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, uiRShift, MW_DEPTH_MAP_INTERP_FILTER);1597 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, uiRShift, 2 ); 1529 1598 } 1530 1599 else … … 1543 1612 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred ); 1544 1613 #endif 1545 #if MW_DEPTH_MAP_INTERP_FILTER1614 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 1546 1615 } 1547 1616 #endif … … 1581 1650 #if HIGH_ACCURACY_BI 1582 1651 if( pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ) >= 0 && pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ) >= 0 ) 1652 #if DEPTH_MAP_GENERATION 1583 1653 xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, true ); 1654 #else 1655 xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, true ); 1656 #endif 1584 1657 else 1585 xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap ); 1658 #if DEPTH_MAP_GENERATION 1659 xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap ); 1586 1660 #else 1661 xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx ); 1662 #endif 1663 #else 1664 #if DEPTH_MAP_GENERATION 1587 1665 xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap ); 1666 #else 1667 xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx ); 1668 #endif 1588 1669 #endif 1589 1670 } … … 1610 1691 Int iHor = ( uiFilterMode == 2 ? ( pcMv->getHor() + 2 ) & iFPelMask : pcMv->getHor() ); 1611 1692 Int iVer = ( uiFilterMode == 2 ? ( pcMv->getVer() + 2 ) & iFPelMask : pcMv->getVer() ); 1612 #if MW_DEPTH_MAP_INTERP_FILTER == 2 && MW_FULL_PEL_DEPTH_MAP_MV_SIGNALLING1693 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 1613 1694 if( pcCU->getSlice()->getSPS()->isDepth() ) 1614 1695 { … … 2561 2642 #endif 2562 2643 2563 #if HHI_DMM_ INTRA2644 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 2564 2645 TComWedgeDist::TComWedgeDist() 2565 2646 { -
trunk/source/Lib/TLibCommon/TComPrediction.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 1 34 2 35 … … 55 88 // motion compensation functions 56 89 #if HIGH_ACCURACY_BI 90 #if DEPTH_MAP_GENERATION 57 91 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, Bool bi=false ); 58 92 #else 93 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi=false ); 94 #endif 95 #else 96 #if DEPTH_MAP_GENERATION 59 97 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ); 98 #else 99 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx ); 100 #endif 60 101 #endif 61 102 Void xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ); … … 72 113 #endif 73 114 74 #if HHI_DMM_ INTRA115 #if HHI_DMM_WEDGE_INTRA 75 116 Void xPredIntraWedgeFull ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, UInt uiTabIdx, Int iDeltaDC1 = 0, Int iDeltaDC2 = 0 ); 117 76 118 Void xPredIntraWedgeDir ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, Int iWedgeDeltaEnd, Int iDeltaDC1 = 0, Int iDeltaDC2 = 0 ); 77 78 Void xPredIntraWedgeTex ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, Int iDeltaDC1 = 0, Int iDeltaDC2 = 0 );79 Void xPredIntraContourTex ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, Int iDeltaDC1 = 0, Int iDeltaDC2 = 0 );80 81 119 Void xGetBlockOffset ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComDataCU* pcRefCU, UInt uiRefAbsPartIdx, UInt& ruiOffsetX, UInt& ruiOffsetY ); 82 120 Bool xGetWedgeIntraDirPredData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int& riSlopeX, Int& riSlopeY, UInt& ruiStartPosX, UInt& ruiStartPosY ); 83 121 Void xGetWedgeIntraDirStartEnd ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int iDeltaX, Int iDeltaY, UInt uiPMSPosX, UInt uiPMSPosY, UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, Int iDeltaEnd = 0 ); 122 #endif 123 #if HHI_DMM_PRED_TEX 124 Void xPredIntraWedgeTex ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, Int iDeltaDC1 = 0, Int iDeltaDC2 = 0 ); 125 Void xPredIntraContourTex ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, Int iDeltaDC1 = 0, Int iDeltaDC2 = 0 ); 126 #endif 127 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 84 128 Void xDeltaDCQuantScaleUp ( TComDataCU* pcCU, Int& riDeltaDC ); 85 129 #endif … … 110 154 Void predIntraChromaAng ( TComPattern* pcTComPattern, Int* piSrc, UInt uiDirMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, TComDataCU* pcCU, Bool bAbove, Bool bLeft ); 111 155 112 #if HHI_DMM_ INTRA156 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 113 157 Void predIntraLumaDMM ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder ); 114 158 115 UInt getBestContinueWedge ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Int iDeltaEnd = 0 );116 Void getBestContourFromText ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge );117 118 159 Void getWedgePredDCs ( TComWedgelet* pcWedgelet, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2, Bool bAbove, Bool bLeft ); 119 120 Bool getWedgeListIdx ( WedgeList* pcWedgeList, WedgeRefList* pcWedgeRefList, UInt& ruiTabIdx, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe );121 122 UInt getBestWedgeFromText ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, WedgeDist eWedgeDist = WedgeDist_SAD );123 160 Void calcWedgeDCs ( TComWedgelet* pcWedgelet, Pel* piOrig, UInt uiStride, Int& riDC1, Int& riDC2 ); 124 161 Void assignWedgeDCs2Pred ( TComWedgelet* pcWedgelet, Pel* piPred, UInt uiStride, Int iDC1, Int iDC2 ); 162 #endif 163 #if HHI_DMM_PRED_TEX 164 Void getBestContourFromText ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge, Pel* piTextureBlock = NULL ); 165 UInt getBestWedgeFromText ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, WedgeDist eWedgeDist = WedgeDist_SAD, Pel* piTextureBlock = NULL ); 166 Void fillTexturePicTempBlock ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piTempBlockY, UInt uiWidth, UInt uiHeight ); 167 #endif 168 #if HHI_DMM_WEDGE_INTRA 169 UInt getBestContinueWedge ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Int iDeltaEnd = 0 ); 170 Bool getWedgeListIdx ( WedgeList* pcWedgeList, WedgeRefList* pcWedgeRefList, UInt& ruiTabIdx, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe ); 125 171 #endif 126 172 … … 142 188 }; 143 189 144 #if HHI_DMM_ INTRA190 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 145 191 // ==================================================================================================================== 146 192 // Class definition TComWedgeDist -
trunk/source/Lib/TLibCommon/TComRdCost.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 1 34 2 35 … … 46 79 } 47 80 48 #if SB_INTERVIEW_SKIP_LAMBDA_SCALE81 #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE 49 82 dLambda = m_dLambdaScale * dLambda ; 50 83 #endif … … 125 158 } 126 159 160 #if HHI_INTER_VIEW_MOTION_PRED 127 161 Void 128 162 TComRdCost::setLambdaMVReg( Double dLambda ) … … 131 165 m_uiLambdaMVRegSSE = (UInt)floor( 65536.0 * dLambda ); 132 166 } 167 #endif 133 168 134 169 … … 223 258 m_puiMultiviewRegCostVer = 0; 224 259 225 //GTVSO260 #if HHI_VSO 226 261 m_apRefPics = NULL; 227 262 m_paaiShiftLUTs = NULL; … … 231 266 m_fpDistortFuncVSO = NULL; 232 267 m_pcRenModel = NULL; 233 234 //GT VSO end 235 #if SB_INTERVIEW_SKIP_LAMBDA_SCALE268 #endif 269 270 #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE 236 271 m_dLambdaScale = 1; 237 272 #endif … … 287 322 } 288 323 289 //GTVSO324 #if HHI_VSO 290 325 if ( m_apRefPics != NULL ) 291 326 { … … 298 333 m_paaiShiftLUTs = NULL; 299 334 }; 300 //GT VSO end 335 #endif 301 336 } 302 337 … … 378 413 // initialize 379 414 rcDistParam.iSubShift = 0; 380 #if SB_INTERVIEW_SKIP415 #if HHI_INTERVIEW_SKIP 381 416 rcDistParam.pUsed = 0; 382 417 rcDistParam.iStrideUsed = 0; … … 401 436 // initialize 402 437 rcDistParam.iSubShift = 0; 403 #if SB_INTERVIEW_SKIP438 #if HHI_INTERVIEW_SKIP 404 439 rcDistParam.pUsed = 0; 405 440 rcDistParam.iStrideUsed = 0; … … 436 471 // initialize 437 472 rcDistParam.iSubShift = 0; 438 #if SB_INTERVIEW_SKIP473 #if HHI_INTERVIEW_SKIP 439 474 rcDistParam.pUsed = 0; 440 475 rcDistParam.iStrideUsed = 0; … … 454 489 rcDP.iSubShift = 0; 455 490 rcDP.DistFunc = m_afpDistortFunc[ ( bHadamard ? DF_HADS : DF_SADS ) + g_aucConvertToBit[ iWidth ] + 1 ]; 456 #if SB_INTERVIEW_SKIP491 #if HHI_INTERVIEW_SKIP 457 492 rcDP.pUsed = 0; 458 493 rcDP.iStrideUsed = 0; … … 504 539 return ( uiSum >> g_uiBitIncrement ); 505 540 } 506 #if SB_INTERVIEW_SKIP541 #if HHI_INTERVIEW_SKIP 507 542 UInt TComRdCost::getDistPart( Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, Pel* piUsed, Int iUsedStride, UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc ) 508 543 { … … 3367 3402 Int iTemp; 3368 3403 3369 #if SB_INTERVIEW_SKIP3404 #if HHI_INTERVIEW_SKIP 3370 3405 if( pcDtParam->pUsed ) 3371 3406 { … … 3400 3435 piCur += iStrideCur; 3401 3436 } 3402 #if SB_INTERVIEW_SKIP3437 #if HHI_INTERVIEW_SKIP 3403 3438 } 3404 3439 #endif … … 3427 3462 Int iTemp; 3428 3463 3429 #if SB_INTERVIEW_SKIP3464 #if HHI_INTERVIEW_SKIP 3430 3465 if( pcDtParam->pUsed ) 3431 3466 { … … 3458 3493 piCur += iStrideCur; 3459 3494 } 3460 #if SB_INTERVIEW_SKIP3495 #if HHI_INTERVIEW_SKIP 3461 3496 } 3462 3497 #endif … … 3485 3520 Int iTemp; 3486 3521 3487 #if SB_INTERVIEW_SKIP3522 #if HHI_INTERVIEW_SKIP 3488 3523 if( pcDtParam->pUsed ) 3489 3524 { … … 3523 3558 piCur += iStrideCur; 3524 3559 } 3525 #if SB_INTERVIEW_SKIP3560 #if HHI_INTERVIEW_SKIP 3526 3561 } 3527 3562 #endif … … 3550 3585 Int iTemp; 3551 3586 3552 #if SB_INTERVIEW_SKIP3587 #if HHI_INTERVIEW_SKIP 3553 3588 if( pcDtParam->pUsed ) 3554 3589 { … … 3605 3640 piCur += iStrideCur; 3606 3641 } 3607 #if SB_INTERVIEW_SKIP3642 #if HHI_INTERVIEW_SKIP 3608 3643 } 3609 3644 #endif … … 3631 3666 Int iTemp; 3632 3667 3633 #if SB_INTERVIEW_SKIP3668 #if HHI_INTERVIEW_SKIP 3634 3669 if( pcDtParam->pUsed ) 3635 3670 { … … 3691 3726 piCur += iStrideCur; 3692 3727 } 3693 #if SB_INTERVIEW_SKIP3728 #if HHI_INTERVIEW_SKIP 3694 3729 } 3695 3730 #endif … … 3717 3752 Int iTemp; 3718 3753 3719 #if SB_INTERVIEW_SKIP3754 #if HHI_INTERVIEW_SKIP 3720 3755 if( pcDtParam->pUsed ) 3721 3756 { … … 3804 3839 piCur += iStrideCur; 3805 3840 } 3806 #if SB_INTERVIEW_SKIP3841 #if HHI_INTERVIEW_SKIP 3807 3842 } 3808 3843 #endif … … 3830 3865 Int iTemp; 3831 3866 3832 #if SB_INTERVIEW_SKIP3867 #if HHI_INTERVIEW_SKIP 3833 3868 if( pcDtParam->pUsed ) 3834 3869 { … … 3980 4015 piCur += iStrideCur; 3981 4016 } 3982 #if SB_INTERVIEW_SKIP4017 #if HHI_INTERVIEW_SKIP 3983 4018 } 3984 4019 #endif … … 4711 4746 4712 4747 4713 //GT VSO 4714 4748 #if HHI_VSO 4715 4749 Void TComRdCost::setLambdaVSO( Double dLambdaVSO ) 4716 4750 { … … 4721 4755 } 4722 4756 4723 Dist TComRdCost::xGetDistVSOMode1( Int iStartPosX, Int iStartPosY, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bSAD )4724 {4725 4726 assert( m_uiVSOMode == 1 );4727 UInt uiShift = g_uiBitIncrement << 1;4728 4729 UInt uiPlane = 0;4730 4731 Int iRefWidth = m_pcVideoPicYuv->getWidth();4732 Int iStrideOrgVid;4733 UInt uiErr = 0;4734 4735 if (uiPlane > 0)4736 {4737 iStartPosX = iStartPosX >> 1;4738 iStartPosY = iStartPosY >> 1;4739 iRefWidth = iRefWidth >> 1;4740 iStrideOrgVid = m_pcVideoPicYuv ->getCStride();4741 }4742 else4743 {4744 iStrideOrgVid = m_pcVideoPicYuv ->getStride();4745 }4746 4747 UInt uiReferenceNumber = 0;4748 for (UInt uiReference = 0; uiReference < 3; uiReference+=2 )4749 {4750 if ( m_paaiShiftLUTs[uiReference] == 0 )4751 continue;4752 4753 uiReferenceNumber++;4754 4755 Pel* piOrgVid;4756 4757 if (uiPlane == 0)4758 {4759 piOrgVid = m_pcVideoPicYuv ->getLumaAddr();4760 }4761 else4762 {4763 if (uiPlane == 1)4764 {4765 piOrgVid = m_pcVideoPicYuv ->getCbAddr();4766 }4767 else4768 {4769 piOrgVid = m_pcVideoPicYuv ->getCrAddr();4770 }4771 }4772 4773 piOrgVid += iStartPosY * iStrideOrgVid;4774 4775 for ( Int iY = 0; iY < uiBlkHeight; iY++ )4776 {4777 Int iPos = iStartPosX;4778 4779 for (Int iX = 0; iX < uiBlkWidth; iX++ )4780 {4781 Int iTargetPos;4782 4783 assert( RemoveBitIncrement(piCur[iX]) >= 0 && RemoveBitIncrement(piCur[iX]) <= 256);4784 assert( RemoveBitIncrement(piOrg[iX]) >= 0 && RemoveBitIncrement(piOrg[iX]) <= 256);4785 4786 iTargetPos = iPos - m_paaiShiftLUTs[uiReference][0][RemoveBitIncrement(piCur[iX])] + m_paaiShiftLUTs[uiReference][0][RemoveBitIncrement(piOrg[iX])];4787 iTargetPos = iTargetPos > 0 ? iTargetPos : 0;4788 iTargetPos = iTargetPos < iRefWidth ? iTargetPos : iRefWidth-1;4789 Int iDiff = piOrgVid[iTargetPos] - piOrgVid[iPos];4790 4791 if ( bSAD )4792 {4793 uiErr += abs(iDiff);4794 }4795 else4796 {4797 uiErr += ((iDiff * iDiff) >> uiShift );4798 }4799 4800 iPos++;4801 }4802 4803 piOrgVid += iStrideOrgVid;4804 4805 piCur += iCurStride;4806 piOrg += iOrgStride;4807 4808 }4809 piCur -= iCurStride * uiBlkHeight;4810 piOrg -= iOrgStride * uiBlkHeight;4811 }4812 4813 if ( bSAD )4814 {4815 uiErr = uiErr >> g_uiBitIncrement;4816 }4817 4818 return ( uiErr + ( uiReferenceNumber >> 1 )) / uiReferenceNumber;4819 }4820 4821 Dist TComRdCost::xGetDistVSOMode2( Int iStartPosX, Int iStartPosY, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bSAD )4822 {4823 assert( m_uiVSOMode == 2 );4824 UInt uiShift = g_uiBitIncrement << 1;4825 UInt uiPlane = 0;4826 4827 Int iRefWidth = m_pcVideoPicYuv->getWidth();4828 Int iStrideOrgVid;4829 4830 UInt uiErr = 0;4831 4832 if (uiPlane > 0)4833 {4834 iStartPosX = iStartPosX >> 1;4835 iStartPosY = iStartPosY >> 1;4836 iRefWidth = iRefWidth >> 1;4837 iStrideOrgVid = m_pcVideoPicYuv ->getCStride();4838 }4839 else4840 {4841 iStrideOrgVid = m_pcVideoPicYuv ->getStride();4842 }4843 4844 for (UInt uiRefPic = 0; uiRefPic < m_uiNumberRefPics; uiRefPic++ )4845 {4846 Pel* piRefVid;4847 Pel* piOrgVid;4848 Int iStrideRefVid;4849 4850 if (uiPlane == 0)4851 {4852 piRefVid = m_apRefPics[uiRefPic]->getLumaAddr();4853 piOrgVid = m_pcVideoPicYuv ->getLumaAddr();4854 iStrideRefVid = m_apRefPics[uiRefPic]->getStride();4855 }4856 else4857 {4858 if (uiPlane == 1)4859 {4860 piRefVid = m_apRefPics[uiRefPic]->getCbAddr();4861 piOrgVid = m_pcVideoPicYuv ->getCbAddr();4862 }4863 else4864 {4865 piRefVid = m_apRefPics[uiRefPic]->getCrAddr();4866 piOrgVid = m_pcVideoPicYuv ->getCrAddr();4867 }4868 iStrideRefVid = m_apRefPics[uiRefPic]->getCStride();4869 }4870 4871 piRefVid += iStartPosY * iStrideRefVid;4872 piOrgVid += iStartPosY * iStrideOrgVid;4873 4874 for (Int iY = 0; iY < uiBlkHeight; iY++ )4875 {4876 Int iPos = iStartPosX;4877 4878 for (Int iX = 0; iX < uiBlkWidth; iX++ )4879 {4880 int iTargetPos;4881 4882 AOF( RemoveBitIncrement(piCur[iX]) >= 0 && RemoveBitIncrement(piCur[iX]) <= 255);4883 iTargetPos = iPos - m_paaiShiftLUTs[uiRefPic][0][RemoveBitIncrement(piCur[iX])];4884 iTargetPos = iTargetPos > 0 ? iTargetPos : 0;4885 iTargetPos = iTargetPos < iRefWidth ? iTargetPos : iRefWidth-1;4886 4887 Int iDiff = piRefVid[iTargetPos] - piOrgVid[iPos];4888 4889 if ( bSAD )4890 {4891 uiErr += abs(iDiff);4892 }4893 else4894 {4895 uiErr += ((iDiff * iDiff) >> uiShift );4896 }4897 4898 iPos++;4899 }4900 4901 piRefVid += iStrideRefVid;4902 piOrgVid += iStrideOrgVid;4903 }4904 piCur -= iCurStride * uiBlkHeight;4905 piOrg -= iOrgStride * uiBlkHeight;4906 }4907 4908 if ( bSAD )4909 {4910 uiErr = uiErr >> g_uiBitIncrement;4911 }4912 4913 4914 return ( uiErr + (m_uiNumberRefPics >> 1)) / m_uiNumberRefPics;4915 }4916 4917 Dist TComRdCost::xGetDistVSOMode3( Int iStartPosX, Int iStartPosY, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bSAD )4918 {4919 assert( m_uiVSOMode == 3 );4920 UInt uiShift = g_uiBitIncrement << 1;4921 4922 UInt uiPlane = 0;4923 4924 Int iRefWidth = m_pcVideoPicYuv->getWidth();4925 Int iStrideOrgVid;4926 4927 UInt uiErr = 0;4928 4929 if (uiPlane > 0)4930 {4931 iStartPosX = iStartPosX >> 1;4932 iStartPosY = iStartPosY >> 1;4933 iRefWidth = iRefWidth >> 1;4934 iStrideOrgVid = m_pcVideoPicYuv ->getCStride();4935 }4936 else4937 {4938 iStrideOrgVid = m_pcVideoPicYuv ->getStride();4939 }4940 4941 for (UInt uiRefPicNum = 0; uiRefPicNum < m_uiNumberRefPics; uiRefPicNum++ )4942 {4943 Pel* piRefVid;4944 Pel* piOrgVid;4945 Int iStrideRefVid;4946 4947 if (uiPlane == 0)4948 {4949 piRefVid = m_apRefPics[uiRefPicNum]->getLumaAddr();4950 piOrgVid = m_pcVideoPicYuv ->getLumaAddr();4951 iStrideRefVid = m_apRefPics[uiRefPicNum]->getStride();4952 }4953 else4954 {4955 if (uiPlane == 1)4956 {4957 piRefVid = m_apRefPics[uiRefPicNum]->getCbAddr();4958 piOrgVid = m_pcVideoPicYuv ->getCbAddr();4959 }4960 else4961 {4962 piRefVid = m_apRefPics[uiRefPicNum]->getCrAddr();4963 piOrgVid = m_pcVideoPicYuv ->getCrAddr();4964 }4965 iStrideRefVid = m_apRefPics[uiRefPicNum]->getCStride();4966 }4967 4968 4969 piRefVid += iStartPosY * iStrideRefVid;4970 piOrgVid += iStartPosY * iStrideOrgVid;4971 4972 for ( Int iY = 0; iY < uiBlkHeight; iY++ )4973 {4974 Int iPos = iStartPosX;4975 4976 for (Int iX = 0; iX < uiBlkWidth; iX++ )4977 {4978 int iTargetPos;4979 4980 4981 assert( RemoveBitIncrement(piCur[iX]) >= 0 && RemoveBitIncrement(piCur[iX]) <= 256 );4982 iTargetPos = iPos - m_paaiShiftLUTs[uiRefPicNum][0][RemoveBitIncrement(piCur[iX])];4983 iTargetPos = iTargetPos > 0 ? iTargetPos : 0;4984 iTargetPos = iTargetPos < iRefWidth ? iTargetPos : iRefWidth-1;4985 4986 int iSourcePos;4987 4988 assert( RemoveBitIncrement(piOrg[iX]) >= 0 && RemoveBitIncrement(piOrg[iX]) <= 256 );4989 iSourcePos = iPos - m_paaiShiftLUTs[uiRefPicNum][0][RemoveBitIncrement(piOrg[iX])];4990 iSourcePos = iSourcePos > 0 ? iSourcePos : 0;4991 iSourcePos = iSourcePos < iRefWidth ? iSourcePos : iRefWidth-1;4992 4993 Int iDiff = piRefVid[iTargetPos] - piRefVid[iSourcePos];4994 4995 if ( bSAD )4996 {4997 uiErr += abs(iDiff);4998 }4999 else5000 {5001 uiErr += ((iDiff * iDiff) >> uiShift) ;5002 }5003 iPos++;5004 }5005 5006 piRefVid += iStrideRefVid;5007 piOrgVid += iStrideOrgVid;5008 5009 piCur += iCurStride;5010 piOrg += iOrgStride;5011 }5012 piCur -= iCurStride * uiBlkHeight;5013 piOrg -= iOrgStride * uiBlkHeight;5014 }5015 5016 if ( bSAD )5017 {5018 uiErr = uiErr >> g_uiBitIncrement;5019 }5020 UInt uiNumRef = Max( 1, m_uiNumberRefPics );5021 return ( uiErr + (uiNumRef >> 1) ) / uiNumRef;5022 }5023 5024 5025 5026 5027 #if GERHARD_VQM_XCHECK5028 UInt TComRdCost::xGetDistXCheck( Int iStartPosX, Int iStartPosY, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bSAD )5029 {5030 UInt uiShift = g_uiBitIncrement << 1;5031 5032 UInt uiPlane = 0;5033 UInt uiErr = 0;5034 Int iStrideOrgVid = m_pcVideoPicYuv ->getStride();5035 5036 Pel* piRefOrg = m_pcVideoPicYuv->getLumaAddr() + iStartPosX + iStrideOrgVid * iStartPosY;5037 5038 for ( Int iY = 0; iY < uiBlkHeight; iY++ )5039 {5040 for (Int iX = 0; iX < uiBlkWidth; iX++ )5041 {5042 Int iDiff;5043 if (uiPlane != 0)5044 {5045 5046 iDiff = piCur[iX] - piOrg[iX];5047 }5048 else5049 {5050 // assert( piOrg[iX] == piRefOrg[iX] );5051 iDiff = piCur[iX] - piRefOrg[iX];5052 }5053 5054 5055 if ( bSAD )5056 {5057 uiErr += abs(iDiff);5058 }5059 else5060 {5061 uiErr += ((iDiff * iDiff) >> uiShift) ;5062 }5063 }5064 piRefOrg += iStrideOrgVid;5065 piCur += iCurStride;5066 piOrg += iOrgStride;5067 }5068 5069 if ( bSAD )5070 {5071 uiErr >>= g_uiBitIncrement;5072 }5073 return uiErr;5074 }5075 5076 5077 #endif5078 5079 4757 Dist TComRdCost::xGetDistVSOMode4( Int iStartPosX, Int iStartPosY, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bSAD ) 5080 4758 { … … 5083 4761 5084 4762 RMDist iDistMin = (RMDist) RDO_DIST_MIN; 5085 #if RDO_DIST_INT4763 #if HHI_VSO_DIST_INT 5086 4764 iDistMin = m_bAllowNegDist ? RDO_DIST_MIN : 0; 5087 4765 #endif … … 5132 4810 pRefInfo->getRefPicYuvAndLUT(m_apRefPics, m_paaiShiftLUTs); 5133 4811 } 5134 5135 5136 4812 m_pcVideoPicYuv = pRefInfo->getPicYuvVideo(); 5137 5138 #if GERHARD_VQM_XCHECK5139 m_pcVideoPicYuv = pRefInfo->getPicYuvOrgDepth(CURRVIEW);5140 #endif5141 5142 4813 } 5143 4814 … … 5147 4818 switch (m_uiVSOMode ) 5148 4819 { 5149 case 1:5150 m_fpDistortFuncVSO = &TComRdCost::xGetDistVSOMode1;5151 break;5152 case 2:5153 m_fpDistortFuncVSO = &TComRdCost::xGetDistVSOMode2;5154 break;5155 case 3:5156 m_fpDistortFuncVSO = &TComRdCost::xGetDistVSOMode3;5157 break;5158 4820 case 4: 5159 4821 m_fpDistortFuncVSO = &TComRdCost::xGetDistVSOMode4; … … 5163 4825 break; 5164 4826 } 5165 #if GERHARD_VQM_XCHECK5166 m_fpDistortFuncVSO = &TComRdCost::xGetDistXCheck;5167 #endif5168 4827 } 5169 4828 … … 5228 4887 } 5229 4888 5230 #if RDO_DIST_INT4889 #if HHI_VSO_DIST_INT 5231 4890 Void TComRdCost::setAllowNegDist( Bool bAllowNegDist ) 5232 4891 { … … 5235 4894 #endif 5236 4895 5237 //GT VSO end 4896 #endif -
trunk/source/Lib/TLibCommon/TComRdCost.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 1 34 /** \file TComRdCost.h 2 35 \brief RD cost computation classes (header) … … 58 91 FpDistFuncRnd DistFuncRnd; 59 92 #endif 60 #if SB_INTERVIEW_SKIP93 #if HHI_INTERVIEW_SKIP 61 94 Pel* pUsed; 62 95 Int iStrideUsed; … … 87 120 #endif 88 121 iSubShift = 0; 89 #if SB_INTERVIEW_SKIP122 #if HHI_INTERVIEW_SKIP 90 123 pUsed = 0; 91 124 iStrideUsed = 0; … … 116 149 Double m_dFrameLambda; 117 150 118 #if SB_INTERVIEW_SKIP_LAMBDA_SCALE151 #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE 119 152 Double m_dLambdaScale ; 120 153 #endif … … 148 181 149 182 Void setLambda ( Double dLambda ); 183 #if HHI_INTER_VIEW_MOTION_PRED 150 184 Void setLambdaMVReg ( Double dLambda ); 185 #endif 151 186 Void setFrameLambda ( Double dLambda ) { m_dFrameLambda = dLambda; } 152 187 153 #if SB_INTERVIEW_SKIP_LAMBDA_SCALE188 #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE 154 189 Void setLambdaScale ( Double dLambdaScale) { m_dLambdaScale = dLambdaScale; } 155 190 Double getLambdaScale ( ) { return m_dLambdaScale ; } … … 287 322 288 323 public: 289 #if SB_INTERVIEW_SKIP324 #if HHI_INTERVIEW_SKIP 290 325 UInt getDistPart( Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, Pel* piUsed, Int iUsedStride, UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc = DF_SSE ); 291 326 #endif 292 327 UInt getDistPart( Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, DFunc eDFunc = DF_SSE ); 293 328 294 //GT VSO 295 329 #if HHI_VSO 296 330 private: 297 331 Double m_dLambdaVSO; … … 301 335 Double m_dFrameLambdaVSO; 302 336 303 #if RDO_DIST_INT337 #if HHI_VSO_DIST_INT 304 338 Bool m_bAllowNegDist; 305 339 #endif … … 334 368 UInt getVSOMode( ) { return m_uiVSOMode; } 335 369 336 #if RDO_DIST_INT370 #if HHI_VSO_DIST_INT 337 371 Void setAllowNegDist ( Bool bAllowNegDist ); 338 372 #endif … … 346 380 347 381 private: 348 349 Dist xGetDistVSOMode1( Int iStartPosX, Int iStartPosY, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bSAD );350 Dist xGetDistVSOMode2( Int iStartPosX, Int iStartPosY, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bSAD );351 Dist xGetDistVSOMode3( Int iStartPosX, Int iStartPosY, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bSAD );352 382 Dist xGetDistVSOMode4( Int iStartPosX, Int iStartPosY, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bSAD ); 353 383 354 #if GERHARD_VQM_XCHECK 355 Dist xGetDistXCheck( Int iStartPosX, Int iStartPosY, Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, Bool bSAD ); 356 #endif 357 358 //GT VSO end 384 #endif // HHI_VSO 359 385 360 386 };// END CLASS DEFINITION TComRdCost -
trunk/source/Lib/TLibCommon/TComRdCostWeightPrediction.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 1 34 2 35 … … 56 89 57 90 UInt uiSum = 0; 58 #if SB_INTERVIEW_SKIP91 #if HHI_INTERVIEW_SKIP 59 92 if( pcDtParam->pUsed ) 60 93 { … … 90 123 } 91 124 #endif 92 #if SB_INTERVIEW_SKIP125 #if HHI_INTERVIEW_SKIP 93 126 } 94 127 #endif -
trunk/source/Lib/TLibCommon/TComRdCostWeightPrediction.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComResidualGenerator.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 1 34 2 35 … … 10 43 #include "TComResidualGenerator.h" 11 44 45 46 #if HHI_INTER_VIEW_RESIDUAL_PRED 12 47 13 48 … … 541 576 542 577 543 578 #endif // HHI_INTER_VIEW_RESIDUAL_PRED 579 -
trunk/source/Lib/TLibCommon/TComResidualGenerator.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 1 34 2 35 … … 17 50 18 51 52 #if HHI_INTER_VIEW_RESIDUAL_PRED 19 53 20 54 class TComResidualGenerator … … 69 103 70 104 105 #endif // __TCOM_RESIDUAL_GENERATOR__ 71 106 72 #endif // __TCOM_RESIDUAL_GENERATOR__107 #endif // HHI_INTER_VIEW_RESIDUAL_PRED 73 108 74 109 -
trunk/source/Lib/TLibCommon/TComRom.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 1 34 2 35 … … 64 97 } 65 98 66 #if HHI_DMM_ INTRA99 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 67 100 if ( !g_aacWedgeLists.empty() ) 68 101 { … … 2369 2402 // Mapping each Unified Directional Intra prediction direction to DCT/DST transform 2370 2403 // 0 implies use DCT, 1 implies DST 2371 #if ADD_PLANAR_MODE && !HHI_DMM_INTRA 2404 #if ADD_PLANAR_MODE 2405 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX 2406 const UChar g_aucDCTDSTMode_Vert[NUM_INTRA_MODE+8] = 2407 #elif HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 2408 const UChar g_aucDCTDSTMode_Vert[NUM_INTRA_MODE+4] = 2409 #else 2372 2410 const UChar g_aucDCTDSTMode_Vert[NUM_INTRA_MODE] = 2373 #elif !ADD_PLANAR_MODE && HHI_DMM_INTRA 2374 const UChar g_aucDCTDSTMode_Vert[34+NUM_DMM_INTRA] = 2375 #elif ADD_PLANAR_MODE && HHI_DMM_INTRA 2376 const UChar g_aucDCTDSTMode_Vert[NUM_INTRA_MODE+NUM_DMM_INTRA] = 2411 #endif 2412 #else 2413 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX 2414 const UChar g_aucDCTDSTMode_Vert[34+8] = 2415 #elif 2416 const UChar g_aucDCTDSTMode_Vert[34+4] = 2377 2417 #else 2378 2418 const UChar g_aucDCTDSTMode_Vert[34] = 2419 #endif 2379 2420 #endif 2380 2421 { //0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 … … 2383 2424 ,1 2384 2425 #endif 2385 #if HHI_DMM_ INTRA2426 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX 2386 2427 ,0,0,0,0,0,0,0,0 2387 #endif 2388 }; 2389 #if ADD_PLANAR_MODE && !HHI_DMM_INTRA 2428 #elif HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 2429 ,0,0,0,0 2430 #endif 2431 }; 2432 #if ADD_PLANAR_MODE 2433 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX 2434 const UChar g_aucDCTDSTMode_Hor[NUM_INTRA_MODE+8] = 2435 #elif HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 2436 const UChar g_aucDCTDSTMode_Hor[NUM_INTRA_MODE+4] = 2437 #else 2390 2438 const UChar g_aucDCTDSTMode_Hor[NUM_INTRA_MODE] = 2391 #elif !ADD_PLANAR_MODE && HHI_DMM_INTRA 2392 const UChar g_aucDCTDSTMode_Hor[34+NUM_DMM_INTRA] = 2393 #elif ADD_PLANAR_MODE && HHI_DMM_INTRA 2394 const UChar g_aucDCTDSTMode_Hor[NUM_INTRA_MODE+NUM_DMM_INTRA] = 2439 #endif 2440 #else 2441 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX 2442 const UChar g_aucDCTDSTMode_Hor[34+8] = 2443 #elif 2444 const UChar g_aucDCTDSTMode_Hor[34+4] = 2395 2445 #else 2396 2446 const UChar g_aucDCTDSTMode_Hor[34] = 2447 #endif 2397 2448 #endif 2398 2449 { //0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 … … 2401 2452 ,1 2402 2453 #endif 2403 #if HHI_DMM_ INTRA2454 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX 2404 2455 ,0,0,0,0,0,0,0,0 2456 #elif HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 2457 ,0,0,0,0 2405 2458 #endif 2406 2459 }; … … 2536 2589 }; 2537 2590 2538 #if HHI_DMM_ INTRA2591 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 2539 2592 const WedgeResolution g_aeWedgeResolutionList[5] = 2540 2593 { … … 2568 2621 }; 2569 2622 2570 const UChar g_aucAdditionalIntraModeList[NUM_DMM_INTRA] =2571 {2572 DMM_WEDGE_FULL_IDX,2573 DMM_WEDGE_FULL_D_IDX,2574 DMM_WEDGE_PREDTEX_IDX,2575 DMM_WEDGE_PREDTEX_D_IDX,2576 DMM_CONTOUR_PREDTEX_IDX,2577 DMM_CONTOUR_PREDTEX_D_IDX,2578 DMM_WEDGE_PREDDIR_IDX,2579 DMM_WEDGE_PREDDIR_D_IDX2580 };2581 2582 2623 double g_dDeltaDCsQuantOffset = 0.0; 2583 2624 #endif … … 2595 2636 // Misc. 2596 2637 // ==================================================================================================================== 2597 #if SB_DEBUG2598 Bool g_bEncoding = false ;2599 #endif2600 2638 Char g_aucConvertToBit [ MAX_CU_SIZE+1 ]; 2601 2639 … … 2754 2792 #endif 2755 2793 2756 #if HHI_DMM_ INTRA2794 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 2757 2795 std::vector<std::vector<TComWedgelet> > g_aacWedgeLists; 2758 2796 std::vector<std::vector<TComWedgeRef> > g_aacWedgeRefLists; -
trunk/source/Lib/TLibCommon/TComRom.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 1 34 2 35 … … 14 47 15 48 16 #if HHI_DMM_ INTRA49 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 17 50 #include "TComWedgelet.h" 18 51 #endif … … 38 71 #endif //QC_MDCS 39 72 40 #if HHI_DMM_ INTRA73 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 41 74 Void initWedgeLists(); 42 75 Void createWedgeList( UInt uiWidth, UInt uiHeight, std::vector<TComWedgelet> &racWedgeList, std::vector<TComWedgeRef> &racWedgeRefList, WedgeResolution eWedgeRes ); … … 72 105 extern UInt g_auiPUOffset[4]; 73 106 74 #if HHI_DMM_ INTRA107 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 75 108 extern std::vector<std::vector<TComWedgelet> > g_aacWedgeLists; 76 109 extern std::vector<std::vector<TComWedgeRef> > g_aacWedgeRefLists; … … 287 320 #endif 288 321 289 #if HHI_DMM_ INTRA322 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 290 323 extern const UChar g_aucWedgeFullBitsListIdx[7]; 291 324 extern const UChar g_aucIntraSizeIdxToWedgeSize[7]; 292 extern const UChar g_aucAdditionalIntraModeList[NUM_DMM_INTRA];293 325 extern const WedgeResolution g_aeWedgeResolutionList[5]; 294 295 326 extern double g_dDeltaDCsQuantOffset; 296 327 #endif … … 315 346 #if INTRA_DST_TYPE_7 316 347 extern const short g_as_DST_MAT_4 [4][4]; 317 #if ADD_PLANAR_MODE && !HHI_DMM_INTRA 348 #if ADD_PLANAR_MODE 349 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX 350 extern const UChar g_aucDCTDSTMode_Vert[NUM_INTRA_MODE+8]; 351 extern const UChar g_aucDCTDSTMode_Hor[NUM_INTRA_MODE+8]; 352 #elif HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 353 extern const UChar g_aucDCTDSTMode_Vert[NUM_INTRA_MODE+4]; 354 extern const UChar g_aucDCTDSTMode_Hor[NUM_INTRA_MODE+4]; 355 #else 318 356 extern const UChar g_aucDCTDSTMode_Vert[NUM_INTRA_MODE]; 319 357 extern const UChar g_aucDCTDSTMode_Hor[NUM_INTRA_MODE]; 320 #elif !ADD_PLANAR_MODE && HHI_DMM_INTRA 321 extern const UChar g_aucDCTDSTMode_Vert[34+NUM_DMM_INTRA]; 322 extern const UChar g_aucDCTDSTMode_Hor[34+NUM_DMM_INTRA]; 323 #elif ADD_PLANAR_MODE && HHI_DMM_INTRA 324 extern const UChar g_aucDCTDSTMode_Vert[NUM_INTRA_MODE+NUM_DMM_INTRA]; 325 extern const UChar g_aucDCTDSTMode_Hor[NUM_INTRA_MODE+NUM_DMM_INTRA]; 358 #endif 359 #else 360 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX 361 extern const UChar g_aucDCTDSTMode_Vert[34+8]; 362 extern const UChar g_aucDCTDSTMode_Hor[34+8]; 363 #elif HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 364 extern const UChar g_aucDCTDSTMode_Vert[34+4]; 365 extern const UChar g_aucDCTDSTMode_Hor[34+4]; 326 366 #else 327 367 extern const UChar g_aucDCTDSTMode_Vert[34]; … … 329 369 #endif 330 370 #endif 371 #endif 331 372 // ========================================== 332 373 … … 334 375 // Misc. 335 376 // ==================================================================================================================== 336 #if SB_DEBUG337 extern Bool g_bEncoding ;338 #endif339 377 340 378 #if QC_MOD_LCEC … … 500 538 __inline Void mapPlanartoDC( Int& curDir ) { curDir = (curDir == PLANAR_IDX) ? 2 : curDir; } 501 539 #endif 502 #if HHI_DMM_ INTRA540 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 503 541 __inline Void mapDMMtoDC( UChar& curDir ) { curDir = (curDir > MAX_MODE_ID_INTRA_DIR) ? 2 : curDir; } 504 542 __inline Void mapDMMtoDC( UInt& curDir ) { curDir = (curDir > MAX_MODE_ID_INTRA_DIR) ? 2 : curDir; } -
trunk/source/Lib/TLibCommon/TComSlice.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 34 35 1 36 /** \file TComSlice.cpp 2 37 \brief slice header and SPS class … … 17 52 m_aiNumRefIdx[1] = 0; 18 53 m_bLoopFilterDisable = false; 19 54 20 55 m_iSliceQpDelta = 0; 21 56 22 57 m_iDepth = 0; 23 58 24 59 m_pcPic = NULL; 25 60 m_bRefenced = false; … … 28 63 #endif 29 64 m_uiColDir = 0; 30 65 31 66 m_iViewIdx = 0 ; 32 67 … … 36 71 m_bRefIdxCombineCoding = false; 37 72 #endif 38 #if DCM_COMB_LIST 73 #if DCM_COMB_LIST 39 74 m_bRefPicListCombinationFlag = false; 40 75 m_bRefPicListModificationFlagLC = false; … … 61 96 m_aiNumRefIdx[0] = 0; 62 97 m_aiNumRefIdx[1] = 0; 63 98 64 99 m_uiColDir = 0; 65 100 … … 67 102 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 68 103 m_pcTexturePic = NULL; 69 104 70 105 initEqualRef(); 71 106 m_bNoBackPredFlag = false; … … 73 108 m_bRefIdxCombineCoding = false; 74 109 #endif 75 #if DCM_COMB_LIST 110 #if DCM_COMB_LIST 76 111 m_bRefPicListCombinationFlag = false; 77 112 m_bRefPicListModificationFlagLC = false; … … 83 118 TComPic* pcPicExtract; 84 119 TComPic* pcPicInsert; 85 120 86 121 TComList<TComPic*>::iterator iterPicExtract; 87 122 TComList<TComPic*>::iterator iterPicExtract_1; 88 123 TComList<TComPic*>::iterator iterPicInsert; 89 124 90 125 for (Int i = 1; i < (Int)(rcListPic.size()); i++) 91 126 { … … 94 129 pcPicExtract = *(iterPicExtract); 95 130 pcPicExtract->setCurrSliceIdx(0); 96 131 97 132 iterPicInsert = rcListPic.begin(); 98 133 while (iterPicInsert != iterPicExtract) … … 104 139 break; 105 140 } 106 141 107 142 iterPicInsert++; 108 143 } 109 144 110 145 iterPicExtract_1 = iterPicExtract; iterPicExtract_1++; 111 146 112 147 // swap iterPicExtract and iterPicInsert, iterPicExtract = curr. / iterPicInsert = insertion position 113 148 rcListPic.insert (iterPicInsert, iterPicExtract, iterPicExtract_1); … … 128 163 } 129 164 130 #if DCM_COMB_LIST 165 #if DCM_COMB_LIST 131 166 Void TComSlice::generateCombinedList() 132 167 { … … 162 197 163 198 if(bTempRefIdxInL2 == true) 164 { 199 { 165 200 m_eListIdFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = REF_PIC_LIST_0; 166 201 m_iRefIdxFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = iNumRefIdx; … … 346 381 * \param rcListPic reference to the reference picture list 347 382 * This function marks the reference pictures as "unused for reference" in the following conditions. 348 * If the nal_unit_type is IDR all pictures in the reference picture list 349 * is marked as "unused for reference" 383 * If the nal_unit_type is IDR all pictures in the reference picture list 384 * is marked as "unused for reference" 350 385 * Otherwise do for the CDR case (non CDR case has no effect since both if conditions below will not be true) 351 * If the bRefreshPending flag is true (a deferred decoding refresh is pending) and the current 352 * temporal reference is greater than the temporal reference of the latest CDR picture (uiPOCCDR), 353 * mark all reference pictures except the latest CDR picture as "unused for reference" and set 386 * If the bRefreshPending flag is true (a deferred decoding refresh is pending) and the current 387 * temporal reference is greater than the temporal reference of the latest CDR picture (uiPOCCDR), 388 * mark all reference pictures except the latest CDR picture as "unused for reference" and set 354 389 * the bRefreshPending flag to false. 355 * If the nal_unit_type is CDR, set the bRefreshPending flag to true and iPOCCDR to the temporal 390 * If the nal_unit_type is CDR, set the bRefreshPending flag to true and iPOCCDR to the temporal 356 391 * reference of the current picture. 357 392 * Note that the current picture is already placed in the reference list and its marking is not changed. … … 361 396 { 362 397 TComPic* rpcPic; 363 UInt uiPOCCurr = getPOC(); 398 UInt uiPOCCurr = getPOC(); 364 399 365 400 if (getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR) // IDR … … 377 412 else // CDR or No DR 378 413 { 379 if (bRefreshPending==true && uiPOCCurr > uiPOCCDR) // CDR reference marking pending 414 if (bRefreshPending==true && uiPOCCurr > uiPOCCDR) // CDR reference marking pending 380 415 { 381 416 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); … … 386 421 iterPic++; 387 422 } 388 bRefreshPending = false; 423 bRefreshPending = false; 389 424 } 390 425 if (getNalUnitType() == NAL_UNIT_CODED_SLICE_CDR) // CDR picture found 391 426 { 392 bRefreshPending = true; 427 bRefreshPending = true; 393 428 uiPOCCDR = uiPOCCurr; 394 429 } … … 407 442 #if DCM_DECODING_REFRESH 408 443 m_eNalUnitType = pSrc->m_eNalUnitType; 409 #endif 444 #endif 410 445 m_eSliceType = pSrc->m_eSliceType; 411 446 m_iSliceQp = pSrc->m_iSliceQp; 412 447 m_iSymbolMode = pSrc->m_iSymbolMode; 413 448 m_bLoopFilterDisable = pSrc->m_bLoopFilterDisable; 414 415 #if DCM_COMB_LIST 449 450 #if DCM_COMB_LIST 416 451 for (i = 0; i < 3; i++) 417 452 { … … 440 475 m_aiNumRefIdx[i] = pSrc->m_aiNumRefIdx[i]; 441 476 } 442 #endif 477 #endif 443 478 444 479 m_iSliceQpDelta = pSrc->m_iSliceQpDelta; … … 451 486 m_aiRefViewList[i][j] = pSrc->m_aiRefViewList[i][j]; 452 487 } 453 } 488 } 454 489 m_iDepth = pSrc->m_iDepth; 455 490 … … 489 524 m_uiSliceIdx = pSrc->m_uiSliceIdx; 490 525 m_uiEntropySliceMode = pSrc->m_uiEntropySliceMode; 491 m_uiEntropySliceArgument = pSrc->m_uiEntropySliceArgument; 526 m_uiEntropySliceArgument = pSrc->m_uiEntropySliceArgument; 492 527 m_uiEntropySliceCurStartCUAddr = pSrc->m_uiEntropySliceCurStartCUAddr; 493 528 m_uiEntropySliceCurEndCUAddr = pSrc->m_uiEntropySliceCurEndCUAddr; … … 534 569 } 535 570 536 // Default WP values settings : no weight. 571 // Default WP values settings : no weight. 537 572 Void TComSlice::resetWpScaling(wpScalingParam wp[2][MAX_NUM_REF][3]) 538 573 { … … 608 643 m_uiMaxTrDepth = 1; 609 644 m_uiMaxTrSize = 32; 610 645 611 646 // Tool list 612 647 m_bUseALF = false; 613 648 m_bUseDQP = false; 614 649 615 650 m_bUseMRG = false; // SOPH: 651 #if HHI_MPI 616 652 m_bUseMVI = false; 617 653 #endif 654 618 655 m_uiViewId = 0; 619 656 m_iViewOrderIdx = 0; … … 624 661 ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) ); 625 662 663 #if DEPTH_MAP_GENERATION 626 664 m_uiPredDepthMapGeneration = 0; 627 m_uiMultiviewMvPredMode = 0;628 665 m_uiPdmPrecision = 0; 629 666 ::memset( m_aiPdmScaleNomDelta, 0x00, sizeof( m_aiPdmScaleNomDelta ) ); 630 667 ::memset( m_aiPdmOffset, 0x00, sizeof( m_aiPdmOffset ) ); 668 #endif 669 #if HHI_INTER_VIEW_MOTION_PRED 670 m_uiMultiviewMvPredMode = 0; 671 #endif 672 #if HHI_INTER_VIEW_RESIDUAL_PRED 631 673 m_uiMultiviewResPredMode = 0; 674 #endif 632 675 633 676 // AMVP parameter 634 677 ::memset( m_aeAMVPMode, 0, sizeof( m_aeAMVPMode ) ); 635 #if SB_MEM_FIX 636 m_bUseDepthModelModes = false; 637 #endif 678 m_bUseDMM = false; 638 679 } 639 680 … … 697 738 698 739 740 #if DEPTH_MAP_GENERATION 699 741 Void 700 742 TComSPS::setPredDepthMapGeneration( UInt uiViewId, Bool bIsDepth, UInt uiPdmGenMode, UInt uiPdmMvPredMode, UInt uiPdmPrec, Int** aaiPdmScaleNomDelta, Int** aaiPdmOffset ) 701 { 743 { 702 744 AOF( m_uiViewId == uiViewId ); 703 745 AOF( m_bDepth == bIsDepth ); … … 705 747 AOT( uiPdmGenMode && ( aaiPdmScaleNomDelta == 0 || aaiPdmOffset == 0 ) ); 706 748 AOT( uiPdmMvPredMode && uiPdmGenMode == 0 ); 707 749 708 750 m_uiPredDepthMapGeneration = uiPdmGenMode; 751 #if HHI_INTER_VIEW_MOTION_PRED 709 752 m_uiMultiviewMvPredMode = uiPdmMvPredMode; 753 #endif 710 754 m_uiPdmPrecision = ( m_uiPredDepthMapGeneration ? uiPdmPrec : 0 ); 711 755 ::memset( m_aiPdmScaleNomDelta, 0x00, sizeof( m_aiPdmScaleNomDelta ) ); … … 720 764 } 721 765 } 722 766 #endif -
trunk/source/Lib/TLibCommon/TComSlice.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 1 34 2 35 … … 17 50 18 51 class TComPic; 52 #if DEPTH_MAP_GENERATION 19 53 class TComDepthMapGenerator; 54 #endif 55 #if HHI_INTER_VIEW_RESIDUAL_PRED 20 56 class TComResidualGenerator; 57 #endif 21 58 22 59 // ==================================================================================================================== … … 38 75 UInt m_uiMinTrDepth; 39 76 UInt m_uiMaxTrDepth; 40 77 41 78 UInt m_uiViewId; 42 79 Int m_iViewOrderIdx; … … 54 91 Bool m_bUseALF; 55 92 Bool m_bUseDQP; 56 #if ! SB_NO_LowDelayCoding93 #if !HHI_NO_LowDelayCoding 57 94 Bool m_bUseLDC; 58 95 #endif … … 60 97 Bool m_bUseMRG; // SOPH: 61 98 62 #if LM_CHROMA 99 #if LM_CHROMA 63 100 Bool m_bUseLMChroma; // JL: 64 101 #endif … … 68 105 Bool m_bLCMod; 69 106 #endif 70 107 71 108 #if HHI_RMP_SWITCH 72 109 Bool m_bUseRMP; … … 76 113 UInt m_uiBitDepth; 77 114 UInt m_uiBitIncrement; 78 115 79 116 // Max physical transform size 80 117 UInt m_uiMaxTrSize; 81 118 82 119 Int m_iAMPAcc[MAX_CU_DEPTH]; 83 120 … … 86 123 #endif 87 124 #if MTK_SAO 88 Bool m_bUseSAO; 89 #endif 125 Bool m_bUseSAO; 126 #endif 127 #if HHI_MPI 90 128 Bool m_bUseMVI; 129 #endif 91 130 92 131 UInt m_uiCodedPictureBufferSize ; 93 132 94 #if HHI_DMM_INTRA 95 Bool m_bUseDepthModelModes; 96 #endif 97 133 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 134 Bool m_bUseDMM; 135 #endif 136 137 #if DEPTH_MAP_GENERATION 98 138 UInt m_uiPredDepthMapGeneration; 99 UInt m_uiMultiviewMvPredMode;100 139 UInt m_uiPdmPrecision; 101 140 Int m_aiPdmScaleNomDelta[MAX_NUMBER_VIEWS]; 102 141 Int m_aiPdmOffset [MAX_NUMBER_VIEWS]; 142 #endif 143 #if HHI_INTER_VIEW_MOTION_PRED 144 UInt m_uiMultiviewMvPredMode; 145 #endif 146 #if HHI_INTER_VIEW_RESIDUAL_PRED 103 147 UInt m_uiMultiviewResPredMode; 104 148 #endif 149 150 #if DEPTH_MAP_GENERATION 105 151 TComDepthMapGenerator* m_pcDepthMapGenerator; 152 #endif 153 #if HHI_INTER_VIEW_RESIDUAL_PRED 106 154 TComResidualGenerator* m_pcResidualGenerator; 155 #endif 107 156 108 157 public: 109 158 TComSPS(); 110 159 virtual ~TComSPS(); 111 160 112 161 // structure 113 162 Void setSPSId ( UInt u ) { m_uiSPSId = u; } … … 140 189 Int getPad ( Int u ) { assert(u < 2); return m_aiPad[u];} 141 190 Int* getPad ( ) { return m_aiPad; } 142 191 143 192 Void initMultiviewSPS ( UInt uiViewId, Int iViewOrderIdx = 0, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 ); 144 193 Void initMultiviewSPSDepth ( UInt uiViewId, Int iViewOrderIdx ); … … 157 206 Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } 158 207 UInt getMaxTrSize () { return m_uiMaxTrSize; } 159 208 160 209 // Tool list 161 210 Bool getUseALF () { return m_bUseALF; } 162 211 Bool getUseDQP () { return m_bUseDQP; } 163 164 #if ! SB_NO_LowDelayCoding212 213 #if !HHI_NO_LowDelayCoding 165 214 Bool getUseLDC () { return m_bUseLDC; } 166 215 #endif 167 216 Bool getUsePAD () { return m_bUsePAD; } 168 217 Bool getUseMRG () { return m_bUseMRG; } // SOPH: 169 218 170 219 Void setUseALF ( Bool b ) { m_bUseALF = b; } 171 220 Void setUseDQP ( Bool b ) { m_bUseDQP = b; } 172 173 #if ! SB_NO_LowDelayCoding221 222 #if !HHI_NO_LowDelayCoding 174 223 Void setUseLDC ( Bool b ) { m_bUseLDC = b; } 175 224 #endif … … 177 226 Void setUseMRG ( Bool b ) { m_bUseMRG = b; } // SOPH: 178 227 179 #if HHI_DMM_ INTRA180 Bool getUseD epthModelModes() { return m_bUseDepthModelModes; }181 Void setUseD epthModelModes( Bool b ) { m_bUseDepthModelModes= b; }228 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 229 Bool getUseDMM() { return m_bUseDMM; } 230 Void setUseDMM( Bool b ) { m_bUseDMM = b; } 182 231 #endif 183 232 … … 194 243 Void setUseRMP ( Bool b ) { m_bUseRMP = b; } 195 244 #endif 196 197 #if LM_CHROMA 245 246 #if LM_CHROMA 198 247 Bool getUseLMChroma () { return m_bUseLMChroma; } 199 248 Void setUseLMChroma ( Bool b ) { m_bUseLMChroma = b; } … … 203 252 AMVP_MODE getAMVPMode ( UInt uiDepth ) { assert(uiDepth < g_uiMaxCUDepth); return m_aeAMVPMode[uiDepth]; } 204 253 Void setAMVPMode ( UInt uiDepth, AMVP_MODE eMode) { assert(uiDepth < g_uiMaxCUDepth); m_aeAMVPMode[uiDepth] = eMode; } 205 254 206 255 // Bit-depth 207 256 UInt getBitDepth () { return m_uiBitDepth; } … … 212 261 #if MTK_NONCROSS_INLOOP_FILTER 213 262 Void setLFCrossSliceBoundaryFlag ( Bool bValue ) { m_bLFCrossSliceBoundaryFlag = bValue; } 214 Bool getLFCrossSliceBoundaryFlag () { return m_bLFCrossSliceBoundaryFlag; } 263 Bool getLFCrossSliceBoundaryFlag () { return m_bLFCrossSliceBoundaryFlag; } 215 264 #endif 216 265 … … 220 269 #endif 221 270 271 #if HHI_MPI 222 272 Void setUseMVI (Bool bVal) {m_bUseMVI = bVal;} 223 273 Bool getUseMVI () {return m_bUseMVI;} 274 #endif 224 275 225 276 Void setCodedPictureBufferSize( UInt u ) { m_uiCodedPictureBufferSize = u ;} 226 277 UInt getCodedPictureBufferSize( ) { return m_uiCodedPictureBufferSize ;} 227 278 279 #if DEPTH_MAP_GENERATION 228 280 Void setPredDepthMapGeneration( UInt uiViewId, Bool bIsDepth, UInt uiPdmGenMode = 0, UInt uiPdmMvPredMode = 0, UInt uiPdmPrec = 0, Int** aaiPdmScaleNomDelta = 0, Int** aaiPdmOffset = 0 ); 281 #endif 282 #if HHI_INTER_VIEW_RESIDUAL_PRED 229 283 Void setMultiviewResPredMode ( UInt uiResPrdMode ) { m_uiMultiviewResPredMode = uiResPrdMode; } 230 284 #endif 285 286 #if DEPTH_MAP_GENERATION 231 287 UInt getPredDepthMapGeneration() { return m_uiPredDepthMapGeneration; } 232 UInt getMultiviewMvPredMode () { return m_uiMultiviewMvPredMode; }233 288 UInt getPdmPrecision () { return m_uiPdmPrecision; } 234 289 Int* getPdmScaleNomDelta () { return m_aiPdmScaleNomDelta; } 235 290 Int* getPdmOffset () { return m_aiPdmOffset; } 291 #endif 292 #if HHI_INTER_VIEW_MOTION_PRED 293 UInt getMultiviewMvPredMode () { return m_uiMultiviewMvPredMode; } 294 #endif 295 #if HHI_INTER_VIEW_RESIDUAL_PRED 236 296 UInt getMultiviewResPredMode () { return m_uiMultiviewResPredMode; } 237 297 #endif 298 299 #if DEPTH_MAP_GENERATION 238 300 Void setDepthMapGenerator( TComDepthMapGenerator* pcDepthMapGenerator ) { m_pcDepthMapGenerator = pcDepthMapGenerator; } 239 301 TComDepthMapGenerator* getDepthMapGenerator() { return m_pcDepthMapGenerator; } 240 302 #endif 303 #if HHI_INTER_VIEW_RESIDUAL_PRED 241 304 Void setResidualGenerator( TComResidualGenerator* pcResidualGenerator ) { m_pcResidualGenerator = pcResidualGenerator; } 242 305 TComResidualGenerator* getResidualGenerator() { return m_pcResidualGenerator; } 306 #endif 243 307 }; 244 308 … … 256 320 UInt m_uiPPSId; 257 321 UInt m_uiSPSId; 258 322 259 323 public: 260 324 TComPPS(); 261 325 virtual ~TComPPS(); 262 326 263 327 Void setPPSId ( UInt u ) { m_uiPPSId = u; } 264 328 UInt getPPSId () { return m_uiPPSId; } … … 301 365 class TComSlice 302 366 { 303 367 304 368 private: 305 369 // Bitstream writing … … 313 377 Int m_iSymbolMode; 314 378 Bool m_bLoopFilterDisable; 315 379 316 380 #if DCM_COMB_LIST 317 381 Int m_aiNumRefIdx [3]; // for multiple reference of current slice … … 326 390 #else 327 391 Int m_aiNumRefIdx [2]; // for multiple reference of current slice 328 #endif 392 #endif 329 393 330 394 // Data … … 334 398 Int m_iDepth; 335 399 TComPic* m_pcTexturePic; 336 400 337 401 // referenced slice? 338 402 Bool m_bRefenced; … … 340 404 Bool m_bRounding; 341 405 #endif 342 406 343 407 // access channel 344 408 TComSPS* m_pcSPS; 345 409 TComPPS* m_pcPPS; 346 410 TComPic* m_pcPic; 347 411 348 412 UInt m_uiColDir; // direction to get colocated CUs 349 413 350 414 Double m_dLambda; 351 415 352 416 Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; 353 417 354 // SB355 418 Int m_iViewIdx; 356 419 Int m_aiRefViewList[2][MAX_INPUT_VIEW_NUM]; 357 420 358 421 Bool m_bNoBackPredFlag; 359 422 #if MS_LCEC_LOOKUP_TABLE_EXCEPTION … … 381 444 wpACDCParam m_weightACDCParam[3]; // [0:Y, 1:U, 2:V] 382 445 #endif 383 446 384 447 public: 385 448 TComSlice(); 386 449 virtual ~TComSlice(); 387 450 388 451 Void initSlice (); 389 452 390 453 Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } 391 454 TComSPS* getSPS () { return m_pcSPS; } 392 455 393 456 Void setPPS ( TComPPS* pcPPS ) { m_pcPPS = pcPPS; } 394 457 TComPPS* getPPS () { return m_pcPPS; } 395 458 396 459 UInt getPPSId () { return m_uiPPSId; } 397 460 SliceType getSliceType () { return m_eSliceType; } … … 407 470 Int getDepth () { return m_iDepth; } 408 471 UInt getColDir () { return m_uiColDir; } 409 410 #if DCM_COMB_LIST 472 473 #if DCM_COMB_LIST 411 474 Int getRefIdxOfLC (RefPicList e, Int iRefIdx) { return m_iRefIdxOfLC[e][iRefIdx]; } 412 475 Int getListIdFromIdxOfLC(Int iRefIdx) { return m_eListIdFromIdxOfLC[iRefIdx]; } … … 415 478 Int getRefIdxOfL1FromRefIdxOfL0(Int iRefIdx) { return m_iRefIdxOfL1FromRefIdxOfL0[iRefIdx];} 416 479 Bool getRefPicListModificationFlagLC() {return m_bRefPicListModificationFlagLC;} 417 Void setRefPicListModificationFlagLC(Bool bflag) {m_bRefPicListModificationFlagLC=bflag;} 480 Void setRefPicListModificationFlagLC(Bool bflag) {m_bRefPicListModificationFlagLC=bflag;} 418 481 Bool getRefPicListCombinationFlag() {return m_bRefPicListCombinationFlag;} 419 Void setRefPicListCombinationFlag(Bool bflag) {m_bRefPicListCombinationFlag=bflag;} 482 Void setRefPicListCombinationFlag(Bool bflag) {m_bRefPicListCombinationFlag=bflag;} 420 483 Void setListIdFromIdxOfLC(Int iRefIdx, UInt uiVal) { m_eListIdFromIdxOfLC[iRefIdx]=uiVal; } 421 484 Void setRefIdxFromIdxOfLC(Int iRefIdx, UInt uiVal) { m_iRefIdxFromIdxOfLC[iRefIdx]=uiVal; } … … 429 492 Bool isRounding() { return m_bRounding; } 430 493 #endif 431 494 432 495 Void setPPSId ( UInt u ) { m_uiPPSId = u; } 433 496 Void setPOC ( Int i ) { m_iPOC = i; } … … 442 505 Void setSymbolMode ( Int b ) { m_iSymbolMode = b; } 443 506 Void setLoopFilterDisable( Bool b ) { m_bLoopFilterDisable= b; } 444 507 445 508 Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } 446 509 Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } … … 448 511 Void setPic ( TComPic* p ) { m_pcPic = p; } 449 512 Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } 450 513 451 514 Void setRefPicList ( TComList<TComPic*>& rcListPic ); 452 515 Void setRefPOCList (); 453 516 Void setColDir ( UInt uiDir ) { m_uiColDir = uiDir; } 454 517 455 518 Void setRefPicListFromGOPSTring( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcSpatRefPics ); 456 519 Void setRefPicListExplicitlyDecoderSided( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcSpatRefPics ); … … 459 522 Bool isInterB () { return m_eSliceType == B_SLICE; } 460 523 Bool isInterP () { return m_eSliceType == P_SLICE; } 461 524 462 525 Void setLambda( Double d ) { m_dLambda = d; } 463 526 Double getLambda() { return m_dLambda; } 464 465 //SB 527 466 528 Void setViewIdx(Int i) { m_iViewIdx = i; } 467 529 Int getViewIdx() { return m_iViewIdx; } … … 476 538 return m_abEqualRef[e][iRefIdx1][iRefIdx2]; 477 539 } 478 540 479 541 Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) 480 542 { 481 543 m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; 482 544 } 483 545 484 546 static Void sortPicList ( TComList<TComPic*>& rcListPic ); 485 547 486 548 Bool getNoBackPredFlag() { return m_bNoBackPredFlag; } 487 549 Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; } … … 517 579 Bool isNextEntropySlice () { return m_bNextEntropySlice; } 518 580 Void setSliceBits ( UInt uiVal ) { m_uiSliceBits = uiVal; } 519 UInt getSliceBits () { return m_uiSliceBits; } 520 581 UInt getSliceBits () { return m_uiSliceBits; } 582 521 583 Void initMultiviewSlice ( Int** aaiScale = 0, Int** aaiOffset = 0 ); 522 584 … … 537 599 Void initWpScaling(); 538 600 inline Bool applyWP() { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPredIdc()) ); } 539 601 540 602 Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } 541 603 Void getWpAcDcParam ( wpACDCParam *&wp ); … … 552 614 UInt uiNthRefPic ); 553 615 #endif 554 616 555 617 };// END CLASS DEFINITION TComSlice 556 618 -
trunk/source/Lib/TLibCommon/TComTrQuant.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComTrQuant.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComWedgelet.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 1 34 2 35 … … 107 140 } 108 141 109 #if HHI_DMM_ INTRA142 #if HHI_DMM_WEDGE_INTRA 110 143 Bool TComWedgelet::checkPredDirAbovePossible( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset ) 111 144 { -
trunk/source/Lib/TLibCommon/TComWedgelet.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComWeightPrediction.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 1 34 2 35 -
trunk/source/Lib/TLibCommon/TComYuv.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 1 34 2 35 … … 321 354 } 322 355 323 //GT VSO324 356 Void TComYuv::addClipPartLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 325 357 { … … 344 376 } 345 377 } 346 //GT VSO end347 348 378 349 379 Void … … 918 948 return m_apiBufV + (iBlkX + iBlkY * getCStride()) * iBlkSize; 919 949 } 920 921 #if HHI_DMM_INTRA922 UInt64 TComYuv::getLumaDistDCSAD( UInt uiPartUnitIdx, UInt iBlkSize )923 {924 UInt iBlkX;925 UInt iBlkY;926 iBlkX = g_auiRasterToPelX[g_auiZscanToRaster[uiPartUnitIdx]];927 iBlkY = g_auiRasterToPelY[g_auiZscanToRaster[uiPartUnitIdx]];928 929 Pel* piAct = m_apiBufY + iBlkY*getStride() + iBlkX;930 931 Int iDC = 0;932 for( UInt uiY = 0; uiY < iBlkSize; uiY++ )933 {934 for( UInt uiX = 0; uiX < iBlkSize; uiX++ )935 {936 iDC += piAct[uiX];937 }938 piAct += getStride();939 }940 iDC /= (iBlkSize*iBlkSize);941 942 piAct = m_apiBufY + iBlkY*getStride() + iBlkX;943 944 UInt64 uiDistSAD = 0;945 946 for( UInt uiY = 0; uiY < iBlkSize; uiY++ )947 {948 for( UInt uiX = 0; uiX < iBlkSize; uiX++ )949 {950 uiDistSAD += abs( piAct[uiX] - iDC );951 }952 piAct += getStride();953 }954 955 uiDistSAD /= ( iBlkSize * iBlkSize );956 957 return uiDistSAD;958 }959 960 UInt64 TComYuv::getLumaDistDCSAD( UInt iBlkSize )961 {962 Pel* piAct = m_apiBufY;963 964 Int iDC = 0;965 for( UInt uiY = 0; uiY < iBlkSize; uiY++ )966 {967 for( UInt uiX = 0; uiX < iBlkSize; uiX++ )968 {969 iDC += piAct[uiX];970 }971 piAct += getStride();972 }973 iDC /= (iBlkSize*iBlkSize);974 975 piAct = m_apiBufY;976 977 UInt64 uiDistSAD = 0;978 979 for( UInt uiY = 0; uiY < iBlkSize; uiY++ )980 {981 for( UInt uiX = 0; uiX < iBlkSize; uiX++ )982 {983 uiDistSAD += abs( piAct[uiX] - iDC );984 }985 piAct += getStride();986 }987 988 uiDistSAD /= ( iBlkSize * iBlkSize );989 990 return uiDistSAD;991 }992 #endif993 -
trunk/source/Lib/TLibCommon/TComYuv.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 1 34 2 35 … … 89 122 Void addClipLuma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 90 123 Void addClipChroma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 91 //GT VSO92 124 Void addClipPartLuma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); //GT 93 //GT VSO end 125 94 126 95 127 // pcYuvSrc0 - pcYuvSrc1 -> m_apiBuf … … 152 184 __inline Pel xClip (Pel x ) { return ( (x < 0) ? 0 : (x > (Pel)g_uiIBDI_MAX) ? (Pel)g_uiIBDI_MAX : x ); } 153 185 154 #if HHI_DMM_INTRA155 UInt64 getLumaDistDCSAD( UInt uiPartUnitIdx, UInt iBlkSize );156 UInt64 getLumaDistDCSAD( UInt iBlkSize );157 #endif158 159 186 };// END CLASS DEFINITION TComYuv 160 187 -
trunk/source/Lib/TLibCommon/TypeDef.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 1 34 /** \file TypeDef.h 2 35 \brief Define basic types, new types and enumerations … … 6 39 #define _TYPEDEF__ 7 40 8 #define MW_DEPTH_MAP_INTERP_FILTER 2 // 0:std, 1:bilin, 2:nearest neighbour 9 #define MW_FULL_PEL_DEPTH_MAP_MV_SIGNALLING 1 10 #define MW_MVI_SIGNALLING_MODE 1 // 0: mvi_flags at each layer, 1: using merge_flag 11 #define SB_DEBUG 1 41 42 //>>>>> HHI 3DV tools >>>>> 43 #define HHI_INTER_VIEW_MOTION_PRED 1 // inter-view motion parameter prediction 44 #define HHI_INTER_VIEW_RESIDUAL_PRED 1 // inter-view residual prediction 45 #define HHI_FULL_PEL_DEPTH_MAP_MV_ACC 1 // full-pel mv accuracy for depth maps 46 #define HHI_MPI 1 // motion parameter inheritance from texture picture for depth map coding 47 #define HHI_INTERVIEW_SKIP 1 // skipping of residual for renderable regions 48 #define HHI_INTERVIEW_SKIP_LAMBDA_SCALE 1 // scaling of lambda in cost calculation in rederable regions 49 #define HHI_VSO 1 // view synthesis optimization 50 #define HHI_VSO_COLOR_PLANES 1 // view synthesis optimization in color planes 51 #define HHI_VSO_DIST_INT 1 // view synthesis optimization integer distorition in rdo process 52 53 #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE && !HHI_INTERVIEW_SKIP 54 #error "HHI_INTERVIEW_SKIP_LAMBDA_SCALE cannot be enabled if HHI_INTERVIEW_SKIP is not" 55 #endif 56 57 #define HHI_DMM_WEDGE_INTRA 1 // depth model modes independent on texture (explicit and intra-predicted Wedgelet prediction) 58 #define HHI_DMM_PRED_TEX 1 // depth model model dependent on texture (inter-component Wedgelet and Contour prediction ) 59 60 #define HHI_NO_LowDelayCoding 0 // old-fashioned encoder control, should be adapted to hm5.0 61 //<<<<< HHI 3DV tools <<<<< 62 12 63 13 64 //////////////////////////// … … 42 93 #define PART_MRG 1 // If the number of partitions is two and size > 8, only merging mode is enabled for the first partition & do not code merge_flag for the first partition 43 94 #define HHI_MRG_SKIP 1 // (JCTVC-E481 - merge skip) replaces the AMVP based skip by merge based skip (E481 - MERGE skip) 44 45 #define HHI_DMM_INTRA 1 //< PM: depth modelling modes for intra46 #if HHI_DMM_INTRA47 #define NUM_DMM_INTRA 848 #define DMM_INTRA_MODE_BITS 349 #define DMM_WEDGEMODEL_MIN_SIZE 4 //< PM: do not change50 #define DMM_WEDGEMODEL_MAX_SIZE 3251 #define DMM_WEDGE_PREDDIR_DELTAEND_MAX 4 //< PM: do not change52 #define DMM_RES_CHECK_INTRA 1 //< CB: skip residual for intra blocks53 #define HHI_DISABLE_INTRA_SMOOTHING_DEPTH 054 #define DMM_NO_TEXTURE_MODES 055 #endif56 95 57 96 #if HHI_RQT_INTRA_SPEEDUP_MOD && !HHI_RQT_INTRA_SPEEDUP … … 150 189 #define PLANAR_IDX (NUM_INTRA_MODE-1) 151 190 #endif 152 #if HHI_DMM_INTRA 191 192 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 193 #define DMM_WEDGEMODEL_MIN_SIZE 4 194 #define DMM_WEDGEMODEL_MAX_SIZE 32 195 #define DMM_WEDGE_PREDDIR_DELTAEND_MAX 4 196 153 197 #if ADD_PLANAR_MODE 154 198 #define MAX_MODE_ID_INTRA_DIR 34 199 #else 200 #define MAX_MODE_ID_INTRA_DIR 33 201 #endif 202 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX 155 203 enum MODE_IDX 156 204 { 157 DMM_WEDGE_FULL_IDX = 35, 158 DMM_WEDGE_FULL_D_IDX = 36, 159 DMM_WEDGE_PREDTEX_IDX = 37, 160 DMM_WEDGE_PREDTEX_D_IDX = 38, 161 DMM_CONTOUR_PREDTEX_IDX = 39, 162 DMM_CONTOUR_PREDTEX_D_IDX = 40, 163 DMM_WEDGE_PREDDIR_IDX = 41, 164 DMM_WEDGE_PREDDIR_D_IDX = 42 165 }; 166 #else 167 #define MAX_MODE_ID_INTRA_DIR 33 205 DMM_WEDGE_FULL_IDX = MAX_MODE_ID_INTRA_DIR+1, 206 DMM_WEDGE_FULL_D_IDX = MAX_MODE_ID_INTRA_DIR+2, 207 DMM_WEDGE_PREDTEX_IDX = MAX_MODE_ID_INTRA_DIR+3, 208 DMM_WEDGE_PREDTEX_D_IDX = MAX_MODE_ID_INTRA_DIR+4, 209 DMM_CONTOUR_PREDTEX_IDX = MAX_MODE_ID_INTRA_DIR+5, 210 DMM_CONTOUR_PREDTEX_D_IDX = MAX_MODE_ID_INTRA_DIR+6, 211 DMM_WEDGE_PREDDIR_IDX = MAX_MODE_ID_INTRA_DIR+7, 212 DMM_WEDGE_PREDDIR_D_IDX = MAX_MODE_ID_INTRA_DIR+8 213 }; 214 #elif HHI_DMM_WEDGE_INTRA && !HHI_DMM_PRED_TEX 168 215 enum MODE_IDX 169 216 { 170 DMM_WEDGE_FULL_IDX = 34, 171 DMM_WEDGE_FULL_D_IDX = 35, 172 DMM_WEDGE_PREDTEX_IDX = 36, 173 DMM_WEDGE_PREDTEX_D_IDX = 37, 174 DMM_CONTOUR_PREDTEX_IDX = 38, 175 DMM_CONTOUR_PREDTEX_D_IDX = 39, 176 DMM_WEDGE_PREDDIR_IDX = 40, 177 DMM_WEDGE_PREDDIR_D_IDX = 41 217 DMM_WEDGE_FULL_IDX = MAX_MODE_ID_INTRA_DIR+1, 218 DMM_WEDGE_FULL_D_IDX = MAX_MODE_ID_INTRA_DIR+2, 219 DMM_WEDGE_PREDDIR_IDX = MAX_MODE_ID_INTRA_DIR+3, 220 DMM_WEDGE_PREDDIR_D_IDX = MAX_MODE_ID_INTRA_DIR+4 221 }; 222 #elif !HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX 223 enum MODE_IDX 224 { 225 DMM_WEDGE_PREDTEX_IDX = MAX_MODE_ID_INTRA_DIR+1, 226 DMM_WEDGE_PREDTEX_D_IDX = MAX_MODE_ID_INTRA_DIR+2, 227 DMM_CONTOUR_PREDTEX_IDX = MAX_MODE_ID_INTRA_DIR+3, 228 DMM_CONTOUR_PREDTEX_D_IDX = MAX_MODE_ID_INTRA_DIR+4, 178 229 }; 179 230 #endif … … 325 376 typedef Int64 RMDist; ///< renderer model distortion 326 377 327 #define RDO_DIST_INT 1 328 329 #if RDO_DIST_INT 378 #if HHI_VSO_DIST_INT 330 379 typedef Int Dist; ///< RDO distortion 331 380 #define RDO_DIST_MIN MIN_INT
Note: See TracChangeset for help on using the changeset viewer.