summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbrjake <[email protected]>2009-02-10 22:57:21 +0000
committerjbrjake <[email protected]>2009-02-10 22:57:21 +0000
commitae6f965cd5438c9e9c09f3d6270ef811ecc94035 (patch)
tree9434d4da77809282400b7a5c2c84d981e938485d
parenta0ae27ea704a01f788c2137a45c5732081604d6a (diff)
Allows direct setting of job->vquality from interfaces in the native QP scales used by XviD and Theora instead of requiring conversion to a percentage.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2136 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/enctheora.c12
-rw-r--r--libhb/encxvid.c14
2 files changed, 21 insertions, 5 deletions
diff --git a/libhb/enctheora.c b/libhb/enctheora.c
index e340bade5..29dfed1b5 100644
--- a/libhb/enctheora.c
+++ b/libhb/enctheora.c
@@ -63,7 +63,7 @@ int enctheoraInit( hb_work_object_t * w, hb_job_t * job )
ti.keyframe_mindistance = 8;
ti.noise_sensitivity = 1;
ti.sharpness = 0;
- if (job->vquality < 0.0 || job->vquality > 1.0)
+ if (job->vquality < 0.0)
{
ti.target_bitrate = job->vbitrate * 1000;
ti.keyframe_data_target_bitrate = job->vbitrate * 1000 * 1.5;
@@ -72,7 +72,15 @@ int enctheoraInit( hb_work_object_t * w, hb_job_t * job )
else
{
ti.target_bitrate = 0;
- ti.quality = 63 * job->vquality;
+
+ if( job->vquality > 0 && job->vquality < 1 )
+ {
+ ti.quality = 63 * job->vquality;
+ }
+ else
+ {
+ ti.quality = job->vquality;
+ }
}
theora_encode_init( &pv->theora, &ti );
diff --git a/libhb/encxvid.c b/libhb/encxvid.c
index 6feadb770..843d12adf 100644
--- a/libhb/encxvid.c
+++ b/libhb/encxvid.c
@@ -63,7 +63,7 @@ int encxvidInit( hb_work_object_t * w, hb_job_t * job )
case 0:
memset( &single, 0, sizeof( single ) );
single.version = XVID_VERSION;
- if( job->vquality < 0.0 || job->vquality > 1.0 )
+ if( job->vquality < 0.0 )
{
/* Rate control */
single.bitrate = 1000 * job->vbitrate;
@@ -71,8 +71,16 @@ int encxvidInit( hb_work_object_t * w, hb_job_t * job )
}
else
{
- /* Constant quantizer */
- pv->quant = 31 - job->vquality * 30;
+ if( job->vquality > 0 && job->vquality < 1 )
+ {
+ /* Constant quantizer */
+ pv->quant = 31 - job->vquality * 30;
+ }
+ else
+ {
+ pv->quant = job->vquality;
+ }
+
hb_log( "encxvid: encoding at constant quantizer %d",
pv->quant );
}