diff options
author | jbrjake <[email protected]> | 2007-01-04 19:48:54 +0000 |
---|---|---|
committer | jbrjake <[email protected]> | 2007-01-04 19:48:54 +0000 |
commit | 6481b2d707275c582b9cf90dbe96598082a1fe33 (patch) | |
tree | 4b1e8d56bb73b9e7c03e21532687f59d948e44a3 /libhb | |
parent | b30e6cee64f1005cd31f5deb00ca5120c9852d23 (diff) |
Added CRF x264 rate control method to HBTest.
Constant quantizer is maintained as the default so nothing changes:
HBTest -i input -o output -e x264 -q 0.60
Switch to constant rate factor by throwing a -Q on the end:
HBTest -i input -o output -e x264 -q 0.60 -Q
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@89 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/common.h | 3 | ||||
-rw-r--r-- | libhb/encx264.c | 20 |
2 files changed, 18 insertions, 5 deletions
diff --git a/libhb/common.h b/libhb/common.h index 0bd8971e3..eba152f35 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -124,7 +124,8 @@ struct hb_job_s int pass; int h264_13; int h264_level; - + int crf; + /* Audio tracks: Indexes in hb_title_t's audios list, starting from 0. -1 indicates the end of the list */ diff --git a/libhb/encx264.c b/libhb/encx264.c index a72a9603e..1bc24866c 100644 --- a/libhb/encx264.c +++ b/libhb/encx264.c @@ -77,11 +77,23 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job ) if( job->vquality >= 0.0 && job->vquality <= 1.0 ) { - /* Constant QP */ - param.rc.i_rc_method = X264_RC_CQP; - param.rc.i_qp_constant = 51 - job->vquality * 51; - hb_log( "encx264: encoding at constant QP %d", + switch(job->crf) + { + case 1: + /*Constant RF*/ + param.rc.i_rc_method = X264_RC_CRF; + param.rc.f_rf_constant = 51 - job->vquality * 51; + hb_log( "encx264: Encoding at constant RF %f", param.rc.f_rf_constant ); + break; + + case 0: + /*Constant QP*/ + param.rc.i_rc_method = X264_RC_CQP; + param.rc.i_qp_constant = 51 - job->vquality * 51; + hb_log( "encx264: encoding at constant QP %d", param.rc.i_qp_constant ); + break; + } } else { |