MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / ghb_vquality_default

Function ghb_vquality_default

gtk/src/hb-backend.c:1065–1103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1063}
1064
1065float
1066ghb_vquality_default(signal_user_data_t *ud)
1067{
1068 float quality;
1069 gint vcodec;
1070 vcodec = ghb_settings_video_encoder_codec(ud->settings, "VideoEncoder");
1071
1072 switch (vcodec)
1073 {
1074 case HB_VCODEC_X265_8BIT:
1075 case HB_VCODEC_X265_10BIT:
1076 case HB_VCODEC_X265_12BIT:
1077 case HB_VCODEC_X265_16BIT:
1078 case HB_VCODEC_X264_8BIT:
1079 case HB_VCODEC_X264_10BIT:
1080 return 20;
1081 case HB_VCODEC_THEORA:
1082 return 45;
1083 case HB_VCODEC_FFMPEG_MPEG2:
1084 case HB_VCODEC_FFMPEG_MPEG4:
1085 return 3;
1086 case HB_VCODEC_SVT_AV1_8BIT:
1087 case HB_VCODEC_SVT_AV1_10BIT:
1088 return 30;
1089 default:
1090 {
1091 float min, max, step;
1092 int direction;
1093
1094 hb_video_quality_get_limits(vcodec, &min, &max, &step, &direction);
1095 // Pick something that is 70% of max
1096 // Probably too low for some and too high for others...
1097 quality = (max - min) * 0.7;
1098 if (direction)
1099 quality = max - quality;
1100 }
1101 }
1102 return quality;
1103}
1104
1105void
1106ghb_vquality_range(

Callers 1

vcodec_changed_cbFunction · 0.85

Tested by

no test coverage detected