-#define AUTOCROP_LONGTEXT N_("Activate automatic black border cropping")
-
-vlc_module_begin();
- add_category_hint( N_("Crop"), NULL, VLC_FALSE );
- add_string( "crop-geometry", NULL, NULL, GEOMETRY_TEXT, GEOMETRY_LONGTEXT, VLC_FALSE );
- add_bool( "autocrop", 0, NULL, AUTOCROP_TEXT, AUTOCROP_LONGTEXT, VLC_FALSE );
- set_description( _("crop video filter") );
- set_capability( "video filter", 0 );
- add_shortcut( "crop" );
- set_callbacks( Create, Destroy );
-vlc_module_end();
+#define AUTOCROP_LONGTEXT N_("Automatically detect black borders and crop them.")
+
+#ifdef BEST_AUTOCROP
+#define RATIOMAX_TEXT N_("Ratio max (x 1000)")
+#define RATIOMAX_LONGTEXT N_("Maximum image ratio. The crop plugin will never automatically crop to a higher ratio (ie, to a more \"flat\" image). The value is x1000: 1333 means 4/3.")
+
+#define RATIO_TEXT N_("Manual ratio")
+#define RATIO_LONGTEXT N_("Force a ratio (0 for automatic). Value is x1000: 1333 means 4/3.")
+
+#define TIME_TEXT N_("Number of images for change")
+#define TIME_LONGTEXT N_("The number of consecutive images with the same detected ratio (different from the previously detected ratio) to consider that ratio chnged and trigger recrop.")
+
+#define DIFF_TEXT N_("Number of lines for change")
+#define DIFF_LONGTEXT N_("The minimum difference in the number of detected black lines to consider that ratio changed and trigger recrop.")
+
+#define NBP_TEXT N_("Number of non black pixels ")
+#define NBP_LONGTEXT N_("The maximum of non-black pixels in a line to consider"\
+ " that the line is black.")
+
+#define SKIP_TEXT N_("Skip percentage (%)")
+#define SKIP_LONGTEXT N_("Percentage of the line to consider while checking for black lines. This allows to skip logos in black borders and crop them anyway.")
+
+#define LUM_TEXT N_("Luminance threshold ")
+#define LUM_LONGTEXT N_("Maximum luminance to consider a pixel as black (0-255).")
+#endif
+
+vlc_module_begin ()
+ set_description( N_("Crop video filter") )
+ set_shortname( N_("Crop" ))
+ set_category( CAT_VIDEO )
+ set_subcategory( SUBCAT_VIDEO_VFILTER )
+ set_capability( "video filter", 0 )
+
+ add_string( "crop-geometry", NULL, NULL, GEOMETRY_TEXT,
+ GEOMETRY_LONGTEXT, false )
+ add_bool( "autocrop", false, NULL, AUTOCROP_TEXT,
+ AUTOCROP_LONGTEXT, false )
+
+#ifdef BEST_AUTOCROP
+ add_integer_with_range( "autocrop-ratio-max", 2405, 0, RATIO_MAX, NULL,
+ RATIOMAX_TEXT, RATIOMAX_LONGTEXT, true )
+
+ add_integer_with_range( "crop-ratio", 0, 0, RATIO_MAX, NULL, RATIO_TEXT,
+ RATIO_LONGTEXT, false )
+ add_integer( "autocrop-time", 25, NULL, TIME_TEXT,
+ TIME_LONGTEXT, true )
+ add_integer( "autocrop-diff", 16, NULL, DIFF_TEXT,
+ DIFF_LONGTEXT, true )
+
+ add_integer( "autocrop-non-black-pixels", 3, NULL,
+ NBP_TEXT, NBP_LONGTEXT, true )
+
+ add_integer_with_range( "autocrop-skip-percent", 17, 0, 100, NULL,
+ SKIP_TEXT, SKIP_LONGTEXT, true )
+
+ add_integer_with_range( "autocrop-luminance-threshold", 40, 0, 128, NULL,
+ LUM_TEXT, LUM_LONGTEXT, true )
+#endif //BEST_AUTOCROP
+
+ add_shortcut( "crop" )
+ set_callbacks( Create, Destroy )
+vlc_module_end ()