[5] | 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 | */ |
---|
[2] | 33 | |
---|
| 34 | #include "TRenImage.h" |
---|
| 35 | #include "TRenFilter.h" |
---|
| 36 | #include "TRenSingleModel.h" |
---|
| 37 | |
---|
| 38 | ////////////// TRENSINGLE MODEL /////////////// |
---|
[100] | 39 | template <BlenMod iBM, Bool bBitInc> |
---|
| 40 | TRenSingleModelC<iBM,bBitInc>::TRenSingleModelC() |
---|
[2] | 41 | : m_iDistShift ( g_uiBitIncrement << 1 ) |
---|
| 42 | { |
---|
| 43 | m_iWidth = -1; |
---|
| 44 | m_iHeight = -1; |
---|
| 45 | m_iStride = -1; |
---|
| 46 | m_iMode = -1; |
---|
[56] | 47 | m_iPad = PICYUV_PAD; |
---|
[2] | 48 | m_iGapTolerance = -1; |
---|
| 49 | m_bUseOrgRef = false; |
---|
| 50 | |
---|
| 51 | m_pcPicYuvRef = NULL; |
---|
[100] | 52 | |
---|
| 53 | m_pcOutputSamples = NULL; |
---|
| 54 | m_pcOutputSamplesRow = NULL; |
---|
| 55 | m_iOutputSamplesStride = -1; |
---|
| 56 | |
---|
| 57 | m_ppiCurLUT = NULL; |
---|
| 58 | m_piInvZLUTLeft = NULL; |
---|
| 59 | m_piInvZLUTRight = NULL; |
---|
| 60 | |
---|
[2] | 61 | m_aapiRefVideoPel[0] = NULL; |
---|
| 62 | m_aapiRefVideoPel[1] = NULL; |
---|
| 63 | m_aapiRefVideoPel[2] = NULL; |
---|
| 64 | |
---|
| 65 | m_aiRefVideoStrides[0] = -1; |
---|
| 66 | m_aiRefVideoStrides[1] = -1; |
---|
| 67 | m_aiRefVideoStrides[2] = -1; |
---|
| 68 | |
---|
[100] | 69 | |
---|
[2] | 70 | for (UInt uiViewNum = 0 ; uiViewNum < 2; uiViewNum++) |
---|
| 71 | { |
---|
| 72 | // LUT |
---|
| 73 | m_appiShiftLut[uiViewNum] = NULL; |
---|
[100] | 74 | |
---|
| 75 | m_pcInputSamples[uiViewNum] = NULL; |
---|
| 76 | m_iInputSamplesStride = -1; |
---|
| 77 | |
---|
[2] | 78 | m_ppiCurLUT = NULL; |
---|
| 79 | m_piInvZLUTLeft = NULL; |
---|
| 80 | m_piInvZLUTRight = NULL; |
---|
[100] | 81 | } |
---|
[2] | 82 | |
---|
[100] | 83 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 84 | m_pbHorSkip = NULL; |
---|
| 85 | #endif |
---|
[2] | 86 | } |
---|
| 87 | |
---|
[100] | 88 | template <BlenMod iBM, Bool bBitInc> |
---|
| 89 | TRenSingleModelC<iBM,bBitInc>::~TRenSingleModelC() |
---|
[2] | 90 | { |
---|
[100] | 91 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 92 | if (m_pbHorSkip) |
---|
[2] | 93 | { |
---|
[100] | 94 | delete[] m_pbHorSkip; |
---|
| 95 | m_pbHorSkip = NULL; |
---|
[2] | 96 | } |
---|
[100] | 97 | #endif |
---|
[2] | 98 | |
---|
[100] | 99 | if ( m_pcInputSamples [0] ) delete[] m_pcInputSamples [0]; |
---|
| 100 | if ( m_pcInputSamples [1] ) delete[] m_pcInputSamples [1]; |
---|
[121] | 101 | |
---|
| 102 | #if FIX_MEM_LEAKS |
---|
| 103 | if ( m_pcOutputSamples ) delete[] m_pcOutputSamples ; |
---|
| 104 | #else |
---|
[100] | 105 | if ( m_pcOutputSamples ) delete m_pcOutputSamples ; |
---|
[121] | 106 | #endif |
---|
| 107 | |
---|
| 108 | #if FIX_MEM_LEAKS |
---|
| 109 | if ( m_piInvZLUTLeft ) delete[] m_piInvZLUTLeft ; |
---|
| 110 | if ( m_piInvZLUTRight ) delete[] m_piInvZLUTRight; |
---|
| 111 | |
---|
| 112 | if ( m_aapiRefVideoPel[0] ) delete[] ( m_aapiRefVideoPel[0] - ( m_aiRefVideoStrides[0] * m_iPad + m_iPad ) ); |
---|
| 113 | if ( m_aapiRefVideoPel[1] ) delete[] ( m_aapiRefVideoPel[1] - ( m_aiRefVideoStrides[1] * m_iPad + m_iPad ) ); |
---|
| 114 | if ( m_aapiRefVideoPel[2] ) delete[] ( m_aapiRefVideoPel[2] - ( m_aiRefVideoStrides[2] * m_iPad + m_iPad ) ); |
---|
| 115 | #endif |
---|
[2] | 116 | } |
---|
| 117 | |
---|
[100] | 118 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 119 | #if LGE_VSO_EARLY_SKIP_A0093 |
---|
| 120 | TRenSingleModelC<iBM,bBitInc>::create( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ) |
---|
| 121 | #else |
---|
| 122 | TRenSingleModelC<iBM,bBitInc>::create( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode ) |
---|
| 123 | #endif |
---|
| 124 | |
---|
[2] | 125 | { |
---|
[100] | 126 | #if LGE_VSO_EARLY_SKIP_A0093 |
---|
| 127 | m_pbHorSkip = new Bool [MAX_CU_SIZE]; |
---|
| 128 | m_bEarlySkip = bEarlySkip; |
---|
| 129 | #endif |
---|
| 130 | |
---|
| 131 | AOF( iBlendMode == iBM ); |
---|
| 132 | |
---|
[2] | 133 | m_iMode = iMode; |
---|
[100] | 134 | |
---|
[2] | 135 | m_iWidth = iWidth; |
---|
| 136 | m_iHeight = iHeight; |
---|
| 137 | m_iStride = iWidth; |
---|
| 138 | |
---|
| 139 | m_iSampledWidth = m_iWidth << iShiftPrec; |
---|
| 140 | m_iSampledStride = m_iStride << iShiftPrec; |
---|
| 141 | |
---|
| 142 | m_iShiftPrec = iShiftPrec; |
---|
| 143 | m_aaiSubPelShiftL = aaaiSubPelShiftTable[0]; |
---|
| 144 | m_aaiSubPelShiftR = aaaiSubPelShiftTable[1]; |
---|
| 145 | |
---|
| 146 | if (m_iMode == 2) |
---|
| 147 | { |
---|
| 148 | m_piInvZLUTLeft = new Int[257]; |
---|
| 149 | m_piInvZLUTRight = new Int[257]; |
---|
| 150 | } |
---|
| 151 | |
---|
| 152 | m_iGapTolerance = ( 2 << iShiftPrec ); |
---|
| 153 | m_iHoleMargin = iHoleMargin; |
---|
| 154 | |
---|
| 155 | m_bUseOrgRef = bUseOrgRef; |
---|
| 156 | |
---|
| 157 | m_aiRefVideoStrides[0] = m_iStride + (m_iPad << 1); |
---|
| 158 | m_aiRefVideoStrides[1] = m_iStride + (m_iPad << 1); |
---|
| 159 | m_aiRefVideoStrides[2] = m_iStride + (m_iPad << 1); |
---|
| 160 | |
---|
| 161 | m_aapiRefVideoPel [0] = new Pel[ m_aiRefVideoStrides[0] * (m_iHeight + (m_iPad << 1))]; |
---|
| 162 | m_aapiRefVideoPel [1] = new Pel[ m_aiRefVideoStrides[1] * (m_iHeight + (m_iPad << 1))]; |
---|
| 163 | m_aapiRefVideoPel [2] = new Pel[ m_aiRefVideoStrides[2] * (m_iHeight + (m_iPad << 1))]; |
---|
| 164 | |
---|
| 165 | m_aapiRefVideoPel [0] += m_aiRefVideoStrides[0] * m_iPad + m_iPad; |
---|
| 166 | m_aapiRefVideoPel [1] += m_aiRefVideoStrides[1] * m_iPad + m_iPad; |
---|
| 167 | m_aapiRefVideoPel [2] += m_aiRefVideoStrides[2] * m_iPad + m_iPad; |
---|
| 168 | |
---|
[100] | 169 | m_iInputSamplesStride = m_iWidth+1; |
---|
| 170 | m_iOutputSamplesStride = m_iWidth; |
---|
[2] | 171 | |
---|
[100] | 172 | m_pcInputSamples[0] = new RenModelInPels[m_iInputSamplesStride*m_iHeight]; |
---|
| 173 | m_pcInputSamples[1] = new RenModelInPels[m_iInputSamplesStride*m_iHeight]; |
---|
[2] | 174 | |
---|
[100] | 175 | m_pcOutputSamples = new RenModelOutPels[m_iOutputSamplesStride*m_iHeight]; |
---|
| 176 | } |
---|
[2] | 177 | |
---|
[100] | 178 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 179 | TRenSingleModelC<iBM,bBitInc>::setLRView( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ) |
---|
| 180 | { |
---|
| 181 | AOF(( iViewPos == 0) || (iViewPos == 1) ); |
---|
| 182 | |
---|
| 183 | RenModelInPels* pcCurInputSampleRow = m_pcInputSamples[iViewPos]; |
---|
| 184 | |
---|
| 185 | Pel* piDRow = piCurDepthPel; |
---|
| 186 | Pel* piYRow = apiCurVideoPel[0]; |
---|
| 187 | #if HHI_VSO_COLOR_PLANES |
---|
| 188 | Pel* piURow = apiCurVideoPel[1]; |
---|
| 189 | Pel* piVRow = apiCurVideoPel[2]; |
---|
| 190 | #endif |
---|
| 191 | |
---|
| 192 | |
---|
| 193 | Int iOffsetX = ( iViewPos == VIEWPOS_RIGHT ) ? 1 : 0; |
---|
| 194 | |
---|
| 195 | for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ ) |
---|
[2] | 196 | { |
---|
[100] | 197 | if ( iViewPos == VIEWPOS_RIGHT ) |
---|
[2] | 198 | { |
---|
[100] | 199 | Int iSubPosX = (1 << m_iShiftPrec); |
---|
| 200 | pcCurInputSampleRow[0].aiY[iSubPosX] = piYRow[0]; |
---|
| 201 | #if HHI_VSO_COLOR_PLANES |
---|
| 202 | pcCurInputSampleRow[0].aiU[iSubPosX] = piURow[0]; |
---|
| 203 | pcCurInputSampleRow[0].aiV[iSubPosX] = piVRow[0]; |
---|
| 204 | #endif |
---|
[2] | 205 | } |
---|
| 206 | |
---|
[100] | 207 | for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ ) |
---|
| 208 | { |
---|
| 209 | pcCurInputSampleRow[iPosX].iD = piDRow[iPosX]; |
---|
[2] | 210 | |
---|
[100] | 211 | for (Int iSubPosX = 0; iSubPosX < (1 << m_iShiftPrec)+1; iSubPosX++ ) |
---|
| 212 | { |
---|
| 213 | Int iShift = (iPosX << m_iShiftPrec) + iSubPosX; |
---|
| 214 | pcCurInputSampleRow[iPosX+iOffsetX].aiY[iSubPosX] = piYRow[iShift]; |
---|
| 215 | #if HHI_VSO_COLOR_PLANES |
---|
| 216 | pcCurInputSampleRow[iPosX+iOffsetX].aiU[iSubPosX] = piURow[iShift]; |
---|
| 217 | pcCurInputSampleRow[iPosX+iOffsetX].aiV[iSubPosX] = piVRow[iShift]; |
---|
| 218 | #endif |
---|
| 219 | } |
---|
| 220 | } |
---|
| 221 | |
---|
| 222 | pcCurInputSampleRow += m_iInputSamplesStride; |
---|
| 223 | |
---|
| 224 | piDRow += iCurDepthStride; |
---|
| 225 | piYRow += aiCurVideoStride[0]; |
---|
| 226 | #if HHI_VSO_COLOR_PLANES |
---|
| 227 | piURow += aiCurVideoStride[1]; |
---|
| 228 | piVRow += aiCurVideoStride[2]; |
---|
| 229 | #endif |
---|
[2] | 230 | } |
---|
| 231 | |
---|
[100] | 232 | |
---|
[2] | 233 | m_aapiBaseVideoPel [iViewPos] = apiCurVideoPel; |
---|
| 234 | m_aaiBaseVideoStrides [iViewPos] = aiCurVideoStride; |
---|
| 235 | m_apiBaseDepthPel [iViewPos] = piCurDepthPel; |
---|
| 236 | m_aiBaseDepthStrides [iViewPos] = iCurDepthStride; |
---|
[100] | 237 | |
---|
[2] | 238 | } |
---|
| 239 | |
---|
[100] | 240 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 241 | TRenSingleModelC<iBM,bBitInc>::setup( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference, UInt uiHorOff ) |
---|
[2] | 242 | { |
---|
| 243 | AOT( !m_bUseOrgRef && pcOrgVideo ); |
---|
| 244 | AOT( (ppiShiftLutLeft == NULL) && (m_iMode == 0 || m_iMode == 2) ); |
---|
| 245 | AOT( (ppiShiftLutRight == NULL) && (m_iMode == 1 || m_iMode == 2) ); |
---|
| 246 | |
---|
| 247 | m_appiShiftLut[0] = ppiShiftLutLeft; |
---|
| 248 | m_appiShiftLut[1] = ppiShiftLutRight; |
---|
| 249 | |
---|
| 250 | // Copy Reference |
---|
| 251 | m_pcPicYuvRef = pcOrgVideo; |
---|
| 252 | |
---|
[77] | 253 | if ( pcOrgVideo && !bKeepReference ) |
---|
[2] | 254 | { |
---|
[100] | 255 | TRenFilter::copy( pcOrgVideo->getLumaAddr() + uiHorOff * pcOrgVideo->getStride() , pcOrgVideo->getStride() , m_iWidth, m_iHeight, m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]); |
---|
| 256 | TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCbAddr() + (uiHorOff >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]); |
---|
| 257 | TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCrAddr() + (uiHorOff >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]); |
---|
| 258 | xSetStructRefView(); |
---|
[2] | 259 | } |
---|
| 260 | |
---|
| 261 | // Initial Rendering |
---|
[100] | 262 | xResetStructError(); |
---|
| 263 | xInitSampleStructs(); |
---|
[2] | 264 | |
---|
| 265 | switch ( m_iMode ) |
---|
[100] | 266 | { |
---|
| 267 | case 0: |
---|
| 268 | #if LGE_VSO_EARLY_SKIP_A0093 |
---|
| 269 | xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false ); |
---|
| 270 | #else |
---|
| 271 | xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] ); |
---|
| 272 | #endif |
---|
[2] | 273 | break; |
---|
[100] | 274 | case 1: |
---|
| 275 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 276 | xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false); |
---|
| 277 | #else |
---|
| 278 | xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] ); |
---|
| 279 | #endif |
---|
[2] | 280 | break; |
---|
| 281 | case 2: |
---|
| 282 | TRenFilter::setupZLUT( true, 30, iDistToLeft, ppiBaseShiftLutLeft, ppiBaseShiftLutRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight ); |
---|
[100] | 283 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 284 | xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false); |
---|
| 285 | xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false); |
---|
| 286 | #else |
---|
| 287 | xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] ); |
---|
| 288 | xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] ); |
---|
| 289 | #endif |
---|
[2] | 290 | break; |
---|
| 291 | default: |
---|
| 292 | AOT(true); |
---|
| 293 | } |
---|
| 294 | |
---|
| 295 | // Get Rendered View as Reference |
---|
| 296 | if ( !pcOrgVideo && !bKeepReference ) |
---|
| 297 | { |
---|
[100] | 298 | xResetStructError(); |
---|
| 299 | xSetStructSynthViewAsRefView(); |
---|
[2] | 300 | } |
---|
| 301 | } |
---|
| 302 | |
---|
[100] | 303 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 304 | #if HHI_VSO_COLOR_PLANES |
---|
| 305 | TRenSingleModelC<iBM,bBitInc>::xGetSampleStrTextPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY, Pel RenModelOutPels::*& rpiSrcU, Pel RenModelOutPels::*& rpiSrcV ) |
---|
| 306 | #else |
---|
| 307 | TRenSingleModelC<iBM,bBitInc>::xGetSampleStrTextPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY ) |
---|
| 308 | #endif |
---|
[2] | 309 | { |
---|
[100] | 310 | switch ( iViewNum ) |
---|
[2] | 311 | { |
---|
| 312 | case 0: |
---|
[100] | 313 | rpiSrcY = &RenModelOutPels::iYLeft; |
---|
| 314 | #if HHI_VSO_COLOR_PLANES |
---|
| 315 | rpiSrcU = &RenModelOutPels::iULeft; |
---|
| 316 | rpiSrcV = &RenModelOutPels::iVLeft; |
---|
| 317 | #endif |
---|
[2] | 318 | break; |
---|
| 319 | case 1: |
---|
[100] | 320 | rpiSrcY = &RenModelOutPels::iYRight; |
---|
| 321 | #if HHI_VSO_COLOR_PLANES |
---|
| 322 | rpiSrcU = &RenModelOutPels::iURight; |
---|
| 323 | rpiSrcV = &RenModelOutPels::iVRight; |
---|
| 324 | #endif |
---|
[2] | 325 | break; |
---|
[100] | 326 | case 2: |
---|
| 327 | rpiSrcY = &RenModelOutPels::iYBlended; |
---|
| 328 | #if HHI_VSO_COLOR_PLANES |
---|
| 329 | rpiSrcU = &RenModelOutPels::iUBlended; |
---|
| 330 | rpiSrcV = &RenModelOutPels::iVBlended; |
---|
| 331 | #endif |
---|
| 332 | break; |
---|
[2] | 333 | } |
---|
| 334 | } |
---|
| 335 | |
---|
[100] | 336 | |
---|
| 337 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 338 | TRenSingleModelC<iBM,bBitInc>::xGetSampleStrDepthPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcD ) |
---|
[2] | 339 | { |
---|
[100] | 340 | AOT(iViewNum != 0 && iViewNum != 1); |
---|
| 341 | rpiSrcD = (iViewNum == 1) ? &RenModelOutPels::iDRight : &RenModelOutPels::iDLeft; |
---|
[2] | 342 | } |
---|
| 343 | |
---|
| 344 | |
---|
[100] | 345 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 346 | TRenSingleModelC<iBM,bBitInc>::xSetStructRefView( ) |
---|
[2] | 347 | { |
---|
[100] | 348 | RenModelOutPels* pcCurOutSampleRow = m_pcOutputSamples; |
---|
| 349 | |
---|
| 350 | Pel* piYRow = m_aapiRefVideoPel[0]; |
---|
| 351 | #if HHI_VSO_COLOR_PLANES |
---|
| 352 | Pel* piURow = m_aapiRefVideoPel[1]; |
---|
| 353 | Pel* piVRow = m_aapiRefVideoPel[2]; |
---|
| 354 | #endif |
---|
| 355 | |
---|
| 356 | for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ ) |
---|
| 357 | { |
---|
| 358 | for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ ) |
---|
| 359 | { |
---|
| 360 | pcCurOutSampleRow[iPosX].iYRef = piYRow[iPosX]; |
---|
| 361 | #if HHI_VSO_COLOR_PLANES |
---|
| 362 | pcCurOutSampleRow[iPosX].iURef = piURow[iPosX]; |
---|
| 363 | pcCurOutSampleRow[iPosX].iVRef = piVRow[iPosX]; |
---|
| 364 | #endif |
---|
| 365 | } |
---|
| 366 | |
---|
| 367 | pcCurOutSampleRow += m_iOutputSamplesStride; |
---|
| 368 | |
---|
| 369 | piYRow += m_aiRefVideoStrides[0]; |
---|
| 370 | #if HHI_VSO_COLOR_PLANES |
---|
| 371 | piURow += m_aiRefVideoStrides[1]; |
---|
| 372 | piVRow += m_aiRefVideoStrides[2]; |
---|
| 373 | #endif |
---|
| 374 | } |
---|
[2] | 375 | } |
---|
| 376 | |
---|
[100] | 377 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 378 | TRenSingleModelC<iBM,bBitInc>::xResetStructError( ) |
---|
| 379 | { |
---|
| 380 | RenModelOutPels* pcCurOutSampleRow = m_pcOutputSamples; |
---|
[2] | 381 | |
---|
[100] | 382 | for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ ) |
---|
| 383 | { |
---|
| 384 | for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ ) |
---|
| 385 | { |
---|
| 386 | pcCurOutSampleRow[iPosX].iError = 0; |
---|
| 387 | } |
---|
| 388 | pcCurOutSampleRow += m_iOutputSamplesStride; |
---|
| 389 | } |
---|
[2] | 390 | } |
---|
| 391 | |
---|
[100] | 392 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 393 | TRenSingleModelC<iBM,bBitInc>::xSetStructSynthViewAsRefView( ) |
---|
| 394 | { |
---|
| 395 | AOT( m_iMode < 0 || m_iMode > 2); |
---|
[2] | 396 | |
---|
[100] | 397 | RenModelOutPels* pcCurOutSampleRow = m_pcOutputSamples; |
---|
| 398 | |
---|
| 399 | Pel RenModelOutPels::* piSrcY = NULL; |
---|
| 400 | |
---|
| 401 | #if HHI_VSO_COLOR_PLANES |
---|
| 402 | Pel RenModelOutPels::* piSrcU = NULL; |
---|
| 403 | Pel RenModelOutPels::* piSrcV = NULL; |
---|
| 404 | xGetSampleStrTextPtrs( m_iMode, piSrcY, piSrcU, piSrcV ); |
---|
| 405 | #else |
---|
| 406 | xGetSampleStrTextPtrs( m_iMode, piSrcY ); |
---|
| 407 | #endif |
---|
| 408 | |
---|
| 409 | for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ ) |
---|
| 410 | { |
---|
| 411 | for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ ) |
---|
| 412 | { |
---|
| 413 | pcCurOutSampleRow[iPosX].iYRef = pcCurOutSampleRow[iPosX].*piSrcY; |
---|
| 414 | #if HHI_VSO_COLOR_PLANES |
---|
| 415 | pcCurOutSampleRow[iPosX].iURef = pcCurOutSampleRow[iPosX].*piSrcU; |
---|
| 416 | pcCurOutSampleRow[iPosX].iVRef = pcCurOutSampleRow[iPosX].*piSrcV; |
---|
| 417 | #endif |
---|
| 418 | } |
---|
| 419 | pcCurOutSampleRow += m_iOutputSamplesStride; |
---|
| 420 | } |
---|
[2] | 421 | } |
---|
| 422 | |
---|
[100] | 423 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 424 | TRenSingleModelC<iBM,bBitInc>::xInitSampleStructs() |
---|
[2] | 425 | { |
---|
[100] | 426 | RenModelOutPels* pcOutSampleRow = m_pcOutputSamples; |
---|
| 427 | RenModelInPels * pcLeftInSampleRow = m_pcInputSamples[0]; |
---|
| 428 | RenModelInPels * pcRightInSampleRow = m_pcInputSamples[1]; |
---|
| 429 | |
---|
| 430 | |
---|
| 431 | for (Int iPosY = 0; iPosY < m_iHeight; iPosY++) |
---|
| 432 | { |
---|
| 433 | for (Int iPosX = 0; iPosX < m_iWidth; iPosX++) |
---|
| 434 | { |
---|
| 435 | //// Output Samples |
---|
| 436 | pcOutSampleRow[iPosX].iFilledLeft = REN_IS_HOLE; |
---|
| 437 | pcOutSampleRow[iPosX].iFilledRight = REN_IS_HOLE; |
---|
| 438 | |
---|
| 439 | pcOutSampleRow[iPosX].iDLeft = 0; |
---|
| 440 | pcOutSampleRow[iPosX].iDRight = 0; |
---|
| 441 | pcOutSampleRow[iPosX].iDBlended = 0; |
---|
| 442 | |
---|
| 443 | // Y Planes |
---|
| 444 | pcOutSampleRow[iPosX].iYLeft = 0; |
---|
| 445 | pcOutSampleRow[iPosX].iYRight = 0; |
---|
| 446 | pcOutSampleRow[iPosX].iYBlended = 0; |
---|
| 447 | #if HHI_VSO_COLOR_PLANES |
---|
| 448 | // U Planes |
---|
| 449 | pcOutSampleRow[iPosX].iULeft = 128 << g_uiBitIncrement; |
---|
| 450 | pcOutSampleRow[iPosX].iURight = 128 << g_uiBitIncrement; |
---|
| 451 | pcOutSampleRow[iPosX].iUBlended = 128 << g_uiBitIncrement; |
---|
| 452 | |
---|
| 453 | // V Planes |
---|
| 454 | pcOutSampleRow[iPosX].iVLeft = 128 << g_uiBitIncrement; |
---|
| 455 | pcOutSampleRow[iPosX].iVRight = 128 << g_uiBitIncrement; |
---|
| 456 | pcOutSampleRow[iPosX].iVBlended = 128 << g_uiBitIncrement; |
---|
| 457 | #endif |
---|
| 458 | //// Input Samples |
---|
| 459 | pcLeftInSampleRow [iPosX].bOccluded = false; |
---|
| 460 | pcRightInSampleRow[iPosX].bOccluded = false; |
---|
| 461 | } |
---|
| 462 | |
---|
| 463 | pcOutSampleRow += m_iOutputSamplesStride; |
---|
| 464 | pcLeftInSampleRow += m_iInputSamplesStride; |
---|
| 465 | pcRightInSampleRow += m_iInputSamplesStride; |
---|
| 466 | } |
---|
[2] | 467 | } |
---|
| 468 | |
---|
| 469 | |
---|
[100] | 470 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 471 | template <BlenMod iBM, Bool bBitInc> RMDist |
---|
| 472 | TRenSingleModelC<iBM,bBitInc>::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData , Pel * piOrgData, Int iOrgStride ) |
---|
| 473 | #else |
---|
| 474 | template <BlenMod iBM, Bool bBitInc> RMDist |
---|
| 475 | TRenSingleModelC<iBM,bBitInc>::getDistDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) |
---|
| 476 | #endif |
---|
| 477 | { |
---|
| 478 | RMDist iSSE = 0; |
---|
| 479 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 480 | Bool bEarlySkip; |
---|
| 481 | #endif |
---|
| 482 | switch ( iViewPos ) |
---|
| 483 | { |
---|
| 484 | case 0: |
---|
| 485 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 486 | bEarlySkip = m_bEarlySkip ? xDetectEarlySkipL(iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, piOrgData, iOrgStride) : false; |
---|
| 487 | if( !bEarlySkip ) |
---|
| 488 | { |
---|
| 489 | iSSE = xRenderL<false>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,true ); |
---|
| 490 | } |
---|
| 491 | #else |
---|
| 492 | iSSE = xRenderL<false>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); |
---|
| 493 | #endif |
---|
| 494 | break; |
---|
| 495 | case 1: |
---|
| 496 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 497 | bEarlySkip = m_bEarlySkip ? xDetectEarlySkipR(iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, piOrgData, iOrgStride) : false; |
---|
| 498 | if( !bEarlySkip ) |
---|
| 499 | { |
---|
| 500 | iSSE = xRenderR<false>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,true ); |
---|
| 501 | } |
---|
| 502 | #else |
---|
| 503 | iSSE = xRenderR<false>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); |
---|
| 504 | #endif |
---|
| 505 | break; |
---|
| 506 | default: |
---|
| 507 | assert(0); |
---|
| 508 | } |
---|
[2] | 509 | |
---|
[100] | 510 | return iSSE; |
---|
| 511 | } |
---|
| 512 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 513 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 514 | TRenSingleModelC<iBM,bBitInc>::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel* piOrgData, Int iOrgStride ) |
---|
| 515 | #else |
---|
| 516 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 517 | TRenSingleModelC<iBM,bBitInc>::setDepth( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) |
---|
| 518 | #endif |
---|
[2] | 519 | { |
---|
[100] | 520 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 521 | Bool bEarlySkip; |
---|
| 522 | #endif |
---|
| 523 | switch ( iViewPos ) |
---|
| 524 | { |
---|
| 525 | case 0: |
---|
| 526 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 527 | bEarlySkip = m_bEarlySkip ? xDetectEarlySkipL(iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, piOrgData,iOrgStride) : false; |
---|
| 528 | if( !bEarlySkip ) |
---|
| 529 | { |
---|
| 530 | xRenderL<true>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,true ); |
---|
| 531 | } |
---|
| 532 | #else |
---|
| 533 | xRenderL<true>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); |
---|
| 534 | #endif |
---|
| 535 | break; |
---|
| 536 | case 1: |
---|
| 537 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 538 | bEarlySkip = m_bEarlySkip ? xDetectEarlySkipR(iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, piOrgData,iOrgStride) : false; |
---|
| 539 | if( !bEarlySkip ) |
---|
| 540 | { |
---|
| 541 | xRenderR<true>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,true ); |
---|
| 542 | } |
---|
| 543 | #else |
---|
| 544 | xRenderR<true>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); |
---|
| 545 | #endif |
---|
| 546 | break; |
---|
| 547 | default: |
---|
| 548 | assert(0); |
---|
| 549 | } |
---|
| 550 | } |
---|
[2] | 551 | |
---|
[100] | 552 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 553 | TRenSingleModelC<iBM,bBitInc>::getSynthVideo( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) |
---|
| 554 | { |
---|
| 555 | AOT( pcPicYuv->getWidth() != m_iWidth ); |
---|
| 556 | AOT( pcPicYuv->getHeight() > m_iHeight + uiHorOffset ); |
---|
[2] | 557 | |
---|
[100] | 558 | #if HHI_VSO_COLOR_PLANES |
---|
| 559 | Pel RenModelOutPels::* piText[3] = { NULL, NULL, NULL }; |
---|
| 560 | xGetSampleStrTextPtrs(iViewPos, piText[0], piText[1], piText[2]); |
---|
[2] | 561 | |
---|
[100] | 562 | // Temp image for chroma down sampling |
---|
| 563 | PelImage cTempImage( m_iWidth, m_iHeight, 3, 0); |
---|
| 564 | Int aiStrides[3]; |
---|
| 565 | Pel* apiData [3]; |
---|
[2] | 566 | |
---|
[100] | 567 | cTempImage.getDataAndStrides( apiData, aiStrides ); |
---|
| 568 | |
---|
| 569 | for (UInt uiCurPlane = 0; uiCurPlane < 3; uiCurPlane++ ) |
---|
[2] | 570 | { |
---|
[100] | 571 | xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piText[uiCurPlane], apiData[uiCurPlane], aiStrides[uiCurPlane] , m_iWidth, m_iHeight); |
---|
| 572 | } |
---|
[2] | 573 | |
---|
[100] | 574 | xCopy2PicYuv( apiData, aiStrides, pcPicYuv, uiHorOffset ); |
---|
| 575 | #else |
---|
| 576 | Pel RenModelOutPels::* piY; |
---|
| 577 | xGetSampleStrTextPtrs(iViewPos, piY); |
---|
| 578 | xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piY, pcPicYuv->getLumaAddr() + uiHorOffset * pcPicYuv->getStride(), pcPicYuv->getStride(), m_iWidth, m_iHeight ); |
---|
| 579 | pcPicYuv->setChromaTo( 128 << g_uiBitIncrement ); |
---|
| 580 | #endif |
---|
| 581 | } |
---|
[2] | 582 | |
---|
[100] | 583 | |
---|
| 584 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 585 | TRenSingleModelC<iBM,bBitInc>::getSynthDepth( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOff ) |
---|
| 586 | { |
---|
| 587 | AOT( iViewPos != 0 && iViewPos != 1); |
---|
| 588 | |
---|
| 589 | AOT( pcPicYuv->getWidth() != m_iWidth ); |
---|
| 590 | AOT( pcPicYuv->getHeight() > m_iHeight + uiHorOff ); |
---|
| 591 | |
---|
| 592 | Pel RenModelOutPels::* piD = 0; |
---|
| 593 | xGetSampleStrDepthPtrs(iViewPos, piD); |
---|
| 594 | xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piD, pcPicYuv->getLumaAddr() + pcPicYuv->getStride() * uiHorOff, pcPicYuv->getStride(), m_iWidth, m_iHeight ); |
---|
| 595 | pcPicYuv->setChromaTo( 128 << g_uiBitIncrement ); |
---|
[2] | 596 | } |
---|
| 597 | |
---|
[100] | 598 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 599 | TRenSingleModelC<iBM,bBitInc>::getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) |
---|
| 600 | { |
---|
| 601 | AOT( pcPicYuv->getWidth() != m_iWidth ); |
---|
| 602 | AOT( pcPicYuv->getHeight() > m_iHeight + uiHorOffset); |
---|
[2] | 603 | |
---|
[100] | 604 | #if HHI_VSO_COLOR_PLANES |
---|
| 605 | Pel RenModelOutPels::* piText[3]; |
---|
| 606 | piText[0] = &RenModelOutPels::iYRef; |
---|
| 607 | piText[1] = &RenModelOutPels::iURef; |
---|
| 608 | piText[2] = &RenModelOutPels::iVRef; |
---|
[2] | 609 | |
---|
[100] | 610 | // Temp image for chroma down sampling |
---|
| 611 | PelImage cTempImage( m_iWidth, m_iHeight, 3, 0); |
---|
| 612 | Int aiStrides[3]; |
---|
| 613 | Pel* apiData [3]; |
---|
[2] | 614 | |
---|
[100] | 615 | cTempImage.getDataAndStrides( apiData, aiStrides ); |
---|
[2] | 616 | |
---|
[100] | 617 | for (UInt uiCurPlane = 0; uiCurPlane < 3; uiCurPlane++ ) |
---|
[2] | 618 | { |
---|
[100] | 619 | xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piText[uiCurPlane], apiData[uiCurPlane], aiStrides[uiCurPlane] , m_iWidth, m_iHeight); |
---|
| 620 | } |
---|
[2] | 621 | |
---|
[100] | 622 | xCopy2PicYuv( apiData, aiStrides, pcPicYuv, uiHorOffset ); |
---|
| 623 | #else |
---|
| 624 | xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, &RenModelOutPels::iYRef, pcPicYuv->getLumaAddr() * pcPicYuv->getStride() + uiHorOffset, pcPicYuv->getStride(), m_iWidth, m_iHeight ); |
---|
| 625 | pcPicYuv->setChromaTo( 128 << g_uiBitIncrement ); |
---|
| 626 | #endif |
---|
| 627 | } |
---|
[2] | 628 | |
---|
| 629 | |
---|
[100] | 630 | template <BlenMod iBM, Bool bBitInc> RMDist |
---|
| 631 | TRenSingleModelC<iBM,bBitInc>::getDistVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) |
---|
| 632 | { |
---|
| 633 | AOF(false); |
---|
| 634 | return 0; |
---|
[2] | 635 | } |
---|
| 636 | |
---|
[100] | 637 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 638 | TRenSingleModelC<iBM,bBitInc>::setVideo( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) |
---|
[2] | 639 | { |
---|
[100] | 640 | AOF(false); |
---|
| 641 | } |
---|
[2] | 642 | |
---|
[100] | 643 | |
---|
| 644 | |
---|
| 645 | template <BlenMod iBM, Bool bBitInc> __inline Void |
---|
| 646 | TRenSingleModelC<iBM,bBitInc>::xSetViewRow( Int iPosY ) |
---|
| 647 | { |
---|
| 648 | m_pcInputSamplesRow[0] = m_pcInputSamples[0] + m_iInputSamplesStride * iPosY; |
---|
| 649 | m_pcInputSamplesRow[1] = m_pcInputSamples[1] + m_iInputSamplesStride * iPosY; |
---|
| 650 | m_pcOutputSamplesRow = m_pcOutputSamples + m_iOutputSamplesStride * iPosY; |
---|
| 651 | |
---|
| 652 | } |
---|
| 653 | |
---|
| 654 | template <BlenMod iBM, Bool bBitInc> __inline Void |
---|
| 655 | TRenSingleModelC<iBM,bBitInc>::xIncViewRow( ) |
---|
| 656 | { |
---|
| 657 | m_pcInputSamplesRow[0] += m_iInputSamplesStride ; |
---|
| 658 | m_pcInputSamplesRow[1] += m_iInputSamplesStride ; |
---|
| 659 | m_pcOutputSamplesRow += m_iOutputSamplesStride; |
---|
| 660 | } |
---|
| 661 | #if LGE_VSO_EARLY_SKIP_A0093 |
---|
| 662 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist |
---|
| 663 | TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast) |
---|
| 664 | #else |
---|
| 665 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist |
---|
| 666 | TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData) |
---|
| 667 | #endif |
---|
| 668 | { |
---|
| 669 | const Int iCurViewPos = 0; |
---|
| 670 | const Int iOtherViewPos = 1; |
---|
| 671 | |
---|
| 672 | m_iCurViewPos = iCurViewPos ; |
---|
| 673 | m_iOtherViewPos = iOtherViewPos; |
---|
| 674 | |
---|
[2] | 675 | m_piNewDepthData = piNewData; |
---|
| 676 | m_iNewDataWidth = iWidth; |
---|
| 677 | m_iStartChangePosX = iStartPosX; |
---|
| 678 | |
---|
| 679 | if ((iWidth == 0) || (iHeight == 0)) |
---|
| 680 | return 0; |
---|
| 681 | |
---|
| 682 | // Get Data |
---|
[100] | 683 | m_ppiCurLUT = m_appiShiftLut [iCurViewPos]; |
---|
[2] | 684 | |
---|
| 685 | xSetViewRow ( iStartPosY); |
---|
| 686 | |
---|
| 687 | // Init Start |
---|
| 688 | RMDist iError = 0; |
---|
| 689 | Int iStartChangePos; |
---|
| 690 | |
---|
| 691 | iStartChangePos = m_iStartChangePosX; |
---|
| 692 | |
---|
| 693 | for (Int iPosY = iStartPosY; iPosY < iStartPosY + iHeight; iPosY++ ) |
---|
| 694 | { |
---|
[100] | 695 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 696 | if( m_bEarlySkip && bFast ) |
---|
| 697 | { |
---|
| 698 | if ( m_pbHorSkip[iPosY-iStartPosY] ) |
---|
| 699 | { |
---|
| 700 | xIncViewRow(); |
---|
| 701 | m_piNewDepthData += iStride; |
---|
| 702 | continue; |
---|
| 703 | } |
---|
| 704 | } |
---|
| 705 | #endif |
---|
[2] | 706 | m_bInOcclusion = false; |
---|
| 707 | |
---|
| 708 | Int iLastSPos; |
---|
| 709 | Int iEndChangePos = m_iStartChangePosX + iWidth - 1; |
---|
| 710 | Int iPosXinNewData = iWidth - 1; |
---|
| 711 | Int iMinChangedSPos = m_iSampledWidth; |
---|
| 712 | |
---|
| 713 | if ( iEndChangePos == ( m_iWidth -1 )) // Special processing for rightmost depth sample |
---|
| 714 | { |
---|
| 715 | m_iCurDepth = m_piNewDepthData[iPosXinNewData]; |
---|
| 716 | Int iCurSPos = xShiftNewData(iEndChangePos, iPosXinNewData); |
---|
| 717 | m_iLastOccludedSPos = iCurSPos + 1; |
---|
| 718 | m_iLastOccludedSPosFP = xRangeLeftL( m_iLastOccludedSPos ); |
---|
[100] | 719 | xExtrapolateMarginL<bSet> ( iCurSPos, iEndChangePos, iError ); |
---|
| 720 | |
---|
| 721 | iMinChangedSPos = Min( iMinChangedSPos, (iEndChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( Max(m_pcInputSamplesRow[iCurViewPos][iEndChangePos].iD, m_piNewDepthData[iPosXinNewData] )) ]); |
---|
[2] | 722 | iLastSPos = iCurSPos; |
---|
| 723 | m_iLastDepth = m_iCurDepth; |
---|
[100] | 724 | |
---|
| 725 | if ( bSet ) |
---|
| 726 | { |
---|
| 727 | m_pcInputSamplesRow[iCurViewPos][iEndChangePos].iD = m_piNewDepthData[iPosXinNewData]; |
---|
| 728 | } |
---|
| 729 | |
---|
[2] | 730 | iPosXinNewData--; |
---|
| 731 | iEndChangePos--; |
---|
| 732 | } |
---|
| 733 | else |
---|
| 734 | { |
---|
| 735 | iLastSPos = xShift(iEndChangePos+1); |
---|
[100] | 736 | m_iLastDepth = m_pcInputSamplesRow [iCurViewPos][iEndChangePos+1].iD; |
---|
[2] | 737 | xInitRenderPartL( iEndChangePos, iLastSPos ); |
---|
| 738 | } |
---|
| 739 | |
---|
| 740 | //// RENDER NEW DATA |
---|
| 741 | Int iCurPosX; |
---|
| 742 | for ( iCurPosX = iEndChangePos; iCurPosX >= iStartChangePos; iCurPosX-- ) |
---|
| 743 | { |
---|
| 744 | // Get minimal changed sample position |
---|
[100] | 745 | |
---|
| 746 | iMinChangedSPos = Min( iMinChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( Max(m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD, m_piNewDepthData[iPosXinNewData] )) ]); |
---|
[2] | 747 | Int iCurSPos = xShiftNewData(iCurPosX,iPosXinNewData); |
---|
| 748 | m_iCurDepth = m_piNewDepthData[iPosXinNewData]; |
---|
[100] | 749 | xRenderRangeL<bSet>(iCurSPos, iLastSPos, iCurPosX, iError ); |
---|
[2] | 750 | iLastSPos = iCurSPos; |
---|
| 751 | m_iLastDepth = m_iCurDepth; |
---|
[100] | 752 | |
---|
| 753 | if ( bSet ) |
---|
| 754 | { |
---|
| 755 | m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD = m_piNewDepthData[iPosXinNewData]; |
---|
| 756 | } |
---|
| 757 | |
---|
[2] | 758 | iPosXinNewData--; |
---|
| 759 | } |
---|
| 760 | |
---|
| 761 | //// RE-RENDER DATA LEFT TO NEW DATA |
---|
| 762 | while ( iCurPosX >= 0 ) |
---|
| 763 | { |
---|
| 764 | Int iCurSPos = xShift(iCurPosX); |
---|
| 765 | |
---|
[100] | 766 | m_iCurDepth = m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD; |
---|
| 767 | xRenderRangeL<bSet>( iCurSPos, iLastSPos, iCurPosX, iError ); |
---|
| 768 | |
---|
[2] | 769 | if ( iCurSPos < iMinChangedSPos ) |
---|
| 770 | { |
---|
| 771 | break; |
---|
| 772 | } |
---|
[5] | 773 | |
---|
[2] | 774 | iCurPosX--; |
---|
| 775 | iLastSPos = iCurSPos; |
---|
| 776 | m_iLastDepth = m_iCurDepth; |
---|
| 777 | } |
---|
| 778 | |
---|
[100] | 779 | |
---|
[2] | 780 | xIncViewRow(); |
---|
| 781 | m_piNewDepthData += iStride; |
---|
| 782 | } |
---|
| 783 | return iError; |
---|
| 784 | } |
---|
| 785 | |
---|
[100] | 786 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 787 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist |
---|
| 788 | TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData , Bool bFast) |
---|
| 789 | #else |
---|
| 790 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist |
---|
| 791 | TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) |
---|
| 792 | #endif |
---|
[2] | 793 | { |
---|
| 794 | |
---|
[100] | 795 | const Int iCurViewPos = 1; |
---|
| 796 | const Int iOtherViewPos = 0; |
---|
| 797 | |
---|
| 798 | m_iCurViewPos = iCurViewPos; |
---|
| 799 | m_iOtherViewPos = iOtherViewPos; |
---|
| 800 | |
---|
[2] | 801 | m_piNewDepthData = piNewData; |
---|
| 802 | m_iNewDataWidth = iWidth; |
---|
| 803 | m_iStartChangePosX = iStartPosX; |
---|
| 804 | |
---|
| 805 | if ((iWidth == 0) || (iHeight == 0)) |
---|
| 806 | return 0; |
---|
| 807 | |
---|
| 808 | // Get Data |
---|
[100] | 809 | m_ppiCurLUT = m_appiShiftLut [iCurViewPos]; |
---|
[2] | 810 | xSetViewRow ( iStartPosY); |
---|
| 811 | |
---|
| 812 | // Init Start |
---|
| 813 | RMDist iError = 0; |
---|
| 814 | Int iEndChangePos; |
---|
| 815 | |
---|
| 816 | iEndChangePos = m_iStartChangePosX + iWidth - 1; |
---|
| 817 | |
---|
| 818 | |
---|
| 819 | for (Int iPosY = iStartPosY; iPosY < iStartPosY + iHeight; iPosY++ ) |
---|
| 820 | { |
---|
[100] | 821 | |
---|
| 822 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 823 | if( m_bEarlySkip && bFast ) |
---|
| 824 | { |
---|
| 825 | if ( m_pbHorSkip[iPosY-iStartPosY] ) |
---|
| 826 | { |
---|
| 827 | xIncViewRow(); |
---|
| 828 | m_piNewDepthData += iStride; |
---|
| 829 | continue; |
---|
| 830 | } |
---|
| 831 | } |
---|
| 832 | #endif |
---|
[2] | 833 | m_bInOcclusion = false; |
---|
| 834 | |
---|
| 835 | Int iLastSPos; |
---|
| 836 | Int iStartChangePos = m_iStartChangePosX; |
---|
| 837 | Int iPosXinNewData = 0; |
---|
| 838 | Int iMaxChangedSPos = -1; |
---|
| 839 | |
---|
| 840 | if ( iStartChangePos == 0 ) // Special processing for leftmost depth sample |
---|
| 841 | { |
---|
| 842 | m_iCurDepth = m_piNewDepthData[iPosXinNewData]; |
---|
| 843 | Int iCurSPos = xShiftNewData(iStartChangePos, iPosXinNewData); |
---|
| 844 | m_iLastOccludedSPos = iCurSPos - 1; |
---|
| 845 | m_iLastOccludedSPosFP = xRangeRightR( m_iLastOccludedSPos ); |
---|
[100] | 846 | xExtrapolateMarginR<bSet> ( iCurSPos, iStartChangePos, iError ); |
---|
| 847 | |
---|
| 848 | iMaxChangedSPos = Max( iMaxChangedSPos, (iStartChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( Max(m_pcInputSamplesRow[iCurViewPos][iStartChangePos].iD, m_piNewDepthData[iPosXinNewData] )) ]); |
---|
[2] | 849 | iLastSPos = iCurSPos; |
---|
| 850 | m_iLastDepth = m_iCurDepth; |
---|
[100] | 851 | if ( bSet ) |
---|
| 852 | { |
---|
| 853 | m_pcInputSamplesRow[iCurViewPos][iStartChangePos].iD = m_piNewDepthData[iPosXinNewData]; |
---|
| 854 | } |
---|
| 855 | |
---|
| 856 | |
---|
[2] | 857 | iPosXinNewData++; |
---|
| 858 | iStartChangePos++; |
---|
| 859 | } |
---|
| 860 | else |
---|
| 861 | { |
---|
| 862 | iLastSPos = xShift(iStartChangePos-1); |
---|
[100] | 863 | |
---|
| 864 | m_iLastDepth = m_pcInputSamplesRow[iCurViewPos][iStartChangePos-1].iD; |
---|
[2] | 865 | xInitRenderPartR( iStartChangePos, iLastSPos ); |
---|
| 866 | } |
---|
| 867 | |
---|
| 868 | //// RENDER NEW DATA |
---|
| 869 | Int iCurPosX; |
---|
| 870 | for ( iCurPosX = iStartChangePos; iCurPosX <= iEndChangePos; iCurPosX++ ) |
---|
| 871 | { |
---|
| 872 | // Get minimal changed sample position |
---|
[100] | 873 | |
---|
| 874 | iMaxChangedSPos = Max( iMaxChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( Max(m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD, m_piNewDepthData[iPosXinNewData] )) ]); |
---|
[2] | 875 | Int iCurSPos = xShiftNewData(iCurPosX,iPosXinNewData); |
---|
| 876 | m_iCurDepth = m_piNewDepthData[iPosXinNewData]; |
---|
[100] | 877 | xRenderRangeR<bSet>(iCurSPos, iLastSPos, iCurPosX, iError ); |
---|
[2] | 878 | iLastSPos = iCurSPos; |
---|
| 879 | m_iLastDepth = m_iCurDepth; |
---|
[100] | 880 | |
---|
| 881 | if ( bSet ) |
---|
| 882 | { |
---|
| 883 | m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD = m_piNewDepthData[iPosXinNewData]; |
---|
| 884 | } |
---|
| 885 | |
---|
[2] | 886 | iPosXinNewData++; |
---|
| 887 | } |
---|
| 888 | |
---|
| 889 | //// RE-RENDER DATA LEFT TO NEW DATA |
---|
| 890 | while ( iCurPosX < m_iWidth ) |
---|
| 891 | { |
---|
| 892 | Int iCurSPos = xShift(iCurPosX); |
---|
| 893 | |
---|
[100] | 894 | m_iCurDepth = m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD; |
---|
| 895 | xRenderRangeR<bSet>( iCurSPos, iLastSPos, iCurPosX, iError ); |
---|
| 896 | |
---|
[2] | 897 | if ( iCurSPos > iMaxChangedSPos ) |
---|
| 898 | { |
---|
| 899 | break; |
---|
| 900 | } |
---|
| 901 | iCurPosX++; |
---|
| 902 | iLastSPos = iCurSPos; |
---|
| 903 | m_iLastDepth = m_iCurDepth; |
---|
| 904 | } |
---|
[100] | 905 | |
---|
[2] | 906 | xIncViewRow(); |
---|
| 907 | m_piNewDepthData += iStride; |
---|
| 908 | } |
---|
| 909 | return iError; |
---|
| 910 | } |
---|
| 911 | |
---|
| 912 | |
---|
[100] | 913 | template <BlenMod iBM, Bool bBitInc> __inline Void |
---|
| 914 | TRenSingleModelC<iBM,bBitInc>::xInitRenderPartL( Int iEndChangePos, Int iLastSPos ) |
---|
[2] | 915 | { |
---|
[100] | 916 | const Int iCurViewPos = 0; |
---|
[2] | 917 | // GET MINIMAL OCCLUDED SAMPLE POSITION |
---|
| 918 | Int iCurPosX = iEndChangePos; |
---|
| 919 | |
---|
[100] | 920 | |
---|
| 921 | if ( ( iCurPosX + 1 < m_iWidth ) && (m_pcInputSamplesRow[iCurViewPos][ iCurPosX + 1].bOccluded ) ) |
---|
[2] | 922 | { |
---|
| 923 | iCurPosX++; |
---|
[100] | 924 | |
---|
| 925 | while ( (iCurPosX + 1 < m_iWidth) && (m_pcInputSamplesRow[iCurViewPos][ iCurPosX + 1].bOccluded ) ) |
---|
| 926 | |
---|
[2] | 927 | iCurPosX++; |
---|
| 928 | |
---|
| 929 | if ( iCurPosX + 1 < m_iWidth ) |
---|
| 930 | { |
---|
| 931 | iCurPosX++; |
---|
| 932 | m_iLastOccludedSPos = xShift(iCurPosX); |
---|
| 933 | } |
---|
| 934 | else |
---|
| 935 | { |
---|
| 936 | m_iLastOccludedSPos = xShift(iCurPosX) + 1; |
---|
| 937 | } |
---|
| 938 | |
---|
| 939 | m_iLastOccludedSPosFP = xRoundL( m_iLastOccludedSPos ); |
---|
| 940 | } |
---|
| 941 | else |
---|
| 942 | { |
---|
| 943 | m_iLastOccludedSPos = iLastSPos+1; |
---|
| 944 | m_iLastOccludedSPosFP = xRangeLeftL( m_iLastOccludedSPos ); |
---|
| 945 | } |
---|
| 946 | |
---|
| 947 | m_bInOcclusion = iLastSPos >= m_iLastOccludedSPos; |
---|
| 948 | }; |
---|
| 949 | |
---|
[100] | 950 | template <BlenMod iBM, Bool bBitInc> __inline Void |
---|
| 951 | TRenSingleModelC<iBM,bBitInc>::xInitRenderPartR( Int iStartChangePos, Int iLastSPos ) |
---|
[2] | 952 | { |
---|
[100] | 953 | const Int iCurViewPos = 1; |
---|
[2] | 954 | // GET MINIMAL OCCLUDED SAMPLE POSITION |
---|
| 955 | Int iCurPosX = iStartChangePos; |
---|
| 956 | |
---|
[100] | 957 | if ( ( iCurPosX - 1 > -1 ) && (m_pcInputSamplesRow[iCurViewPos][ iCurPosX - 1].bOccluded ) ) |
---|
[2] | 958 | { |
---|
| 959 | iCurPosX--; |
---|
[100] | 960 | |
---|
| 961 | while ( (iCurPosX - 1 > -1 ) && (m_pcInputSamplesRow[iCurViewPos][ iCurPosX - 1].bOccluded ) ) |
---|
[2] | 962 | iCurPosX--; |
---|
| 963 | |
---|
| 964 | if ( iCurPosX - 1 > -1 ) |
---|
| 965 | { |
---|
| 966 | iCurPosX--; |
---|
| 967 | m_iLastOccludedSPos = xShift(iCurPosX); |
---|
| 968 | } |
---|
| 969 | else |
---|
| 970 | { |
---|
| 971 | m_iLastOccludedSPos = xShift(iCurPosX) - 1; |
---|
| 972 | } |
---|
| 973 | m_iLastOccludedSPosFP = xRoundR( m_iLastOccludedSPos ); |
---|
| 974 | } |
---|
| 975 | else |
---|
| 976 | { |
---|
| 977 | m_iLastOccludedSPos = iLastSPos-1; |
---|
| 978 | m_iLastOccludedSPosFP = xRangeRightR( m_iLastOccludedSPos ); |
---|
| 979 | } |
---|
| 980 | |
---|
| 981 | m_bInOcclusion = iLastSPos <= m_iLastOccludedSPos; |
---|
| 982 | }; |
---|
| 983 | |
---|
| 984 | |
---|
[100] | 985 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void |
---|
| 986 | TRenSingleModelC<iBM,bBitInc>::xRenderShiftedRangeL(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) |
---|
[2] | 987 | { |
---|
| 988 | assert( iCurSPos <= iLastSPos ); |
---|
| 989 | //assert( iRightSPos < m_iWidth ); |
---|
| 990 | |
---|
| 991 | Int iDeltaSPos = iLastSPos - iCurSPos; |
---|
| 992 | if ( iDeltaSPos > m_iGapTolerance ) |
---|
| 993 | { |
---|
[100] | 994 | xFillHoleL<bSet>( iCurSPos, iLastSPos, iCurPos, riError ); |
---|
[2] | 995 | } |
---|
| 996 | else |
---|
| 997 | { |
---|
| 998 | if (iLastSPos < 0 ) |
---|
| 999 | return; |
---|
| 1000 | |
---|
[100] | 1001 | RM_AOT( iDeltaSPos > m_iGapTolerance ); |
---|
[2] | 1002 | |
---|
| 1003 | m_iThisDepth = m_iCurDepth; |
---|
[100] | 1004 | for (Int iFillSPos = Max(0, xRangeLeftL(iCurSPos) ); iFillSPos <= min(xRangeRightL( iLastSPos ) ,m_iLastOccludedSPosFP-1); iFillSPos++ ) |
---|
[2] | 1005 | { |
---|
| 1006 | Int iDeltaCurSPos = (iFillSPos << m_iShiftPrec) - iCurSPos; |
---|
| 1007 | |
---|
[100] | 1008 | RM_AOT( iDeltaCurSPos > iDeltaSPos ); |
---|
| 1009 | RM_AOT( iDeltaCurSPos < 0 ); |
---|
| 1010 | RM_AOT( m_aaiSubPelShiftL[iDeltaSPos][iDeltaCurSPos] == 0xdeaddead); |
---|
[2] | 1011 | |
---|
[100] | 1012 | xSetShiftedPelL<bSet>( iCurPos, m_aaiSubPelShiftL[iDeltaSPos][iDeltaCurSPos], iFillSPos, REN_IS_FILLED, riError ); |
---|
[2] | 1013 | } |
---|
| 1014 | }; |
---|
| 1015 | } |
---|
| 1016 | |
---|
[100] | 1017 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void |
---|
| 1018 | TRenSingleModelC<iBM,bBitInc>::xRenderShiftedRangeR(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) |
---|
[2] | 1019 | { |
---|
| 1020 | assert( iCurSPos >= iLastSPos ); |
---|
| 1021 | |
---|
| 1022 | Int iDeltaSPos = iCurSPos - iLastSPos; |
---|
| 1023 | if ( iDeltaSPos > m_iGapTolerance ) |
---|
| 1024 | { |
---|
[100] | 1025 | xFillHoleR<bSet>( iCurSPos, iLastSPos, iCurPos, riError ); |
---|
[2] | 1026 | } |
---|
| 1027 | else |
---|
| 1028 | { |
---|
| 1029 | if (iLastSPos > m_iSampledWidth - 1 ) |
---|
| 1030 | return; |
---|
| 1031 | |
---|
| 1032 | m_iThisDepth = m_iCurDepth; |
---|
[100] | 1033 | RM_AOT( iDeltaSPos > m_iGapTolerance ); |
---|
[2] | 1034 | for (Int iFillSPos = max(m_iLastOccludedSPosFP+1, xRangeLeftR(iLastSPos) ); iFillSPos <= min(xRangeRightR( iCurSPos ) ,m_iWidth -1); iFillSPos++ ) |
---|
| 1035 | { |
---|
| 1036 | Int iDeltaCurSPos = (iFillSPos << m_iShiftPrec) - iLastSPos; |
---|
| 1037 | |
---|
[100] | 1038 | RM_AOT( iDeltaCurSPos > iDeltaSPos ); |
---|
| 1039 | RM_AOT( iDeltaCurSPos < 0 ); |
---|
| 1040 | RM_AOT( m_aaiSubPelShiftR[iDeltaSPos][iDeltaCurSPos] == 0xdeaddead); |
---|
[2] | 1041 | |
---|
[100] | 1042 | xSetShiftedPelR<bSet>( iCurPos, m_aaiSubPelShiftR[iDeltaSPos][iDeltaCurSPos], iFillSPos, REN_IS_FILLED, riError ); |
---|
[2] | 1043 | } |
---|
| 1044 | }; |
---|
| 1045 | } |
---|
| 1046 | |
---|
| 1047 | |
---|
| 1048 | |
---|
[100] | 1049 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void |
---|
| 1050 | TRenSingleModelC<iBM,bBitInc>::xRenderRangeL(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) |
---|
[2] | 1051 | { |
---|
[100] | 1052 | const Int iCurViewPos = 0; |
---|
[2] | 1053 | if ( !m_bInOcclusion ) |
---|
| 1054 | { |
---|
| 1055 | if ( iCurSPos >= iLastSPos ) |
---|
| 1056 | { |
---|
| 1057 | m_iLastOccludedSPos = iLastSPos; |
---|
[5] | 1058 | |
---|
[2] | 1059 | Int iRightSPosFP = xRoundL( iLastSPos ); |
---|
| 1060 | if ( ( iRightSPosFP == xRangeRightL(iLastSPos)) && (iRightSPosFP >= 0) ) |
---|
| 1061 | { |
---|
| 1062 | m_iThisDepth = m_iLastDepth; |
---|
[100] | 1063 | |
---|
| 1064 | xSetShiftedPelL<bSet>( iCurPos+1, 0, iRightSPosFP, REN_IS_FILLED, riError ); |
---|
[2] | 1065 | } |
---|
| 1066 | m_iLastOccludedSPosFP = iRightSPosFP; |
---|
| 1067 | |
---|
| 1068 | m_bInOcclusion = true; |
---|
| 1069 | |
---|
[100] | 1070 | if ( bSet ) |
---|
[2] | 1071 | { |
---|
[100] | 1072 | m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = true; |
---|
[2] | 1073 | } |
---|
| 1074 | } |
---|
| 1075 | else |
---|
| 1076 | { |
---|
[100] | 1077 | if ( bSet ) |
---|
[2] | 1078 | { |
---|
[100] | 1079 | m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = false; |
---|
[2] | 1080 | } |
---|
| 1081 | |
---|
[100] | 1082 | xRenderShiftedRangeL<bSet>(iCurSPos, iLastSPos, iCurPos, riError ); |
---|
[2] | 1083 | } |
---|
| 1084 | } |
---|
| 1085 | else |
---|
| 1086 | { |
---|
| 1087 | if ( iCurSPos < m_iLastOccludedSPos ) |
---|
| 1088 | { |
---|
| 1089 | m_bInOcclusion = false; |
---|
[100] | 1090 | if ( bSet ) |
---|
[2] | 1091 | { |
---|
[100] | 1092 | m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = false; |
---|
[2] | 1093 | } |
---|
| 1094 | |
---|
[100] | 1095 | xRenderShiftedRangeL<bSet>(iCurSPos, iLastSPos, iCurPos, riError ); |
---|
[2] | 1096 | } |
---|
| 1097 | else |
---|
| 1098 | { |
---|
[100] | 1099 | if ( bSet ) |
---|
[2] | 1100 | { |
---|
[100] | 1101 | m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = true; |
---|
[2] | 1102 | } |
---|
| 1103 | } |
---|
| 1104 | } |
---|
| 1105 | } |
---|
| 1106 | |
---|
[100] | 1107 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void |
---|
| 1108 | TRenSingleModelC<iBM,bBitInc>::xRenderRangeR(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) |
---|
[2] | 1109 | { |
---|
[100] | 1110 | const Int iCurViewPos = 1; |
---|
[2] | 1111 | // Find out if current sample is occluded |
---|
| 1112 | if ( !m_bInOcclusion ) |
---|
| 1113 | { |
---|
| 1114 | if ( iCurSPos <= iLastSPos ) |
---|
| 1115 | { |
---|
| 1116 | m_iLastOccludedSPos = iLastSPos; |
---|
| 1117 | |
---|
| 1118 | Int iLeftSPosFP = xRoundR( iLastSPos ); |
---|
| 1119 | if ( ( iLeftSPosFP == xRangeLeftR(iLastSPos)) && (iLeftSPosFP <= m_iWidth - 1) ) |
---|
| 1120 | { |
---|
| 1121 | m_iThisDepth = m_iLastDepth; |
---|
[100] | 1122 | xSetShiftedPelR<bSet>( iCurPos-1,1 << m_iShiftPrec , iLeftSPosFP, REN_IS_FILLED, riError ); |
---|
[2] | 1123 | } |
---|
| 1124 | m_iLastOccludedSPosFP = iLeftSPosFP; |
---|
| 1125 | |
---|
| 1126 | m_bInOcclusion = true; |
---|
| 1127 | |
---|
[100] | 1128 | if ( bSet ) |
---|
[2] | 1129 | { |
---|
[100] | 1130 | m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = true; |
---|
[2] | 1131 | } |
---|
| 1132 | } |
---|
| 1133 | else |
---|
| 1134 | { |
---|
[100] | 1135 | if ( bSet ) |
---|
[2] | 1136 | { |
---|
[100] | 1137 | m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = false; |
---|
[2] | 1138 | } |
---|
| 1139 | |
---|
[100] | 1140 | xRenderShiftedRangeR<bSet>(iCurSPos, iLastSPos, iCurPos, riError ); |
---|
[2] | 1141 | } |
---|
| 1142 | } |
---|
| 1143 | else |
---|
| 1144 | { |
---|
| 1145 | if ( iCurSPos > m_iLastOccludedSPos ) |
---|
| 1146 | { |
---|
| 1147 | m_bInOcclusion = false; |
---|
[100] | 1148 | if ( bSet ) |
---|
[2] | 1149 | { |
---|
[100] | 1150 | m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = false; |
---|
[2] | 1151 | } |
---|
| 1152 | |
---|
[100] | 1153 | xRenderShiftedRangeR<bSet>(iCurSPos, iLastSPos, iCurPos, riError ); |
---|
[2] | 1154 | } |
---|
| 1155 | else |
---|
| 1156 | { |
---|
[100] | 1157 | if ( bSet ) |
---|
[2] | 1158 | { |
---|
[100] | 1159 | m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = true; |
---|
[2] | 1160 | } |
---|
| 1161 | } |
---|
| 1162 | } |
---|
| 1163 | } |
---|
| 1164 | |
---|
[100] | 1165 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void |
---|
| 1166 | TRenSingleModelC<iBM,bBitInc>::xFillHoleL( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) |
---|
[2] | 1167 | { |
---|
| 1168 | if (iLastSPos < 0) |
---|
| 1169 | return; |
---|
| 1170 | |
---|
| 1171 | Int iStartFillSPos = iCurSPos; |
---|
| 1172 | Int iStartFillPos = iCurPos; |
---|
| 1173 | Int iLastPos = iCurPos + 1; |
---|
| 1174 | |
---|
| 1175 | Int iStartFillSPosFP = xRangeLeftL(iStartFillSPos); |
---|
| 1176 | |
---|
| 1177 | if (iStartFillSPosFP == xRoundL(iStartFillSPos)) |
---|
| 1178 | { |
---|
| 1179 | if ((iStartFillSPosFP >= 0) && (iStartFillSPosFP < m_iLastOccludedSPosFP) ) |
---|
| 1180 | { |
---|
| 1181 | m_iThisDepth = m_iCurDepth; |
---|
[100] | 1182 | xSetShiftedPelL<bSet> ( iStartFillPos, 0, iStartFillSPosFP, REN_IS_FILLED, riError ); |
---|
[2] | 1183 | } |
---|
| 1184 | } |
---|
| 1185 | else |
---|
| 1186 | { |
---|
| 1187 | iStartFillSPosFP--; |
---|
| 1188 | } |
---|
| 1189 | |
---|
| 1190 | m_iThisDepth = m_iLastDepth; |
---|
[100] | 1191 | for (Int iFillSPos = Max(iStartFillSPosFP+1,0); iFillSPos <= min(xRangeRightL( iLastSPos ), m_iLastOccludedSPosFP-1 ); iFillSPos++ ) |
---|
[2] | 1192 | { |
---|
[100] | 1193 | xSetShiftedPelL<bSet>( iLastPos, 0, iFillSPos, REN_IS_HOLE, riError ); |
---|
[2] | 1194 | } |
---|
| 1195 | } |
---|
| 1196 | |
---|
[100] | 1197 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void |
---|
| 1198 | TRenSingleModelC<iBM,bBitInc>::xFillHoleR( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) |
---|
[2] | 1199 | { |
---|
| 1200 | if (iLastSPos < 0) |
---|
| 1201 | return; |
---|
| 1202 | |
---|
| 1203 | Int iStartFillSPos = iCurSPos; |
---|
| 1204 | Int iEndFillPos = iCurPos; |
---|
| 1205 | Int iLastPos = iCurPos - 1; |
---|
| 1206 | |
---|
| 1207 | Int iStartFillSPosFP = xRangeRightR(iStartFillSPos); |
---|
| 1208 | |
---|
| 1209 | if (iStartFillSPosFP == xRoundR(iStartFillSPos)) |
---|
| 1210 | { |
---|
| 1211 | if ((iStartFillSPosFP < m_iWidth) && (iStartFillSPosFP > m_iLastOccludedSPosFP) ) |
---|
| 1212 | { |
---|
| 1213 | m_iThisDepth = m_iCurDepth; |
---|
[100] | 1214 | xSetShiftedPelR<bSet>( iEndFillPos, 1 << m_iShiftPrec , iStartFillSPosFP, REN_IS_FILLED, riError ); |
---|
[2] | 1215 | } |
---|
| 1216 | } |
---|
| 1217 | else |
---|
| 1218 | { |
---|
| 1219 | iStartFillSPosFP++; |
---|
| 1220 | } |
---|
| 1221 | |
---|
| 1222 | m_iThisDepth = m_iLastDepth; |
---|
| 1223 | for (Int iFillSPos = max(xRangeLeftR( iLastSPos ), m_iLastOccludedSPosFP+1); iFillSPos <= min(iStartFillSPosFP,m_iWidth)-1 ; iFillSPos++ ) |
---|
| 1224 | { |
---|
[100] | 1225 | xSetShiftedPelR<bSet>( iLastPos, 1 << m_iShiftPrec, iFillSPos, REN_IS_HOLE, riError ); |
---|
[2] | 1226 | } |
---|
| 1227 | } |
---|
| 1228 | |
---|
[100] | 1229 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void |
---|
| 1230 | TRenSingleModelC<iBM,bBitInc>::xExtrapolateMarginL(Int iCurSPos, Int iCurPos, RMDist& riError ) |
---|
[2] | 1231 | { |
---|
| 1232 | // if (iLeftSPos < 0 ) |
---|
| 1233 | // return; |
---|
| 1234 | |
---|
[100] | 1235 | Int iSPosFullPel = Max(0,xRangeLeftL(iCurSPos)); |
---|
[2] | 1236 | |
---|
| 1237 | m_iThisDepth = m_iCurDepth; |
---|
| 1238 | if (iSPosFullPel < m_iWidth) |
---|
| 1239 | { |
---|
[100] | 1240 | xSetShiftedPelL<bSet>( iCurPos, 0, iSPosFullPel, REN_IS_FILLED, riError ); |
---|
[2] | 1241 | } |
---|
| 1242 | |
---|
| 1243 | for (Int iFillSPos = iSPosFullPel +1; iFillSPos < m_iWidth; iFillSPos++ ) |
---|
| 1244 | { |
---|
[100] | 1245 | xSetShiftedPelL<bSet>( iCurPos, 0, iFillSPos, REN_IS_HOLE, riError ); |
---|
[2] | 1246 | } |
---|
| 1247 | } |
---|
| 1248 | |
---|
[100] | 1249 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void |
---|
| 1250 | TRenSingleModelC<iBM,bBitInc>::xExtrapolateMarginR(Int iCurSPos, Int iCurPos, RMDist& riError ) |
---|
[2] | 1251 | { |
---|
| 1252 | // if (iLeftSPos < 0 ) |
---|
| 1253 | // return; |
---|
| 1254 | |
---|
| 1255 | Int iSPosFullPel = Min(m_iWidth-1,xRangeRightR(iCurSPos)); |
---|
| 1256 | |
---|
| 1257 | m_iThisDepth = m_iCurDepth; |
---|
| 1258 | if (iSPosFullPel > -1) |
---|
| 1259 | { |
---|
[100] | 1260 | xSetShiftedPelR<bSet>( iCurPos, 1 << m_iShiftPrec, iSPosFullPel, REN_IS_FILLED, riError ); |
---|
[2] | 1261 | } |
---|
| 1262 | |
---|
| 1263 | for (Int iFillSPos = iSPosFullPel -1; iFillSPos > -1; iFillSPos-- ) |
---|
| 1264 | { |
---|
[100] | 1265 | xSetShiftedPelR<bSet>( iCurPos , 1 << m_iShiftPrec, iFillSPos, REN_IS_HOLE, riError ); |
---|
[2] | 1266 | } |
---|
| 1267 | } |
---|
| 1268 | |
---|
[100] | 1269 | template <BlenMod iBM, Bool bBitInc> __inline Int |
---|
| 1270 | TRenSingleModelC<iBM,bBitInc>::xShiftNewData( Int iPosX, Int iPosInNewData ) |
---|
[2] | 1271 | { |
---|
[100] | 1272 | RM_AOT( iPosInNewData < 0 ); |
---|
| 1273 | RM_AOF( iPosInNewData < m_iNewDataWidth ); |
---|
[2] | 1274 | |
---|
[100] | 1275 | return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( m_piNewDepthData[iPosInNewData] )]; |
---|
[2] | 1276 | } |
---|
| 1277 | |
---|
[100] | 1278 | template <BlenMod iBM, Bool bBitInc> __inline Int |
---|
| 1279 | TRenSingleModelC<iBM,bBitInc>::xShift( Int iPosX ) |
---|
[2] | 1280 | { |
---|
[100] | 1281 | RM_AOT( iPosX < 0); |
---|
| 1282 | RM_AOF( iPosX < m_iWidth); |
---|
| 1283 | |
---|
| 1284 | return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( m_pcInputSamplesRow[m_iCurViewPos][iPosX].iD )]; |
---|
[2] | 1285 | } |
---|
| 1286 | |
---|
| 1287 | |
---|
[100] | 1288 | template <BlenMod iBM, Bool bBitInc> __inline Int |
---|
| 1289 | TRenSingleModelC<iBM,bBitInc>::xShift( Int iPos, Int iPosInNewData ) |
---|
[2] | 1290 | { |
---|
| 1291 | if ( (iPosInNewData >= 0) && (iPosInNewData < m_iNewDataWidth) ) |
---|
| 1292 | { |
---|
| 1293 | return xShiftNewData(iPos ,iPosInNewData ); |
---|
| 1294 | } |
---|
| 1295 | else |
---|
| 1296 | { |
---|
| 1297 | return xShift(iPos); |
---|
| 1298 | } |
---|
| 1299 | } |
---|
| 1300 | |
---|
[100] | 1301 | template <BlenMod iBM, Bool bBitInc> __inline Int |
---|
| 1302 | TRenSingleModelC<iBM,bBitInc>::xRangeLeftL( Int iPos ) |
---|
[2] | 1303 | { |
---|
| 1304 | return ( iPos + (1 << m_iShiftPrec) - 1) >> m_iShiftPrec; |
---|
| 1305 | } |
---|
| 1306 | |
---|
| 1307 | |
---|
[100] | 1308 | template <BlenMod iBM, Bool bBitInc> __inline Int |
---|
| 1309 | TRenSingleModelC<iBM,bBitInc>::xRangeLeftR( Int iPos ) |
---|
[2] | 1310 | { |
---|
| 1311 | |
---|
| 1312 | return xRangeRightR( iPos ) + 1; |
---|
| 1313 | } |
---|
| 1314 | |
---|
| 1315 | |
---|
[100] | 1316 | template <BlenMod iBM, Bool bBitInc> __inline Int |
---|
| 1317 | TRenSingleModelC<iBM,bBitInc>::xRangeRightL( Int iPos ) |
---|
[2] | 1318 | { |
---|
| 1319 | return xRangeLeftL(iPos) - 1; |
---|
| 1320 | } |
---|
| 1321 | |
---|
[100] | 1322 | template <BlenMod iBM, Bool bBitInc> __inline Int |
---|
| 1323 | TRenSingleModelC<iBM,bBitInc>::xRangeRightR( Int iPos ) |
---|
[2] | 1324 | { |
---|
| 1325 | return iPos >> m_iShiftPrec; |
---|
| 1326 | } |
---|
| 1327 | |
---|
| 1328 | |
---|
[100] | 1329 | template <BlenMod iBM, Bool bBitInc> __inline Int |
---|
| 1330 | TRenSingleModelC<iBM,bBitInc>::xRoundL( Int iPos ) |
---|
[2] | 1331 | { |
---|
| 1332 | return (iPos + (( 1 << m_iShiftPrec ) >> 1 )) >> m_iShiftPrec; |
---|
| 1333 | } |
---|
| 1334 | |
---|
[100] | 1335 | template <BlenMod iBM, Bool bBitInc> __inline Int |
---|
| 1336 | TRenSingleModelC<iBM,bBitInc>::xRoundR( Int iPos ) |
---|
[2] | 1337 | { |
---|
| 1338 | return (m_iShiftPrec == 0) ? iPos : xRoundL(iPos - 1); |
---|
| 1339 | } |
---|
| 1340 | |
---|
| 1341 | |
---|
[100] | 1342 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 1343 | TRenSingleModelC<iBM,bBitInc>::xSetPels( Pel* piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Pel iVal ) |
---|
[2] | 1344 | { |
---|
| 1345 | for (Int iYPos = 0; iYPos < iHeight; iYPos++) |
---|
| 1346 | { |
---|
| 1347 | for (Int iXPos = 0; iXPos < iWidth; iXPos++) |
---|
| 1348 | { |
---|
| 1349 | piPelSource[iXPos] = iVal; |
---|
| 1350 | } |
---|
| 1351 | piPelSource += iSourceStride; |
---|
| 1352 | } |
---|
| 1353 | } |
---|
| 1354 | |
---|
[100] | 1355 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 1356 | TRenSingleModelC<iBM,bBitInc>::xSetInts( Int* piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Int iVal ) |
---|
[2] | 1357 | { |
---|
| 1358 | for (Int iYPos = 0; iYPos < iHeight; iYPos++) |
---|
| 1359 | { |
---|
| 1360 | for (Int iXPos = 0; iXPos < iWidth; iXPos++) |
---|
| 1361 | { |
---|
| 1362 | piPelSource[iXPos] = iVal; |
---|
| 1363 | } |
---|
| 1364 | piPelSource += iSourceStride; |
---|
| 1365 | } |
---|
| 1366 | } |
---|
| 1367 | |
---|
| 1368 | |
---|
[100] | 1369 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 1370 | TRenSingleModelC<iBM,bBitInc>::xSetBools( Bool* pbPelSource , Int iSourceStride, Int iWidth, Int iHeight, Bool bVal ) |
---|
[2] | 1371 | { |
---|
| 1372 | for (Int iYPos = 0; iYPos < iHeight; iYPos++) |
---|
| 1373 | { |
---|
| 1374 | for (Int iXPos = 0; iXPos < iWidth; iXPos++) |
---|
| 1375 | { |
---|
| 1376 | pbPelSource[iXPos] = bVal; |
---|
| 1377 | } |
---|
| 1378 | pbPelSource += iSourceStride; |
---|
| 1379 | } |
---|
| 1380 | } |
---|
| 1381 | |
---|
[100] | 1382 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void |
---|
| 1383 | TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelL(Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ) |
---|
[2] | 1384 | { |
---|
[100] | 1385 | RM_AOT( iSourcePos < 0 ); |
---|
| 1386 | RM_AOT( iSourcePos >= m_iWidth ); |
---|
| 1387 | RM_AOT( iSubSourcePos < 0 ); |
---|
| 1388 | RM_AOT( iSubSourcePos > (1 << m_iShiftPrec) ); |
---|
| 1389 | RM_AOT( iTargetSPos < 0 ); |
---|
| 1390 | RM_AOT( iTargetSPos >= m_iWidth ); |
---|
[2] | 1391 | |
---|
[100] | 1392 | RenModelOutPels* pcOutSample = m_pcOutputSamplesRow + iTargetSPos; |
---|
| 1393 | RenModelInPels * pcInSample = m_pcInputSamplesRow[VIEWPOS_LEFT] + iSourcePos ; |
---|
[2] | 1394 | |
---|
[100] | 1395 | if ( iBM != BLEND_NONE ) |
---|
[2] | 1396 | { |
---|
[100] | 1397 | xSetShiftedPelBlendL<bSet> (pcInSample, iSubSourcePos, pcOutSample, iFilled, riError); |
---|
[2] | 1398 | } |
---|
[100] | 1399 | else |
---|
| 1400 | { |
---|
| 1401 | xSetShiftedPelNoBlendL<bSet>(pcInSample, iSubSourcePos, pcOutSample, iFilled, riError); |
---|
| 1402 | } |
---|
[2] | 1403 | } |
---|
| 1404 | |
---|
[100] | 1405 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void |
---|
| 1406 | TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelNoBlendL(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ) |
---|
[2] | 1407 | { |
---|
[100] | 1408 | if ( bSet ) |
---|
| 1409 | { |
---|
| 1410 | // Filled |
---|
| 1411 | pcOutSample->iFilledLeft = iFilled; |
---|
[2] | 1412 | |
---|
[100] | 1413 | // Yuv |
---|
| 1414 | pcOutSample->iYLeft = pcInSample->aiY[iSubSourcePos]; |
---|
| 1415 | #if HHI_VSO_COLOR_PLANES |
---|
| 1416 | pcOutSample->iULeft = pcInSample->aiU[iSubSourcePos]; |
---|
| 1417 | pcOutSample->iVLeft = pcInSample->aiV[iSubSourcePos]; |
---|
[2] | 1418 | |
---|
[100] | 1419 | pcOutSample->iError = xGetDist( pcOutSample->iYLeft - pcOutSample->iYRef, |
---|
| 1420 | pcOutSample->iULeft - pcOutSample->iURef, |
---|
| 1421 | pcOutSample->iVLeft - pcOutSample->iVRef |
---|
| 1422 | ); |
---|
| 1423 | #else |
---|
| 1424 | pcOutSample->iError = xGetDist( pcOutSample->iYLeft - pcOutSample->iYRef ); |
---|
| 1425 | #endif |
---|
| 1426 | |
---|
[2] | 1427 | } |
---|
[100] | 1428 | else |
---|
| 1429 | { |
---|
| 1430 | #if HHI_VSO_COLOR_PLANES |
---|
| 1431 | riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef, |
---|
| 1432 | pcInSample->aiU[iSubSourcePos] - pcOutSample->iURef, |
---|
| 1433 | pcInSample->aiV[iSubSourcePos] - pcOutSample->iVRef |
---|
| 1434 | ); |
---|
| 1435 | #else |
---|
| 1436 | riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef ); |
---|
| 1437 | #endif |
---|
[2] | 1438 | |
---|
[100] | 1439 | riError -= pcOutSample->iError; |
---|
| 1440 | } |
---|
| 1441 | } |
---|
| 1442 | |
---|
| 1443 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void |
---|
| 1444 | TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelBlendL(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ) |
---|
| 1445 | { |
---|
| 1446 | Pel piBlendedValueY; |
---|
[5] | 1447 | #if HHI_VSO_COLOR_PLANES |
---|
[100] | 1448 | Pel piBlendedValueU; |
---|
| 1449 | Pel piBlendedValueV; |
---|
[2] | 1450 | #endif |
---|
[100] | 1451 | |
---|
| 1452 | xGetBlendedValue ( |
---|
| 1453 | pcInSample ->aiY[iSubSourcePos], |
---|
| 1454 | pcOutSample->iYRight, |
---|
[5] | 1455 | #if HHI_VSO_COLOR_PLANES |
---|
[100] | 1456 | pcInSample ->aiU[iSubSourcePos], |
---|
| 1457 | pcOutSample->iURight, |
---|
| 1458 | pcInSample ->aiV[iSubSourcePos], |
---|
| 1459 | pcOutSample->iVRight, |
---|
| 1460 | #endif |
---|
| 1461 | m_piInvZLUTLeft [RenModRemoveBitInc(m_iThisDepth) ], |
---|
| 1462 | m_piInvZLUTRight[RenModRemoveBitInc(pcOutSample->iDRight)], |
---|
| 1463 | iFilled, |
---|
| 1464 | pcOutSample->iFilledRight , |
---|
| 1465 | piBlendedValueY |
---|
| 1466 | #if HHI_VSO_COLOR_PLANES |
---|
| 1467 | , piBlendedValueU, |
---|
| 1468 | piBlendedValueV |
---|
| 1469 | #endif |
---|
| 1470 | ); |
---|
| 1471 | |
---|
| 1472 | if ( bSet ) |
---|
| 1473 | { |
---|
| 1474 | // Set values |
---|
| 1475 | pcOutSample->iDLeft = m_iThisDepth; |
---|
| 1476 | pcOutSample->iYLeft = pcInSample ->aiY[iSubSourcePos]; |
---|
| 1477 | pcOutSample->iYBlended = piBlendedValueY; |
---|
| 1478 | #if HHI_VSO_COLOR_PLANES |
---|
| 1479 | pcOutSample->iULeft = pcInSample ->aiU[iSubSourcePos]; |
---|
| 1480 | pcOutSample->iUBlended = piBlendedValueU; |
---|
| 1481 | pcOutSample->iVLeft = pcInSample ->aiV[iSubSourcePos]; |
---|
| 1482 | pcOutSample->iVBlended = piBlendedValueV; |
---|
| 1483 | #endif |
---|
| 1484 | pcOutSample->iFilledLeft = iFilled; |
---|
| 1485 | |
---|
| 1486 | // Get Error |
---|
| 1487 | Int iDiffY = pcOutSample->iYRef - piBlendedValueY; |
---|
| 1488 | #if HHI_VSO_COLOR_PLANES |
---|
| 1489 | Int iDiffU = pcOutSample->iURef - piBlendedValueU; |
---|
| 1490 | Int iDiffV = pcOutSample->iVRef - piBlendedValueV; |
---|
| 1491 | pcOutSample->iError = xGetDist(iDiffY, iDiffU, iDiffV ); |
---|
[2] | 1492 | #else |
---|
[100] | 1493 | pcOutSample->iError = xGetDist(iDiffY ); |
---|
[2] | 1494 | #endif |
---|
| 1495 | } |
---|
| 1496 | else |
---|
| 1497 | { |
---|
[100] | 1498 | Int iDiffY = pcOutSample->iYRef - piBlendedValueY; |
---|
[5] | 1499 | #if HHI_VSO_COLOR_PLANES |
---|
[100] | 1500 | Int iDiffU = pcOutSample->iURef - piBlendedValueU; |
---|
| 1501 | Int iDiffV = pcOutSample->iVRef - piBlendedValueV; |
---|
| 1502 | riError += ( xGetDist( iDiffY, iDiffU, iDiffV ) - pcOutSample->iError ); |
---|
| 1503 | |
---|
[2] | 1504 | #else |
---|
[100] | 1505 | riError += ( xGetDist( iDiffY ) - pcOutSample->iError ); |
---|
[2] | 1506 | #endif |
---|
[100] | 1507 | |
---|
[2] | 1508 | } |
---|
| 1509 | } |
---|
| 1510 | |
---|
[100] | 1511 | |
---|
| 1512 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void |
---|
| 1513 | TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelR(Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ) |
---|
[2] | 1514 | { |
---|
[100] | 1515 | RM_AOT( iSourcePos < 0 ); |
---|
| 1516 | RM_AOT( iSourcePos >= m_iWidth ); |
---|
| 1517 | RM_AOT( iSubSourcePos < 0 ); |
---|
| 1518 | RM_AOT( iSubSourcePos >= (1 << m_iShiftPrec)+1 ); |
---|
| 1519 | RM_AOT( iTargetSPos < 0 ); |
---|
| 1520 | RM_AOT( iTargetSPos >= m_iWidth ); |
---|
[2] | 1521 | |
---|
[100] | 1522 | RenModelOutPels* pcOutSample = m_pcOutputSamplesRow + iTargetSPos; |
---|
| 1523 | RenModelInPels * pcInSample = m_pcInputSamplesRow[VIEWPOS_RIGHT] + iSourcePos ; |
---|
[2] | 1524 | |
---|
[100] | 1525 | if ( iBM != BLEND_NONE ) |
---|
| 1526 | { |
---|
| 1527 | xSetShiftedPelBlendR<bSet> (pcInSample, iSubSourcePos, pcOutSample, iFilled, riError); |
---|
| 1528 | } |
---|
| 1529 | else |
---|
| 1530 | { |
---|
| 1531 | xSetShiftedPelNoBlendR<bSet> (pcInSample, iSubSourcePos, pcOutSample, iFilled, riError); |
---|
| 1532 | } |
---|
| 1533 | } |
---|
| 1534 | |
---|
| 1535 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void |
---|
| 1536 | TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelNoBlendR(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ) |
---|
| 1537 | { |
---|
| 1538 | if ( bSet ) |
---|
| 1539 | { |
---|
| 1540 | // Filled |
---|
| 1541 | pcOutSample->iFilledRight = iFilled; |
---|
| 1542 | |
---|
| 1543 | // Yuv |
---|
| 1544 | pcOutSample->iYRight = pcInSample->aiY[iSubSourcePos]; |
---|
[5] | 1545 | #if HHI_VSO_COLOR_PLANES |
---|
[100] | 1546 | pcOutSample->iURight = pcInSample->aiU[iSubSourcePos]; |
---|
| 1547 | pcOutSample->iVRight = pcInSample->aiV[iSubSourcePos]; |
---|
[2] | 1548 | |
---|
[100] | 1549 | pcOutSample->iError = xGetDist( |
---|
| 1550 | pcOutSample->iYRight - pcOutSample->iYRef, |
---|
| 1551 | pcOutSample->iURight - pcOutSample->iURef, |
---|
| 1552 | pcOutSample->iVRight - pcOutSample->iVRef |
---|
| 1553 | ); |
---|
| 1554 | #else |
---|
| 1555 | pcOutSample->iError = xGetDist( pcOutSample->iYRight - pcOutSample->iYRef ); |
---|
| 1556 | #endif |
---|
[2] | 1557 | |
---|
[100] | 1558 | } |
---|
| 1559 | else |
---|
| 1560 | { |
---|
[5] | 1561 | #if HHI_VSO_COLOR_PLANES |
---|
[100] | 1562 | riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef, |
---|
| 1563 | pcInSample->aiU[iSubSourcePos] - pcOutSample->iURef, |
---|
| 1564 | pcInSample->aiV[iSubSourcePos] - pcOutSample->iVRef |
---|
| 1565 | ); |
---|
| 1566 | #else |
---|
| 1567 | riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef ); |
---|
[2] | 1568 | #endif |
---|
[100] | 1569 | |
---|
| 1570 | riError -= pcOutSample->iError; |
---|
| 1571 | } |
---|
| 1572 | } |
---|
| 1573 | |
---|
| 1574 | template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void |
---|
| 1575 | TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelBlendR(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ) |
---|
| 1576 | { |
---|
| 1577 | Pel piBlendedValueY; |
---|
[5] | 1578 | #if HHI_VSO_COLOR_PLANES |
---|
[100] | 1579 | Pel piBlendedValueU; |
---|
| 1580 | Pel piBlendedValueV; |
---|
[2] | 1581 | #endif |
---|
[100] | 1582 | |
---|
| 1583 | xGetBlendedValue ( |
---|
| 1584 | pcOutSample->iYLeft, |
---|
| 1585 | pcInSample ->aiY[iSubSourcePos], |
---|
[5] | 1586 | #if HHI_VSO_COLOR_PLANES |
---|
[100] | 1587 | pcOutSample->iULeft, |
---|
| 1588 | pcInSample ->aiU[iSubSourcePos], |
---|
| 1589 | pcOutSample->iVLeft, |
---|
| 1590 | pcInSample ->aiV[iSubSourcePos], |
---|
[2] | 1591 | #endif |
---|
[100] | 1592 | m_piInvZLUTLeft [RenModRemoveBitInc(pcOutSample->iDLeft)], |
---|
| 1593 | m_piInvZLUTRight [RenModRemoveBitInc(m_iThisDepth) ], |
---|
| 1594 | pcOutSample->iFilledLeft, |
---|
| 1595 | iFilled, |
---|
| 1596 | piBlendedValueY |
---|
[5] | 1597 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1598 | , piBlendedValueU, |
---|
[100] | 1599 | piBlendedValueV |
---|
[2] | 1600 | #endif |
---|
| 1601 | ); |
---|
| 1602 | |
---|
[100] | 1603 | if ( bSet ) |
---|
| 1604 | { |
---|
| 1605 | // Set values |
---|
| 1606 | pcOutSample->iDRight = m_iThisDepth; |
---|
| 1607 | pcOutSample->iYRight = pcInSample ->aiY[iSubSourcePos]; |
---|
| 1608 | pcOutSample->iYBlended = piBlendedValueY; |
---|
| 1609 | #if HHI_VSO_COLOR_PLANES |
---|
| 1610 | pcOutSample->iURight = pcInSample ->aiU[iSubSourcePos]; |
---|
| 1611 | pcOutSample->iUBlended = piBlendedValueU; |
---|
| 1612 | pcOutSample->iVRight = pcInSample ->aiV[iSubSourcePos]; |
---|
| 1613 | pcOutSample->iVBlended = piBlendedValueV; |
---|
[2] | 1614 | #endif |
---|
[100] | 1615 | pcOutSample->iFilledRight = iFilled; |
---|
[2] | 1616 | |
---|
[100] | 1617 | // Get Error |
---|
| 1618 | Int iDiffY = pcOutSample->iYRef - piBlendedValueY; |
---|
[5] | 1619 | #if HHI_VSO_COLOR_PLANES |
---|
[100] | 1620 | Int iDiffU = pcOutSample->iURef - piBlendedValueU; |
---|
| 1621 | Int iDiffV = pcOutSample->iVRef - piBlendedValueV; |
---|
| 1622 | pcOutSample->iError = xGetDist(iDiffY, iDiffU, iDiffV ); |
---|
[2] | 1623 | #else |
---|
[100] | 1624 | pcOutSample->iError = xGetDist(iDiffY ); |
---|
[2] | 1625 | #endif |
---|
| 1626 | } |
---|
| 1627 | else |
---|
| 1628 | { |
---|
[100] | 1629 | Int iDiffY = pcOutSample->iYRef - piBlendedValueY; |
---|
[5] | 1630 | #if HHI_VSO_COLOR_PLANES |
---|
[100] | 1631 | Int iDiffU = pcOutSample->iURef - piBlendedValueU; |
---|
| 1632 | Int iDiffV = pcOutSample->iVRef - piBlendedValueV; |
---|
| 1633 | riError += ( xGetDist( iDiffY, iDiffU, iDiffV ) - pcOutSample->iError ); |
---|
[2] | 1634 | #else |
---|
[100] | 1635 | riError += ( xGetDist( iDiffY ) - pcOutSample->iError ); |
---|
[2] | 1636 | #endif |
---|
| 1637 | } |
---|
| 1638 | } |
---|
| 1639 | |
---|
[100] | 1640 | template <BlenMod iBM, Bool bBitInc> __inline Int |
---|
| 1641 | TRenSingleModelC<iBM,bBitInc>::xGetDist( Int iDiffY, Int iDiffU, Int iDiffV ) |
---|
| 1642 | { |
---|
[2] | 1643 | |
---|
[100] | 1644 | if ( !bBitInc ) |
---|
| 1645 | { |
---|
| 1646 | return ( (iDiffY * iDiffY ) |
---|
| 1647 | + ((( (iDiffU * iDiffU ) |
---|
| 1648 | +(iDiffV * iDiffV ) |
---|
| 1649 | ) |
---|
| 1650 | ) >> 2 |
---|
[2] | 1651 | ) |
---|
[100] | 1652 | ); |
---|
| 1653 | } |
---|
| 1654 | else |
---|
| 1655 | { |
---|
| 1656 | return ( ((iDiffY * iDiffY) >> m_iDistShift) |
---|
| 1657 | + ((( ((iDiffU * iDiffU) >> m_iDistShift) |
---|
| 1658 | +((iDiffV * iDiffV) >> m_iDistShift) |
---|
| 1659 | ) |
---|
| 1660 | ) >> 2 |
---|
| 1661 | ) |
---|
| 1662 | ); |
---|
| 1663 | |
---|
| 1664 | } |
---|
[2] | 1665 | } |
---|
| 1666 | |
---|
[100] | 1667 | template <BlenMod iBM, Bool bBitInc> __inline Int |
---|
| 1668 | TRenSingleModelC<iBM,bBitInc>::xGetDist( Int iDiffY ) |
---|
[2] | 1669 | { |
---|
[100] | 1670 | if ( !bBitInc ) |
---|
| 1671 | { |
---|
| 1672 | return (iDiffY * iDiffY); |
---|
| 1673 | } |
---|
| 1674 | else |
---|
| 1675 | { |
---|
| 1676 | return ((iDiffY * iDiffY) >> m_iDistShift); |
---|
| 1677 | } |
---|
| 1678 | |
---|
[2] | 1679 | } |
---|
| 1680 | |
---|
[100] | 1681 | |
---|
[5] | 1682 | #if HHI_VSO_COLOR_PLANES |
---|
[100] | 1683 | template <BlenMod iBM, Bool bBitInc> __inline Void |
---|
| 1684 | TRenSingleModelC<iBM,bBitInc>::xGetBlendedValue( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ) |
---|
[2] | 1685 | #else |
---|
[100] | 1686 | template <BlenMod iBM, Bool bBitInc> __inline Void |
---|
| 1687 | TRenSingleModelC<iBM,bBitInc>::xGetBlendedValue( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ) |
---|
[2] | 1688 | #endif |
---|
| 1689 | { |
---|
[100] | 1690 | |
---|
| 1691 | RM_AOT( iBM != BLEND_AVRG && iBM != BLEND_LEFT && iBM != BLEND_RIGHT ); |
---|
| 1692 | |
---|
| 1693 | if (iBM != BLEND_AVRG ) |
---|
[2] | 1694 | { |
---|
[100] | 1695 | if (iBM == BLEND_LEFT ) |
---|
[2] | 1696 | { |
---|
[5] | 1697 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1698 | xGetBlendedValueBM1( iYL, iYR, iUL, iUR, iVL, iVR, iDepthL, iDepthR, iFilledL, iFilledR, riY, riU, riV ); |
---|
[5] | 1699 | #else |
---|
| 1700 | xGetBlendedValueBM1( iYL, iYR, iDepthL, iDepthR, iFilledL, iFilledR, riY ); |
---|
| 1701 | #endif |
---|
[2] | 1702 | } |
---|
| 1703 | else |
---|
| 1704 | { |
---|
[5] | 1705 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1706 | xGetBlendedValueBM2( iYL, iYR, iUL, iUR, iVL, iVR, iDepthL, iDepthR, iFilledL, iFilledR, riY, riU, riV ); |
---|
[5] | 1707 | #else |
---|
| 1708 | xGetBlendedValueBM2( iYL, iYR, iDepthL, iDepthR, iFilledL, iFilledR, riY ); |
---|
| 1709 | #endif |
---|
[2] | 1710 | } |
---|
| 1711 | return; |
---|
| 1712 | } |
---|
| 1713 | |
---|
| 1714 | if ( (iFilledL != REN_IS_HOLE ) && ( iFilledR != REN_IS_HOLE) ) |
---|
| 1715 | { |
---|
| 1716 | Int iDepthDifference = iDepthR - iDepthL; |
---|
| 1717 | |
---|
| 1718 | if ( abs ( iDepthDifference ) <= m_iBlendZThres ) |
---|
| 1719 | { |
---|
| 1720 | if ((iFilledL == REN_IS_FILLED) && ( iFilledR != REN_IS_FILLED)) |
---|
| 1721 | { |
---|
| 1722 | riY = xBlend( iYL, iYR, iFilledR >> 1 ); |
---|
[5] | 1723 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1724 | riU = xBlend( iUL, iUR, iFilledR >> 1 ); |
---|
| 1725 | riV = xBlend( iVL, iVR, iFilledR >> 1 ); |
---|
| 1726 | #endif |
---|
| 1727 | |
---|
| 1728 | } |
---|
| 1729 | else if ((iFilledL != REN_IS_FILLED) && ( iFilledR == REN_IS_FILLED)) |
---|
| 1730 | { |
---|
| 1731 | riY = xBlend( iYR, iYL, (iFilledL >> 1) ); |
---|
[5] | 1732 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1733 | riU = xBlend( iUR, iUL, (iFilledL >> 1) ); |
---|
| 1734 | riV = xBlend( iVR, iVL, (iFilledL >> 1) ); |
---|
| 1735 | #endif |
---|
| 1736 | } |
---|
| 1737 | else |
---|
| 1738 | { |
---|
[81] | 1739 | riY = xBlend( iYL, iYR, m_iBlendDistWeight ); |
---|
| 1740 | #if HHI_VSO_COLOR_PLANES |
---|
| 1741 | riU = xBlend( iUL, iUR, m_iBlendDistWeight ); |
---|
| 1742 | riV = xBlend( iVL, iVR, m_iBlendDistWeight ); |
---|
| 1743 | #endif |
---|
[2] | 1744 | } |
---|
| 1745 | } |
---|
| 1746 | else if ( iDepthDifference < 0 ) |
---|
| 1747 | { |
---|
| 1748 | riY = iYL; |
---|
[5] | 1749 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1750 | riU = iUL; |
---|
| 1751 | riV = iVL; |
---|
| 1752 | #endif |
---|
| 1753 | } |
---|
| 1754 | else |
---|
| 1755 | { |
---|
| 1756 | riY = iYR; |
---|
[5] | 1757 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1758 | riU = iUR; |
---|
| 1759 | riV = iVR; |
---|
| 1760 | #endif |
---|
| 1761 | } |
---|
| 1762 | } |
---|
| 1763 | else if ( (iFilledL == REN_IS_HOLE) && (iFilledR == REN_IS_HOLE)) |
---|
| 1764 | { |
---|
| 1765 | if ( iDepthR < iDepthL ) |
---|
| 1766 | { |
---|
| 1767 | riY = iYR; |
---|
[5] | 1768 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1769 | riU = iUR; |
---|
| 1770 | riV = iVR; |
---|
| 1771 | #endif |
---|
| 1772 | } |
---|
| 1773 | else |
---|
| 1774 | { |
---|
| 1775 | riY = iYL; |
---|
[5] | 1776 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1777 | riU = iUL; |
---|
| 1778 | riV = iVL; |
---|
| 1779 | #endif |
---|
| 1780 | } |
---|
| 1781 | } |
---|
| 1782 | else |
---|
| 1783 | { |
---|
| 1784 | if (iFilledR == REN_IS_HOLE) |
---|
| 1785 | { |
---|
| 1786 | riY = iYL; |
---|
[5] | 1787 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1788 | riU = iUL; |
---|
| 1789 | riV = iVL; |
---|
| 1790 | #endif |
---|
| 1791 | } |
---|
| 1792 | else |
---|
| 1793 | { |
---|
| 1794 | riY = iYR; |
---|
[5] | 1795 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1796 | riU = iUR; |
---|
| 1797 | riV = iVR; |
---|
| 1798 | #endif |
---|
| 1799 | } |
---|
| 1800 | } |
---|
| 1801 | } |
---|
| 1802 | |
---|
[100] | 1803 | template <BlenMod iBM, Bool bBitInc> __inline Void |
---|
[5] | 1804 | #if HHI_VSO_COLOR_PLANES |
---|
[100] | 1805 | TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM1( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ) |
---|
[5] | 1806 | #else |
---|
[100] | 1807 | TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM1( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ) |
---|
[5] | 1808 | #endif |
---|
[2] | 1809 | { |
---|
[100] | 1810 | if ( iFilledL == REN_IS_FILLED || iFilledR == REN_IS_HOLE ) |
---|
[2] | 1811 | { |
---|
| 1812 | riY = iYL; |
---|
[5] | 1813 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1814 | riU = iUL; |
---|
| 1815 | riV = iVL; |
---|
| 1816 | #endif |
---|
| 1817 | } |
---|
| 1818 | else if ( iFilledL == REN_IS_HOLE ) |
---|
| 1819 | { |
---|
| 1820 | riY = iYR; |
---|
[5] | 1821 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1822 | riU = iUR; |
---|
| 1823 | riV = iVR; |
---|
| 1824 | #endif |
---|
| 1825 | } |
---|
| 1826 | else |
---|
| 1827 | { |
---|
| 1828 | riY = xBlend( iYR, iYL, iFilledL ); |
---|
[5] | 1829 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1830 | riU = xBlend( iUR, iUL, iFilledL ); |
---|
| 1831 | riV = xBlend( iVR, iUL, iFilledL ); |
---|
| 1832 | #endif |
---|
| 1833 | } |
---|
| 1834 | } |
---|
| 1835 | |
---|
[100] | 1836 | template <BlenMod iBM, Bool bBitInc> __inline Void |
---|
[5] | 1837 | #if HHI_VSO_COLOR_PLANES |
---|
[100] | 1838 | TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM2( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ) |
---|
[5] | 1839 | #else |
---|
[100] | 1840 | TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM2( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ) |
---|
[5] | 1841 | #endif |
---|
[2] | 1842 | { |
---|
| 1843 | if ( iFilledR == REN_IS_FILLED || iFilledL == REN_IS_HOLE ) |
---|
| 1844 | { |
---|
| 1845 | riY = iYR; |
---|
[5] | 1846 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1847 | riU = iUR; |
---|
| 1848 | riV = iVR; |
---|
| 1849 | #endif |
---|
| 1850 | } |
---|
| 1851 | else if ( iFilledR == REN_IS_HOLE ) |
---|
| 1852 | { |
---|
| 1853 | riY = iYL; |
---|
[5] | 1854 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1855 | riU = iUL; |
---|
| 1856 | riV = iVL; |
---|
| 1857 | #endif |
---|
| 1858 | } |
---|
| 1859 | else |
---|
| 1860 | { |
---|
| 1861 | riY = xBlend( iYL, iYR, iFilledR ); |
---|
[5] | 1862 | #if HHI_VSO_COLOR_PLANES |
---|
[2] | 1863 | riU = xBlend( iUL, iUR, iFilledR ); |
---|
| 1864 | riV = xBlend( iVL, iUR, iFilledR ); |
---|
| 1865 | #endif |
---|
| 1866 | } |
---|
| 1867 | } |
---|
| 1868 | |
---|
[100] | 1869 | template <BlenMod iBM, Bool bBitInc> __inline Pel |
---|
| 1870 | TRenSingleModelC<iBM,bBitInc>::xBlend( Pel pVal1, Pel pVal2, Int iWeightVal2 ) |
---|
[2] | 1871 | { |
---|
| 1872 | return pVal1 + (Pel) ( ( (Int) ( pVal2 - pVal1) * iWeightVal2 + (1 << (REN_VDWEIGHT_PREC - 1)) ) >> REN_VDWEIGHT_PREC ); |
---|
| 1873 | } |
---|
[100] | 1874 | |
---|
| 1875 | template <BlenMod iBM, Bool bBitInc> Void |
---|
| 1876 | TRenSingleModelC<iBM,bBitInc>::xCopy2PicYuv( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget, UInt uiHorOffset ) |
---|
| 1877 | { |
---|
| 1878 | TRenFilter::copy ( ppiSrcVideoPel[0], piStrides[0], m_iWidth, m_iHeight, rpcPicYuvTarget->getLumaAddr() + uiHorOffset * rpcPicYuvTarget->getStride() , rpcPicYuvTarget->getStride () ); |
---|
| 1879 | TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[1], piStrides[1], m_iWidth, m_iHeight, rpcPicYuvTarget->getCbAddr () + (uiHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() ); |
---|
| 1880 | TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[2], piStrides[2], m_iWidth, m_iHeight, rpcPicYuvTarget->getCrAddr () + (uiHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() ); |
---|
| 1881 | } |
---|
| 1882 | |
---|
| 1883 | template class TRenSingleModelC<BLEND_NONE ,true>; |
---|
| 1884 | template class TRenSingleModelC<BLEND_AVRG ,true>; |
---|
| 1885 | template class TRenSingleModelC<BLEND_LEFT ,true>; |
---|
| 1886 | template class TRenSingleModelC<BLEND_RIGHT,true>; |
---|
| 1887 | |
---|
| 1888 | template class TRenSingleModelC<BLEND_NONE ,false>; |
---|
| 1889 | template class TRenSingleModelC<BLEND_AVRG ,false>; |
---|
| 1890 | template class TRenSingleModelC<BLEND_LEFT ,false>; |
---|
| 1891 | template class TRenSingleModelC<BLEND_RIGHT,false>; |
---|
| 1892 | |
---|
| 1893 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 1894 | template <BlenMod iBM, Bool bBitInc> |
---|
| 1895 | __inline Bool |
---|
| 1896 | TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride) |
---|
| 1897 | { |
---|
| 1898 | RM_AOF( m_bEarlySkip ); |
---|
| 1899 | const Int iCurViewPos = 0; |
---|
| 1900 | Int** ppiCurLUT = m_appiShiftLut [ iCurViewPos ]; |
---|
| 1901 | |
---|
| 1902 | Bool bNoDiff = true; |
---|
| 1903 | |
---|
| 1904 | for (Int iPosY=0; iPosY < iHeight; iPosY++) |
---|
| 1905 | { |
---|
| 1906 | m_pbHorSkip[iPosY] = true; |
---|
| 1907 | |
---|
| 1908 | for (Int iPosX = 0; iPosX < iWidth; iPosX++) |
---|
| 1909 | { |
---|
| 1910 | Int iDisparityRec = abs(ppiCurLUT[0][ RenModRemoveBitInc(piNewData[iPosX])]); |
---|
| 1911 | Int iDispartyOrg = abs(ppiCurLUT[0][ RenModRemoveBitInc(piOrgData[iPosX])]); |
---|
| 1912 | |
---|
| 1913 | if( iDispartyOrg != iDisparityRec) |
---|
| 1914 | { |
---|
| 1915 | m_pbHorSkip[iPosY] = false; |
---|
| 1916 | bNoDiff = false; |
---|
| 1917 | break; |
---|
| 1918 | } |
---|
| 1919 | } |
---|
| 1920 | piNewData += iStride; |
---|
| 1921 | piOrgData += iOrgStride; |
---|
| 1922 | } |
---|
| 1923 | return bNoDiff; |
---|
| 1924 | } |
---|
| 1925 | |
---|
| 1926 | template <BlenMod iBM, Bool bBitInc> |
---|
| 1927 | __inline Bool |
---|
| 1928 | TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride) |
---|
| 1929 | { |
---|
| 1930 | RM_AOF( m_bEarlySkip ); |
---|
| 1931 | Bool bNoDiff = true; |
---|
| 1932 | |
---|
| 1933 | const Int iCurViewPos = 1; |
---|
| 1934 | Int** ppiCurLUT = m_appiShiftLut [ iCurViewPos ]; |
---|
| 1935 | |
---|
| 1936 | for ( Int iPosY = 0; iPosY < iHeight; iPosY++ ) |
---|
| 1937 | { |
---|
| 1938 | m_pbHorSkip[iPosY] = true; |
---|
| 1939 | |
---|
| 1940 | for (Int iPosX = 0; iPosX < iWidth; iPosX++) |
---|
| 1941 | { |
---|
| 1942 | Int iDisparityRec = abs( ppiCurLUT[0][ RenModRemoveBitInc(piNewData[iPosX])] ); |
---|
| 1943 | Int iDisparityOrg = abs( ppiCurLUT[0][ RenModRemoveBitInc(piOrgData[iPosX])] ); |
---|
| 1944 | |
---|
| 1945 | if( iDisparityRec != iDisparityOrg ) |
---|
| 1946 | { |
---|
| 1947 | m_pbHorSkip[iPosY] = false; |
---|
| 1948 | bNoDiff = false; |
---|
| 1949 | break; |
---|
| 1950 | } |
---|
| 1951 | } |
---|
| 1952 | |
---|
| 1953 | piNewData += iStride; |
---|
| 1954 | piOrgData += iOrgStride; |
---|
| 1955 | } |
---|
| 1956 | return bNoDiff; |
---|
| 1957 | } |
---|
| 1958 | #endif |
---|