3
* Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de>
5
* Authors: Dirk Farin <farin@struktur.de>
7
* This file is part of libde265.
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.
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.
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/>.
26
#include "libde265/nal-parser.h"
27
#include "libde265/decctx.h"
28
#include "libde265/encoder/encode.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"
38
#include "libde265/encoder/algo/algo.h"
41
// ========== CB Intra/Inter decision ==========
46
class Algo_PB_MV : public Algo_PB
49
Algo_PB_MV() : mTBSplitAlgo(NULL) { }
50
virtual ~Algo_PB_MV() { }
52
void setChildAlgo(Algo_TB_Split* algo) { mTBSplitAlgo = algo; }
55
Algo_TB_Split* mTBSplitAlgo;
65
MVTestMode_Horizontal,
69
class option_MVTestMode : public choice_option<enum MVTestMode>
73
add_choice("zero", MVTestMode_Zero);
74
add_choice("random", MVTestMode_Random);
75
add_choice("horiz", MVTestMode_Horizontal, true);
76
add_choice("verti", MVTestMode_Vertical);
81
class Algo_PB_MV_Test : public Algo_PB_MV
84
Algo_PB_MV_Test() : mCodeResidual(false) { }
89
testMode.set_ID("PB-MV-TestMode");
90
range.set_ID ("PB-MV-Range");
94
option_MVTestMode testMode;
98
void registerParams(config_parameters& config) {
99
config.add_option(&mParams.testMode);
100
config.add_option(&mParams.range);
103
void setParams(const params& p) { mParams=p; }
105
virtual enc_cb* analyze(encoder_context*,
106
context_model_table&,
108
int PBidx, int x,int y,int w,int h);
123
MVSearchAlgo_Diamond,
127
class option_MVSearchAlgo : public choice_option<enum MVSearchAlgo>
130
option_MVSearchAlgo() {
131
add_choice("zero", MVSearchAlgo_Zero);
132
add_choice("full", MVSearchAlgo_Full, true);
133
add_choice("diamond",MVSearchAlgo_Diamond);
134
add_choice("pmvfast",MVSearchAlgo_PMVFast);
139
class Algo_PB_MV_Search : public Algo_PB_MV
142
Algo_PB_MV_Search() : mCodeResidual(false) { }
147
mvSearchAlgo.set_ID("PB-MV-Search-Algo");
148
hrange.set_ID ("PB-MV-Search-HRange");
149
vrange.set_ID ("PB-MV-Search-VRange");
150
hrange.set_default(8);
151
vrange.set_default(8);
154
option_MVSearchAlgo mvSearchAlgo;
159
void registerParams(config_parameters& config) {
160
config.add_option(&mParams.mvSearchAlgo);
161
config.add_option(&mParams.hrange);
162
config.add_option(&mParams.vrange);
165
void setParams(const params& p) { mParams=p; }
167
virtual enc_cb* analyze(encoder_context*,
168
context_model_table&,
170
int PBidx, int x,int y,int w,int h);