int err; \
av_strlcatf(opt_str, sizeof(opt_str), format, __VA_ARGS__); \
err = cae->api->opt_set2(cae->param, name, opt_str); \
- if (err) {\
+ if (err < 0) {\
av_log(avctx, AV_LOG_WARNING, "Invalid value for %s: %s\n", name, opt_str);\
}\
} while(0);
int min_qp;
int preset_level;
int log_level;
- int hierarchical_reference;
void *encoder;
char *xavs2_opts;
xavs2_opt_set2("RateControl", "%d", 1);
xavs2_opt_set2("TargetBitRate", "%"PRId64"", avctx->bit_rate);
xavs2_opt_set2("InitialQP", "%d", cae->initial_qp);
- xavs2_opt_set2("MaxQP", "%d", cae->max_qp);
- xavs2_opt_set2("MinQP", "%d", cae->min_qp);
+ xavs2_opt_set2("MaxQP", "%d", avctx->qmax >= 0 ? avctx->qmax : cae->max_qp);
+ xavs2_opt_set2("MinQP", "%d", avctx->qmin >= 0 ? avctx->qmin : cae->min_qp);
} else {
xavs2_opt_set2("InitialQP", "%d", cae->qp);
}