libs: encoder: refine guard of bitrate control mode

Remove useless guard of all bitrate control mode's guard except MB
which is define in VA-API version 0.39.1.
This commit is contained in:
Wangfei 2019-07-01 16:52:00 +08:00 committed by Víctor Manuel Jáquez Leal
parent 1e36478b0f
commit 66d6754fce

View file

@ -328,20 +328,16 @@ string_of_VARateControl (guint rate_control)
switch (rate_control) { switch (rate_control) {
case VA_RC_NONE: case VA_RC_NONE:
return "None"; return "None";
#ifdef VA_RC_CQP
case VA_RC_CQP: case VA_RC_CQP:
return "CQP"; return "CQP";
#endif
case VA_RC_CBR: case VA_RC_CBR:
return "CBR"; return "CBR";
case VA_RC_VCM: case VA_RC_VCM:
return "VCM"; return "VCM";
case VA_RC_VBR: case VA_RC_VBR:
return "VBR"; return "VBR";
#ifdef VA_RC_VBR_CONSTRAINED
case VA_RC_VBR_CONSTRAINED: case VA_RC_VBR_CONSTRAINED:
return "VBR-Constrained"; return "VBR-Constrained";
#endif
default: default:
break; break;
} }
@ -697,21 +693,17 @@ from_GstVaapiRateControl (guint value)
switch (value) { switch (value) {
case GST_VAAPI_RATECONTROL_NONE: case GST_VAAPI_RATECONTROL_NONE:
return VA_RC_NONE; return VA_RC_NONE;
#ifdef VA_RC_CQP
case GST_VAAPI_RATECONTROL_CQP: case GST_VAAPI_RATECONTROL_CQP:
return VA_RC_CQP; return VA_RC_CQP;
#endif
case GST_VAAPI_RATECONTROL_CBR: case GST_VAAPI_RATECONTROL_CBR:
return VA_RC_CBR; return VA_RC_CBR;
case GST_VAAPI_RATECONTROL_VCM: case GST_VAAPI_RATECONTROL_VCM:
return VA_RC_VCM; return VA_RC_VCM;
case GST_VAAPI_RATECONTROL_VBR: case GST_VAAPI_RATECONTROL_VBR:
return VA_RC_VBR; return VA_RC_VBR;
#ifdef VA_RC_VBR_CONSTRAINED
case GST_VAAPI_RATECONTROL_VBR_CONSTRAINED: case GST_VAAPI_RATECONTROL_VBR_CONSTRAINED:
return VA_RC_VBR_CONSTRAINED; return VA_RC_VBR_CONSTRAINED;
#endif #if VA_CHECK_VERSION(0,39,1)
#ifdef VA_RC_MB
case GST_VAAPI_RATECONTROL_MB: case GST_VAAPI_RATECONTROL_MB:
return VA_RC_MB; return VA_RC_MB;
#endif #endif
@ -726,21 +718,17 @@ to_GstVaapiRateControl (guint value)
switch (value) { switch (value) {
case VA_RC_NONE: case VA_RC_NONE:
return GST_VAAPI_RATECONTROL_NONE; return GST_VAAPI_RATECONTROL_NONE;
#ifdef VA_RC_CQP
case VA_RC_CQP: case VA_RC_CQP:
return GST_VAAPI_RATECONTROL_CQP; return GST_VAAPI_RATECONTROL_CQP;
#endif
case VA_RC_CBR: case VA_RC_CBR:
return GST_VAAPI_RATECONTROL_CBR; return GST_VAAPI_RATECONTROL_CBR;
case VA_RC_VCM: case VA_RC_VCM:
return GST_VAAPI_RATECONTROL_VCM; return GST_VAAPI_RATECONTROL_VCM;
case VA_RC_VBR: case VA_RC_VBR:
return GST_VAAPI_RATECONTROL_VBR; return GST_VAAPI_RATECONTROL_VBR;
#ifdef VA_RC_VBR_CONSTRAINED
case VA_RC_VBR_CONSTRAINED: case VA_RC_VBR_CONSTRAINED:
return GST_VAAPI_RATECONTROL_VBR_CONSTRAINED; return GST_VAAPI_RATECONTROL_VBR_CONSTRAINED;
#endif #if VA_CHECK_VERSION(0,39,1)
#ifdef VA_RC_MB
case VA_RC_MB: case VA_RC_MB:
return GST_VAAPI_RATECONTROL_MB; return GST_VAAPI_RATECONTROL_MB;
#endif #endif