Coverage Report

Created: 2026-04-01 07:49

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/vvenc/source/Lib/EncoderLib/EncPicture.h
Line
Count
Source
1
/* -----------------------------------------------------------------------------
2
The copyright in this software is being made available under the Clear BSD
3
License, included below. No patent rights, trademark rights and/or 
4
other Intellectual Property Rights other than the copyrights concerning 
5
the Software are granted under this license.
6
7
The Clear BSD License
8
9
Copyright (c) 2019-2026, Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. & The VVenC Authors.
10
All rights reserved.
11
12
Redistribution and use in source and binary forms, with or without modification,
13
are permitted (subject to the limitations in the disclaimer below) provided that
14
the following conditions are met:
15
16
     * Redistributions of source code must retain the above copyright notice,
17
     this list of conditions and the following disclaimer.
18
19
     * Redistributions in binary form must reproduce the above copyright
20
     notice, this list of conditions and the following disclaimer in the
21
     documentation and/or other materials provided with the distribution.
22
23
     * Neither the name of the copyright holder nor the names of its
24
     contributors may be used to endorse or promote products derived from this
25
     software without specific prior written permission.
26
27
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
28
THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
29
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
31
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
32
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
33
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
34
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
35
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
36
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38
POSSIBILITY OF SUCH DAMAGE.
39
40
41
------------------------------------------------------------------------------------------- */
42
/** \file     EncPicture.h
43
    \brief    encode picture (header)
44
*/
45
46
#pragma once
47
48
#include "EncSlice.h"
49
#include "EncSampleAdaptiveOffset.h"
50
#include "EncAdaptiveLoopFilter.h"
51
#include "CommonLib/LoopFilter.h"
52
#include "Utilities/NoMallocThreadPool.h"
53
54
//! \ingroup EncoderLib
55
//! \{
56
57
namespace vvenc {
58
59
class EncGOP;
60
61
// ---------------------------------------------------------------------------------------------------------------------
62
63
class EncPicture
64
{
65
  private:
66
    const VVEncCfg*          m_pcEncCfg;
67
    EncSlice                 m_SliceEncoder;
68
    LoopFilter               m_LoopFilter;
69
    EncAdaptiveLoopFilter    m_ALF;
70
71
    BitEstimator             m_BitEstimator;
72
    CABACWriter              m_CABACEstimator;
73
    CtxCache                 m_CtxCache;
74
    RateCtrl*                m_pcRateCtrl;
75
76
  public:
77
    WaitCounter              m_ctuTasksDoneCounter;
78
79
  public:
80
    EncPicture()
81
0
      : m_pcEncCfg      ( nullptr )
82
0
      , m_CABACEstimator( m_BitEstimator )
83
0
      , m_pcRateCtrl    ( nullptr )
84
0
    {}
85
0
    virtual ~EncPicture() {}
86
87
    void init                   ( const VVEncCfg& encCfg,
88
                                  std::vector<int>* const globalCtuQpVector,
89
                                  const SPS& sps,
90
                                  const PPS& pps,
91
                                  RateCtrl& rateCtrl,
92
                                  NoMallocThreadPool* threadPool );
93
    void compressPicture        ( Picture& pic, EncGOP& gopEncoder );
94
    void finalizePicture        ( Picture& pic );
95
96
  protected:
97
    void xInitPicEncoder        ( Picture& pic );
98
    void xWriteSliceData        ( Picture& pic );
99
    void xCalcDistortion        ( Picture& pic, const SPS& sps );
100
101
    void xInitSliceColFromL0Flag( Slice* slice ) const;
102
    void xInitSliceCheckLDC     ( Slice* slice ) const;
103
};
104
105
} // namespace vvenc
106
107
//! \}
108