#ifndef CTB_QSCALE_H
#define CTB_QSCALE_H
#include "libde265/nal-parser.h"
#include "libde265/decctx.h"
#include "libde265/encoder/algo/algo.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/cb-split.h"
class Algo_CTB_QScale : public Algo
{
public:
Algo_CTB_QScale() : mChildAlgo(NULL) { }
virtual ~Algo_CTB_QScale() { }
virtual enc_cb* analyze(encoder_context*,
context_model_table&,
int ctb_x,int ctb_y) = 0;
void setChildAlgo(Algo_CB_Split* algo) { mChildAlgo = algo; }
protected:
Algo_CB_Split* mChildAlgo;
};
class Algo_CTB_QScale_Constant : public Algo_CTB_QScale
{
public:
struct params
{
params() {
mQP.set_range(1,51);
mQP.set_default(27);
mQP.set_ID("CTB-QScale-Constant");
mQP.set_cmd_line_options("qp",'q');
}
option_int mQP;
};
void setParams(const params& p) { mParams=p; }
void registerParams(config_parameters& config) {
config.add_option(&mParams.mQP);
}
virtual enc_cb* analyze(encoder_context*,
context_model_table&,
int ctb_x,int ctb_y);
int getQP() const { return mParams.mQP; }
const char* name() const { return "ctb-qscale-constant"; }
private:
params mParams;
};
#endif