From f47fc81d32f0222afb8102c3ed0f72c76a120610 Mon Sep 17 00:00:00 2001 From: derrod Date: Sat, 16 Mar 2024 00:22:02 +0100 Subject: [PATCH] obs-qsv11: Remove adaptive CQM option Without setting the ScenarioInfo to game streaming, which was removed in 03b70f06722b1d193c6cff852247f0da83e6dbb9, this is a no-op and its existence is just confusing to users. --- plugins/obs-qsv11/QSV_Encoder.h | 1 - plugins/obs-qsv11/QSV_Encoder_Internal.cpp | 11 ------ plugins/obs-qsv11/QSV_Encoder_Internal.h | 1 - plugins/obs-qsv11/data/locale/en-US.ini | 1 - plugins/obs-qsv11/obs-qsv11.c | 46 +--------------------- 5 files changed, 2 insertions(+), 58 deletions(-) diff --git a/plugins/obs-qsv11/QSV_Encoder.h b/plugins/obs-qsv11/QSV_Encoder.h index 8c2b83cff..8bbd9b2db 100644 --- a/plugins/obs-qsv11/QSV_Encoder.h +++ b/plugins/obs-qsv11/QSV_Encoder.h @@ -128,7 +128,6 @@ typedef struct { mfxU32 MinDisplayMasteringLuminance; mfxU16 MaxContentLightLevel; mfxU16 MaxPicAverageLightLevel; - bool bCQM; bool video_fmt_10bit; bool bRepeatHeaders; } qsv_param_t; diff --git a/plugins/obs-qsv11/QSV_Encoder_Internal.cpp b/plugins/obs-qsv11/QSV_Encoder_Internal.cpp index c35e8d5b7..f8c681ab4 100644 --- a/plugins/obs-qsv11/QSV_Encoder_Internal.cpp +++ b/plugins/obs-qsv11/QSV_Encoder_Internal.cpp @@ -276,10 +276,6 @@ mfxStatus QSV_Encoder_Internal::InitParams(qsv_param_t *pParams, else m_co2.RepeatPPS = MFX_CODINGOPTION_OFF; - memset(&m_co3, 0, sizeof(mfxExtCodingOption3)); - m_co3.Header.BufferId = MFX_EXTBUFF_CODING_OPTION3; - m_co3.Header.BufferSz = sizeof(m_co3); - if (pParams->nbFrames > 1) m_co2.BRefType = MFX_B_REF_PYRAMID; @@ -307,16 +303,9 @@ mfxStatus QSV_Encoder_Internal::InitParams(qsv_param_t *pParams, m_mfxEncParams.mfx.LowPower == MFX_CODINGOPTION_ON) { m_co2.LookAheadDepth = pParams->nLADEPTH; } - // CQM to follow UI setting - if (pParams->bCQM && !pParams->bRepeatHeaders) { - m_co3.AdaptiveCQM = MFX_CODINGOPTION_ON; - } else { - m_co3.AdaptiveCQM = MFX_CODINGOPTION_OFF; - } } extendedBuffers.push_back((mfxExtBuffer *)&m_co2); - extendedBuffers.push_back((mfxExtBuffer *)&m_co3); if (codec == QSV_CODEC_HEVC) { if ((pParams->nWidth & 15) || (pParams->nHeight & 15)) { diff --git a/plugins/obs-qsv11/QSV_Encoder_Internal.h b/plugins/obs-qsv11/QSV_Encoder_Internal.h index b3e98bc79..9377c7453 100644 --- a/plugins/obs-qsv11/QSV_Encoder_Internal.h +++ b/plugins/obs-qsv11/QSV_Encoder_Internal.h @@ -117,7 +117,6 @@ private: mfxU16 m_nPPSBufferSize; mfxVideoParam m_parameter; std::vector extendedBuffers; - mfxExtCodingOption3 m_co3; mfxExtCodingOption2 m_co2; mfxExtCodingOption m_co; mfxExtHEVCParam m_ExtHEVCParam{}; diff --git a/plugins/obs-qsv11/data/locale/en-US.ini b/plugins/obs-qsv11/data/locale/en-US.ini index e20734cac..951572ec0 100644 --- a/plugins/obs-qsv11/data/locale/en-US.ini +++ b/plugins/obs-qsv11/data/locale/en-US.ini @@ -7,7 +7,6 @@ Profile="Profile" ICQQuality="ICQ Quality" Latency="Latency" Latency.ToolTip="There is trade-off between latency and quality.\nIf your case prefers on quality, please select 'normal' mode, which may get > 2s end-to-end latency.\nIf your case requires < 500ms end-to-end latency, please select 'ultra-low' mode." -SubjectiveVideoEnhancements="Subjective Video Enhancements" 8bitUnsupportedHdr="OBS does not support 8-bit output of Rec. 2100." 10bitUnsupportedAvc="Cannot perform 10-bit encode on Intel QSV H.264 encoder." 16bitUnsupported="Cannot perform 16-bit encode on this encoder." diff --git a/plugins/obs-qsv11/obs-qsv11.c b/plugins/obs-qsv11/obs-qsv11.c index a4aefda2e..cf9d2b8fe 100644 --- a/plugins/obs-qsv11/obs-qsv11.c +++ b/plugins/obs-qsv11/obs-qsv11.c @@ -187,7 +187,6 @@ static void obs_qsv_defaults(obs_data_t *settings, int ver, obs_data_set_default_int(settings, "keyint_sec", 0); obs_data_set_default_string(settings, "latency", "normal"); obs_data_set_default_int(settings, "bframes", 3); - obs_data_set_default_bool(settings, "enhancements", true); obs_data_set_default_bool(settings, "repeat_headers", false); } @@ -240,8 +239,6 @@ static inline void add_translated_strings(obs_property_t *list, #define TEXT_ICQ_QUALITY obs_module_text("ICQQuality") #define TEXT_KEYINT_SEC obs_module_text("KeyframeIntervalSec") #define TEXT_BFRAMES obs_module_text("BFrames") -#define TEXT_PERCEPTUAL_ENHANCEMENTS \ - obs_module_text("SubjectiveVideoEnhancements") static inline bool is_skl_or_greater_platform() { @@ -316,31 +313,6 @@ static bool update_ratecontrol(obs_data_t *settings) return true; } -static bool update_enhancements(obs_data_t *settings) -{ - bool update = false; - bool mbbrc = true; - if (obs_data_item_byname(settings, "mbbrc") != NULL) { - mbbrc = (bool)obs_data_get_bool(settings, "mbbrc"); - obs_data_erase(settings, "mbbrc"); - update = true; - } - - bool cqm = false; - if (obs_data_item_byname(settings, "CQM") != NULL) { - cqm = (bool)obs_data_get_bool(settings, "CQM"); - obs_data_erase(settings, "CQM"); - update = true; - } - - if (update) { - bool enabled = (mbbrc && cqm); - obs_data_set_bool(settings, "enhancements", enabled); - } - - return true; -} - static void update_targetusage(obs_data_t *settings) { const char *target_usage = @@ -398,13 +370,7 @@ static bool rate_control_modified(obs_properties_t *ppts, obs_property_t *p, p = obs_properties_get(ppts, "icq_quality"); obs_property_set_visible(p, bVisible); - bVisible = astrcmpi(rate_control, "CBR") == 0 || - astrcmpi(rate_control, "VBR") == 0; - p = obs_properties_get(ppts, "enhancements"); - obs_property_set_visible(p, bVisible); - update_latency(settings); - update_enhancements(settings); update_targetusage(settings); update_ratecontrol(settings); @@ -505,9 +471,6 @@ static obs_properties_t *obs_qsv_props(enum qsv_codec codec, void *unused, obs_properties_add_int(props, "bframes", TEXT_BFRAMES, 0, 3, 1); - if (is_skl_or_greater_platform()) - obs_properties_add_bool(props, "enhancements", - TEXT_PERCEPTUAL_ENHANCEMENTS); return props; } @@ -540,7 +503,6 @@ static void update_params(struct obs_qsv *obsqsv, obs_data_t *settings) video_t *video = obs_encoder_video(obsqsv->encoder); const struct video_output_info *voi = video_output_get_info(video); update_latency(settings); - update_enhancements(settings); update_targetusage(settings); const char *target_usage = @@ -560,7 +522,6 @@ 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 enhancements = obs_data_get_bool(settings, "enhancements"); bool repeat_headers = obs_data_get_bool(settings, "repeat_headers"); const char *codec = ""; @@ -744,7 +705,6 @@ 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.bCQM = enhancements; obsqsv->params.bRepeatHeaders = repeat_headers; info("settings:\n" @@ -782,14 +742,12 @@ static void update_params(struct obs_qsv *obsqsv, obs_data_t *settings) "\tkeyint: %d\n" "\tlatency: %s\n" "\tb-frames: %d\n" - "\tenhancements: %s\n" "\tfps_num: %d\n" "\tfps_den: %d\n" "\twidth: %d\n" "\theight: %d", - target_usage, profile, keyint_sec, latency, bFrames, - enhancements ? "on" : "off", voi->fps_num, voi->fps_den, width, - height); + target_usage, profile, keyint_sec, latency, bFrames, voi->fps_num, + voi->fps_den, width, height); info("debug info:"); }