diff options
author | jstebbins <[email protected]> | 2009-10-19 20:32:20 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-10-19 20:32:20 +0000 |
commit | 23fb2706d3b4e2594829d70275df8c4c21f07688 (patch) | |
tree | b800967dbbbf21c062b35762a2ce70fdf6219a77 | |
parent | 41dc72b96a5b99eb0d80439b95c0b02efc9f84af (diff) |
remove crf flag and all uses of it
x264 encodes will only use crf now. qp mode is gone.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2891 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | gtk/src/hb-backend.c | 1 | ||||
-rw-r--r-- | gtk/src/queuehandler.c | 2 | ||||
-rw-r--r-- | libhb/common.h | 2 | ||||
-rw-r--r-- | libhb/encx264.c | 44 | ||||
-rw-r--r-- | libhb/work.c | 2 | ||||
-rw-r--r-- | test/test.c | 18 |
6 files changed, 11 insertions, 58 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 9e6eff708..396eae561 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -4309,7 +4309,6 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex) dest_str = ghb_settings_get_string(js, "destination"); job->file = dest_str; - job->crf = 1; const GValue *subtitle_list; gint subtitle; diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c index 75432872e..761072300 100644 --- a/gtk/src/queuehandler.c +++ b/gtk/src/queuehandler.c @@ -256,7 +256,7 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) vqvalue = ghb_settings_get_double(settings, "VideoQualitySlider"); vq_desc = "Constant Quality:"; vqstr = g_strdup_printf("%d", (gint)vqvalue); - vq_units = "(crf)"; + vq_units = "(RF)"; } fps = ghb_settings_get_string(settings, "VideoFramerate"); if (strcmp("source", fps) == 0) diff --git a/libhb/common.h b/libhb/common.h index fb1f21198..15ab737bd 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -209,7 +209,6 @@ struct hb_job_s cfr: 0 (vfr), 1 (cfr), 2 (pfr) [see render.c] pass: 0, 1 or 2 (or -1 for scan) h264_level: vestigial boolean to decide if we're encoding for iPod - crf: boolean for whether to use constant rate factor with x264 x264opts: string of extra x264 options areBframes: boolean to note if b-frames are included in x264opts */ #define HB_VCODEC_MASK 0x0000FF @@ -227,7 +226,6 @@ struct hb_job_s int pass; int h264_13; int h264_level; - int crf; char *x264opts; int areBframes; int color_matrix; diff --git a/libhb/encx264.c b/libhb/encx264.c index 99dc35193..efccf7c05 100644 --- a/libhb/encx264.c +++ b/libhb/encx264.c @@ -312,47 +312,19 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job ) if( job->vquality > 0.0 && job->vquality < 1.0 ) { - 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; - } + /*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 ); } else if( job->vquality == 0 || job->vquality >= 1.0 ) { /* Use the vquality as a raw RF or QP instead of treating it like a percentage. */ - switch( job->crf ) - { - case 1: - /*Constant RF*/ - param.rc.i_rc_method = X264_RC_CRF; - param.rc.f_rf_constant = job->vquality; - 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 = job->vquality; - hb_log( "encx264: encoding at constant QP %d", - param.rc.i_qp_constant ); - break; - } + /*Constant RF*/ + param.rc.i_rc_method = X264_RC_CRF; + param.rc.f_rf_constant = job->vquality; + hb_log( "encx264: Encoding at constant RF %f", param.rc.f_rf_constant ); } else { diff --git a/libhb/work.c b/libhb/work.c index 752839bce..2209b15f2 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -273,7 +273,7 @@ void hb_display_job_info( hb_job_t * job ) } else if( job->vquality > 1 ) { - hb_log( " + quality: %.2f %s", job->vquality, job->crf && job->vcodec == HB_VCODEC_X264 ? "(RF)" : "(QP)" ); + hb_log( " + quality: %.2f %s", job->vquality, job->vcodec == HB_VCODEC_X264 ? "(RF)" : "(QP)" ); } else { diff --git a/test/test.c b/test/test.c index 41bbe51e0..7b5f11b23 100644 --- a/test/test.c +++ b/test/test.c @@ -99,7 +99,6 @@ static int chapter_start = 0; static int chapter_end = 0; static int chapter_markers = 0; static char * marker_file = NULL; -static int crf = 1; static char *x264opts = NULL; static char *x264opts2 = NULL; static int maxHeight = 0; @@ -591,7 +590,6 @@ static int HandleEvents( hb_handle_t * h ) } vcodec = HB_VCODEC_X264; job->vquality = 20.0; - job->crf = 1; if( !atracks ) { atracks = strdup("1,1"); @@ -674,7 +672,6 @@ static int HandleEvents( hb_handle_t * h ) } vcodec = HB_VCODEC_X264; job->vquality = 20.0; - job->crf = 1; if( !atracks ) { atracks = strdup("1"); @@ -716,7 +713,6 @@ static int HandleEvents( hb_handle_t * h ) job->largeFileSize = 1; vcodec = HB_VCODEC_X264; job->vquality = 20.0; - job->crf = 1; if( !atracks ) { atracks = strdup("1,1"); @@ -758,7 +754,6 @@ static int HandleEvents( hb_handle_t * h ) } vcodec = HB_VCODEC_X264; job->vquality = 20.0; - job->crf = 1; if( !atracks ) { atracks = strdup("1"); @@ -799,7 +794,6 @@ static int HandleEvents( hb_handle_t * h ) } vcodec = HB_VCODEC_X264; job->vquality = 20.0; - job->crf = 1; if( !atracks ) { atracks = strdup("1,1"); @@ -1937,11 +1931,6 @@ static int HandleEvents( hb_handle_t * h ) job->file = strdup( output ); - if( crf ) - { - job->crf = 1; - } - if( color_matrix ) { job->color_matrix = color_matrix; @@ -2208,7 +2197,6 @@ static void ShowHelp() " same style as mencoder:\n" " option1=value1:option2=value2\n" " -q, --quality <float> Set video quality (0.0..1.0)\n" - " -Q, --cqp Use with -q for CQP instead of CRF\n" " -S, --size <MB> Set target size\n" " -b, --vb <kb/s> Set video bitrate (default: 1000)\n" " -2, --two-pass Use two-pass mode\n" @@ -2565,7 +2553,6 @@ static int ParseOptions( int argc, char ** argv ) { "ab", required_argument, NULL, 'B' }, { "rate", required_argument, NULL, 'r' }, { "arate", required_argument, NULL, 'R' }, - { "cqp", no_argument, NULL, 'Q' }, { "x264opts", required_argument, NULL, 'x' }, { "turbo", no_argument, NULL, 'T' }, { "maxHeight", required_argument, NULL, 'Y' }, @@ -2588,7 +2575,7 @@ static int ParseOptions( int argc, char ** argv ) int c; c = getopt_long( argc, argv, - "hv::uC:f:4i:Io:t:Lc:m::M:a:A:6:s:UF::N:e:E:2dD:7895gOw:l:n:b:q:S:B:r:R:Qx:TY:X:Z:z", + "hv::uC:f:4i:Io:t:Lc:m::M:a:A:6:s:UF::N:e:E:2dD:7895gOw:l:n:b:q:S:B:r:R:x:TY:X:Z:z", long_options, &option_index ); if( c < 0 ) { @@ -2963,9 +2950,6 @@ static int ParseOptions( int argc, char ** argv ) abitrates = strdup( optarg ); } break; - case 'Q': - crf = 0; - break; case 'x': x264opts = strdup( optarg ); break; |