digiKam
ctb-qscale.h
Go to the documentation of this file.
1 /*
2  * H.265 video codec.
3  * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de>
4  *
5  * Authors: Dirk Farin <farin@struktur.de>
6  *
7  * This file is part of libde265.
8  *
9  * libde265 is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU Lesser General Public License as
11  * published by the Free Software Foundation, either version 3 of
12  * the License, or (at your option) any later version.
13  *
14  * libde265 is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with libde265. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef CTB_QSCALE_H
24 #define CTB_QSCALE_H
25 
26 #include "libde265/nal-parser.h"
27 #include "libde265/decctx.h"
29 #include "libde265/slice.h"
30 #include "libde265/scan.h"
31 #include "libde265/intrapred.h"
32 #include "libde265/transform.h"
33 #include "libde265/fallback-dct.h"
34 #include "libde265/quality.h"
35 #include "libde265/fallback.h"
36 #include "libde265/configparam.h"
37 
39 
40 
41 /* Encoder search tree, bottom up:
42 
43  - Algo_TB_Split - whether TB is split or not
44 
45  - Algo_TB_IntraPredMode - choose the intra prediction mode (or NOP, if at the wrong tree level)
46 
47  - Algo_CB_IntraPartMode - choose between NxN and 2Nx2N intra parts
48 
49  - Algo_CB_Split - whether CB is split or not
50 
51  - Algo_CTB_QScale - select QScale on CTB granularity
52  */
53 
54 
55 // ========== choose a qscale at CTB level ==========
56 
57 class Algo_CTB_QScale : public Algo
58 {
59  public:
61  virtual ~Algo_CTB_QScale() { }
62 
65  int ctb_x,int ctb_y) = 0;
66 
67  void setChildAlgo(Algo_CB_Split* algo) { mChildAlgo = algo; }
68 
69  protected:
71 };
72 
73 
74 
76 {
77  public:
78  struct params
79  {
80  params() {
81  mQP.set_range(1,51);
82  mQP.set_default(27);
83  mQP.set_ID("CTB-QScale-Constant");
84  mQP.set_cmd_line_options("qp",'q');
85  }
86 
88  };
89 
90  void setParams(const params& p) { mParams=p; }
91 
93  config.add_option(&mParams.mQP);
94  }
95 
98  int ctb_x,int ctb_y);
99 
100  int getQP() const { return mParams.mQP; }
101 
102  const char* name() const { return "ctb-qscale-constant"; }
103 
104  private:
105  params mParams;
106 };
107 
108 
109 #endif
Definition: cb-split.h:59
Definition: ctb-qscale.h:76
const char * name() const
Definition: ctb-qscale.h:102
int getQP() const
Definition: ctb-qscale.h:100
void setParams(const params &p)
Definition: ctb-qscale.h:90
void registerParams(config_parameters &config)
Definition: ctb-qscale.h:92
virtual enc_cb * analyze(encoder_context *, context_model_table &, int ctb_x, int ctb_y)
Definition: ctb-qscale.h:58
Algo_CB_Split * mChildAlgo
Definition: ctb-qscale.h:70
virtual enc_cb * analyze(encoder_context *, context_model_table &, int ctb_x, int ctb_y)=0
Algo_CTB_QScale()
Definition: ctb-qscale.h:60
virtual ~Algo_CTB_QScale()
Definition: ctb-qscale.h:61
void setChildAlgo(Algo_CB_Split *algo)
Definition: ctb-qscale.h:67
Definition: algo.h:46
Definition: configparam.h:366
void LIBDE265_API add_option(option_base *o)
Definition: contextmodel.h:100
Definition: encoder-types.h:248
Definition: encoder-context.h:39
void set_cmd_line_options(const char *long_option, char short_option=0)
Definition: configparam.h:79
void set_ID(const char *name)
Definition: configparam.h:56
Definition: configparam.h:182
void set_range(int mini, int maxi)
void set_default(int v)
Definition: configparam.h:203
Definition: ctb-qscale.h:79
option_int mQP
Definition: ctb-qscale.h:87
params()
Definition: ctb-qscale.h:80