summaryrefslogtreecommitdiffstats
path: root/gtk/src/hb-backend.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-02-11 01:22:50 +0000
committerjstebbins <[email protected]>2009-02-11 01:22:50 +0000
commit8fe4592112acf80dd8fba8de130196e8a12a2c46 (patch)
tree7b0a89947938c64fc1d680b434582367b2d57aa4 /gtk/src/hb-backend.c
parente6fa09bc4f3b7b093454e34805ae491d3f5ab71d (diff)
LinGui: Constant Quality Slider now QP/RF based
Nearest percentage is also shown for reference git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2138 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/hb-backend.c')
-rw-r--r--gtk/src/hb-backend.c102
1 files changed, 48 insertions, 54 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index 227d96373..fe6b7c41c 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -529,41 +529,46 @@ ghb_vquality_range(
gdouble *max,
gdouble *step,
gdouble *page,
- gint *digits)
+ gint *digits,
+ gboolean *inverted)
{
- if (ghb_settings_get_boolean(ud->settings, "directqp"))
+ gint vcodec = ghb_settings_combo_int(ud->settings, "VideoEncoder");
+ *step = 1;
+ *page = 10;
+ *digits = 0;
+ switch (vcodec)
{
- gint vcodec = ghb_settings_combo_int(ud->settings, "VideoEncoder");
- // Only x264 and ffmpeg currently support direct qp/crf entry
- *step = 1;
- *page = 10;
- *digits = 0;
- if (vcodec == HB_VCODEC_X264)
+ case HB_VCODEC_X264:
{
*min = 0;
*max = 51;
- }
- else if (vcodec == HB_VCODEC_FFMPEG)
+ *step = 0.1;
+ *digits = 3;
+ *inverted = TRUE;
+ } break;
+
+ case HB_VCODEC_XVID:
+ case HB_VCODEC_FFMPEG:
{
- *min = 0;
+ *min = 1;
*max = 31;
- }
- else
+ *inverted = TRUE;
+ } break;
+
+ case HB_VCODEC_THEORA:
{
*min = 0;
- *max = 1.0;
- *step = 0.001;
- *page = 0.1;
+ *max = 63;
+ *inverted = FALSE;
+ } break;
+
+ default:
+ {
+ *min = 0;
+ *max = 100;
*digits = 3;
- }
- }
- else
- {
- *min = 0;
- *max = 1.0;
- *step = 0.001;
- *page = 0.1;
- *digits = 3;
+ *inverted = FALSE;
+ } break;
}
}
@@ -3048,38 +3053,32 @@ ghb_validate_vquality(GValue *settings)
vquality = ghb_settings_get_double(settings, "VideoQualitySlider");
if (ghb_settings_get_boolean(settings, "vquality_type_constant"))
{
- if (!ghb_settings_get_boolean(settings, "directqp"))
+ switch (vcodec)
{
- vquality *= 100.0;
- if (vcodec != HB_VCODEC_X264)
- {
- min = 68;
- max = 97;
- }
- else
- {
- min = 40;
- max = 70;
- }
- }
- else
- {
- if (vcodec == HB_VCODEC_X264)
+ case HB_VCODEC_X264:
{
min = 16;
max = 30;
- }
- else if (vcodec == HB_VCODEC_FFMPEG)
+ } break;
+
+ case HB_VCODEC_XVID:
+ case HB_VCODEC_FFMPEG:
{
min = 1;
max = 8;
- }
- else
+ } break;
+
+ case HB_VCODEC_THEORA:
{
- min = 68;
- max = 97;
- vquality *= 100.0;
- }
+ min = 0;
+ max = 63;
+ } break;
+
+ default:
+ {
+ min = 48;
+ max = 62;
+ } break;
}
if (vquality < min || vquality > max)
{
@@ -3303,11 +3302,6 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
{
gdouble vquality;
vquality = ghb_settings_get_double(js, "VideoQualitySlider");
- if (!ghb_settings_get_boolean(js, "directqp"))
- {
- if (vquality == 0.0) vquality = 0.01;
- if (vquality == 1.0) vquality = 0.0;
- }
job->vquality = vquality;
job->vbitrate = 0;
}