uvgVPCCenc 1.0.0
uvgVPCCenc is an open-source real-time V-PCC encoder library written in C++ from scratch.
Loading...
Searching...
No Matches
mapGeneration.hpp
Go to the documentation of this file.
1/*****************************************************************************
2 * This file is part of uvgVPCCenc V-PCC encoder.
3 *
4 * Copyright (c) 2024, Tampere University, ITU/ISO/IEC, project contributors
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without modification,
8 * are permitted provided that the following conditions are met:
9 *
10 * * Redistributions of source code must retain the above copyright notice, this
11 * list of conditions and the following disclaimer.
12 *
13 * * Redistributions in binary form must reproduce the above copyright notice, this
14 * list of conditions and the following disclaimer in the documentation and/or
15 * other materials provided with the distribution.
16 *
17 * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its
18 * contributors may be used to endorse or promote products derived from
19 * this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON
28 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
31 ****************************************************************************/
32
34
35#include "uvgvpcc/uvgvpcc.hpp"
36
37using namespace uvgvpcc_enc;
38
39
40struct Filter {
41 std::vector<float> data_;
42 double shift_;
43};
48
50 public:
51 static void initializeStaticParameters();
52 static void initGOFMapGeneration(const std::shared_ptr<uvgvpcc_enc::GOF>& gof);
53 static void generateFrameMaps(const std::shared_ptr<uvgvpcc_enc::Frame>& frame);
54 static void writeFrameMapsYUV(const std::shared_ptr<uvgvpcc_enc::Frame>& frame);
55
56 private:
57
58 static void writePatches(const std::shared_ptr<uvgvpcc_enc::Frame>& frame, const size_t& gofMapsHeight);
59
60 static void fillBackgroundImages(const std::shared_ptr<uvgvpcc_enc::Frame>& frame, const size_t& gofMapsHeight);
61
62 static void fillBackgroundEmptyBlock(const std::shared_ptr<uvgvpcc_enc::Frame>& frame, const size_t blockSize, const size_t imageSize,
63 const size_t uBlk, const size_t vBlk, const size_t uom, const size_t vom);
64 static void fillBackgroundNonEmptyBlock(const std::shared_ptr<uvgvpcc_enc::Frame>& frame, const size_t blockSize, const size_t imageSize,
65 const size_t uom, const size_t vom, const size_t pixelBlockCount,
66 size_t missingPixelCount, std::vector<size_t>& iterations);
67 static void updateSums(const std::shared_ptr<uvgvpcc_enc::Frame>& frame, const size_t blockLeft, const size_t blockTop, const size_t iBlk,
68 const size_t jBlk, const size_t imageSize, std::vector<size_t>& iterations,
69 const size_t blockSize, std::vector<size_t>& sumGeo, std::vector<size_t>& sumR,
70 std::vector<size_t>& sumG, std::vector<size_t>& sumB, std::vector<size_t>& count);
71 static void allocateMaps(const std::shared_ptr<uvgvpcc_enc::Frame>& frame, const size_t& gofMapsHeight);
72
73 static void downsampling(const std::vector<float>& chroma_in, std::vector<float>& chroma_out, const size_t widthIn,
74 const size_t heightIn);
75};
Definition mapGeneration.hpp:49
static void initGOFMapGeneration(const std::shared_ptr< uvgvpcc_enc::GOF > &gof)
Definition mapGeneration.cpp:655
static void writeFrameMapsYUV(const std::shared_ptr< uvgvpcc_enc::Frame > &frame)
Definition mapGeneration.cpp:577
static void generateFrameMaps(const std::shared_ptr< uvgvpcc_enc::Frame > &frame)
Definition mapGeneration.cpp:546
static void initializeStaticParameters()
Definition mapGeneration.cpp:57
Definition log.hpp:43
Definition mapGeneration.hpp:44
Filter horizontal_
Definition mapGeneration.hpp:45
Filter vertical_
Definition mapGeneration.hpp:46
Definition mapGeneration.hpp:40
double shift_
Definition mapGeneration.hpp:42
std::vector< float > data_
Definition mapGeneration.hpp:41