digiKam
pb-mv.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 PB_MV_H
24 #define PB_MV_H
25 
26 #include "libde265/nal-parser.h"
27 #include "libde265/decctx.h"
28 #include "libde265/slice.h"
29 #include "libde265/scan.h"
30 #include "libde265/intrapred.h"
31 #include "libde265/transform.h"
32 #include "libde265/fallback-dct.h"
33 #include "libde265/quality.h"
34 #include "libde265/fallback.h"
35 #include "libde265/configparam.h"
36 
38 
39 
40 // ========== CB Intra/Inter decision ==========
41 
42 class Algo_TB_Split;
43 
44 
45 class Algo_PB_MV : public Algo_PB
46 {
47  public:
48  Algo_PB_MV() : mTBSplitAlgo(NULL) { }
49  virtual ~Algo_PB_MV() { }
50 
51  void setChildAlgo(Algo_TB_Split* algo) { mTBSplitAlgo = algo; }
52 
53  protected:
55 };
56 
57 
58 
59 
61  {
66  };
67 
68 class option_MVTestMode : public choice_option<enum MVTestMode>
69 {
70  public:
72  add_choice("zero", MVTestMode_Zero);
73  add_choice("random", MVTestMode_Random);
74  add_choice("horiz", MVTestMode_Horizontal, true);
76  }
77 };
78 
79 
81 {
82  public:
83  Algo_PB_MV_Test() : mCodeResidual(false) { }
84 
85  struct params
86  {
87  params() {
88  testMode.set_ID("PB-MV-TestMode");
89  range.set_ID ("PB-MV-Range");
90  range.set_default(4);
91  }
92 
95  };
96 
98  config.add_option(&mParams.testMode);
99  config.add_option(&mParams.range);
100  }
101 
102  void setParams(const params& p) { mParams=p; }
103 
106  enc_cb* cb,
107  int PBidx, int x,int y,int w,int h);
108 
109  private:
110  params mParams;
111 
112  bool mCodeResidual;
113 };
114 
115 
116 
117 
119  {
124  };
125 
126 class option_MVSearchAlgo : public choice_option<enum MVSearchAlgo>
127 {
128  public:
130  add_choice("zero", MVSearchAlgo_Zero);
131  add_choice("full", MVSearchAlgo_Full, true);
132  add_choice("diamond",MVSearchAlgo_Diamond);
133  add_choice("pmvfast",MVSearchAlgo_PMVFast);
134  }
135 };
136 
137 
139 {
140  public:
141  Algo_PB_MV_Search() : mCodeResidual(false) { }
142 
143  struct params
144  {
145  params() {
146  mvSearchAlgo.set_ID("PB-MV-Search-Algo");
147  hrange.set_ID ("PB-MV-Search-HRange");
148  vrange.set_ID ("PB-MV-Search-VRange");
149  hrange.set_default(8);
150  vrange.set_default(8);
151  }
152 
156  };
157 
159  config.add_option(&mParams.mvSearchAlgo);
160  config.add_option(&mParams.hrange);
161  config.add_option(&mParams.vrange);
162  }
163 
164  void setParams(const params& p) { mParams=p; }
165 
168  enc_cb* cb,
169  int PBidx, int x,int y,int w,int h);
170 
171  private:
172  params mParams;
173 
174  bool mCodeResidual;
175 };
176 
177 #endif
Definition: pb-mv.h:139
Algo_PB_MV_Search()
Definition: pb-mv.h:141
virtual enc_cb * analyze(encoder_context *, context_model_table &, enc_cb *cb, int PBidx, int x, int y, int w, int h)
void registerParams(config_parameters &config)
Definition: pb-mv.h:158
void setParams(const params &p)
Definition: pb-mv.h:164
Definition: pb-mv.h:81
void registerParams(config_parameters &config)
Definition: pb-mv.h:97
virtual enc_cb * analyze(encoder_context *, context_model_table &, enc_cb *cb, int PBidx, int x, int y, int w, int h)
Algo_PB_MV_Test()
Definition: pb-mv.h:83
void setParams(const params &p)
Definition: pb-mv.h:102
Definition: pb-mv.h:46
void setChildAlgo(Algo_TB_Split *algo)
Definition: pb-mv.h:51
Algo_TB_Split * mTBSplitAlgo
Definition: pb-mv.h:54
virtual ~Algo_PB_MV()
Definition: pb-mv.h:49
Algo_PB_MV()
Definition: pb-mv.h:48
Definition: algo.h:84
Definition: tb-split.h:47
Definition: configparam.h:258
void add_choice(const std::string &s, enum MVTestMode id, bool default_value=false)
Definition: configparam.h:264
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
Definition: pb-mv.h:127
option_MVSearchAlgo()
Definition: pb-mv.h:129
Definition: pb-mv.h:69
option_MVTestMode()
Definition: pb-mv.h:71
void set_ID(const char *name)
Definition: configparam.h:56
Definition: configparam.h:182
void set_default(int v)
Definition: configparam.h:203
MVTestMode
Definition: pb-mv.h:61
@ MVTestMode_Random
Definition: pb-mv.h:63
@ MVTestMode_Vertical
Definition: pb-mv.h:65
@ MVTestMode_Zero
Definition: pb-mv.h:62
@ MVTestMode_Horizontal
Definition: pb-mv.h:64
MVSearchAlgo
Definition: pb-mv.h:119
@ MVSearchAlgo_Zero
Definition: pb-mv.h:120
@ MVSearchAlgo_Full
Definition: pb-mv.h:121
@ MVSearchAlgo_Diamond
Definition: pb-mv.h:122
@ MVSearchAlgo_PMVFast
Definition: pb-mv.h:123
Definition: pb-mv.h:144
option_int hrange
Definition: pb-mv.h:154
option_int vrange
Definition: pb-mv.h:155
params()
Definition: pb-mv.h:145
option_MVSearchAlgo mvSearchAlgo
Definition: pb-mv.h:153
Definition: pb-mv.h:86
option_int range
Definition: pb-mv.h:94
params()
Definition: pb-mv.h:87
option_MVTestMode testMode
Definition: pb-mv.h:93