obs-qsv11: Simplify UI subjective quality parameters

Combine MMBRC and CQM parameters into a subjective video
enhancement box
master
brittneysclark 2020-05-16 05:36:18 -07:00
parent 45df89ef93
commit d0a539341b
1 changed files with 10 additions and 12 deletions

View File

@ -160,7 +160,7 @@ static void obs_qsv_defaults(obs_data_t *settings)
obs_data_set_default_int(settings, "keyint_sec", 3);
obs_data_set_default_string(settings, "latency", "normal");
obs_data_set_default_int(settings, "bframes", 3);
obs_data_set_default_bool(settings, "mbbrc", true);
obs_data_set_default_bool(settings, "enhancements", false);
}
static inline void add_strings(obs_property_t *list, const char *const *strings)
@ -182,7 +182,8 @@ static inline void add_strings(obs_property_t *list, const char *const *strings)
#define TEXT_ICQ_QUALITY obs_module_text("ICQQuality")
#define TEXT_KEYINT_SEC obs_module_text("KeyframeIntervalSec")
#define TEXT_BFRAMES obs_module_text("B Frames")
#define TEXT_MBBRC obs_module_text("Content Adaptive Quantization")
#define TEXT_SUBJECTIVE_ENHANCEMENTS \
obs_module_text("Subjective Video Enhancements")
static inline bool is_skl_or_greater_platform()
{
@ -226,9 +227,8 @@ static bool rate_control_modified(obs_properties_t *ppts, obs_property_t *p,
obs_property_set_visible(p, bVisible);
bVisible = astrcmpi(rate_control, "CBR") == 0 ||
astrcmpi(rate_control, "VBR") == 0 ||
astrcmpi(rate_control, "AVBR") == 0;
p = obs_properties_get(ppts, "mbbrc");
astrcmpi(rate_control, "VBR") == 0;
p = obs_properties_get(ppts, "enhancements");
obs_property_set_visible(p, bVisible);
return true;
@ -309,9 +309,8 @@ static obs_properties_t *obs_qsv_props(void *unused)
obs_properties_add_int(props, "bframes", TEXT_BFRAMES, 0, 3, 1);
if (is_skl_or_greater_platform())
obs_properties_add_bool(props, "mbbrc", TEXT_MBBRC);
obs_properties_add_bool(props, "CQM", "Customized quantization matrix");
obs_properties_add_bool(props, "enhancements",
TEXT_SUBJECTIVE_ENHANCEMENTS);
return props;
}
@ -338,7 +337,7 @@ static void update_params(struct obs_qsv *obsqsv, obs_data_t *settings)
int keyint_sec = (int)obs_data_get_int(settings, "keyint_sec");
bool cbr_override = obs_data_get_bool(settings, "cbr");
int bFrames = (int)obs_data_get_int(settings, "bframes");
bool mbbrc = obs_data_get_bool(settings, "mbbrc");
bool enhancements = obs_data_get_bool(settings, "enhancements");
if (obs_data_has_user_value(settings, "bf"))
bFrames = (int)obs_data_get_int(settings, "bf");
@ -440,7 +439,8 @@ static void update_params(struct obs_qsv *obsqsv, obs_data_t *settings)
obsqsv->params.nbFrames = (mfxU16)bFrames;
obsqsv->params.nKeyIntSec = (mfxU16)keyint_sec;
obsqsv->params.nICQQuality = (mfxU16)icq_quality;
obsqsv->params.bMBBRC = mbbrc;
obsqsv->params.bMBBRC = enhancements;
obsqsv->params.bCQM = enhancements;
info("settings:\n\trate_control: %s", rate_control);
@ -480,8 +480,6 @@ static void update_params(struct obs_qsv *obsqsv, obs_data_t *settings)
"\theight: %d",
voi->fps_num, voi->fps_den, width, height);
obsqsv->params.bCQM = (bool)obs_data_get_bool(settings, "CQM");
info("debug info:");
}