diff options
-rw-r--r-- | gtk/src/hb-backend.c | 53 | ||||
-rw-r--r-- | libhb/common.c | 10 | ||||
-rw-r--r-- | libhb/common.h | 14 | ||||
-rw-r--r-- | libhb/encx264.c | 198 | ||||
-rw-r--r-- | libhb/encx264.h | 14 | ||||
-rw-r--r-- | libhb/hb.c | 4 | ||||
-rw-r--r-- | libhb/work.c | 4 | ||||
-rw-r--r-- | macosx/Controller.m | 39 | ||||
-rw-r--r-- | macosx/English.lproj/MainMenu.xib | 4 | ||||
-rwxr-xr-x | scripts/manicure.rb | 4 | ||||
-rw-r--r-- | test/test.c | 86 |
11 files changed, 228 insertions, 202 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 3426e5adc..bdd53c959 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -2085,53 +2085,35 @@ x264_tune_opts_set(GtkBuilder *builder, const gchar *name) } static void -x264_profile_opts_set(GtkBuilder *builder, const gchar *name) +h264_profile_opts_set(GtkBuilder *builder, const gchar *name) { GtkTreeIter iter; GtkListStore *store; gint ii, count = 0; const char * const *profiles; - profiles = hb_x264_profiles(); + profiles = hb_h264_profiles(); while (profiles && profiles[count]) count++; - g_debug("x264_profile_opts_set ()\n"); + g_debug("h264_profile_opts_set ()\n"); store = get_combo_box_store(builder, name); gtk_list_store_clear(store); - gtk_list_store_append(store, &iter); - gtk_list_store_set(store, &iter, - 0, "Auto", - 1, TRUE, - 2, "auto", - 3, (gdouble)0, - 4, "auto", - -1); - for (ii = 0; ii < count; ii++) { - // HandBrake doesn't support high10 (10 bit encoding) - // or high422 (YUV422) - if (!strcasecmp("high10", profiles[ii]) || - !strcasecmp("high422", profiles[ii]) || - !strcasecmp("high444", profiles[ii])) - { - continue; - } - gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, 0, profiles[ii], 1, TRUE, 2, profiles[ii], - 3, (gdouble)ii + 1, + 3, (gdouble)ii, 4, profiles[ii], -1); } } static void -x264_level_opts_set(GtkBuilder *builder, const gchar *name) +h264_level_opts_set(GtkBuilder *builder, const gchar *name) { GtkTreeIter iter; GtkListStore *store; @@ -2141,19 +2123,10 @@ x264_level_opts_set(GtkBuilder *builder, const gchar *name) levels = hb_h264_levels(); while (levels && levels[count]) count++; - g_debug("x264_level_opts_set ()\n"); + g_debug("h264_level_opts_set ()\n"); store = get_combo_box_store(builder, name); gtk_list_store_clear(store); - gtk_list_store_append(store, &iter); - gtk_list_store_set(store, &iter, - 0, "Auto", - 1, TRUE, - 2, "auto", - 3, (gdouble)0, - 4, "auto", - -1); - for (ii = 0; ii < count; ii++) { gtk_list_store_append(store, &iter); @@ -2161,7 +2134,7 @@ x264_level_opts_set(GtkBuilder *builder, const gchar *name) 0, levels[ii], 1, TRUE, 2, levels[ii], - 3, (gdouble)ii + 1, + 3, (gdouble)ii, 4, levels[ii], -1); } @@ -3040,8 +3013,8 @@ ghb_update_ui_combo_box( small_opts_set(ud->builder, "x264_analyse", &analyse_opts); small_opts_set(ud->builder, "x264_trellis", &trellis_opts); x264_tune_opts_set(ud->builder, "x264Tune"); - x264_profile_opts_set(ud->builder, "h264Profile"); - x264_level_opts_set(ud->builder, "h264Level"); + h264_profile_opts_set(ud->builder, "h264Profile"); + h264_level_opts_set(ud->builder, "h264Level"); } else { @@ -3074,9 +3047,9 @@ ghb_update_ui_combo_box( else if (strcmp(name, "x264Tune") == 0) x264_tune_opts_set(ud->builder, "x264Tune"); else if (strcmp(name, "h264Profile") == 0) - x264_profile_opts_set(ud->builder, "h264Profile"); + h264_profile_opts_set(ud->builder, "h264Profile"); else if (strcmp(name, "h264Level") == 0) - x264_level_opts_set(ud->builder, "h264Level"); + h264_level_opts_set(ud->builder, "h264Level"); else generic_opts_set(ud->builder, name, find_combo_table(name)); } @@ -3200,10 +3173,10 @@ void ghb_set_video_encoder_opts(hb_job_t *job, GValue *js) hb_job_set_x264_tune(job, tunes); if (profile != NULL && strcasecmp(profile, "auto")) - hb_job_set_x264_profile(job, profile); + hb_job_set_h264_profile(job, profile); if (level != NULL && strcasecmp(level, "auto")) - hb_job_set_x264_level(job, level); + hb_job_set_h264_level(job, level); hb_job_set_advanced_opts(job, opts); diff --git a/libhb/common.c b/libhb/common.c index 21729cd4f..355b458e5 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -1794,8 +1794,8 @@ static void job_clean( hb_job_t * job ) job->x264_preset = NULL; free(job->x264_tune); job->x264_tune = NULL; - free(job->x264_profile); - job->x264_profile = NULL; + free(job->h264_profile); + job->h264_profile = NULL; free(job->h264_level); job->h264_level = NULL; @@ -1935,15 +1935,15 @@ void hb_job_set_x264_tune( hb_job_t *job, const char *tune ) } } -void hb_job_set_x264_profile( hb_job_t *job, const char *profile ) +void hb_job_set_h264_profile( hb_job_t *job, const char *profile ) { if ( job ) { - hb_update_str( &job->x264_profile, profile ); + hb_update_str( &job->h264_profile, profile ); } } -void hb_job_set_x264_level( hb_job_t *job, const char *level ) +void hb_job_set_h264_level( hb_job_t *job, const char *level ) { if ( job ) { diff --git a/libhb/common.h b/libhb/common.h index 32a23d5fd..ac7d46287 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -122,8 +122,8 @@ void hb_fix_aspect( hb_job_t * job, int keep ); void hb_job_set_advanced_opts( hb_job_t *job, const char *advanced_opts ); void hb_job_set_x264_preset( hb_job_t *job, const char *preset ); void hb_job_set_x264_tune( hb_job_t *job, const char *tune ); -void hb_job_set_x264_profile( hb_job_t *job, const char *profile ); -void hb_job_set_x264_level( hb_job_t *job, const char *level ); +void hb_job_set_h264_profile( hb_job_t *job, const char *profile ); +void hb_job_set_h264_level( hb_job_t *job, const char *level ); void hb_job_set_file( hb_job_t *job, const char *file ); hb_audio_t *hb_audio_copy(const hb_audio_t *src); @@ -355,10 +355,10 @@ struct hb_job_s int cfr; int pass; int fastfirstpass; - char *advanced_opts; - char *x264_profile; char *x264_preset; char *x264_tune; + char *advanced_opts; + char *h264_profile; char *h264_level; int areBframes; @@ -1032,13 +1032,13 @@ const char * hb_subsource_name( int source ); // unparse a set of x264 settings to an HB encopts string char * hb_x264_param_unparse(const char *x264_preset, const char *x264_tune, - const char *x264_encopts, const char *x264_profile, + const char *x264_encopts, const char *h264_profile, const char *h264_level, int width, int height); -// x264 preset/tune/profile & h264 level helpers +// x264 preset/tune & h264 profile/level helpers const char * const * hb_x264_presets(); const char * const * hb_x264_tunes(); -const char * const * hb_x264_profiles(); +const char * const * hb_h264_profiles(); const char * const * hb_h264_levels(); // x264 option name/synonym helper diff --git a/libhb/encx264.c b/libhb/encx264.c index 503f46cd9..b52832416 100644 --- a/libhb/encx264.c +++ b/libhb/encx264.c @@ -275,9 +275,9 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job ) } /* Apply profile and level settings last, if present. */ - if (job->x264_profile != NULL && *job->x264_profile) + if (job->h264_profile != NULL && *job->h264_profile) { - if (x264_param_apply_profile(¶m, job->x264_profile)) + if (hb_apply_h264_profile(¶m, job->h264_profile, 1)) { free(pv); pv = NULL; @@ -287,7 +287,7 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job ) if (job->h264_level != NULL && *job->h264_level) { if (hb_apply_h264_level(¶m, job->h264_level, - job->x264_profile, 1) < 0) + job->h264_profile, 1) < 0) { free(pv); pv = NULL; @@ -629,6 +629,60 @@ int encx264Work( hb_work_object_t * w, hb_buffer_t ** buf_in, return HB_WORK_OK; } +int hb_apply_h264_profile(x264_param_t *param, const char *h264_profile, + int verbose) +{ + if (h264_profile != NULL && + strcasecmp(h264_profile, hb_h264_profile_names[0]) != 0) + { + /* + * baseline profile doesn't support interlacing + */ + if ((param->b_interlaced || + param->b_fake_interlaced) && + !strcasecmp(h264_profile, "baseline")) + { + if (verbose) + { + hb_log("hb_apply_h264_profile [warning]: baseline profile doesn't support interlacing, disabling"); + } + param->b_interlaced = param->b_fake_interlaced = 0; + } + /* + * lossless requires High 4:4:4 Predictive profile + */ + if (param->rc.f_rf_constant < 1.0 && + param->rc.i_rc_method == X264_RC_CRF && + strcasecmp(h264_profile, "high444") != 0) + { + if (verbose) + { + hb_log("hb_apply_h264_profile [warning]: lossless requires high444 profile, disabling"); + } + param->rc.f_rf_constant = 1.0; + } + if (!strcasecmp(h264_profile, "high10") || + !strcasecmp(h264_profile, "high422")) + { + // arbitrary profile names may be specified via the CLI + // map unsupported high10 and high422 profiles to high + return x264_param_apply_profile(param, "high"); + } + return x264_param_apply_profile(param, h264_profile); + } + else if (!strcasecmp(h264_profile, hb_h264_profile_names[0])) + { + // "auto", do nothing + return 0; + } + else + { + // error (profile not a string), abort + hb_error("hb_apply_h264_profile: no profile specified"); + return -1; + } +} + int hb_check_h264_level(const char *h264_level, int width, int height, int fps_num, int fps_den, int interlaced, int fake_interlaced) @@ -645,24 +699,65 @@ int hb_check_h264_level(const char *h264_level, int width, int height, } int hb_apply_h264_level(x264_param_t *param, const char *h264_level, - const char *x264_profile, int verbose) + const char *h264_profile, int verbose) { float f_framerate; const x264_level_t *x264_level = NULL; int i, i_mb_size, i_mb_rate, i_mb_width, i_mb_height, max_mb_side, ret; /* + * find the x264_level_t corresponding to the requested level + */ + if (h264_level != NULL && + strcasecmp(h264_level, hb_h264_level_names[0]) != 0) + { + for (i = 0; hb_h264_level_values[i]; i++) + { + if (!strcmp(hb_h264_level_names[i], h264_level)) + { + int val = hb_h264_level_values[i]; + for (i = 0; x264_levels[i].level_idc; i++) + { + if (x264_levels[i].level_idc == val) + { + x264_level = &x264_levels[i]; + break; + } + } + break; + } + } + if (x264_level == NULL) + { + // error (invalid or unsupported level), abort + hb_error("hb_apply_h264_level: invalid level %s", h264_level); + return -1; + } + } + else if(!strcasecmp(h264_level, hb_h264_level_names[0])) + { + // "auto", do nothing + return 0; + } + else + { + // error (level not a string), abort + hb_error("hb_apply_h264_level: no level specified"); + return -1; + } + + /* * the H.264 profile determines VBV constraints */ enum { // Main or Baseline (equivalent) - HB_H264_PROFILE_MAIN, + HB_ENCX264_PROFILE_MAIN, // High (no 4:2:2 or 10-bit support, so anything lossy is equivalent) - HB_H264_PROFILE_HIGH, + HB_ENCX264_PROFILE_HIGH, // Lossless (4:2:0 8-bit for now) - HB_H264_PROFILE_HIGH444, - } h264_profile; + HB_ENCX264_PROFILE_HIGH444, + } hb_encx264_profile; /* * H.264 profile @@ -674,21 +769,21 @@ int hb_apply_h264_level(x264_param_t *param, const char *h264_level, * re-enabled. */ #if 0 - if (x264_profile != NULL && *x264_profile) + if (h264_profile != NULL && *h264_profile) { // if the user explicitly specified a profile, don't guess it - if (!strcasecmp(x264_profile, "high444")) + if (!strcasecmp(h264_profile, "high444")) { - h264_profile = HB_H264_PROFILE_HIGH444; + hb_encx264_profile = HB_ENCX264_PROFILE_HIGH444; } - else if (!strcasecmp(x264_profile, "main") || - !strcasecmp(x264_profile, "baseline")) + else if (!strcasecmp(h264_profile, "main") || + !strcasecmp(h264_profile, "baseline")) { - h264_profile = HB_H264_PROFILE_MAIN; + hb_encx264_profile = HB_ENCX264_PROFILE_MAIN; } else { - h264_profile = HB_H264_PROFILE_HIGH; + hb_encx264_profile = HB_ENCX264_PROFILE_HIGH; } } else @@ -698,53 +793,18 @@ int hb_apply_h264_level(x264_param_t *param, const char *h264_level, if (param->rc.i_rc_method == X264_RC_CRF && param->rc.f_rf_constant < 1.0) { - h264_profile = HB_H264_PROFILE_HIGH444; + hb_encx264_profile = HB_ENCX264_PROFILE_HIGH444; } else if (param->analyse.b_transform_8x8 || param->i_cqm_preset != X264_CQM_FLAT) { - h264_profile = HB_H264_PROFILE_HIGH; + hb_encx264_profile = HB_ENCX264_PROFILE_HIGH; } else { - h264_profile = HB_H264_PROFILE_MAIN; - } - } - - /* - * find the x264_level_t corresponding to the requested level - */ - if (h264_level != NULL && *h264_level) - { - for (i = 0; hb_h264_level_values[i]; i++) - { - if (!strcmp(hb_h264_level_names[i], h264_level)) - { - int val = hb_h264_level_values[i]; - for (i = 0; x264_levels[i].level_idc; i++) - { - if (x264_levels[i].level_idc == val) - { - x264_level = &x264_levels[i]; - break; - } - } - break; - } - } - if (x264_level == NULL) - { - // error (invalid or unsupported level), abort - hb_error("hb_apply_h264_level: invalid level %s", h264_level); - return -1; + hb_encx264_profile = HB_ENCX264_PROFILE_MAIN; } } - else - { - // error (level not a string), abort - hb_error("hb_apply_h264_level: no level specified"); - return -1; - } /* * we need at least width and height in order to apply a level correctly @@ -825,10 +885,10 @@ int hb_apply_h264_level(x264_param_t *param, const char *h264_level, /* * set and/or sanitize the VBV (if not lossless) */ - if (h264_profile != HB_H264_PROFILE_HIGH444) + if (hb_encx264_profile != HB_ENCX264_PROFILE_HIGH444) { // High profile allows for higher VBV bufsize/maxrate - int cbp_factor = h264_profile == HB_H264_PROFILE_HIGH ? 5 : 4; + int cbp_factor = hb_encx264_profile == HB_ENCX264_PROFILE_HIGH ? 5 : 4; if (!param->rc.i_vbv_max_bitrate) { param->rc.i_vbv_max_bitrate = (x264_level->bitrate * cbp_factor) / 4; @@ -918,7 +978,7 @@ int hb_apply_h264_level(x264_param_t *param, const char *h264_level, } char * hb_x264_param_unparse(const char *x264_preset, const char *x264_tune, - const char *x264_encopts, const char *x264_profile, + const char *x264_encopts, const char *h264_profile, const char *h264_level, int width, int height) { int i; @@ -979,24 +1039,10 @@ char * hb_x264_param_unparse(const char *x264_preset, const char *x264_tune, /* * apply the x264 profile, if specified */ - if (x264_profile != NULL && *x264_profile) + if (h264_profile != NULL && *h264_profile) { - if (x264_param_apply_profile(¶m, x264_profile) < 0) - { - /* - * Note: x264_param_apply_profile can bail even when the specified - * profile is valid; examples: - * - * 1) when profile is baseline and interlaced is set - * 2) when profile is not high444 and lossless is set - * - * So this can happen even when calling hb_x264_param_unparse from a - * GUI - maybe we should sanitize settings before calling - * x264_param_apply_profile()? - */ - hb_dict_free(&x264_opts); - return strdup("hb_x264_param_unparse: could not apply x264 profile"); - } + // be quiet so at to not pollute GUI logs + hb_apply_h264_profile(¶m, h264_profile, 0); } /* @@ -1008,7 +1054,7 @@ char * hb_x264_param_unparse(const char *x264_preset, const char *x264_tune, param.i_width = width; param.i_height = height; // be quiet so at to not pollute GUI logs - hb_apply_h264_level(¶m, h264_level, x264_profile, 0); + hb_apply_h264_level(¶m, h264_level, h264_profile, 0); } /* @@ -1590,9 +1636,9 @@ const char * const * hb_x264_tunes() return x264_tune_names; } -const char * const * hb_x264_profiles() +const char * const * hb_h264_profiles() { - return x264_profile_names; + return hb_h264_profile_names; } const char * const * hb_h264_levels() diff --git a/libhb/encx264.h b/libhb/encx264.h index b989c6281..963797afe 100644 --- a/libhb/encx264.h +++ b/libhb/encx264.h @@ -9,8 +9,9 @@ #include "x264.h" -static const char * const hb_h264_level_names[] = { "1.0", "1b", "1.1", "1.2", "1.3", "2.0", "2.1", "2.2", "3.0", "3.1", "3.2", "4.0", "4.1", "4.2", "5.0", "5.1", "5.2", NULL }; -static const int const hb_h264_level_values[] = { 10, 9, 11, 12, 13, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51, 52, 0 }; +static const char * const hb_h264_profile_names[] = { "auto", "high", "main", "baseline", NULL, }; +static const char * const hb_h264_level_names[] = { "auto", "1.0", "1b", "1.1", "1.2", "1.3", "2.0", "2.1", "2.2", "3.0", "3.1", "3.2", "4.0", "4.1", "4.2", "5.0", "5.1", "5.2", NULL, }; +static const int const hb_h264_level_values[] = { -1, 10, 9, 11, 12, 13, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51, 52, 0, }; /* x264 preferred option names (left) and synonyms (right). * The "preferred" names match names used in x264's param2string function more @@ -68,3 +69,12 @@ int hb_check_h264_level(const char *h264_level, int width, int height, */ int hb_apply_h264_level(x264_param_t *param, const char *h264_level, const char *x264_profile, int verbose); + +/* + * Applies the restrictions of the requested H.264 profile to an x264_param_t. + * + * x264_param_apply_profile wrapper designed to always succeed when a valid + * H.264 profile is specified (unlike x264's function). + */ +int hb_apply_h264_profile(x264_param_t *param, const char *h264_profile, + int verbose); diff --git a/libhb/hb.c b/libhb/hb.c index ac9a7d015..43c5baa3c 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -1479,8 +1479,8 @@ void hb_add( hb_handle_t * h, hb_job_t * job ) job_copy->x264_preset = strdup( job->x264_preset ); if ( job->x264_tune ) job_copy->x264_tune = strdup( job->x264_tune ); - if ( job->x264_profile ) - job_copy->x264_profile = strdup( job->x264_profile ); + if ( job->h264_profile ) + job_copy->h264_profile = strdup( job->h264_profile ); if ( job->h264_level ) job_copy->h264_level = strdup( job->h264_level ); diff --git a/libhb/work.c b/libhb/work.c index 137b9434b..19389bf11 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -353,10 +353,10 @@ void hb_display_job_info( hb_job_t * job ) { hb_log( " + options: %s", job->advanced_opts ); } - if( job->x264_profile && *job->x264_profile && + if( job->h264_profile && *job->h264_profile && job->vcodec == HB_VCODEC_X264 ) { - hb_log( " + x264 profile: %s", job->x264_profile ); + hb_log( " + h264 profile: %s", job->h264_profile ); } if( job->h264_level && *job->h264_level && job->vcodec == HB_VCODEC_X264 ) diff --git a/macosx/Controller.m b/macosx/Controller.m index 13b324aca..1a4b1fa8d 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -2856,7 +2856,7 @@ fWorkingCount = 0; char *x264_preset_tmp = job->x264_preset != NULL ? strdup(job->x264_preset) : NULL; char *x264_tune_tmp = job->x264_tune != NULL ? strdup(job->x264_tune) : NULL; char *advanced_opts_tmp = job->advanced_opts != NULL ? strdup(job->advanced_opts) : NULL; - char *h264_profile_tmp = job->x264_profile != NULL ? strdup(job->x264_profile) : NULL; + char *h264_profile_tmp = job->h264_profile != NULL ? strdup(job->h264_profile) : NULL; char *h264_level_tmp = job->h264_level != NULL ? strdup(job->h264_level) : NULL; /* * When subtitle scan is enabled do a fast pre-scan job @@ -2865,8 +2865,8 @@ fWorkingCount = 0; hb_job_set_x264_preset (job, NULL); hb_job_set_x264_tune (job, NULL); hb_job_set_advanced_opts(job, NULL); - hb_job_set_x264_profile (job, NULL); - hb_job_set_x264_level (job, NULL); + hb_job_set_h264_profile (job, NULL); + hb_job_set_h264_level (job, NULL); job->pass = -1; hb_add(fQueueEncodeLibhb, job); /* @@ -2875,8 +2875,8 @@ fWorkingCount = 0; hb_job_set_x264_preset (job, x264_preset_tmp); hb_job_set_x264_tune (job, x264_tune_tmp); hb_job_set_advanced_opts(job, advanced_opts_tmp); - hb_job_set_x264_profile (job, h264_profile_tmp); - hb_job_set_x264_level (job, h264_level_tmp); + hb_job_set_h264_profile (job, h264_profile_tmp); + hb_job_set_h264_level (job, h264_level_tmp); free(x264_preset_tmp); free(x264_tune_tmp); free(advanced_opts_tmp); @@ -3306,8 +3306,8 @@ fWorkingCount = 0; hb_job_set_x264_preset (job, x264_preset); hb_job_set_x264_tune (job, x264_tune); hb_job_set_advanced_opts(job, advanced_opts); - hb_job_set_x264_profile (job, h264_profile); - hb_job_set_x264_level (job, h264_level); + hb_job_set_h264_profile (job, h264_profile); + hb_job_set_h264_level (job, h264_level); } else if (job->vcodec & HB_VCODEC_FFMPEG_MASK) { @@ -3831,8 +3831,8 @@ bool one_burned = FALSE; hb_job_set_x264_preset (job, x264_preset); hb_job_set_x264_tune (job, x264_tune); hb_job_set_advanced_opts(job, advanced_opts); - hb_job_set_x264_profile (job, h264_profile); - hb_job_set_x264_level (job, h264_level); + hb_job_set_h264_profile (job, h264_profile); + hb_job_set_h264_level (job, h264_level); } else if (job->vcodec & HB_VCODEC_FFMPEG_MASK) { @@ -5276,9 +5276,8 @@ the user is using "Custom" settings by determining the sender*/ NSUInteger i; /* * now we populate the x264 system widgets via hb_x264_presets(), - * hb_x264_tunes(), hb_x264_profiles(), hb_h264_levels() + * hb_x264_tunes(), hb_h264_profiles(), hb_h264_levels() */ - // store x264 preset names const char * const * x264_presets = hb_x264_presets(); NSMutableArray *tmp_array = [[NSMutableArray alloc] init]; @@ -5305,9 +5304,9 @@ the user is using "Custom" settings by determining the sender*/ [fX264TunePopUp addItemWithTitle: @"none"]; const char * const * x264_tunes = hb_x264_tunes(); for (int i = 0; x264_tunes[i] != NULL; i++) - { + { // we filter out "fastdecode" as we have a dedicated checkbox for it - if (strcasecmp(x264_tunes[i], "fastdecode")) + if (strcasecmp(x264_tunes[i], "fastdecode") != 0) { [fX264TunePopUp addItemWithTitle: [NSString stringWithUTF8String:x264_tunes[i]]]; } @@ -5316,18 +5315,16 @@ the user is using "Custom" settings by determining the sender*/ [fX264FastDecodeCheck setState: NSOffState]; // setup the h264 profile popup [fX264ProfilePopUp removeAllItems]; - [fX264ProfilePopUp addItemWithTitle: @"auto"]; - const char * const * x264_profiles = hb_x264_profiles(); - for (int i = 0; x264_profiles[i] != NULL; i++) - { - [fX264ProfilePopUp addItemWithTitle: [NSString stringWithUTF8String:x264_profiles[i]]]; + const char * const * h264_profiles = hb_h264_profiles(); + for (int i = 0; h264_profiles[i] != NULL; i++) + { + [fX264ProfilePopUp addItemWithTitle: [NSString stringWithUTF8String:h264_profiles[i]]]; } // setup the h264 level popup [fX264LevelPopUp removeAllItems]; - [fX264LevelPopUp addItemWithTitle: @"auto"]; const char * const * h264_levels = hb_h264_levels(); for (int i = 0; h264_levels[i] != NULL; i++) - { + { [fX264LevelPopUp addItemWithTitle: [NSString stringWithUTF8String:h264_levels[i]]]; } // clear the additional x264 options @@ -5554,7 +5551,7 @@ the user is using "Custom" settings by determining the sender*/ * char * hb_x264_param_unparse(const char *x264_preset, * const char *x264_tune, * const char *x264_encopts, - * const char *x264_profile, + * const char *h264_profile, * const char *h264_level, * int width, int height); */ diff --git a/macosx/English.lproj/MainMenu.xib b/macosx/English.lproj/MainMenu.xib index 41011e73d..a77f08d63 100644 --- a/macosx/English.lproj/MainMenu.xib +++ b/macosx/English.lproj/MainMenu.xib @@ -1076,7 +1076,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextFieldCell" key="NSCell" id="858212432"> <int key="NSCellFlags">67108864</int> <int key="NSCellFlags2">71303168</int> - <string key="NSContents">x264 Profile:</string> + <string key="NSContents">h264 Profile:</string> <reference key="NSSupport" ref="26"/> <reference key="NSControlView" ref="102651997"/> <reference key="NSBackgroundColor" ref="242973447"/> @@ -1095,7 +1095,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextFieldCell" key="NSCell" id="248169798"> <int key="NSCellFlags">67108864</int> <int key="NSCellFlags2">71303168</int> - <string key="NSContents">x264 Level:</string> + <string key="NSContents">h264 Level:</string> <reference key="NSSupport" ref="26"/> <reference key="NSControlView" ref="8023338"/> <reference key="NSBackgroundColor" ref="242973447"/> diff --git a/scripts/manicure.rb b/scripts/manicure.rb index f0fa0d184..1b331272c 100755 --- a/scripts/manicure.rb +++ b/scripts/manicure.rb @@ -1282,9 +1282,9 @@ class Display commandString << "}\n " end if hash["h264Profile"] != "" && hash["h264Profile"] != "auto" - commandString << "if (x264_profile == NULL)\n " + commandString << "if (h264_profile == NULL)\n " commandString << "{\n " - commandString << " x264_profile = strdup(\"" + commandString << " h264_profile = strdup(\"" commandString << hash["h264Profile"] << "\");\n " commandString << "}\n " end diff --git a/test/test.c b/test/test.c index ac031c5fc..7cd2d727e 100644 --- a/test/test.c +++ b/test/test.c @@ -112,10 +112,10 @@ static int chapter_start = 0; static int chapter_end = 0; static int chapter_markers = 0; static char * marker_file = NULL; -static char * advanced_opts = NULL; -static char * x264_profile = NULL; static char * x264_preset = NULL; static char * x264_tune = NULL; +static char * advanced_opts = NULL; +static char * h264_profile = NULL; static char * h264_level = NULL; static int maxHeight = 0; static int maxWidth = 0; @@ -371,7 +371,7 @@ int main( int argc, char ** argv ) free(x264_preset); free(x264_tune); free(advanced_opts); - free(x264_profile); + free(h264_profile); free(h264_level); // write a carriage return to stdout @@ -734,9 +734,9 @@ static int HandleEvents( hb_handle_t * h ) { x264_preset = strdup("fast"); } - if (x264_profile == NULL) + if (h264_profile == NULL) { - x264_profile = strdup("baseline"); + h264_profile = strdup("baseline"); } if (h264_level == NULL) { @@ -789,9 +789,9 @@ static int HandleEvents( hb_handle_t * h ) { x264_preset = strdup("medium"); } - if (x264_profile == NULL) + if (h264_profile == NULL) { - x264_profile = strdup("baseline"); + h264_profile = strdup("baseline"); } if (h264_level == NULL) { @@ -840,9 +840,9 @@ static int HandleEvents( hb_handle_t * h ) { x264_preset = strdup("medium"); } - if (x264_profile == NULL) + if (h264_profile == NULL) { - x264_profile = strdup("high"); + h264_profile = strdup("high"); } if (h264_level == NULL) { @@ -895,9 +895,9 @@ static int HandleEvents( hb_handle_t * h ) { x264_preset = strdup("medium"); } - if (x264_profile == NULL) + if (h264_profile == NULL) { - x264_profile = strdup("high"); + h264_profile = strdup("high"); } if (h264_level == NULL) { @@ -950,9 +950,9 @@ static int HandleEvents( hb_handle_t * h ) { x264_preset = strdup("medium"); } - if (x264_profile == NULL) + if (h264_profile == NULL) { - x264_profile = strdup("high"); + h264_profile = strdup("high"); } if (h264_level == NULL) { @@ -1009,9 +1009,9 @@ static int HandleEvents( hb_handle_t * h ) { x264_preset = strdup("medium"); } - if (x264_profile == NULL) + if (h264_profile == NULL) { - x264_profile = strdup("high"); + h264_profile = strdup("high"); } if (h264_level == NULL) { @@ -1064,9 +1064,9 @@ static int HandleEvents( hb_handle_t * h ) { x264_preset = strdup("medium"); } - if (x264_profile == NULL) + if (h264_profile == NULL) { - x264_profile = strdup("high"); + h264_profile = strdup("high"); } if (h264_level == NULL) { @@ -1120,9 +1120,9 @@ static int HandleEvents( hb_handle_t * h ) { x264_preset = strdup("medium"); } - if (x264_profile == NULL) + if (h264_profile == NULL) { - x264_profile = strdup("main"); + h264_profile = strdup("main"); } if (h264_level == NULL) { @@ -1173,9 +1173,9 @@ static int HandleEvents( hb_handle_t * h ) { x264_preset = strdup("medium"); } - if (x264_profile == NULL) + if (h264_profile == NULL) { - x264_profile = strdup("main"); + h264_profile = strdup("main"); } if (h264_level == NULL) { @@ -1223,9 +1223,9 @@ static int HandleEvents( hb_handle_t * h ) { x264_preset = strdup("veryfast"); } - if (x264_profile == NULL) + if (h264_profile == NULL) { - x264_profile = strdup("main"); + h264_profile = strdup("main"); } if (h264_level == NULL) { @@ -1275,9 +1275,9 @@ static int HandleEvents( hb_handle_t * h ) { x264_preset = strdup("medium"); } - if (x264_profile == NULL) + if (h264_profile == NULL) { - x264_profile = strdup("high"); + h264_profile = strdup("high"); } if (h264_level == NULL) { @@ -2455,8 +2455,8 @@ static int HandleEvents( hb_handle_t * h ) hb_job_set_x264_preset(job, x264_preset); hb_job_set_x264_tune(job, x264_tune); - hb_job_set_x264_profile(job, x264_profile); - hb_job_set_x264_level(job, h264_level); + hb_job_set_h264_profile(job, h264_profile); + hb_job_set_h264_level(job, h264_level); if (maxWidth) job->maxWidth = maxWidth; @@ -2771,10 +2771,10 @@ static void ShowHelp() " -x, --encopts <string> Specify advanced encoder options in the\n" " same style as mencoder (x264 and ffmpeg only):\n" " option1=value1:option2=value2\n" - " --x264-profile When using x264, ensures compliance with the\n" - " <string> specified h.264 profile:\n" + " --h264-profile When using x264, ensures compliance with the\n" + " <string> specified H.264 profile:\n" " "); - x264_opts = hb_x264_profiles(); + x264_opts = hb_h264_profiles(); tmp[0] = 0; len = 0; while( x264_opts && *x264_opts ) @@ -2794,7 +2794,7 @@ static void ShowHelp() fprintf( out, "%s\n", tmp ); fprintf( out, " --h264-level When using x264, ensures compliance with the\n" - " <string> specified h.264 level:\n" + " <string> specified H.264 level:\n" " "); x264_opts = hb_h264_levels(); tmp[0] = 0; @@ -3196,9 +3196,9 @@ static int ParseOptions( int argc, char ** argv ) #define ALLOWED_AUDIO_COPY 280 #define AUDIO_FALLBACK 281 #define LOOSE_CROP 282 - #define X264_PROFILE 283 - #define X264_PRESET 284 - #define X264_TUNE 285 + #define X264_PRESET 283 + #define X264_TUNE 284 + #define H264_PROFILE 285 #define H264_LEVEL 286 #define NORMALIZE_MIX 287 @@ -3271,11 +3271,11 @@ static int ParseOptions( int argc, char ** argv ) { "ac", required_argument, NULL, 'C' }, { "rate", required_argument, NULL, 'r' }, { "arate", required_argument, NULL, 'R' }, - { "encopts", required_argument, NULL, 'x' }, - { "x264-profile", required_argument, NULL, X264_PROFILE }, - { "h264-profile", required_argument, NULL, X264_PROFILE }, { "x264-preset", required_argument, NULL, X264_PRESET }, { "x264-tune", required_argument, NULL, X264_TUNE }, + { "encopts", required_argument, NULL, 'x' }, + { "x264-profile", required_argument, NULL, H264_PROFILE }, + { "h264-profile", required_argument, NULL, H264_PROFILE }, { "h264-level", required_argument, NULL, H264_LEVEL }, { "turbo", no_argument, NULL, 'T' }, { "maxHeight", required_argument, NULL, 'Y' }, @@ -3708,18 +3708,18 @@ static int ParseOptions( int argc, char ** argv ) case 'C': acompressions = str_split( optarg, ',' ); break; - case 'x': - advanced_opts = strdup( optarg ); - break; - case X264_PROFILE: - x264_profile = strdup( optarg ); - break; case X264_PRESET: x264_preset = strdup( optarg ); break; case X264_TUNE: x264_tune = strdup( optarg ); break; + case 'x': + advanced_opts = strdup( optarg ); + break; + case H264_PROFILE: + h264_profile = strdup( optarg ); + break; case H264_LEVEL: h264_level = strdup( optarg ); break; |