|
@@ -159,6 +159,7 @@ static void obs_qsv_defaults(obs_data_t *settings)
|
|
|
|
|
|
|
|
obs_data_set_default_int(settings, "keyint_sec", 3);
|
|
obs_data_set_default_int(settings, "keyint_sec", 3);
|
|
|
obs_data_set_default_int(settings, "bframes", 3);
|
|
obs_data_set_default_int(settings, "bframes", 3);
|
|
|
|
|
+ obs_data_set_default_bool(settings, "mbbrc", true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static inline void add_strings(obs_property_t *list, const char *const *strings)
|
|
static inline void add_strings(obs_property_t *list, const char *const *strings)
|
|
@@ -181,7 +182,13 @@ static inline void add_strings(obs_property_t *list, const char *const *strings)
|
|
|
#define TEXT_LA_DEPTH obs_module_text("LookAheadDepth")
|
|
#define TEXT_LA_DEPTH obs_module_text("LookAheadDepth")
|
|
|
#define TEXT_KEYINT_SEC obs_module_text("KeyframeIntervalSec")
|
|
#define TEXT_KEYINT_SEC obs_module_text("KeyframeIntervalSec")
|
|
|
#define TEXT_BFRAMES obs_module_text("B Frames")
|
|
#define TEXT_BFRAMES obs_module_text("B Frames")
|
|
|
|
|
+#define TEXT_MBBRC obs_module_text("Content Adaptive Quantization")
|
|
|
|
|
|
|
|
|
|
+static inline bool is_skl_or_greater_platform()
|
|
|
|
|
+{
|
|
|
|
|
+ enum qsv_cpu_platform plat = qsv_get_cpu_platform();
|
|
|
|
|
+ return (plat >= QSV_CPU_PLATFORM_SKL);
|
|
|
|
|
+}
|
|
|
static bool rate_control_modified(obs_properties_t *ppts, obs_property_t *p,
|
|
static bool rate_control_modified(obs_properties_t *ppts, obs_property_t *p,
|
|
|
obs_data_t *settings)
|
|
obs_data_t *settings)
|
|
|
{
|
|
{
|
|
@@ -223,6 +230,12 @@ static bool rate_control_modified(obs_properties_t *ppts, obs_property_t *p,
|
|
|
p = obs_properties_get(ppts, "la_depth");
|
|
p = obs_properties_get(ppts, "la_depth");
|
|
|
obs_property_set_visible(p, bVisible);
|
|
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");
|
|
|
|
|
+ obs_property_set_visible(p, bVisible);
|
|
|
|
|
+
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -283,6 +296,9 @@ static obs_properties_t *obs_qsv_props(void *unused)
|
|
|
obs_properties_add_int(props, "la_depth", TEXT_LA_DEPTH, 10, 100, 1);
|
|
obs_properties_add_int(props, "la_depth", TEXT_LA_DEPTH, 10, 100, 1);
|
|
|
obs_properties_add_int(props, "bframes", TEXT_BFRAMES, 0, 3, 1);
|
|
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);
|
|
|
|
|
+
|
|
|
return props;
|
|
return props;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -309,6 +325,7 @@ static void update_params(struct obs_qsv *obsqsv, obs_data_t *settings)
|
|
|
int keyint_sec = (int)obs_data_get_int(settings, "keyint_sec");
|
|
int keyint_sec = (int)obs_data_get_int(settings, "keyint_sec");
|
|
|
bool cbr_override = obs_data_get_bool(settings, "cbr");
|
|
bool cbr_override = obs_data_get_bool(settings, "cbr");
|
|
|
int bFrames = (int)obs_data_get_int(settings, "bframes");
|
|
int bFrames = (int)obs_data_get_int(settings, "bframes");
|
|
|
|
|
+ bool mbbrc = obs_data_get_bool(settings, "mbbrc");
|
|
|
|
|
|
|
|
if (obs_data_has_user_value(settings, "bf"))
|
|
if (obs_data_has_user_value(settings, "bf"))
|
|
|
bFrames = (int)obs_data_get_int(settings, "bf");
|
|
bFrames = (int)obs_data_get_int(settings, "bf");
|
|
@@ -373,6 +390,7 @@ static void update_params(struct obs_qsv *obsqsv, obs_data_t *settings)
|
|
|
obsqsv->params.nbFrames = (mfxU16)bFrames;
|
|
obsqsv->params.nbFrames = (mfxU16)bFrames;
|
|
|
obsqsv->params.nKeyIntSec = (mfxU16)keyint_sec;
|
|
obsqsv->params.nKeyIntSec = (mfxU16)keyint_sec;
|
|
|
obsqsv->params.nICQQuality = (mfxU16)icq_quality;
|
|
obsqsv->params.nICQQuality = (mfxU16)icq_quality;
|
|
|
|
|
+ obsqsv->params.bMBBRC = mbbrc;
|
|
|
|
|
|
|
|
info("settings:\n\trate_control: %s", rate_control);
|
|
info("settings:\n\trate_control: %s", rate_control);
|
|
|
|
|
|