From: Good Guy Date: Sat, 20 Oct 2018 22:19:00 +0000 (-0600) Subject: change composer to chroma only - no src alpha blend, resize about pref, new expanders... X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=commitdiff_plain;h=26f3c4335351a3938db78303c57a2ba6551a2a10 change composer to chroma only - no src alpha blend, resize about pref, new expanders.txt/tweaks --- diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index 21852397..3f9f9b2f 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -1719,6 +1719,8 @@ void AWindowGUI::sort_assets() void AWindowGUI::sort_folders() { folder_lock->lock("AWindowGUI::update_assets"); +// folder_list->collapse_recursive(&folders, 0); + folder_list->set_autoplacement(&folders, 0, 1); sort_picons(&folders); folder_list->update_format(folder_list->get_format(), 0); folder_lock->unlock(); diff --git a/cinelerra-5.1/cinelerra/canvas.C b/cinelerra-5.1/cinelerra/canvas.C index 2a478d41..2b395300 100644 --- a/cinelerra-5.1/cinelerra/canvas.C +++ b/cinelerra-5.1/cinelerra/canvas.C @@ -844,7 +844,16 @@ void Canvas::update_refresh(VideoDevice *device, VFrame *output_frame) // OpenGL does YUV->RGB in the compositing step if( use_opengl ) best_color_model = BC_RGB888; - + else if( BC_CModels::has_alpha(best_color_model) ) { + best_color_model = + BC_CModels::is_float(best_color_model ) ? + BC_RGB_FLOAT : + BC_CModels::is_yuv(best_color_model ) ? + ( BC_CModels::calculate_pixelsize(best_color_model) > 8 ? + BC_YUV161616 : BC_YUV888 ) : + ( BC_CModels::calculate_pixelsize(best_color_model) > 8 ? + BC_RGB161616 : BC_RGB888 ) ; + } int out_w = output_frame->get_w(); int out_h = output_frame->get_h(); if( refresh_frame && @@ -869,7 +878,7 @@ void Canvas::update_refresh(VideoDevice *device, VFrame *output_frame) get_canvas()->lock_window(" Canvas::output_refresh"); } else - refresh_frame->copy_from(output_frame); + refresh_frame->transfer_from(output_frame, -1); } diff --git a/cinelerra-5.1/cinelerra/playback3d.C b/cinelerra-5.1/cinelerra/playback3d.C index d7da2f50..2ca2a4c6 100644 --- a/cinelerra-5.1/cinelerra/playback3d.C +++ b/cinelerra-5.1/cinelerra/playback3d.C @@ -724,11 +724,11 @@ void Playback3D::draw_output(Playback3DCommand *command, int flip_y) BC_GL_YUV_TO_RGB(shader); } - if(BC_CModels::components(color_model) == 4) - { - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - } +// if(BC_CModels::components(color_model) == 4) +// { +// glEnable(GL_BLEND); +// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); +// } command->frame->draw_texture( command->in_x1, command->in_y1, command->in_x2, command->in_y2, diff --git a/cinelerra-5.1/cinelerra/preferencesthread.C b/cinelerra-5.1/cinelerra/preferencesthread.C index af64fed1..3e6f7ee2 100644 --- a/cinelerra-5.1/cinelerra/preferencesthread.C +++ b/cinelerra-5.1/cinelerra/preferencesthread.C @@ -64,7 +64,7 @@ -#define WIDTH 840 +#define WIDTH 860 #define HEIGHT 700 diff --git a/cinelerra-5.1/cinelerra/vdevicex11.C b/cinelerra-5.1/cinelerra/vdevicex11.C index ee1feaa3..ea8720db 100644 --- a/cinelerra-5.1/cinelerra/vdevicex11.C +++ b/cinelerra-5.1/cinelerra/vdevicex11.C @@ -523,7 +523,7 @@ int VDeviceX11::write_buffer(VFrame *output_channels, EDL *edl) 0, 0, output_channels->get_w(), output_channels->get_h(), 0, 0, bitmap->get_w(), bitmap->get_h(), output_channels->get_color_model(), bitmap->get_color_model(), - 0, output_channels->get_w(), bitmap->get_w()); + -1, output_channels->get_w(), bitmap->get_w()); } else { BC_CModels::transfer(bitmap->get_row_pointers(), output_channels->get_rows(), 0, 0, 0, @@ -531,7 +531,7 @@ int VDeviceX11::write_buffer(VFrame *output_channels, EDL *edl) (int)output_x1, (int)output_y1, (int)(output_x2 - output_x1), (int)(output_y2 - output_y1), 0, 0, (int)(canvas_x2 - canvas_x1), (int)(canvas_y2 - canvas_y1), output_channels->get_color_model(), bitmap->get_color_model(), - 0, output_channels->get_w(), bitmap->get_w()); + -1, output_channels->get_w(), bitmap->get_w()); } } diff --git a/cinelerra-5.1/expanders.txt b/cinelerra-5.1/expanders.txt index 7445d4d1..b4a2d6e9 100644 --- a/cinelerra-5.1/expanders.txt +++ b/cinelerra-5.1/expanders.txt @@ -9,13 +9,22 @@ Video Effects Histogram Histogram Bezier Hue saturation + Interpolate Bayer + RGB - 601 + Reroute + Swap channels + Threshold VideoScope + YUV411 - FF_Color_Correction - F_color + F_ciescope F_colorbalance F_colorchannelmixer F_colorkey F_colorlevels + F_colormatrix + F_curves + F_elbg F_eq F_floodfill F_histeq @@ -25,9 +34,14 @@ Video Effects F_lutrgb F_lutyuv F_normalize + F_pixscope F_pseudocolor + F_setrange + F_shuffleplanes + F_swapuv F_tlut2 F_vectorscope + F_vignette - Motion Motion Motion 2 Point @@ -35,17 +49,81 @@ Video Effects MotionCV MotionHV F_deshake + F_mestimate - Blur Blur + Edge Linear Blur Motion Blur Radial Blur + Sharpen + Unsharp Zoom Blur F_avgblur F_boxblur + F_edgedetect F_gblur + F_sab F_smartblur F_unsharp + - Denoise + DeScratch + Denoise video + DotTV + Selective Temporal Averaging + Time Average + F_atadenoise + F_bitplanenoise + F_dctdnoiz + F_hqdn3d + F_nlmeans + F_noise + F_owdenoise + F_removegrain + F_vaguedenoiser + - Extract Keys + Chroma key + Chroma key (HSV) + CriKey + Difference key + F_chromakey + F_despill + F_lumakey + - Geometry + Auto Scale + Flip + Lens + Perspective + Polar + Rotate + Scale + Scale Ratio + Sphere Cam + Translate + Whirl + Wave + F_cropdetect + F_crop + F_cover_rect + F_drawbox + F_drawgraph + F_drawgrid + F_hflip + F_lenscorrection + F_perspective + F_rotate + F_scale + F_super2xsai + F_transpose + F_vflip + - Scale + Auto Scale + F_hqx + F_scale + F_super2xsai + F_xbr + Scale + Scale Ratio Audio Effects - Calf - Instruments / Generators diff --git a/cinelerra-5.1/ffmpeg/plugin.opts b/cinelerra-5.1/ffmpeg/plugin.opts index e8863091..dca6523b 100644 --- a/cinelerra-5.1/ffmpeg/plugin.opts +++ b/cinelerra-5.1/ffmpeg/plugin.opts @@ -163,7 +163,7 @@ interlace #join kerndeint lenscorrection -#life ratio=2/3:s=200x200 +life ratio=2/3:s=200x200 loudnorm lowpass lut @@ -193,7 +193,7 @@ noise #nullsrc #overlay x=main_w-overlay_w-10:y=main_h-overlay_h-10 owdenoise -#pad +pad #palettegen #paletteuse #pan 1c|c0=0.9*c0+0.1*c1 diff --git a/cinelerra-5.1/guicast/bccmdl.py b/cinelerra-5.1/guicast/bccmdl.py index 97b2fc0e..6b5b9363 100755 --- a/cinelerra-5.1/guicast/bccmdl.py +++ b/cinelerra-5.1/guicast/bccmdl.py @@ -420,6 +420,49 @@ base = { "w": " *aop++ = fa;", }, }, + # no src alpha blend + "x8": { + "i8": { + "r": " ++inp;", + "w": " *out++ = 0xff;", + }, + "i16": { + "r": " ++inp;", + "w": " *out++ = 0xff;", + }, + "fp": { + "r": " ++inp;", + "w": " *out++ = 0xff;", + }, + }, + "x16": { + "i8": { + "r": " ++inp;", + "w": " *out++ = 0xffff;", + }, + "i16": { + "r": " ++inp;", + "w": " *out++ = 0xffff;", + }, + "fp": { + "r": " ++inp;", + "w": " *out++ = 0xffff;", + }, + }, + "xfp": { + "i8": { + "r": " ++inp;", + "w": " *out++ = 1.f;", + }, + "i16": { + "r": " ++inp;", + "w": " *out++ = 1.f;", + }, + "fp": { + "r": " ++inp;", + "w": " *out++ = 1.f;", + }, + }, # alpha blend rgb/black, yuv/black, rgb/bg_color "brgb": { "i8": " r = r*a/0xffu; g = g*a/0xffu; b = b*a/0xffu;", @@ -506,6 +549,12 @@ add_cmodel(36, "bc_grey8", "i8", "grey8") add_cmodel(37, "bc_grey16", "i16", "grey16") add_cmodel(38, "bc_gbrp", "i8", "gbrp") +add_cmodel(39, "bc_rgbx8888", "i8", "rgb888", "x8") +add_cmodel(40, "bc_rgbx16161616", "i16", "rgb161616", "x16") +add_cmodel(41, "bc_yuvx8888", "i8", "yuv888", "x8") +add_cmodel(42, "bc_yuvx16161616", "i16", "yuv161616", "x16") +add_cmodel(43, "bc_rgbx_float", "fp", "rgbfloat", "xfp") + specialize("bc_rgba8888", "bc_transparency", "XFER_rgba8888_to_transparency") ctype = { @@ -539,20 +588,23 @@ def is_rgb(nm): "bc_bgr888", "bc_bgr8888", "bc_rgb888", "bc_rgba8888", \ "bc_argb8888", "bc_abgr8888", "bc_rgb", "bc_rgb161616", \ "bc_rgba16161616", "bc_rgb_float", "bc_rgba_float", \ - "bc_rgb_floatp", "bc_rgba_floatp", "bc_gbrp", ] + "bc_rgb_floatp", "bc_rgba_floatp", "bc_gbrp", \ + "bc_rgbx8888", "bc_rgbx16161616", "bc_rgbx_float", ] def is_yuv(nm): return nm in [ "bc_yuv888", "bc_yuva8888", "bc_yuv161616", \ "bc_yuva16161616", "bc_ayuv16161616", "bc_yuv422", "bc_uvy422", "bc_yuv101010", \ "bc_vyu888", "bc_uyva8888", "bc_yuv420p", "bc_yuv420pi", "bc_yuv422p", \ - "bc_yuv444p", "bc_yuv411p", "bc_yuv410p", "bc_grey8", "bc_grey16", ] + "bc_yuv444p", "bc_yuv411p", "bc_yuv410p", "bc_grey8", "bc_grey16", \ + "bc_yuvx8888", "bc_yuvx16161616", ] def is_planar(nm): return nm in [ "bc_yuv420p", "bc_yuv420pi", "bc_yuv422p", "bc_yuv444p", \ "bc_yuv411p", "bc_yuv410p", "bc_rgb_floatp", "bc_rgba_floatp", "bc_gbrp", ] def is_float(nm): - return nm in ["bc_rgb_float", "bc_rgba_float", "bc_rgb_floatp", "bc_rgba_floatp", ] + return nm in [ "bc_rgb_float", "bc_rgba_float", "bc_rgbx_float", \ + "bc_rgb_floatp", "bc_rgba_floatp", ] def gen_xfer_proto(fd, pfx, cls, fr_cmdl, to_cmdl): global dtype, ctype diff --git a/cinelerra-5.1/guicast/bccmodels.C b/cinelerra-5.1/guicast/bccmodels.C index 5d3da1ec..13df1c31 100644 --- a/cinelerra-5.1/guicast/bccmodels.C +++ b/cinelerra-5.1/guicast/bccmodels.C @@ -58,12 +58,17 @@ int BC_CModels::components(int colormodel) case BC_VYU888: return 3; case BC_RGBA8888: + case BC_RGBX8888: case BC_ARGB8888: case BC_ABGR8888: case BC_RGBA16161616: + case BC_RGBX16161616: case BC_RGBA_FLOAT: + case BC_RGBX_FLOAT: case BC_YUVA8888: + case BC_YUVX8888: case BC_YUVA16161616: + case BC_YUVX16161616: case BC_UYVA8888: case BC_AYUV16161616: return 4; @@ -96,18 +101,23 @@ int BC_CModels::calculate_pixelsize(int colormodel) case BC_ARGB8888: return 4; case BC_ABGR8888: return 4; case BC_RGBA8888: return 4; + case BC_RGBX8888: return 4; case BC_RGB161616: return 6; case BC_RGBA16161616: return 8; + case BC_RGBX16161616: return 8; case BC_YUV888: return 3; case BC_YUVA8888: return 4; + case BC_YUVX8888: return 4; case BC_YUV161616: return 6; case BC_YUVA16161616: return 8; + case BC_YUVX16161616: return 8; case BC_AYUV16161616: return 8; case BC_YUV101010: return 4; case BC_VYU888: return 3; case BC_UYVA8888: return 4; case BC_RGB_FLOAT: return 12; case BC_RGBA_FLOAT: return 16; + case BC_RGBX_FLOAT: return 16; case BC_GREY8: return 1; case BC_GREY16: return 2; // Planar @@ -135,15 +145,20 @@ int BC_CModels::calculate_max(int colormodel) case BC_A_FLOAT: return 1; case BC_RGB888: return 0xff; case BC_RGBA8888: return 0xff; + case BC_RGBX8888: return 0xff; case BC_RGB161616: return 0xffff; case BC_RGBA16161616: return 0xffff; + case BC_RGBX16161616: return 0xffff; case BC_YUV888: return 0xff; case BC_YUVA8888: return 0xff; + case BC_YUVX8888: return 0xff; case BC_YUV161616: return 0xffff; case BC_YUVA16161616: return 0xffff; + case BC_YUVX16161616: return 0xffff; case BC_AYUV16161616: return 0xffff; case BC_RGB_FLOAT: return 1; case BC_RGBA_FLOAT: return 1; + case BC_RGBX_FLOAT: return 1; case BC_RGB_FLOATP: return 1; case BC_RGBA_FLOATP: return 1; case BC_GREY8: return 0xff; @@ -242,6 +257,7 @@ int BC_CModels::is_float(int colormodel) switch(colormodel) { case BC_RGB_FLOAT: case BC_RGBA_FLOAT: + case BC_RGBX_FLOAT: case BC_RGB_FLOATP: case BC_RGBA_FLOATP: return 1; @@ -255,8 +271,10 @@ int BC_CModels::is_yuv(int colormodel) switch(colormodel) { case BC_YUV888: case BC_YUVA8888: + case BC_YUVX8888: case BC_YUV161616: case BC_YUVA16161616: + case BC_YUVX16161616: case BC_AYUV16161616: case BC_YUV422: case BC_UVY422: diff --git a/cinelerra-5.1/guicast/bccmodels.h b/cinelerra-5.1/guicast/bccmodels.h index 6597bc75..57843aa9 100644 --- a/cinelerra-5.1/guicast/bccmodels.h +++ b/cinelerra-5.1/guicast/bccmodels.h @@ -66,6 +66,12 @@ enum BC_CModel { BC_AYUV16161616 = 35, BC_GREY8 = 36, BC_GREY16 = 37, +//only used for chroma only xfers (transfer with bg_color < 0) + BC_RGBX8888 = 39, + BC_RGBX16161616 = 40, + BC_YUVX8888 = 41, + BC_YUVX16161616 = 42, + BC_RGBX_FLOAT = 43, }; // Colormodels purely used by Quicktime are done in Quicktime. @@ -117,7 +123,7 @@ public: int out_h, int in_colormodel, int out_colormodel, - int bg_color, /* When transfering BC_RGBA8888 to non-alpha this is the background color in 0xRRGGBB hex */ + int bg_color, /* -1 for chroma only xfer, else bg color for BC_RGBA8888 to non-alpha */ int in_rowspan, /* For planar use the luma rowspan */ int out_rowspan); /* For planar use the luma rowspan */ diff --git a/cinelerra-5.1/guicast/bclistbox.inc b/cinelerra-5.1/guicast/bclistbox.inc index ad535471..0073019c 100644 --- a/cinelerra-5.1/guicast/bclistbox.inc +++ b/cinelerra-5.1/guicast/bclistbox.inc @@ -41,7 +41,7 @@ // Distance from sides of window #define LISTBOX_BORDER 2 #define ICON_MARGIN 2 -#define LISTBOX_INDENT 10 +#define LISTBOX_INDENT 18 // Justification for popup listbox #define LISTBOX_LEFT 0 diff --git a/cinelerra-5.1/guicast/bcxfer.C b/cinelerra-5.1/guicast/bcxfer.C index 44258127..95e0c8e5 100644 --- a/cinelerra-5.1/guicast/bcxfer.C +++ b/cinelerra-5.1/guicast/bcxfer.C @@ -6,6 +6,21 @@ void BC_Xfer::init( uint8_t *in_yp, uint8_t *in_up, uint8_t *in_vp, uint8_t *in_ap, int in_rowspan, int bg_color) { + this->bg_color = bg_color; + if( bg_color >= 0 ) { + this->bg_r = (bg_color>>16) & 0xff; + this->bg_g = (bg_color>>8) & 0xff; + this->bg_b = (bg_color>>0) & 0xff; + } + else { // bg_color < 0, no src blending + switch( in_colormodel ) { + case BC_RGBA8888: in_colormodel = BC_RGBX8888; break; + case BC_RGBA16161616: in_colormodel = BC_RGBX16161616; break; + case BC_YUVA8888: in_colormodel = BC_YUVX8888; break; + case BC_YUVA16161616: in_colormodel = BC_YUVX16161616; break; + case BC_RGBA_FLOAT: in_colormodel = BC_RGBX_FLOAT; break; + } + } // prevent bounds errors on poorly dimensioned macro pixel formats switch( in_colormodel ) { case BC_UVY422: @@ -67,11 +82,6 @@ void BC_Xfer::init( break; } this->total_out_w = out_rowspan; - this->bg_color = bg_color; - this->bg_r = (bg_color>>16) & 0xff; - this->bg_g = (bg_color>>8) & 0xff; - this->bg_b = (bg_color>>0) & 0xff; - this->in_pixelsize = BC_CModels::calculate_pixelsize(in_colormodel); this->out_pixelsize = BC_CModels::calculate_pixelsize(out_colormodel); this->scale = (out_w != in_w) || (in_x != 0); diff --git a/cinelerra-5.1/info/plugins.txt b/cinelerra-5.1/info/plugins.txt index 8054ae49..86e83395 100644 --- a/cinelerra-5.1/info/plugins.txt +++ b/cinelerra-5.1/info/plugins.txt @@ -300,6 +300,7 @@ F_inflate: Applies inflate effect. F_interlace: Convert progressive video into interlaced. F_kerndeint: Applies kernel deinterlacing to the input. F_lenscorrection: Rectifies the image by correcting for lens distortion. +F_Life: Generate a life pattern. F_limiter: Limit pixels components to the specified range. F_loop: Loops video frames. F_lumakey: Turns a certain luma into transparency. @@ -325,6 +326,8 @@ F_owdenoise: Denoises using wavelets. F_oscilloscope: 2D video oscilloscope. Useful to measure spatial impulse, step responses, and chroma delays. F_owndenoise: Denoises using wavelets. +F_Pad: Add paddings to the input image, and place the original + input at the provided x, y coordinates. F_perms: Set permissions for the output video frame. F_perspective: Corrects the perspective of video. F_phase: Phases shift fields. @@ -343,7 +346,7 @@ F_realtime: Slows down filtering to match realtime. F_removegrain: Removes grain. F_repeatfields: Hard repeat fields based on MPEG repeat field flag. F_roberts: Apply roberts cross operator which performs a simple/quick 2-D - spatial gradient measurement on the video (usually a graysacle + spatial gradient measurement on the video (usually a grayscale image). It highlights regions of high spatial frequency which most likely correspond to edges. F_rotate: Rotates the input image.