const char *YuvColorSpace::color_space[] = {
- N_("BT601"),
- N_("BT709"),
- N_("BT2020"),
+ N_("BT601"), // COLOR_SPACE_BT601
+ N_("BT709"), // COLOR_SPACE_BT709
+ N_("BT2020"), // COLOR_SPACE_BT2020
};
YuvColorSpace::YuvColorSpace(int x, int y, PreferencesWindow *pwindow)
const char *YuvColorRange::color_range[] = {
- N_("JPEG"),
- N_("MPEG"),
+ N_("JPEG"), // COLOR_RANGE_JPEG
+ N_("MPEG"), // COLOR_RANGE_MPEG
};
YuvColorRange::YuvColorRange(int x, int y, PreferencesWindow *pwindow)
return -1;
}
- int jpeg_range = preferences->yuv_color_range == BC_COLORS_JPEG ? 1 : 0;
+ int color_range = 0;
+ switch( preferences->yuv_color_range ) {
+ case BC_COLORS_JPEG: color_range = 1; break;
+ case BC_COLORS_MPEG: color_range = 0; break;
+ }
+ int ff_color_space = SWS_CS_ITU601;
+ switch( preferences->yuv_color_space ) {
+ case BC_COLORS_BT601: ff_color_space = SWS_CS_ITU601; break;
+ case BC_COLORS_BT709: ff_color_space = SWS_CS_ITU709; break;
+ case BC_COLORS_BT2020: ff_color_space = SWS_CS_BT2020; break;
+ }
+ const int *color_table = sws_getCoefficients(ff_color_space);
+
int *inv_table, *table, src_range, dst_range;
int brightness, contrast, saturation;
if( !sws_getColorspaceDetails(convert_ctx,
&inv_table, &src_range, &table, &dst_range,
&brightness, &contrast, &saturation) ) {
- if( src_range != jpeg_range || dst_range != jpeg_range )
+ if( src_range != color_range || dst_range != color_range ||
+ inv_table != color_table || table != color_table )
sws_setColorspaceDetails(convert_ctx,
- inv_table, jpeg_range, table, jpeg_range,
+ color_table, color_range, color_table, color_range,
brightness, contrast, saturation);
}
return -1;
}
- int jpeg_range = preferences->yuv_color_range == BC_COLORS_JPEG ? 1 : 0;
+
+ int color_range = 0;
+ switch( preferences->yuv_color_range ) {
+ case BC_COLORS_JPEG: color_range = 1; break;
+ case BC_COLORS_MPEG: color_range = 0; break;
+ }
+ int ff_color_space = SWS_CS_ITU601;
+ switch( preferences->yuv_color_space ) {
+ case BC_COLORS_BT601: ff_color_space = SWS_CS_ITU601; break;
+ case BC_COLORS_BT709: ff_color_space = SWS_CS_ITU709; break;
+ case BC_COLORS_BT2020: ff_color_space = SWS_CS_BT2020; break;
+ }
+ const int *color_table = sws_getCoefficients(ff_color_space);
+
int *inv_table, *table, src_range, dst_range;
int brightness, contrast, saturation;
if( !sws_getColorspaceDetails(convert_ctx,
&inv_table, &src_range, &table, &dst_range,
&brightness, &contrast, &saturation) ) {
- if( dst_range != jpeg_range )
+ if( dst_range != color_range || table != color_table )
sws_setColorspaceDetails(convert_ctx,
- inv_table, src_range, table, jpeg_range,
+ inv_table, src_range, color_table, color_range,
brightness, contrast, saturation);
}
CHECK_HEADERS([lv2], [suil headers], [suil/suil.h])
CFLAGS="$saved_CFLAGS"])
+test "x$HAVE_lilv" = "xno" || \
+test "x$HAVE_sord" = "xno" || \
+test "x$HAVE_serd" = "xno" || \
+test "x$HAVE_sratom" = "xno" || \
+test "x$HAVE_lv2" = "xno" || \
+test "x$HAVE_suil" = "xno" && \
+ HAVE_lilv=no && \
+ HAVE_sord=no && \
+ HAVE_serd=no && \
+ HAVE_sratom=no && \
+ HAVE_lv2=no && \
+ HAVE_suil=no
+
CHECK_WANT([CUDA], [auto], [build cuda plugins], [
CHECK_HEADERS([CUDA], [cuda sdk], [${CUDA_PATH:-/usr/local/cuda}/include/cuda.h])])