[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 "TRenModel.h" |
---|
[195] | 37 | #if !QC_MVHEVC_B0046 |
---|
[2] | 38 | /////////// TRENMODEL ////////////////////// |
---|
| 39 | TRenModel::TRenModel() |
---|
| 40 | { |
---|
[56] | 41 | m_iPad = PICYUV_PAD; |
---|
[2] | 42 | m_iWidth = -1; |
---|
| 43 | m_iHeight = -1; |
---|
[124] | 44 | m_iUsedHeight = -1; |
---|
[2] | 45 | m_iNumOfBaseViews = -1; |
---|
| 46 | m_iSampledWidth = -1; |
---|
| 47 | m_iShiftPrec = 0; |
---|
| 48 | m_iHoleMargin = 1; |
---|
[100] | 49 | m_uiHorOff = -1; |
---|
| 50 | #if LGE_VSO_EARLY_SKIP_A0093 |
---|
| 51 | m_bEarlySkip = false; |
---|
| 52 | #endif |
---|
[2] | 53 | |
---|
| 54 | // Current Error Type /// |
---|
| 55 | m_iCurrentView = -1; |
---|
| 56 | m_iCurrentContent = -1; |
---|
| 57 | m_iCurrentPlane = -1; |
---|
| 58 | |
---|
| 59 | // Array of Models used to determine the Current Error /// |
---|
| 60 | m_iNumOfCurRenModels = -1; |
---|
| 61 | m_apcCurRenModels = NULL; |
---|
| 62 | m_aiCurPosInModels = NULL; |
---|
| 63 | |
---|
| 64 | // Array of Models /// |
---|
| 65 | m_iNumOfRenModels = -1; |
---|
| 66 | m_apcRenModels = NULL; |
---|
| 67 | |
---|
| 68 | // Mapping from View number to models /// |
---|
| 69 | m_aiNumOfModelsForDepthView = NULL; |
---|
| 70 | m_aapcRenModelForDepthView = NULL; |
---|
| 71 | m_aaePosInModelForDepthView = NULL; |
---|
| 72 | |
---|
| 73 | m_aiNumOfModelsForVideoView = NULL; |
---|
| 74 | m_aapcRenModelForVideoView = NULL; |
---|
| 75 | m_aaePosInModelForVideoView = NULL; |
---|
| 76 | m_aaeBaseViewPosInModel = NULL; |
---|
| 77 | |
---|
| 78 | // Data |
---|
| 79 | m_aapiCurVideoPel = NULL; |
---|
| 80 | m_aaiCurVideoStrides = NULL; |
---|
| 81 | m_apiCurDepthPel = NULL; |
---|
| 82 | m_aiCurDepthStrides = NULL; |
---|
| 83 | |
---|
| 84 | m_aapiOrgVideoPel = NULL; |
---|
| 85 | m_aaiOrgVideoStrides = NULL; |
---|
| 86 | m_apiOrgDepthPel = NULL; |
---|
| 87 | m_aiOrgDepthStrides = NULL; |
---|
| 88 | |
---|
| 89 | m_aaaiSubPelShiftLut[0]= NULL; |
---|
| 90 | m_aaaiSubPelShiftLut[1]= NULL; |
---|
| 91 | |
---|
| 92 | /// Current Setup data /// |
---|
| 93 | m_abSetupVideoFromOrgForView = NULL; |
---|
| 94 | m_abSetupDepthFromOrgForView = NULL; |
---|
| 95 | } |
---|
| 96 | |
---|
| 97 | TRenModel::~TRenModel() |
---|
| 98 | { |
---|
| 99 | if ( m_apcRenModels ) |
---|
| 100 | { |
---|
| 101 | for (Int iNumModel = 0; iNumModel < m_iNumOfRenModels; iNumModel++) |
---|
| 102 | { |
---|
| 103 | if ( m_apcRenModels[iNumModel] ) delete m_apcRenModels[iNumModel]; |
---|
| 104 | } |
---|
| 105 | |
---|
| 106 | delete[] m_apcRenModels; |
---|
| 107 | } |
---|
| 108 | |
---|
| 109 | for (Int iViewNum = 0; iViewNum < m_iNumOfBaseViews; iViewNum++) |
---|
| 110 | { |
---|
| 111 | if ( m_aapcRenModelForDepthView && m_aapcRenModelForDepthView [iViewNum] ) |
---|
| 112 | { |
---|
| 113 | delete[] m_aapcRenModelForDepthView [iViewNum]; |
---|
| 114 | } |
---|
| 115 | |
---|
| 116 | if ( m_aaePosInModelForDepthView && m_aaePosInModelForDepthView[iViewNum] ) |
---|
| 117 | { |
---|
| 118 | delete[] m_aaePosInModelForDepthView[iViewNum]; |
---|
| 119 | } |
---|
| 120 | |
---|
| 121 | if ( m_aapcRenModelForVideoView && m_aapcRenModelForVideoView[iViewNum] ) |
---|
| 122 | { |
---|
| 123 | delete[] m_aapcRenModelForVideoView[iViewNum]; |
---|
| 124 | } |
---|
| 125 | |
---|
| 126 | if ( m_aaePosInModelForVideoView && m_aaePosInModelForVideoView[iViewNum] ) |
---|
| 127 | { |
---|
| 128 | delete[] m_aaePosInModelForVideoView[iViewNum]; |
---|
| 129 | } |
---|
| 130 | |
---|
| 131 | if ( m_aaeBaseViewPosInModel && m_aaeBaseViewPosInModel[iViewNum] ) |
---|
| 132 | { |
---|
| 133 | delete[] m_aaeBaseViewPosInModel[iViewNum]; |
---|
| 134 | } |
---|
| 135 | |
---|
| 136 | if ( m_aapiCurVideoPel && m_aapiCurVideoPel [iViewNum] ) |
---|
| 137 | { |
---|
| 138 | delete[] ( m_aapiCurVideoPel [iViewNum][0] - m_iPad * m_aaiCurVideoStrides[iViewNum][0] - m_iPad ); |
---|
| 139 | delete[] ( m_aapiCurVideoPel [iViewNum][1] - m_iPad * m_aaiCurVideoStrides[iViewNum][1] - m_iPad ); |
---|
| 140 | delete[] ( m_aapiCurVideoPel [iViewNum][2] - m_iPad * m_aaiCurVideoStrides[iViewNum][2] - m_iPad ); |
---|
| 141 | delete[] m_aapiCurVideoPel [iViewNum]; |
---|
| 142 | } |
---|
| 143 | |
---|
| 144 | if ( m_aaiCurVideoStrides && m_aaiCurVideoStrides [iViewNum] ) |
---|
| 145 | { |
---|
| 146 | delete[] m_aaiCurVideoStrides [iViewNum]; |
---|
| 147 | } |
---|
| 148 | |
---|
| 149 | if ( m_apiCurDepthPel ) |
---|
| 150 | { |
---|
| 151 | delete[] ( m_apiCurDepthPel [iViewNum] - m_iPad * m_aiCurDepthStrides [iViewNum] - m_iPad ); |
---|
| 152 | } |
---|
| 153 | |
---|
| 154 | if ( m_aapiOrgVideoPel && m_aapiOrgVideoPel [iViewNum] ) |
---|
| 155 | { |
---|
| 156 | delete[] ( m_aapiOrgVideoPel [iViewNum][0] - m_iPad * m_aaiOrgVideoStrides[iViewNum][0] - m_iPad ); |
---|
| 157 | delete[] ( m_aapiOrgVideoPel [iViewNum][1] - m_iPad * m_aaiOrgVideoStrides[iViewNum][1] - m_iPad ); |
---|
| 158 | delete[] ( m_aapiOrgVideoPel [iViewNum][2] - m_iPad * m_aaiOrgVideoStrides[iViewNum][2] - m_iPad ); |
---|
| 159 | delete[] m_aapiOrgVideoPel [iViewNum]; |
---|
| 160 | } |
---|
| 161 | |
---|
| 162 | if ( m_aaiOrgVideoStrides && m_aaiOrgVideoStrides [iViewNum] ) |
---|
| 163 | { |
---|
| 164 | delete[] m_aaiOrgVideoStrides [iViewNum]; |
---|
| 165 | } |
---|
| 166 | |
---|
| 167 | if ( m_apiOrgDepthPel && m_apiOrgDepthPel [iViewNum ] ) |
---|
| 168 | { |
---|
| 169 | delete[] ( m_apiOrgDepthPel [iViewNum] - m_iPad * m_aiOrgDepthStrides [iViewNum] - m_iPad ); |
---|
| 170 | } |
---|
| 171 | } |
---|
| 172 | |
---|
| 173 | if(m_aiNumOfModelsForDepthView) delete[] m_aiNumOfModelsForDepthView; |
---|
| 174 | if(m_aapcRenModelForDepthView ) delete[] m_aapcRenModelForDepthView ; |
---|
| 175 | if(m_aaePosInModelForDepthView) delete[] m_aaePosInModelForDepthView; |
---|
| 176 | |
---|
| 177 | if(m_aiNumOfModelsForVideoView) delete[] m_aiNumOfModelsForVideoView; |
---|
| 178 | if(m_aapcRenModelForVideoView ) delete[] m_aapcRenModelForVideoView ; |
---|
| 179 | if(m_aaePosInModelForVideoView) delete[] m_aaePosInModelForVideoView; |
---|
| 180 | |
---|
| 181 | |
---|
| 182 | if(m_aaeBaseViewPosInModel ) delete[] m_aaeBaseViewPosInModel ; |
---|
| 183 | if(m_aapiCurVideoPel ) delete[] m_aapiCurVideoPel ; |
---|
| 184 | if(m_aaiCurVideoStrides ) delete[] m_aaiCurVideoStrides ; |
---|
| 185 | |
---|
| 186 | if(m_abSetupVideoFromOrgForView) delete[] m_abSetupVideoFromOrgForView; |
---|
| 187 | if(m_abSetupDepthFromOrgForView) delete[] m_abSetupDepthFromOrgForView; |
---|
| 188 | |
---|
| 189 | if(m_aapiOrgVideoPel ) delete[] m_aapiOrgVideoPel ; |
---|
| 190 | if(m_aaiOrgVideoStrides ) delete[] m_aaiOrgVideoStrides ; |
---|
| 191 | |
---|
| 192 | if(m_apiOrgDepthPel ) delete[] m_apiOrgDepthPel ; |
---|
| 193 | if(m_aiOrgDepthStrides ) delete[] m_aiOrgDepthStrides ; |
---|
| 194 | |
---|
| 195 | if(m_apiCurDepthPel ) delete[] m_apiCurDepthPel ; |
---|
| 196 | if(m_aiCurDepthStrides ) delete[] m_aiCurDepthStrides ; |
---|
| 197 | |
---|
| 198 | Int iNumEntries = (1 << ( m_iShiftPrec + 1) ) + 1 ; |
---|
| 199 | |
---|
| 200 | for (UInt uiEntry = 0; uiEntry < iNumEntries; uiEntry++) |
---|
| 201 | { |
---|
| 202 | if ( m_aaaiSubPelShiftLut[0] && m_aaaiSubPelShiftLut[0][uiEntry] ) |
---|
| 203 | delete[] m_aaaiSubPelShiftLut[0][uiEntry]; |
---|
| 204 | |
---|
| 205 | if ( m_aaaiSubPelShiftLut[1] && m_aaaiSubPelShiftLut[1][uiEntry] ) |
---|
| 206 | delete[] m_aaaiSubPelShiftLut[1][uiEntry]; |
---|
| 207 | } |
---|
| 208 | |
---|
| 209 | if( m_aaaiSubPelShiftLut[0] ) delete[] m_aaaiSubPelShiftLut[0]; |
---|
| 210 | if( m_aaaiSubPelShiftLut[1] ) delete[] m_aaaiSubPelShiftLut[1]; |
---|
| 211 | } |
---|
| 212 | |
---|
| 213 | |
---|
| 214 | |
---|
| 215 | Void |
---|
[100] | 216 | #if LGE_VSO_EARLY_SKIP_A0093 |
---|
| 217 | TRenModel::create( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin, Bool bEarlySkip ) |
---|
| 218 | #else |
---|
[2] | 219 | TRenModel::create( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin ) |
---|
[100] | 220 | #endif |
---|
[2] | 221 | { |
---|
| 222 | m_iNumOfBaseViews = iNumOfBaseViews; |
---|
| 223 | m_iNumOfRenModels = iNumOfModels; |
---|
| 224 | m_iWidth = iWidth; |
---|
| 225 | m_iHeight = iHeight; |
---|
| 226 | m_iShiftPrec = iShiftPrec; |
---|
| 227 | m_iHoleMargin = iHoleMargin; |
---|
[100] | 228 | #if LGE_VSO_EARLY_SKIP_A0093 |
---|
| 229 | m_bEarlySkip = bEarlySkip; |
---|
| 230 | #endif |
---|
[2] | 231 | |
---|
[100] | 232 | |
---|
[2] | 233 | // LUTs for sub pel shifting |
---|
| 234 | Int iNumEntries = (1 << ( m_iShiftPrec + 1) ) + 1 ; |
---|
| 235 | m_aaaiSubPelShiftLut[0] = new Int*[ iNumEntries ]; |
---|
| 236 | m_aaaiSubPelShiftLut[1] = new Int*[ iNumEntries ]; |
---|
| 237 | for (UInt uiEntry = 0; uiEntry < iNumEntries; uiEntry++) |
---|
| 238 | { |
---|
| 239 | m_aaaiSubPelShiftLut[0][uiEntry] = new Int[ iNumEntries ]; |
---|
| 240 | m_aaaiSubPelShiftLut[1][uiEntry] = new Int[ iNumEntries ]; |
---|
| 241 | } |
---|
| 242 | |
---|
| 243 | TRenFilter::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[0], 0 ); |
---|
[100] | 244 | TRenFilter::setSubPelShiftLUT( m_iShiftPrec, m_aaaiSubPelShiftLut[1], 0 ); |
---|
[2] | 245 | |
---|
| 246 | m_iSampledWidth = iWidth << m_iShiftPrec; |
---|
| 247 | |
---|
| 248 | |
---|
| 249 | m_aapiCurVideoPel = new Pel** [m_iNumOfBaseViews]; |
---|
| 250 | m_aaiCurVideoStrides = new Int* [m_iNumOfBaseViews]; |
---|
| 251 | m_apiCurDepthPel = new Pel* [m_iNumOfBaseViews]; |
---|
| 252 | m_aiCurDepthStrides = new Int [m_iNumOfBaseViews]; |
---|
| 253 | |
---|
| 254 | m_aapiOrgVideoPel = new Pel** [m_iNumOfBaseViews]; |
---|
| 255 | m_aaiOrgVideoStrides = new Int* [m_iNumOfBaseViews]; |
---|
| 256 | |
---|
| 257 | m_apiOrgDepthPel = new Pel* [m_iNumOfBaseViews]; |
---|
| 258 | m_aiOrgDepthStrides = new Int [m_iNumOfBaseViews]; |
---|
| 259 | |
---|
| 260 | m_abSetupVideoFromOrgForView = new Bool[m_iNumOfBaseViews]; |
---|
| 261 | m_abSetupDepthFromOrgForView = new Bool[m_iNumOfBaseViews]; |
---|
| 262 | |
---|
| 263 | m_iNumOfCurRenModels = 0; |
---|
| 264 | m_apcCurRenModels = NULL; |
---|
| 265 | m_aiCurPosInModels = NULL; |
---|
| 266 | |
---|
| 267 | m_apcRenModels = new TRenSingleModel* [m_iNumOfRenModels]; |
---|
| 268 | |
---|
| 269 | m_aiNumOfModelsForDepthView = new Int [m_iNumOfBaseViews]; |
---|
| 270 | m_aapcRenModelForDepthView = new TRenSingleModel** [m_iNumOfBaseViews]; |
---|
| 271 | m_aaePosInModelForDepthView = new Int* [m_iNumOfBaseViews]; |
---|
| 272 | |
---|
| 273 | m_aiNumOfModelsForVideoView = new Int [m_iNumOfBaseViews]; |
---|
| 274 | m_aapcRenModelForVideoView = new TRenSingleModel** [m_iNumOfBaseViews]; |
---|
| 275 | m_aaePosInModelForVideoView = new Int* [m_iNumOfBaseViews]; |
---|
| 276 | m_aaeBaseViewPosInModel = new Int* [m_iNumOfBaseViews]; |
---|
| 277 | |
---|
| 278 | |
---|
| 279 | for (Int iModelNum = 0; iModelNum < m_iNumOfRenModels; iModelNum++) |
---|
| 280 | { |
---|
[100] | 281 | m_apcRenModels [iModelNum] = NULL; |
---|
[2] | 282 | } |
---|
| 283 | |
---|
| 284 | for (Int iViewNum = 0; iViewNum < m_iNumOfBaseViews; iViewNum++ ) |
---|
| 285 | { |
---|
| 286 | m_aiNumOfModelsForDepthView[ iViewNum ] = 0; |
---|
| 287 | m_aiNumOfModelsForVideoView[ iViewNum ] = 0; |
---|
| 288 | |
---|
| 289 | m_aapcRenModelForDepthView [iViewNum] = new TRenSingleModel*[m_iNumOfRenModels]; |
---|
| 290 | m_aapcRenModelForVideoView [iViewNum] = new TRenSingleModel*[m_iNumOfRenModels]; |
---|
| 291 | |
---|
| 292 | m_aaePosInModelForDepthView[iViewNum] = new Int [m_iNumOfRenModels]; |
---|
| 293 | m_aaePosInModelForVideoView[iViewNum] = new Int [m_iNumOfRenModels]; |
---|
| 294 | m_aaeBaseViewPosInModel [iViewNum] = new Int [m_iNumOfRenModels]; |
---|
| 295 | |
---|
| 296 | for (Int iModelNum = 0; iModelNum< m_iNumOfRenModels; iModelNum++) |
---|
| 297 | { |
---|
| 298 | m_aapcRenModelForDepthView [iViewNum] [iModelNum] = NULL; |
---|
| 299 | m_aapcRenModelForVideoView [iViewNum] [iModelNum] = NULL; |
---|
| 300 | m_aaePosInModelForDepthView[iViewNum] [iModelNum] = VIEWPOS_INVALID; |
---|
| 301 | m_aaePosInModelForVideoView[iViewNum] [iModelNum] = VIEWPOS_INVALID; |
---|
| 302 | m_aaeBaseViewPosInModel [iViewNum] [iModelNum] = VIEWPOS_INVALID; |
---|
| 303 | }; |
---|
| 304 | |
---|
| 305 | m_aaiCurVideoStrides [iViewNum] = new Int[3]; |
---|
| 306 | m_aaiCurVideoStrides [iViewNum][0] = m_iSampledWidth + (m_iPad << 1); |
---|
| 307 | m_aaiCurVideoStrides [iViewNum][1] = m_iSampledWidth + (m_iPad << 1); |
---|
| 308 | m_aaiCurVideoStrides [iViewNum][2] = m_iSampledWidth + (m_iPad << 1); |
---|
| 309 | |
---|
| 310 | m_aapiCurVideoPel [iViewNum] = new Pel*[3]; |
---|
| 311 | m_aapiCurVideoPel [iViewNum][0] = new Pel [ m_aaiCurVideoStrides[iViewNum][0] * ( m_iHeight + (m_iPad << 1) )]; |
---|
| 312 | m_aapiCurVideoPel [iViewNum][1] = new Pel [ m_aaiCurVideoStrides[iViewNum][1] * ( m_iHeight + (m_iPad << 1) )]; |
---|
| 313 | m_aapiCurVideoPel [iViewNum][2] = new Pel [ m_aaiCurVideoStrides[iViewNum][2] * ( m_iHeight + (m_iPad << 1) )]; |
---|
| 314 | |
---|
| 315 | m_aapiCurVideoPel [iViewNum][0] += m_aaiCurVideoStrides[iViewNum][0] * m_iPad + m_iPad; |
---|
| 316 | m_aapiCurVideoPel [iViewNum][1] += m_aaiCurVideoStrides[iViewNum][1] * m_iPad + m_iPad; |
---|
| 317 | m_aapiCurVideoPel [iViewNum][2] += m_aaiCurVideoStrides[iViewNum][2] * m_iPad + m_iPad; |
---|
| 318 | |
---|
| 319 | m_aiCurDepthStrides [iViewNum] = m_iWidth + (m_iPad << 1); |
---|
| 320 | m_apiCurDepthPel [iViewNum] = new Pel[ m_aiCurDepthStrides[iViewNum] * ( m_iHeight + (m_iPad << 1) ) ]; |
---|
| 321 | m_apiCurDepthPel [iViewNum] += m_aiCurDepthStrides[iViewNum] * m_iPad + m_iPad; |
---|
| 322 | |
---|
| 323 | m_aaiOrgVideoStrides [iViewNum] = new Int[3]; |
---|
| 324 | m_aaiOrgVideoStrides [iViewNum][0] = m_iSampledWidth + (m_iPad << 1); |
---|
| 325 | m_aaiOrgVideoStrides [iViewNum][1] = m_iSampledWidth + (m_iPad << 1); |
---|
| 326 | m_aaiOrgVideoStrides [iViewNum][2] = m_iSampledWidth + (m_iPad << 1); |
---|
| 327 | |
---|
| 328 | m_aapiOrgVideoPel [iViewNum] = new Pel*[3]; |
---|
| 329 | m_aapiOrgVideoPel [iViewNum][0] = new Pel [ m_aaiOrgVideoStrides[iViewNum][0] * ( m_iHeight + (m_iPad << 1) )]; |
---|
| 330 | m_aapiOrgVideoPel [iViewNum][1] = new Pel [ m_aaiOrgVideoStrides[iViewNum][1] * ( m_iHeight + (m_iPad << 1) )]; |
---|
| 331 | m_aapiOrgVideoPel [iViewNum][2] = new Pel [ m_aaiOrgVideoStrides[iViewNum][2] * ( m_iHeight + (m_iPad << 1) )]; |
---|
| 332 | |
---|
| 333 | m_aapiOrgVideoPel [iViewNum][0] += m_aaiOrgVideoStrides[iViewNum][0] * m_iPad + m_iPad; |
---|
| 334 | m_aapiOrgVideoPel [iViewNum][1] += m_aaiOrgVideoStrides[iViewNum][1] * m_iPad + m_iPad; |
---|
| 335 | m_aapiOrgVideoPel [iViewNum][2] += m_aaiOrgVideoStrides[iViewNum][2] * m_iPad + m_iPad; |
---|
| 336 | |
---|
| 337 | m_aiOrgDepthStrides [iViewNum] = m_iWidth + (m_iPad << 1); |
---|
| 338 | m_apiOrgDepthPel [iViewNum] = new Pel[ m_aiOrgDepthStrides[iViewNum] * ( m_iHeight + (m_iPad << 1) ) ]; |
---|
| 339 | m_apiOrgDepthPel [iViewNum] += m_aiOrgDepthStrides[iViewNum] * m_iPad + m_iPad; |
---|
| 340 | |
---|
| 341 | m_abSetupVideoFromOrgForView[iViewNum] = false; |
---|
| 342 | m_abSetupDepthFromOrgForView[iViewNum] = false; |
---|
| 343 | } |
---|
| 344 | } |
---|
| 345 | |
---|
| 346 | Void |
---|
| 347 | TRenModel::createSingleModel( Int iBaseViewNum, Int iContent, Int iModelNum, Int iLeftViewNum, Int iRightViewNum, Bool bUseOrgRef, Int iBlendMode ) |
---|
| 348 | { |
---|
| 349 | Int iMode = ( (iLeftViewNum != -1) && ( iRightViewNum != -1 ) ) ? 2 : ( iLeftViewNum != -1 ? 0 : ( iRightViewNum != -1 ? 1 : -1 ) ); |
---|
| 350 | |
---|
| 351 | AOT( iMode == -1); |
---|
[100] | 352 | AOT( iModelNum < 0 || iModelNum > m_iNumOfRenModels ); |
---|
[2] | 353 | AOT( iLeftViewNum < -1 || iLeftViewNum > m_iNumOfBaseViews ); |
---|
| 354 | AOT( iRightViewNum < -1 || iRightViewNum > m_iNumOfBaseViews ); |
---|
| 355 | AOT( iBaseViewNum < -1 || iBaseViewNum > m_iNumOfBaseViews ); |
---|
| 356 | AOT( iBaseViewNum != -1 && iBaseViewNum != iLeftViewNum && iBaseViewNum != iRightViewNum ); |
---|
| 357 | AOT( iContent < -1 || iContent > 1 ); |
---|
| 358 | AOT( iBlendMode < -1 || iBlendMode > 2 ); |
---|
| 359 | |
---|
[100] | 360 | Bool bBitInc = (g_uiBitIncrement != 0); |
---|
| 361 | |
---|
| 362 | AOT( m_apcRenModels[iModelNum] ); |
---|
| 363 | |
---|
| 364 | if ( bBitInc ) |
---|
| 365 | { |
---|
| 366 | if ( iMode != 2 ) |
---|
| 367 | { // No Blending |
---|
| 368 | m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_NONE, true>; |
---|
| 369 | } |
---|
| 370 | else |
---|
| 371 | { |
---|
| 372 | switch ( iBlendMode ) |
---|
| 373 | { |
---|
| 374 | case BLEND_AVRG: // average |
---|
| 375 | m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_AVRG, true>; |
---|
| 376 | break; |
---|
| 377 | case BLEND_LEFT: // left view is main view |
---|
| 378 | m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_LEFT, true>; |
---|
| 379 | break; |
---|
| 380 | case BLEND_RIGHT: // right view is main view |
---|
| 381 | m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_RIGHT, true>; |
---|
| 382 | break; |
---|
| 383 | default: |
---|
| 384 | AOT(true); |
---|
| 385 | break; |
---|
| 386 | } |
---|
| 387 | } |
---|
| 388 | } |
---|
| 389 | else |
---|
| 390 | { |
---|
| 391 | if ( iMode != 2 ) |
---|
| 392 | { // No Blending |
---|
| 393 | m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_NONE, false>; |
---|
| 394 | } |
---|
| 395 | else |
---|
| 396 | { |
---|
| 397 | switch ( iBlendMode ) |
---|
| 398 | { |
---|
| 399 | case BLEND_AVRG: // average |
---|
| 400 | m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_AVRG, false>; |
---|
| 401 | break; |
---|
| 402 | case BLEND_LEFT: // left view is main view |
---|
| 403 | m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_LEFT, false>; |
---|
| 404 | break; |
---|
| 405 | case BLEND_RIGHT: // right view is main view |
---|
| 406 | m_apcRenModels[iModelNum] = new TRenSingleModelC<BLEND_RIGHT, false>; |
---|
| 407 | break; |
---|
| 408 | default: |
---|
| 409 | AOT(true); |
---|
| 410 | break; |
---|
| 411 | } |
---|
| 412 | } |
---|
| 413 | } |
---|
| 414 | |
---|
| 415 | |
---|
| 416 | #if LGE_VSO_EARLY_SKIP_A0093 |
---|
| 417 | m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin, bUseOrgRef, iBlendMode, m_bEarlySkip ); |
---|
| 418 | #else |
---|
[2] | 419 | m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin, bUseOrgRef, iBlendMode ); |
---|
[100] | 420 | #endif |
---|
[2] | 421 | |
---|
| 422 | if ( iLeftViewNum != -1 ) |
---|
| 423 | { |
---|
| 424 | xSetLRViewAndAddModel( iModelNum, iLeftViewNum, iContent, VIEWPOS_LEFT, (iBaseViewNum == -1 || iBaseViewNum == iLeftViewNum ) ); |
---|
| 425 | } |
---|
| 426 | |
---|
| 427 | if ( iRightViewNum != -1) |
---|
| 428 | { |
---|
| 429 | xSetLRViewAndAddModel( iModelNum, iRightViewNum, iContent, VIEWPOS_RIGHT, (iBaseViewNum == -1 || iBaseViewNum == iRightViewNum ) ); |
---|
| 430 | } |
---|
| 431 | } |
---|
| 432 | |
---|
| 433 | Void |
---|
| 434 | TRenModel::setBaseView( Int iViewNum, TComPicYuv* pcPicYuvVideoData, TComPicYuv* pcPicYuvDepthData, TComPicYuv* pcPicYuvOrgVideoData, TComPicYuv* pcPicYuvOrgDepthData ) |
---|
| 435 | { |
---|
| 436 | AOT( iViewNum < 0 || iViewNum > m_iNumOfBaseViews ); |
---|
[124] | 437 | AOF( pcPicYuvVideoData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvVideoData->getWidth() == m_iWidth ); |
---|
| 438 | AOF( pcPicYuvDepthData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvDepthData->getWidth() == m_iWidth ); |
---|
[2] | 439 | |
---|
| 440 | pcPicYuvVideoData->extendPicBorder(); |
---|
| 441 | |
---|
[124] | 442 | TRenFilter::sampleHorUp ( m_iShiftPrec, pcPicYuvVideoData->getLumaAddr() + m_uiHorOff * pcPicYuvVideoData->getStride () , pcPicYuvVideoData->getStride() , m_iWidth, m_iUsedHeight, m_aapiCurVideoPel[ iViewNum ][0], m_aaiCurVideoStrides[iViewNum][0] ); |
---|
| 443 | TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCbAddr() + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiCurVideoPel[ iViewNum ][1], m_aaiCurVideoStrides[iViewNum][1] ); |
---|
| 444 | TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCrAddr() + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiCurVideoPel[ iViewNum ][2], m_aaiCurVideoStrides[iViewNum][2] ); |
---|
| 445 | TRenFilter::copy ( pcPicYuvDepthData->getLumaAddr() + m_uiHorOff * pcPicYuvDepthData->getStride () , pcPicYuvDepthData->getStride(), m_iWidth, m_iUsedHeight, m_apiCurDepthPel [ iViewNum], m_aiCurDepthStrides [iViewNum] ); |
---|
[100] | 446 | |
---|
[2] | 447 | // Used for rendering reference pic from original video data |
---|
| 448 | m_abSetupVideoFromOrgForView[iViewNum] = (pcPicYuvOrgVideoData != NULL); |
---|
| 449 | m_abSetupDepthFromOrgForView[iViewNum] = (pcPicYuvOrgDepthData != NULL); |
---|
| 450 | |
---|
| 451 | if ( m_abSetupVideoFromOrgForView[iViewNum] ) |
---|
| 452 | { |
---|
[124] | 453 | AOF( pcPicYuvOrgVideoData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgVideoData->getWidth() == m_iWidth ); |
---|
| 454 | pcPicYuvOrgVideoData->extendPicBorder(); |
---|
| 455 | TRenFilter::sampleHorUp ( m_iShiftPrec, pcPicYuvOrgVideoData->getLumaAddr() + m_uiHorOff * pcPicYuvOrgVideoData->getStride() , pcPicYuvOrgVideoData->getStride() , m_iWidth, m_iUsedHeight, m_aapiOrgVideoPel[ iViewNum ][0], m_aaiOrgVideoStrides[iViewNum][0] ); |
---|
| 456 | TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCbAddr() + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][1], m_aaiOrgVideoStrides[iViewNum][1] ); |
---|
| 457 | TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCrAddr() + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][2], m_aaiOrgVideoStrides[iViewNum][2] ); |
---|
[2] | 458 | } |
---|
| 459 | |
---|
| 460 | if ( m_abSetupDepthFromOrgForView[iViewNum] ) |
---|
| 461 | { |
---|
[124] | 462 | AOF( pcPicYuvOrgDepthData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgDepthData->getWidth() == m_iWidth ); |
---|
| 463 | TRenFilter::copy ( pcPicYuvOrgDepthData->getLumaAddr() + m_uiHorOff * pcPicYuvOrgDepthData->getStride() , pcPicYuvOrgDepthData->getStride(), m_iWidth, m_iUsedHeight, m_apiOrgDepthPel [ iViewNum], m_aiOrgDepthStrides [iViewNum] ); |
---|
[2] | 464 | } |
---|
| 465 | } |
---|
| 466 | |
---|
| 467 | Void |
---|
| 468 | TRenModel::setSingleModel( Int iModelNum, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, TComPicYuv* pcPicYuvRefView ) |
---|
| 469 | { |
---|
| 470 | AOT( iModelNum < 0 || iModelNum > m_iNumOfRenModels ); |
---|
| 471 | |
---|
[124] | 472 | m_apcRenModels[iModelNum]->setupPart( m_uiHorOff, m_iUsedHeight ); |
---|
| 473 | |
---|
[2] | 474 | // Switch model to original data for setup if given to render reference |
---|
| 475 | Bool bAnyRefFromOrg = false; |
---|
| 476 | for (Int iBaseViewIdx = 0; iBaseViewIdx < m_iNumOfBaseViews; iBaseViewIdx++ ) |
---|
| 477 | { |
---|
| 478 | Bool bSetupFromOrgVideo = m_abSetupVideoFromOrgForView[iBaseViewIdx]; |
---|
| 479 | Bool bSetupFromOrgDepth = m_abSetupDepthFromOrgForView[iBaseViewIdx]; |
---|
[100] | 480 | bAnyRefFromOrg = bAnyRefFromOrg || bSetupFromOrgVideo || bSetupFromOrgDepth; |
---|
[2] | 481 | |
---|
[100] | 482 | if ( m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum] != VIEWPOS_INVALID ) |
---|
[2] | 483 | { |
---|
| 484 | bAnyRefFromOrg = true; |
---|
| 485 | m_apcRenModels[iModelNum]->setLRView( m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum], |
---|
| 486 | ( bSetupFromOrgVideo ? m_aapiOrgVideoPel : m_aapiCurVideoPel ) [iBaseViewIdx], |
---|
| 487 | ( bSetupFromOrgVideo ? m_aaiOrgVideoStrides: m_aaiCurVideoStrides) [iBaseViewIdx], |
---|
| 488 | ( bSetupFromOrgDepth ? m_apiOrgDepthPel : m_apiCurDepthPel ) [iBaseViewIdx], |
---|
| 489 | ( bSetupFromOrgDepth ? m_aiOrgDepthStrides : m_aiCurDepthStrides ) [iBaseViewIdx] ); |
---|
| 490 | } |
---|
| 491 | } |
---|
| 492 | |
---|
[124] | 493 | m_apcRenModels[iModelNum]->setup ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, false ); |
---|
[2] | 494 | |
---|
| 495 | // Setup to Org |
---|
| 496 | if ( bAnyRefFromOrg ) |
---|
| 497 | { |
---|
| 498 | // Restore old values |
---|
| 499 | for (Int iBaseViewIdx = 0; iBaseViewIdx < m_iNumOfBaseViews; iBaseViewIdx++ ) |
---|
| 500 | { |
---|
| 501 | if ( m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum] != VIEWPOS_INVALID ) |
---|
| 502 | { |
---|
| 503 | m_apcRenModels[iModelNum]->setLRView( |
---|
| 504 | m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum], |
---|
| 505 | m_aapiCurVideoPel [iBaseViewIdx], |
---|
| 506 | m_aaiCurVideoStrides [iBaseViewIdx], |
---|
| 507 | m_apiCurDepthPel [iBaseViewIdx], |
---|
| 508 | m_aiCurDepthStrides [iBaseViewIdx] |
---|
| 509 | ); |
---|
| 510 | } |
---|
| 511 | } |
---|
| 512 | |
---|
[100] | 513 | // setup keeping reference rendered from original data |
---|
[124] | 514 | m_apcRenModels[iModelNum]->setup ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, true ); |
---|
[2] | 515 | } |
---|
| 516 | } |
---|
| 517 | |
---|
| 518 | Void |
---|
| 519 | TRenModel::setErrorMode( Int iView, Int iContent, int iPlane ) |
---|
| 520 | { |
---|
| 521 | AOT(iView > m_iNumOfBaseViews || iView < 0); |
---|
| 522 | AOT(iContent != 0 && iContent != 1); |
---|
| 523 | AOT(iPlane < 0 || iPlane > 3); |
---|
| 524 | |
---|
| 525 | m_iCurrentView = iView; |
---|
| 526 | m_iCurrentContent = iContent; |
---|
| 527 | m_iCurrentPlane = iPlane; |
---|
| 528 | |
---|
| 529 | if ( iContent == 1 ) |
---|
| 530 | { |
---|
| 531 | m_iNumOfCurRenModels = m_aiNumOfModelsForDepthView[iView]; |
---|
| 532 | m_apcCurRenModels = m_aapcRenModelForDepthView [iView]; |
---|
| 533 | m_aiCurPosInModels = m_aaePosInModelForDepthView[iView]; |
---|
| 534 | } |
---|
| 535 | else |
---|
| 536 | { |
---|
| 537 | m_iNumOfCurRenModels = m_aiNumOfModelsForVideoView[iView]; |
---|
| 538 | m_apcCurRenModels = m_aapcRenModelForVideoView [iView]; |
---|
| 539 | m_aiCurPosInModels = m_aaePosInModelForVideoView[iView]; |
---|
| 540 | } |
---|
| 541 | } |
---|
| 542 | |
---|
[100] | 543 | |
---|
[124] | 544 | Void |
---|
| 545 | TRenModel::setupPart ( UInt uiHorOff, Int iUsedHeight ) |
---|
| 546 | { |
---|
| 547 | AOT( iUsedHeight > m_iHeight ); |
---|
| 548 | m_uiHorOff = uiHorOff; |
---|
| 549 | m_iUsedHeight = iUsedHeight; |
---|
| 550 | } |
---|
[100] | 551 | |
---|
| 552 | #if LGE_VSO_EARLY_SKIP_A0093 |
---|
[2] | 553 | RMDist |
---|
[100] | 554 | TRenModel::getDist( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData, Int iOrgStride) |
---|
| 555 | #else |
---|
| 556 | RMDist |
---|
[2] | 557 | TRenModel::getDist( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) |
---|
[100] | 558 | #endif |
---|
[2] | 559 | { |
---|
[100] | 560 | iStartPosY -= m_uiHorOff; |
---|
| 561 | |
---|
[2] | 562 | AOT( iWidth + iStartPosX > m_iWidth ); |
---|
[124] | 563 | AOT( iHeight + iStartPosY > m_iUsedHeight ); |
---|
| 564 | |
---|
[2] | 565 | AOT( iStartPosX < 0); |
---|
| 566 | AOT( iStartPosY < 0); |
---|
| 567 | AOT( iWidth < 0); |
---|
| 568 | AOT( iHeight < 0); |
---|
| 569 | |
---|
| 570 | RMDist iDist = 0; |
---|
| 571 | |
---|
| 572 | for (Int iModelNum = 0; iModelNum < m_iNumOfCurRenModels; iModelNum++ ) |
---|
| 573 | { |
---|
| 574 | if (m_iCurrentContent == 1) |
---|
| 575 | { |
---|
[100] | 576 | #if LGE_VSO_EARLY_SKIP_A0093 |
---|
| 577 | iDist += m_apcCurRenModels[iModelNum]->getDistDepth ( m_aiCurPosInModels[iModelNum], iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData , piOrgData, iOrgStride); |
---|
| 578 | #else |
---|
[2] | 579 | iDist += m_apcCurRenModels[iModelNum]->getDistDepth ( m_aiCurPosInModels[iModelNum], iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); |
---|
[100] | 580 | #endif |
---|
[2] | 581 | } |
---|
| 582 | else |
---|
| 583 | { |
---|
| 584 | iDist += m_apcCurRenModels[iModelNum]->getDistVideo ( m_aiCurPosInModels[iModelNum], m_iCurrentPlane ,iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); |
---|
| 585 | } |
---|
| 586 | } |
---|
| 587 | |
---|
| 588 | return ( iDist + (m_iNumOfCurRenModels >> 1) ) / m_iNumOfCurRenModels; |
---|
| 589 | } |
---|
| 590 | |
---|
| 591 | Void |
---|
| 592 | TRenModel::setData( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) |
---|
| 593 | { |
---|
[100] | 594 | iStartPosY -= m_uiHorOff; |
---|
| 595 | |
---|
[2] | 596 | iWidth = min(iWidth , m_iWidth - iStartPosX ); |
---|
[124] | 597 | iHeight = min(iHeight, m_iUsedHeight - iStartPosY ); |
---|
[2] | 598 | |
---|
| 599 | AOT( iStartPosX < 0); |
---|
| 600 | AOT( iStartPosY < 0); |
---|
| 601 | AOT( iWidth < 0); |
---|
| 602 | AOT( iHeight < 0); |
---|
| 603 | |
---|
| 604 | for (Int iModelNum = 0; iModelNum < m_iNumOfCurRenModels; iModelNum++ ) |
---|
| 605 | { |
---|
| 606 | if (m_iCurrentContent == 1) |
---|
| 607 | { |
---|
[100] | 608 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
| 609 | Int iTargetStride = m_aiCurDepthStrides[ m_iCurrentView ]; |
---|
| 610 | m_apcCurRenModels[iModelNum]->setDepth ( m_aiCurPosInModels[iModelNum], iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,m_apiCurDepthPel[ m_iCurrentView ] + iStartPosY * iTargetStride + iStartPosX ,iTargetStride ); |
---|
| 611 | #else |
---|
[2] | 612 | m_apcCurRenModels[iModelNum]->setDepth ( m_aiCurPosInModels[iModelNum], iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); |
---|
[100] | 613 | #endif |
---|
[2] | 614 | } |
---|
| 615 | else |
---|
| 616 | { |
---|
| 617 | m_apcCurRenModels[iModelNum]->setVideo ( m_aiCurPosInModels[iModelNum], m_iCurrentPlane ,iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); |
---|
| 618 | } |
---|
| 619 | } |
---|
| 620 | |
---|
[100] | 621 | #ifdef LGE_VSO_EARLY_SKIP_A0093 |
---|
[2] | 622 | if (m_iCurrentContent == 1) |
---|
| 623 | { |
---|
| 624 | Int iTargetStride = m_aiCurDepthStrides[ m_iCurrentView ]; |
---|
| 625 | TRenFilter::copy( piNewData, iStride, iWidth, iHeight, m_apiCurDepthPel[ m_iCurrentView ] + iStartPosY * iTargetStride + iStartPosX, iTargetStride ); |
---|
| 626 | } |
---|
[100] | 627 | #endif |
---|
[2] | 628 | } |
---|
| 629 | |
---|
| 630 | Void |
---|
[100] | 631 | TRenModel::getSynthVideo( Int iModelNum, Int iViewNum, TComPicYuv* pcPicYuv ) |
---|
[2] | 632 | { |
---|
[124] | 633 | m_apcRenModels[iModelNum]->getSynthVideo(iViewNum, pcPicYuv ); |
---|
[2] | 634 | } |
---|
| 635 | |
---|
| 636 | Void |
---|
[100] | 637 | TRenModel::getSynthDepth( Int iModelNum, Int iViewNum, TComPicYuv* pcPicYuv ) |
---|
[2] | 638 | { |
---|
[100] | 639 | m_apcRenModels[iModelNum]->getSynthDepth(iViewNum, pcPicYuv ); |
---|
[2] | 640 | } |
---|
| 641 | |
---|
| 642 | Void |
---|
| 643 | TRenModel::getTotalSSE( Int64& riSSEY, Int64& riSSEU, Int64& riSSEV ) |
---|
| 644 | { |
---|
| 645 | TComPicYuv cPicYuvSynth; |
---|
[124] | 646 | cPicYuvSynth.create( m_iWidth, m_iUsedHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); |
---|
[2] | 647 | |
---|
| 648 | TComPicYuv cPicYuvTempRef; |
---|
[124] | 649 | cPicYuvTempRef.create( m_iWidth, m_iUsedHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth); |
---|
[2] | 650 | |
---|
| 651 | Int64 iSSEY = 0; |
---|
| 652 | Int64 iSSEU = 0; |
---|
| 653 | Int64 iSSEV = 0; |
---|
| 654 | |
---|
| 655 | for (Int iCurModel = 0; iCurModel < m_iNumOfCurRenModels; iCurModel++) |
---|
| 656 | { |
---|
[124] | 657 | m_apcCurRenModels[iCurModel]->getSynthVideo( m_aiCurPosInModels[iCurModel], &cPicYuvSynth ); |
---|
| 658 | m_apcCurRenModels[iCurModel]->getRefVideo ( m_aiCurPosInModels[iCurModel], &cPicYuvTempRef ); |
---|
| 659 | |
---|
| 660 | iSSEY += TRenFilter::SSE( cPicYuvSynth.getLumaAddr(), cPicYuvSynth.getStride(), m_iWidth, m_iUsedHeight , cPicYuvTempRef.getLumaAddr(), cPicYuvTempRef.getStride() ); |
---|
| 661 | iSSEU += TRenFilter::SSE( cPicYuvSynth.getCbAddr() , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getCbAddr() , cPicYuvTempRef.getCStride()); |
---|
| 662 | iSSEV += TRenFilter::SSE( cPicYuvSynth.getCrAddr() , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getCrAddr() , cPicYuvTempRef.getCStride()); |
---|
[2] | 663 | } |
---|
| 664 | |
---|
| 665 | riSSEY = ( iSSEY + (m_iNumOfCurRenModels >> 1) ) / m_iNumOfCurRenModels; |
---|
| 666 | riSSEU = ( iSSEU + (m_iNumOfCurRenModels >> 1) ) / m_iNumOfCurRenModels; |
---|
| 667 | riSSEV = ( iSSEV + (m_iNumOfCurRenModels >> 1) ) / m_iNumOfCurRenModels; |
---|
| 668 | |
---|
| 669 | cPicYuvTempRef.destroy(); |
---|
| 670 | cPicYuvSynth .destroy(); |
---|
| 671 | } |
---|
| 672 | |
---|
| 673 | Void |
---|
| 674 | TRenModel::xSetLRViewAndAddModel( Int iModelNum, Int iBaseViewNum, Int iContent, Int iViewPos, Bool bAdd ) |
---|
| 675 | { |
---|
| 676 | AOF(iViewPos == VIEWPOS_LEFT || iViewPos == VIEWPOS_RIGHT); |
---|
| 677 | AOF(iContent == -1 || iContent == 0 || iContent == 1); |
---|
| 678 | AOT( iBaseViewNum < 0 || iBaseViewNum > m_iNumOfBaseViews ); |
---|
| 679 | AOT( m_aaeBaseViewPosInModel[iBaseViewNum][iModelNum] != VIEWPOS_INVALID ); |
---|
| 680 | m_aaeBaseViewPosInModel[iBaseViewNum][iModelNum] = iViewPos; |
---|
| 681 | |
---|
| 682 | if (bAdd) |
---|
| 683 | { |
---|
| 684 | if (iContent == 0 || iContent == -1 ) |
---|
| 685 | { |
---|
| 686 | Int iNewModelIdxForView = m_aiNumOfModelsForVideoView[iBaseViewNum]++; |
---|
| 687 | m_aapcRenModelForVideoView [ iBaseViewNum ][ iNewModelIdxForView ] = m_apcRenModels[iModelNum]; |
---|
| 688 | m_aaePosInModelForVideoView[ iBaseViewNum ][ iNewModelIdxForView ] = iViewPos; |
---|
| 689 | } |
---|
| 690 | |
---|
| 691 | if (iContent == 1 || iContent == -1 ) |
---|
| 692 | { |
---|
| 693 | Int iNewModelIdxForView = m_aiNumOfModelsForDepthView[iBaseViewNum]++; |
---|
| 694 | m_aapcRenModelForDepthView [ iBaseViewNum ][ iNewModelIdxForView ] = m_apcRenModels[iModelNum]; |
---|
| 695 | m_aaePosInModelForDepthView[ iBaseViewNum ][ iNewModelIdxForView ] = iViewPos; |
---|
| 696 | } |
---|
| 697 | } |
---|
[189] | 698 | } |
---|
[194] | 699 | #endif |
---|
| 700 | |
---|