return 1;
}
+// num. order of those entries must be same as in
+// guicast/bccolors.inc
-const char *YuvColorSpace::color_space[] = {
- N_("BT601"), // COLOR_SPACE_BT601
+const char *YuvColorSpace::color_space[MAX_COLOR_SPACE] = {
+ N_("BT601_NTSC"), // COLOR SPACE BT601_NTSC
N_("BT709"), // COLOR_SPACE_BT709
- N_("BT2020"), // COLOR_SPACE_BT2020
+ N_("BT2020 NCL"), // COLOR_SPACE_BT2020_NCL
+ N_("BT601_PAL"), // COLOR_SPACE_BT601_PAL
+ N_("BT2020 CL"), // COLOR_SPACE_BT2020_CL
};
YuvColorSpace::YuvColorSpace(int x, int y, PreferencesWindow *pwindow)
- : BC_PopupMenu(x, y, xS(120),
+ : BC_PopupMenu(x, y, xS(140),
_(color_space[pwindow->thread->preferences->yuv_color_space]), 1)
{
this->pwindow = pwindow;
class ViewViconColorMode : public BC_PopupMenu
{
- static const char *vicon_color_modes[3];
+#define MAX_VICON_COLOR_MODE 3
+ static const char *vicon_color_modes[MAX_VICON_COLOR_MODE];
public:
ViewViconColorMode(PreferencesWindow *pwindow, int x, int y);
~ViewViconColorMode();
class YuvColorSpace : public BC_PopupMenu
{
public:
- static const char *color_space[3];
+#define MAX_COLOR_SPACE 5
+ static const char *color_space[MAX_COLOR_SPACE];
YuvColorSpace(int x, int y, PreferencesWindow *pwindow);
~YuvColorSpace();
class YuvColorRange : public BC_PopupMenu
{
public:
- static const char *color_range[2];
+#define MAX_COLOR_RANGE 2
+ static const char *color_range[MAX_COLOR_RANGE];
YuvColorRange(int x, int y, PreferencesWindow *pwindow);
~YuvColorRange();
{
this->mwindow = mwindow;
this->exportasset = exportasset;
+// *** CONTEXT_HELP ***
+ context_help_set_keyword("Export to EDL");
for( int i=0; i<2; ++i ) {
list_titles[i] = _(default_list_titles[i]);
list_widths[i] = xS(default_list_widths[i]);
}
int color_space = SWS_CS_ITU601;
switch( preferences->yuv_color_space ) {
- case BC_COLORS_BT601: color_space = SWS_CS_ITU601; break;
+ case BC_COLORS_BT601_PAL: color_space = SWS_CS_ITU601; break;
+ case BC_COLORS_BT601_NTSC: color_space = SWS_CS_SMPTE170M; break;
case BC_COLORS_BT709: color_space = SWS_CS_ITU709; break;
- case BC_COLORS_BT2020: color_space = SWS_CS_BT2020; break;
+ case BC_COLORS_BT2020_NCL:
+ case BC_COLORS_BT2020_CL: color_space = SWS_CS_BT2020; break;
}
const int *color_table = sws_getCoefficients(color_space);
}
int color_space = SWS_CS_ITU601;
switch( preferences->yuv_color_space ) {
- case BC_COLORS_BT601: color_space = SWS_CS_ITU601; break;
+ case BC_COLORS_BT601_PAL: color_space = SWS_CS_ITU601; break;
+ case BC_COLORS_BT601_NTSC: color_space = SWS_CS_SMPTE170M; break;
case BC_COLORS_BT709: color_space = SWS_CS_ITU709; break;
- case BC_COLORS_BT2020: color_space = SWS_CS_BT2020; break;
+ case BC_COLORS_BT2020_NCL:
+ case BC_COLORS_BT2020_CL: color_space = SWS_CS_BT2020; break;
}
const int *color_table = sws_getCoefficients(color_space);
}
switch( avpar->color_space ) {
case AVCOL_SPC_BT470BG:
+ vid->color_space = BC_COLORS_BT601_PAL;
+ break;
case AVCOL_SPC_SMPTE170M:
- vid->color_space = BC_COLORS_BT601;
+ vid->color_space = BC_COLORS_BT601_NTSC;
break;
case AVCOL_SPC_BT709:
vid->color_space = BC_COLORS_BT709;
break;
case AVCOL_SPC_BT2020_NCL:
+ vid->color_space = BC_COLORS_BT2020_NCL;
+ break;
case AVCOL_SPC_BT2020_CL:
- vid->color_space = BC_COLORS_BT2020;
+ vid->color_space = BC_COLORS_BT2020_CL;
break;
default:
- vid->color_space = !file_base ? BC_COLORS_BT601 :
+ vid->color_space = !file_base ? BC_COLORS_BT601_NTSC :
file_base->file->preferences->yuv_color_space;
break;
}
if( (vid->color_space = asset->ff_color_space) < 0 )
vid->color_space = file_base->file->preferences->yuv_color_space;
switch( vid->color_space ) {
- case BC_COLORS_BT601: ctx->colorspace = AVCOL_SPC_SMPTE170M; break;
+ case BC_COLORS_BT601_NTSC: ctx->colorspace = AVCOL_SPC_SMPTE170M; break;
+ case BC_COLORS_BT601_PAL: ctx->colorspace = AVCOL_SPC_BT470BG; break;
case BC_COLORS_BT709: ctx->colorspace = AVCOL_SPC_BT709; break;
- case BC_COLORS_BT2020: ctx->colorspace = AVCOL_SPC_BT2020_NCL; break;
+ case BC_COLORS_BT2020_NCL: ctx->colorspace = AVCOL_SPC_BT2020_NCL; break;
+ case BC_COLORS_BT2020_CL: ctx->colorspace = AVCOL_SPC_BT2020_CL; break;
}
AVPixelFormat pix_fmt = av_get_pix_fmt(asset->ff_pixel_format);
if( opt_hw_dev != 0 ) {
forward_render_displacement = 0;
dvd_yuv420p_interlace = 0;
highlight_inverse = 0xffffff;
- yuv_color_space = BC_COLORS_BT601;
+ yuv_color_space = BC_COLORS_BT601_NTSC;
yuv_color_range = BC_COLORS_JPEG;
autocolor_assets = 0;
ctrl_toggle = 1;
}
}
+
+// TODO validation, otherwise corrupted/edited Cinelerra_rc crash app!
int Preferences::load_defaults(BC_Hash *defaults)
{
char string[BCTEXTLEN];
layout_scale = defaults->get("LAYOUT_SCALE",layout_scale);
vicon_size = defaults->get("VICON_SIZE",vicon_size);
vicon_color_mode = defaults->get("VICON_COLOR_MODE",vicon_color_mode);
+ if (vicon_color_mode > ( MAX_VICON_COLOR_MODE -1 ) || vicon_color_mode <0) vicon_color_mode = 0;
strcpy(theme, _(DEFAULT_THEME));
strcpy(locale, DEFAULT_LOCALE);
strcpy(plugin_icons, DEFAULT_PICON);
dvd_yuv420p_interlace = defaults->get("DVD_YUV420P_INTERLACE", dvd_yuv420p_interlace);
highlight_inverse = defaults->get("HIGHLIGHT_INVERSE", highlight_inverse);
yuv_color_space = defaults->get("YUV_COLOR_SPACE", yuv_color_space);
+ if (yuv_color_space > (MAX_COLOR_SPACE - 1) || yuv_color_space < 0) yuv_color_space = 0;
yuv_color_range = defaults->get("YUV_COLOR_RANGE", yuv_color_range);
+ if (yuv_color_range > (MAX_COLOR_RANGE - 1) || yuv_color_range < 0) yuv_color_range = 0;
autocolor_assets = defaults->get("AUTOCOLOR_ASSETS", autocolor_assets);
ctrl_toggle = defaults->get("CTRL_TOGGLE", ctrl_toggle);
rectify_audio = defaults->get("RECTIFY_AUDIO", rectify_audio);
#include "shbtnprefs.inc"
#include "videoconfig.inc"
+// for MAX_COLOR_SPACE
+#include "appearanceprefs.h"
class Preferences
{
<td align="left"><font face="Liberation Serif" size=4>'Shift-R'</font></td>
<td align="left"><font face="Liberation Serif" size=4>Open render window</font></td>
</tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Export EDL…</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>'Shift-E'</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Export to CMX3600 format</font></td>
+ </tr>
<tr>
<td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
<td align="left"><font face="Liberation Serif" size=4>Batch Render..</font></td>
#overlay x=main_w-overlay_w-10:y=main_h-overlay_h-10 ###Input/output error
owdenoise
pad
-#palettegen ###Resource temporarily unavailable
-#paletteuse ###Input/output error
+#palettegen stats_mode=single ###Resource temporarily unavailable (single ok/need output file)
+#paletteuse ###Input/output error (requires input palette.png and output.gif files)
pan 1c|c0=0.9*c0+0.1*c1
perms
perspective
int mpeg;
switch( color_space ) {
default:
- case BC_COLORS_BT601: kr = BT601_Kr; kb = BT601_Kb; break;
+ case BC_COLORS_BT601_NTSC: kr = BT601_NTSC_Kr; kb = BT601_NTSC_Kb; break;
+ case BC_COLORS_BT601_PAL: kr = BT601_PAL_Kr; kb = BT601_PAL_Kb; break;
case BC_COLORS_BT709: kr = BT709_Kr; kb = BT709_Kb; break;
- case BC_COLORS_BT2020: kr = BT2020_Kr; kb = BT2020_Kb; break;
+ case BC_COLORS_BT2020_NCL:
+ case BC_COLORS_BT2020_CL: kr = BT2020_Kr; kb = BT2020_Kb; break;
}
switch( color_range ) {
default:
// white vector normalized, so:
// Kg = 1 - Kr - Kb
-#define BT601_Kr 0.299
-#define BT601_Kb 0.114
+#define BT601_NTSC_Kr 0.299
+#define BT601_NTSC_Kb 0.114
+
+#define BT601_PAL_Kr 0.299
+#define BT601_PAL_Kb 0.114
#define BT709_Kr 0.2126
#define BT709_Kb 0.0722
class YUV;
-#define BC_COLORS_BT601 0
+#define BC_COLORS_BT601_NTSC 0
+#define BC_COLORS_BT601_PAL 3
#define BC_COLORS_BT709 1
-#define BC_COLORS_BT2020 2
+#define BC_COLORS_BT2020_NCL 2
+#define BC_COLORS_BT2020_CL 4
#define BC_COLORS_JPEG 0
#define BC_COLORS_MPEG 1
ColorSpaceConfig::ColorSpaceConfig()
{
inverse = 0;
- inp_colorspace = BC_COLORS_BT601;
+ inp_colorspace = BC_COLORS_BT601_NTSC;
inp_colorrange = BC_COLORS_JPEG;
out_colorspace = BC_COLORS_BT709;
out_colorrange = BC_COLORS_JPEG;
this->inp_space = inp_space; this->out_space = out_space;
this->inp_range = inp_range; this->out_range = out_range;
- double iKr = BT601_Kr, iKb = BT601_Kb;
- double oKr = BT601_Kr, oKb = BT601_Kb;
+ double iKr = BT601_NTSC_Kr, iKb = BT601_NTSC_Kb;
+ double oKr = BT601_NTSC_Kr, oKb = BT601_NTSC_Kb;
int impg = 0, ompg = 0;
switch( inp_space ) {
default:
- case BC_COLORS_BT601: iKr = BT601_Kr; iKb = BT601_Kb; break;
+ case BC_COLORS_BT601_NTSC: iKr = BT601_NTSC_Kr; iKb = BT601_NTSC_Kb; break;
+ case BC_COLORS_BT601_PAL: iKr = BT601_PAL_Kr; iKb = BT601_PAL_Kb; break;
case BC_COLORS_BT709: iKr = BT709_Kr; iKb = BT709_Kb; break;
- case BC_COLORS_BT2020: iKr = BT2020_Kr; iKb = BT2020_Kb; break;
+ case BC_COLORS_BT2020_NCL:
+ case BC_COLORS_BT2020_CL: iKr = BT2020_Kr; iKb = BT2020_Kb; break;
}
switch( out_space ) {
default:
- case BC_COLORS_BT601: oKr = BT601_Kr; oKb = BT601_Kb; break;
+ case BC_COLORS_BT601_NTSC: oKr = BT601_NTSC_Kr; oKb = BT601_NTSC_Kb; break;
+ case BC_COLORS_BT601_PAL: oKr = BT601_PAL_Kr; oKb = BT601_PAL_Kb; break;
case BC_COLORS_BT709: oKr = BT709_Kr; oKb = BT709_Kb; break;
- case BC_COLORS_BT2020: oKr = BT2020_Kr; oKb = BT2020_Kb; break;
+ case BC_COLORS_BT2020_NCL:
+ case BC_COLORS_BT2020_CL: oKr = BT2020_Kr; oKb = BT2020_Kb; break;
}
int iyuv = BC_CModels::is_yuv(inp_model);