source: 3DVCSoftware/branches/0.3-poznan-univ/source/Lib/TLibCommon/TComMVDRefData.cpp @ 165

Last change on this file since 165 was 5, checked in by hhi, 13 years ago

Clean version with cfg-files

  • Property svn:eol-style set to native
File size: 4.1 KB
Line 
1/* The copyright in this software is being made available under the BSD
2 * License, included below. This software may be subject to other third party
3 * and contributor rights, including patent rights, and no such rights are
4 * granted under this license.
5 *
6 * Copyright (c) 2010-2011, ISO/IEC
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 *  * Redistributions of source code must retain the above copyright notice,
13 *    this list of conditions and the following disclaimer.
14 *  * Redistributions in binary form must reproduce the above copyright notice,
15 *    this list of conditions and the following disclaimer in the documentation
16 *    and/or other materials provided with the distribution.
17 *  * Neither the name of the ISO/IEC nor the names of its contributors may
18 *    be used to endorse or promote products derived from this software without
19 *    specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34
35
36// Include files
37#include "TComMVDRefData.h"
38#include "TComPicYuv.h"
39#include <math.h>
40#include <vector>
41#include <iostream>
42#include <fstream>
43
44#if HHI_VSO
45Void TComMVDRefData::setPicYuvBaseView( InterViewReference eView, Bool bDepth, TComPicYuv* pcOrgView, TComPicYuv* pcRecView )
46{
47  if ( bDepth )
48  {
49    m_apcDepthRec[eView] = pcRecView;
50    m_apcDepthOrg[eView] = pcOrgView;
51  }
52  else
53  {
54    m_apcVideoRec[eView] = pcRecView;
55    m_apcVideoOrg[eView] = pcOrgView;
56  }
57}
58
59Void TComMVDRefData::setShiftLUTsBaseView( InterViewReference eView, Double** adInLut, Int** aiInLut )
60{
61  m_aiBaseViewShiftLUT[eView] = aiInLut;
62  m_adBaseViewShiftLUT[eView] = adInLut;
63}
64
65TComMVDRefData::TComMVDRefData()
66{
67  m_adERViewShiftLUT = 0;
68  m_aiERViewShiftLUT = 0;
69  m_apcExternalReferenceViews.resize(0);
70
71  for (UInt uiView = 0; uiView < 3; uiView++)
72  {
73    m_apcVideoOrg[uiView] = NULL;
74    m_apcDepthOrg[uiView] = NULL;
75    m_apcVideoRec[uiView] = NULL;
76    m_apcDepthRec[uiView] = NULL;
77
78    m_adBaseViewShiftLUT [uiView] = NULL;
79    m_aiBaseViewShiftLUT [uiView] = NULL;
80
81  };
82}
83
84Void TComMVDRefData::getRefPicYuvAndLUT( TComPicYuv**& rpacDistRefPicList, Int***& rppaiShiftLut )
85{
86  UInt uiNextEntry = 0;
87  for ( UInt uiViewIdx = 0; uiViewIdx < m_aiExtViewRefInd.size(); uiViewIdx++ )
88  {
89    rppaiShiftLut[uiNextEntry]       = m_aiERViewShiftLUT         [ m_aiExtViewRefLUTInd[uiViewIdx] ];
90    rpacDistRefPicList[uiNextEntry]  = m_apcExternalReferenceViews[ m_aiExtViewRefInd   [uiViewIdx] ];
91    uiNextEntry++;
92  }
93
94  for ( UInt uiViewIdx = 0; uiViewIdx < m_aiBaseViewRefInd.size(); uiViewIdx++ )
95  {
96    rppaiShiftLut[uiNextEntry]      = m_aiBaseViewShiftLUT[ m_aiBaseViewRefInd[uiViewIdx] + 1 ];
97    rpacDistRefPicList[uiNextEntry] = getPicYuvRecVideo( (InterViewReference) (m_aiBaseViewRefInd[uiViewIdx] + 1) ) ?  getPicYuvRecVideo( (InterViewReference) (m_aiBaseViewRefInd[uiViewIdx] + 1) ) : getPicYuvOrgVideo( (InterViewReference) (m_aiBaseViewRefInd[uiViewIdx] + 1) );
98    uiNextEntry++;
99  }
100}
101
102Void TComMVDRefData::getRefPicYuvAndLUTMode1( TComPicYuv**& rpacDistRefPicList, Int***& rppaiShiftLut )
103{
104  rppaiShiftLut[0] = m_aiBaseViewShiftLUT[ PREVVIEW ];
105  rppaiShiftLut[1] = NULL;
106  rppaiShiftLut[2] = m_aiBaseViewShiftLUT[ NEXTVIEW ];
107
108  rpacDistRefPicList[0] = NULL;
109  rpacDistRefPicList[1] = NULL;
110  rpacDistRefPicList[2] = NULL;
111}
112#endif
Note: See TracBrowser for help on using the repository browser.