#ifndef CB_INTRAPARTMODE_H
#define CB_INTRAPARTMODE_H
#include "libde265/nal-parser.h"
#include "libde265/decctx.h"
#include "libde265/encoder/encoder-types.h"
#include "libde265/slice.h"
#include "libde265/scan.h"
#include "libde265/intrapred.h"
#include "libde265/transform.h"
#include "libde265/fallback-dct.h"
#include "libde265/quality.h"
#include "libde265/fallback.h"
#include "libde265/configparam.h"
#include "libde265/encoder/algo/algo.h"
#include "libde265/encoder/algo/tb-intrapredmode.h"
#include "libde265/encoder/algo/tb-split.h"
enum ALGO_CB_IntraPartMode {
ALGO_CB_IntraPartMode_BruteForce,
ALGO_CB_IntraPartMode_Fixed
};
class option_ALGO_CB_IntraPartMode : public choice_option<enum ALGO_CB_IntraPartMode>
{
public:
option_ALGO_CB_IntraPartMode() {
add_choice("fixed", ALGO_CB_IntraPartMode_Fixed);
add_choice("brute-force",ALGO_CB_IntraPartMode_BruteForce, true);
}
};
class Algo_CB_IntraPartMode : public Algo_CB
{
public:
Algo_CB_IntraPartMode() : mTBIntraPredModeAlgo(NULL) { }
virtual ~Algo_CB_IntraPartMode() { }
virtual enc_cb* analyze(encoder_context*,
context_model_table&,
enc_cb* cb) = 0;
void setChildAlgo(Algo_TB_IntraPredMode* algo) { mTBIntraPredModeAlgo = algo; }
virtual const char* name() const { return "cb-intrapartmode"; }
protected:
Algo_TB_IntraPredMode* mTBIntraPredModeAlgo;
};
class Algo_CB_IntraPartMode_BruteForce : public Algo_CB_IntraPartMode
{
public:
virtual enc_cb* analyze(encoder_context*,
context_model_table&,
enc_cb* cb);
virtual const char* name() const { return "cb-intrapartmode-bruteforce"; }
};
class option_PartMode : public choice_option<enum PartMode>
{
public:
option_PartMode() {
add_choice("NxN", PART_NxN);
add_choice("2Nx2N", PART_2Nx2N, true);
}
};
class Algo_CB_IntraPartMode_Fixed : public Algo_CB_IntraPartMode
{
public:
Algo_CB_IntraPartMode_Fixed() { }
struct params
{
params() {
partMode.set_ID("CB-IntraPartMode-Fixed-partMode");
}
option_PartMode partMode;
};
void registerParams(config_parameters& config) {
config.add_option(&mParams.partMode);
}
void setParams(const params& p) { mParams=p; }
virtual enc_cb* analyze(encoder_context* ectx,
context_model_table& ctxModel,
enc_cb* cb);
virtual const char* name() const { return "cb-intrapartmode-fixed"; }
private:
params mParams;
};
#endif