View Issue Details

IDProjectCategoryView StatusLast Update
0000646Cinelerra-GG[All Projects] Bugpublic2023-11-26 21:09
ReporterAndrew-R Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformLinuxOSSlackwareOS Version15.0
Product Version 
Target VersionFixed in Version 
Summary0000646: Compositing routines in RGB(A) float clamp to 1.0f
DescriptionA bit unexpected for users?

Cinelerra-CV at least does not do this.

Mail list discussion: https://lists.cinelerra-gg.org/pipermail/cin/2023-November/007186.html

Cin HV issue/question: https://github.com/heroineworshiper/hvirtual/issues/8
Steps To Reproduce1. Download EXR file from https://polyhaven.com/a/small_empty_room_1

https://dl.polyhaven.org/file/ph-assets/HDRIs/exr/4k/small_empty_room_1_4k.exr
17 Mb.

2. Set FFmpeg early GUI toggle to false, so native EXR reader will be used.

3. Try colorpicker on Compositor window. It will show some overbright (above 1.0) pixels

4. Try to add fade to 99% or any plugin (any but Blue Banana and Gamma, apparently)

5. Observe overbright pixels clamped to 1.0f.

This is not purely cosmetical, re-saving file as EXR/TIFF will lose that info.

I found WHERE cingg does this, see patch attached

Additional InformationThis is behavior change. Also, I haven't tried to raise limit to fp32 max value, nor fixed clamping to zero (some photographic techniques rely on negative numbers in pipeline)
TagsNo tags attached.

Activities

Andrea_Paz

Andrea_Paz

2023-11-26 21:09

manager   ~0005595

@Andrew-R
With a new build now everything works fine and I get the same results as you.
Andrea_Paz

Andrea_Paz

2023-11-20 21:21

manager   ~0005593

Last edited: 2023-11-20 21:22

View 2 revisions

I think so; the ./configure command shows no errors.

Can you tell me how to do further verification?



configure.txt (16,042 bytes)
 $ git clone --depth 1 "git://git.cinelerra-gg.org/goodguy/cinelerra.git" cinelerra5
Clone in 'cinelerra5' in corso...
remote: Enumerating objects: 11909, done.
remote: Counting objects: 100% (11909/11909), done.
remote: Compressing objects: 100% (8946/8946), done.
remote: Total 11909 (delta 3395), reused 10174 (delta 2752), pack-reused 0
Ricezione degli oggetti: 100% (11909/11909), 164.04 MiB | 11.90 MiB/s, fatto.
Risoluzione dei delta: 100% (3395/3395), fatto.
[paz@arch-paz ~]$ cd /home/paz/cinelerra5/cinelerra-5.1
[paz@arch-paz cinelerra-5.1]$ git am /home/paz/patch/*.patch
Applicazione in corso: Add AC_CONFIG_MACRO_DIRS([m4]) for configure.ac to fix Andrea's Arch
Applicazione in corso: TEST Simpler unlimited float overlay
Applicazione in corso: Allow negative numbers in overlayer
Applicazione in corso: Disable ffmpeg's documentation generation
[paz@arch-paz cinelerra-5.1]$ ./autogen.sh
+ rm -f global_config configure Makefile Makefile.in
+ rm -f aclocal.m4 depcomp compile install-sh ltmain.sh
+ rm -f config.log config.guess config.h config.h.in config.sub config.status missing
+ rm -rf autom4te.cache m4
+ '[' '' = clean ']'
+ mkdir m4
+ autoreconf --install
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'm4'.
libtoolize: copying file 'm4/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:10: installing 'm4/compile'
configure.ac:10: installing 'm4/config.guess'
configure.ac:10: installing 'm4/config.sub'
configure.ac:9: installing 'm4/install-sh'
configure.ac:9: installing 'm4/missing'
++ uname -o
+ '[' GNU/Linux = Android ']'
+ '[' -e /system/bin/app_process ']'
[paz@arch-paz cinelerra-5.1]$ ./configure --with-single-user --with-config-dir=/home/paz/.bcast6 --with-booby
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... none
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for file... file
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking dependency style of gcc... none
checking for g++... g++
checking whether the compiler supports GNU C++... yes
checking whether g++ accepts -g... yes
checking for g++ option to enable C++11 features... none needed
checking dependency style of g++... none
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for makeinfo... ${SHELL} '/home/paz/cinelerra5/cinelerra-5.1/m4/missing' makeinfo
checking for gettext... gettext
checking for libtool... $(SHELL) $(top_builddir)/libtool
checking for gtk_init in -lm... yes
checking for nasm... yes
checking nasm x264 compatible... yes
checking for yasm... yes
checking for objcopy... yes
checking for pactl... yes
checking for gcc options needed to detect all undeclared functions... none needed
checking whether X_HAVE_UTF8_STRING is declared... yes
checking for XOpenDisplay in -lX11... yes
checking for X11/X.h... yes
checking X11 headers... yes
checking for X11/keysym.h... yes
checking X11 headers... yes
checking for XShmQueryExtension in -lXext... yes
checking for X11/Xlib.h... yes
checking Xlib XShm extention... yes
checking for XineramaQueryExtension in -lXinerama... yes
checking for X11/extensions/Xinerama.h... yes
checking Xinerama headers... yes
checking for XFixesQueryVersion in -lXfixes... yes
checking for BZ2_bzDecompress in -lbz2... yes
checking for FcInit in -lfontconfig... yes
checking for FT_Init_FreeType in -lfreetype... yes
checking for lzma_version_number in -llzma... yes
checking for png_read_png in -lpng... yes
checking for pthread_create in -lpthread... yes
checking for gzopen in -lz... yes
checking for fftw3.h... yes
checking fftw headers... yes
checking for uuid/uuid.h... yes
checking uuid headers... yes
checking for linux/cdrom.h... yes
checking linux cdrom headers... yes
checking for sys/ioctl.h... yes
checking linux sys... yes
checking for FLAC/stream_decoder.h... yes
checking FLAC headers... yes
checking for lame/lame.h... yes
checking lame headers... yes
checking for stdio.h... (cached) yes
checking jpeg headers... yes
checking for openjpeg.h... no
checking openjpeg headers... no
checking for sndfile.h... yes
checking sndfile headers... yes
checking for ImfOpenInputFile in -lIlmImf... no
checking for ImfOpenInputFile in -lImath... no
checking for vpx/vpx_decoder.h... yes
checking vpx headers... yes
checking for mjpegtools/mjpeg_types.h... yes
checking mjpegtools headers... yes
checking for tiff.h... yes
checking tiff headers... yes
checking for twolame.h... yes
checking twolame headers... yes
checking for stdint.h... (cached) yes
checking x264 headers... yes
checking for x265.h... yes
checking x265 headers... yes
checking for opus/opus_multistream.h... yes
checking libopus headers... yes
checking for aom/aom.h... yes
checking libaom headers... yes
checking for dav1d/dav1d.h... yes
checking libdav1d headers... yes
checking for webp/encode.h... yes
checking libwebp headers... yes
checking for stdint.h... (cached) yes
checking a52 headers... yes
checking for encore.h... no
checking encore headers... no
checking for gif_lib.h... yes
checking gif lib headers... yes
checking for jbg_dec_init in -ljbig... yes
checking for vdp_device_create_x11 in -lvdpau... yes
checking for vaInitialize in -lva... yes
checking for va/va_x11.h... yes
checking va x11 headers... yes
checking for vaGetDisplay in -lva-x11... yes
checking for va/va_drm.h... yes
checking va drm headers... yes
checking for vaGetDisplayDRM in -lva-drm... yes
checking for glUseProgram in -lGL... yes
checking for gluOrtho2D in -lGLU... yes
checking for GL/gl.h... yes
checking opengl headers... yes
checking for XvQueryExtension in -lXv... yes
checking for X11/Xlib.h... (cached) yes
checking Xlib Xv extention... yes
checking for sys/soundcard.h... yes
checking oss headers... yes
checking for XftInit in -lXft... yes
checking for X11/Xlib.h... (cached) yes
checking Xft/freetype headers... yes
checking for snd_pcm_open in -lasound... yes
checking for alsa/asoundlib.h... yes
checking asound headers... yes
checking for ogg/ogg.h... yes
checking ogg headers... yes
checking for theora/theoraenc.h... yes
checking threora headers... yes
checking for vorbis/vorbisenc.h... yes
checking vorbis encoders headers... yes
checking for vorbis/vorbisfile.h... yes
checking vorbis file headers... yes
checking for libavc1394/avc1394.h... yes
checking libavc1394 headers... yes
checking for libavc1394/rom1394.h... yes
checking librom1394 headers... yes
checking for libiec61883/iec61883.h... yes
checking libiec61883 headers... yes
checking for libraw1394/raw1394.h... yes
checking libraw1394 headers... yes
checking for libdv/dv.h... yes
checking libdv headers... yes
checking for linux/dvb/dmx.h... yes
checking dvb device headers... yes
checking for linux/kernel.h... yes
checking v4l2 system headers... yes
checking for X11/Xlib.h... (cached) yes
checking XF86VM headers... yes
checking for esd.h... no
checking esound headers... no
checking for audiofile.h... no
checking audiofile headers... no
checking for pa_simple_new in -lpulse-simple... yes
checking for pulse/simple.h... yes
checking pulse-simple headers... yes
checking for pa_context_new in -lpulse... yes
checking for pulse/error.h... yes
checking pulse headers... yes
checking for linux/isofs.h... no
checking isofs headers... no
checking for X11/keysymdef.h... yes
checking x11 keysym defs... yes
checking for libusb_init in -lusb-1.0... yes
checking for libusb-1.0/libusb.h... yes
checking libusb headers... yes
checking for lv2 availability... checking for lilv/lilv.h... yes
checking lilv headers... yes
checking for serd/serd.h... yes
checking serd headers... yes
checking for sord/sord.h... yes
checking sord headers... yes
checking for sratom/sratom.h... yes
checking sratom headers... yes
checking for suil/suil.h... yes
checking suil headers... yes
checking for /usr/local/cuda/include/cuda.h... no
checking cuda sdk... no
checking for dlopen in -ldl... yes
checking for numa_alloc in -lnuma... yes
checking for openexr available... yes
  Reason                  Package
  ------                  -------
  static                  libbthread
  forced                  a52dec
  forced                  djbfft
  disabled                encore
  disabled                audiofile
  disabled                esound
  forced                  ffmpeg
  static                  fftw
  static                  flac
  forced                  giflib
  static                  ilmBase
  static                  ladspa
  forced                  lame
  static                  libavc1394
  forced                  libraw1394
  static                  libiec61883
  static                  libdv
  static                  libjpeg
  forced                  libogg
  static                  libsndfile
  forced                  libtheora
  forced                  libuuid
  forced                  libvorbis
  forced                  mjpegtools
  static                  libaom
  static                  dav1d
  static                  libwebp
  static                  openExr
  static                  openexr
  forced                  openjpeg
  static                  tiff
  forced                  twolame
  forced                  x264
  forced                  x265
  static                  libvpx
  static                  opus
  static                  lv2
  static                  lilv
  static                  sratom
  static                  serd
  static                  sord
  static                  suil
  static                  ffnvcodec
  static                  libdpx
  system                  -lX11
  system                  -lXext
  system                  -lXinerama
  system                  -lXfixes
  system                  -lbz2
  system                  -lfontconfig
  system                  -lfreetype
  system                  -llzma
  system                  -lpng
  system                  -lpthread
  system                  -lz
  system                  -ljbig
  system                  -lvdpau
  system                  -lva
  system                  -lva-x11
  system                  -lva-drm
  system                  -lGL
  system                  -lGLU
  system                  -lXv
  system                  -lXft
  system                  -lasound
  system                  -lpulse-simple
  system                  -lpulse
  system                  -lusb-1.0
  system                  -ldl
  system                  -lnuma

  using: with-gl
  using: with-xft
  using: with-xxf86vm
  using: with-oss
  using: with-alsa
  using: with-firewire
  using: with-ogg
  using: with-dv
  using: with-dvb
  using: with-ladspa
  using: with-video4linux2
  using: without-esound
  using: with-pulse
  using: with-pactl
  using: with-openexr
  using: with-lv2
  using: without-commercial
  using: with-giflib
  using: with-libzmpeg
  using: with-libdpx
  using: with-shuttle
  using: with-shuttle_usb
  using: with-xv
  using: with-vaapi
  using: with-vdpau
  using: without-cuda
  using: with-nv
  using: with-wintv
  using: with-x10tv
  using: with-jobs = 38
  using: exec-name = cin
  using: with-cinlib = $$CIN_PATH
  using: with-cindat = $$CIN_PATH
  using: with-config-dir = /home/paz/.bcast6
  using: with-nested-dir = $$HOME/Videos
  using: with-snap-dir = $$HOME/Pictures
  using: with-browser = firefox
  using: with-plugin-dir = $$CIN_LIB/plugins
  using: with-ladspa-dir = $$CIN_LIB/ladspa
  using: with-opencv = no
  using: with-git-ffmpeg = no
  using: with-noelision = auto
  using: with-booby = yes
  using: with-clang = no

  using: thirdparty build = yes
  using: single-user  = yes
  using: static-build = yes
  using: ladspa-build = yes

checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
config.status: executing libtool commands


configure.txt (16,042 bytes)
Andrew-R

Andrew-R

2023-11-20 21:12

reporter   ~0005592

@Andrea_Paz, can you double-check that openexr actually enabled in your build? For me it works even if I rebuild cingg with new internal ffmpeg 6.1.
Andrea_Paz

Andrea_Paz

2023-11-20 21:09

manager   ~0005591

My Cinelerra.rc:
...
FILE_PROBE_TOTAL 20
FILE_PROBE0_NAME EXR
FILE_PROBE0_ARMED 1
FILE_PROBE1_NAME FFMPEG_Early
FILE_PROBE1_ARMED 0
....

It appears to be enabled, but ffmpeg is still active.
Could it be the new ffmpeg6.1 giving problems?
Andrew-R

Andrew-R

2023-11-20 20:28

reporter   ~0005590

strange for me in .bcast5/Cinelerra_rc I have

```
FILE_PROBE_TOTAL 20
FILE_PROBE0_NAME FFMPEG_Early
FILE_PROBE0_ARMED 0
FILE_PROBE1_NAME Scene
FILE_PROBE1_ARMED 1
FILE_PROBE2_NAME DB
FILE_PROBE2_ARMED 1
FILE_PROBE3_NAME DV
FILE_PROBE3_ARMED 1
FILE_PROBE4_NAME SndFile
FILE_PROBE4_ARMED 1
FILE_PROBE5_NAME PNG
FILE_PROBE5_ARMED 1
FILE_PROBE6_NAME PPM
FILE_PROBE6_ARMED 1
FILE_PROBE7_NAME JPEG
FILE_PROBE7_ARMED 1
FILE_PROBE8_NAME GIF
FILE_PROBE8_ARMED 1
FILE_PROBE9_NAME EXR
FILE_PROBE9_ARMED 1
FILE_PROBE10_NAME FLAC
FILE_PROBE10_ARMED 1
FILE_PROBE11_NAME CR2
FILE_PROBE11_ARMED 0
FILE_PROBE12_NAME TGA
FILE_PROBE12_ARMED 1
FILE_PROBE13_NAME TIFF
FILE_PROBE13_ARMED 1
FILE_PROBE14_NAME OGG
FILE_PROBE14_ARMED 1
FILE_PROBE15_NAME Vorbis
FILE_PROBE15_ARMED 1
FILE_PROBE16_NAME MPEG
FILE_PROBE16_ARMED 1
FILE_PROBE17_NAME EDL
FILE_PROBE17_ARMED 1
FILE_PROBE18_NAME FFMPEG_Late
FILE_PROBE18_ARMED 1
```

and it works for me .... try with temporary new profile?
Andrea_Paz

Andrea_Paz

2023-11-20 20:08

manager   ~0005589

Last edited: 2023-11-20 20:12

View 2 revisions

It does not maintain the setting. Activating enable and then "Apply," etc. The internal engine still does not work and if you reopen "probe order" you can see that it is disabled again....

Edit
Sorry, I forgot to mention that I brought exr up as the first item.

Andrew-R

Andrew-R

2023-11-20 19:38

reporter   ~0005588

@Andrea_Paz be sure that EXR entry is Enabled:

exr_enabled.png (12,553 bytes)
exr_enabled.png (12,553 bytes)
Andrea_Paz

Andrea_Paz

2023-11-20 19:26

manager   ~0005587

Yes, I also noticed that "try ffmpeg first" seems to be active.
Actually in all the tests I always left the "try ffmpeg last" on. I don't know why it doesn't work...
Andrew-R

Andrew-R

2023-11-20 19:21

reporter   ~0005586

@Andrea_Paz note that default FFmpge exr decoder apparently can't put out big values to cingg's pipeline like native decoder does. So, try to disable ffmpeg first button before testing, so lines like

FFMPEG::open_decoder: some stream have bad times: /home/paz/test/9.exr

disappear ...
Andrea_Paz

Andrea_Paz

2023-11-20 19:15

manager   ~0005585

@Andrew-R
More tests. I only used the 2 new patches, omitting the "noclamp..." and also "alt_shortcut..." that I was always putting in lately. I made two customizations: "--disable-doc" to keep the build from crashing is adding "AC_CONFIG_MACRO_DIRS([m4])" in configure.ac otherwise autogen.sh doesn't work. The second one has been years in the making.
The results are the usual: all exr images have the clip except the usual one, which works fine instead.
The images that have the clip give this message to the terminal:

FFMPEG::open_decoder: some stream have bad times: /home/paz/test/9.exr
FFMPEG::open_decoder: some stream have bad times: /home/paz/test/Ocean.exr
FFMPEG::open_decoder: some stream have bad times: /home/paz/test/blender_test2.exr
FFMPEG::open_decoder: some stream have bad times: /home/paz/test/BrightRingsNanInf.exr
FFMPEG::open_decoder: some stream have bad times: /home/paz/test/blender_test.exr
FFMPEG::open_decoder: some stream have bad times: /home/paz/test/Desk.exr

As you can see "small_empty_room.exr" gives no errors and in fact works without any problems.

This time the priority of tracks from top to bottom is respected and it works normally.
Andrew-R

Andrew-R

2023-11-20 17:41

reporter   ~0005584

@Andrea_Paz strange, it seems to work for me ...

Andrew-R

Andrew-R

2023-11-20 17:24

reporter   ~0005583

@Andrea_Paz well, there is possibility I messed things up! Be sure you do not have previous patches applied. I'll try to rebuild fully too.
Andrea_Paz

Andrea_Paz

2023-11-20 13:01

manager   ~0005582

Every time I do a build I get different behaviors. Now I am back to having clipped values on every exr except "small_empty_room.exr" which always works for me.
The clipped value read with color picker is 1.0 for some exr and 0.9990 for other images.
Gradient still does not work.
What is very strange is that the upper track is not the one with priority, but the lower track is! Appimage on the other hand works normally, with the upper track in order.
I honestly don't understand all these behaviors and if I'm doing something wrong...
Andrew-R

Andrew-R

2023-11-20 10:52

reporter   ~0005581

@Andrea_Paz new patches replace earlier ones, you can start with just first (0001-TEST-Simpler-unlimited-float-overlay.patch ) and then see if you have any use for second (saving negative-values exrs ?)
Andrea_Paz

Andrea_Paz

2023-11-20 10:45

manager   ~0005580

Could you tell me which patches to apply to test? Opengl3 no; do these two new patches replace others or are they just to be added?
Andrew-R

Andrew-R

2023-11-20 09:25

reporter   ~0005579

And this is second patch allowing cingg behave more like cin-cv with negative numbers as exemplified by AllHalfValues.exr test file

0002-Allow-negative-numbers-in-overlayer.patch (912 bytes)
From 87b6f361951e40eaac3a6ee04050344ad0a45679 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Mon, 20 Nov 2023 12:05:05 +0300
Subject: [PATCH 2/2] Allow negative numbers  in overlayer

---
 cinelerra-5.1/cinelerra/overlayframe.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cinelerra-5.1/cinelerra/overlayframe.h b/cinelerra-5.1/cinelerra/overlayframe.h
index 6f5d0e7b..4775e8df 100644
--- a/cinelerra-5.1/cinelerra/overlayframe.h
+++ b/cinelerra-5.1/cinelerra/overlayframe.h
@@ -238,7 +238,7 @@ static inline int64_t aclip(int64_t v, int mx) {
 	return v < 0 ? 0 : v > mx ? mx : v;
 }
 static inline float   aclip(float v, float mx) {
-	return v < 0 ? 0 : v > FLT_MAX-1 ? FLT_MAX : v;
+	return v < -FLT_MAX+1 ? -FLT_MAX : v > FLT_MAX-1 ? FLT_MAX : v;
 }
 static inline float   aclip(float v, int mx) {
 	return v < 0 ? 0 : v > mx ? mx : v;
-- 
2.35.7

Andrew-R

Andrew-R

2023-11-19 23:36

reporter   ~0005578

Here is simpler non limited float overlayer patch - with it gradient still works, and I can boost brightness above 1.0f and bring it back (with details) with fader OR load big values EXR

0001-TEST-Simpler-unlimited-float-overlay.patch (1,028 bytes)
From bbcae1bba06b78731b5c3b416e4566fe7169eabb Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Mon, 20 Nov 2023 02:16:44 +0300
Subject: [PATCH] TEST Simpler unlimited float overlay

---
 cinelerra-5.1/cinelerra/overlayframe.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cinelerra-5.1/cinelerra/overlayframe.h b/cinelerra-5.1/cinelerra/overlayframe.h
index 13c2e4bd..6f5d0e7b 100644
--- a/cinelerra-5.1/cinelerra/overlayframe.h
+++ b/cinelerra-5.1/cinelerra/overlayframe.h
@@ -32,6 +32,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <float.h>
 
 #define DIRECT_COPY 0
 #define BILINEAR 1
@@ -237,7 +238,7 @@ static inline int64_t aclip(int64_t v, int mx) {
 	return v < 0 ? 0 : v > mx ? mx : v;
 }
 static inline float   aclip(float v, float mx) {
-	return v < 0 ? 0 : v > mx ? mx : v;
+	return v < 0 ? 0 : v > FLT_MAX-1 ? FLT_MAX : v;
 }
 static inline float   aclip(float v, int mx) {
 	return v < 0 ? 0 : v > mx ? mx : v;
-- 
2.35.7

Andrea_Paz

Andrea_Paz

2023-11-19 20:50

manager   ~0005577

Ah, that's where I was wrong! I was using X11-OpenGL. Now with X11, Gradient does not work and fade/eydropper give results above 1.0 (except for BrightRings.exr; Desk.exr and Ocean.exr)
Andrew-R

Andrew-R

2023-11-19 19:21

reporter   ~0005576

@Andrea_Paz be sure to set output device to x11 and not x11-opengl. OpenGL still clips.

Also, gradient with patches presented here also works for me in rgba-8bit, rgb-8bit, yuv modes and rgb-float but NOT in rgbA-float. It just makes black output in compositor.
Andrea_Paz

Andrea_Paz

2023-11-19 19:16

manager   ~0005575

If the fade works for you then the color picker also reports values above 1.0. To me they are fixed at 1.0 except for the exr with the window on the outside...
The same happens with the exr made with Blender that you provided.
I wonder what I may have done; or was it an Arch update.

The gradient works for me with RGB8; YUVA8 and RGB-Float, both on track with exr and mov and in an empty track.
Andrew-R

Andrew-R

2023-11-19 15:53

reporter   ~0005574

@Andrea_Paz at least BrightRings seems to fade correctly for me - with rgba-8 bit white square remains on top of rings, with rgba-float it fades into black background leaving only rings ... But gradient still does not work for me :(
Andrew-R

Andrew-R

2023-11-19 15:21

reporter   ~0005573

@Andrea_Paz thanks for testing while I was asleep!

May be I should rebuild fully before concluding.

Does gradient look the same in all project formats - like yuv8-bit or RGB-8bit in additional to RGB(A)-float ?
I just put plugin over empty video track for testing ....

will re-test openexr test images to see if they work for me.

opengl3 patch is sadly incomplete (I think). It will work for single stage processing but eventually if you add more effects or tracks it will render to 8 bpc buffer and thus clip ... (not tested yet)
Andrea_Paz

Andrea_Paz

2023-11-19 13:11

manager   ~0005572

I did some tests. Gradient plugin works without any problems. I did not put the patch "opengl3...." and the fade does not work for me while Histogram does. In Histogram the black remains clipped, but in my opinion that is good.
Only "small_empty_room_1_4k.exr" works for me while the others I downloaded from "openexr.com/test_image" all turn out clipped at 1.0. I know they are in 16-bit float and not 32-bit; could this be the cause of the clipping? In Gimp and Krita they are not clipped.

Should I apply the patch opengl3... as well?
Andrew-R

Andrew-R

2023-11-19 06:19

reporter   ~0005571

oh, no

change in cinelerra/overlay_direct_rgba_float.C break gradient plugin :(
Andrew-R

Andrew-R

2023-11-19 03:27

reporter   ~0005570

ah, I think I found where it clips colors to 0.

0002-Remove-clip-to-0.0-as-minimal-float-value-enables-ne.patch (905 bytes)
From a446bcf492dbbce2833e2bd788354a24cf385706 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Sun, 19 Nov 2023 06:06:30 +0300
Subject: [PATCH 2/2] Remove clip to 0.0 as minimal float value, enables
 negative numbers in pipeline

---
 cinelerra-5.1/cinelerra/overlayframe.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cinelerra-5.1/cinelerra/overlayframe.h b/cinelerra-5.1/cinelerra/overlayframe.h
index 631af3f1..96d455b2 100644
--- a/cinelerra-5.1/cinelerra/overlayframe.h
+++ b/cinelerra-5.1/cinelerra/overlayframe.h
@@ -238,7 +238,7 @@ static inline int64_t aclip(int64_t v, int mx) {
 	return v < 0 ? 0 : v > mx ? mx : v;
 }
 static inline float   aclip(float v, float mx) {
-	return v < 0 ? 0 : v > mx ? mx : v;
+	return  v > mx ? mx : v;
 }
 static inline float   aclip(float v, int mx) {
 	return v < 0 ? 0 : v > mx ? mx : v;
-- 
2.35.7

Andrew-R

Andrew-R

2023-11-18 23:09

reporter   ~0005569

new patch for overlayer, clamp to FLT_MAX (not found yet where min clamping to 0 happen)

0001-TEST-clamp-to-FLT_MAX-not-1.0f-in-rgba-float-modes.patch (4,226 bytes)
From 3ffabb403ad99824657da8cc4cfd9a530341cc7c Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Sun, 19 Nov 2023 01:48:52 +0300
Subject: [PATCH] TEST: clamp to FLT_MAX, not 1.0f in rgba float modes

---
 cinelerra-5.1/cinelerra/overlay_direct_rgb_float.C   | 2 +-
 cinelerra-5.1/cinelerra/overlay_direct_rgba_float.C  | 2 +-
 cinelerra-5.1/cinelerra/overlay_nearest_rgb_float.C  | 2 +-
 cinelerra-5.1/cinelerra/overlay_nearest_rgba_float.C | 2 +-
 cinelerra-5.1/cinelerra/overlay_sample_rgb_float.C   | 2 +-
 cinelerra-5.1/cinelerra/overlay_sample_rgba_float.C  | 2 +-
 cinelerra-5.1/cinelerra/overlayframe.h               | 1 +
 7 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/cinelerra-5.1/cinelerra/overlay_direct_rgb_float.C b/cinelerra-5.1/cinelerra/overlay_direct_rgb_float.C
index 9b13df3e..e07bceab 100644
--- a/cinelerra-5.1/cinelerra/overlay_direct_rgb_float.C
+++ b/cinelerra-5.1/cinelerra/overlay_direct_rgb_float.C
@@ -1,5 +1,5 @@
 #include "overlaydirect.h"
 // parallel build
-#define BLEND(FN) XBLEND(FN, z_float, z_float, 1.f, 3, 0, 0.f);
+#define BLEND(FN) XBLEND(FN, z_float, z_float, FLT_MAX, 3, 0, 0.f);
 void DirectUnit::rgb_float() { BLEND_SWITCH(BLEND); }
 
diff --git a/cinelerra-5.1/cinelerra/overlay_direct_rgba_float.C b/cinelerra-5.1/cinelerra/overlay_direct_rgba_float.C
index f0c8afcf..83c75fd3 100644
--- a/cinelerra-5.1/cinelerra/overlay_direct_rgba_float.C
+++ b/cinelerra-5.1/cinelerra/overlay_direct_rgba_float.C
@@ -1,5 +1,5 @@
 #include "overlaydirect.h"
 // parallel build
-#define BLEND(FN) XBLEND(FN, z_float, z_float, 1.f, 4, 0, 0.f);
+#define BLEND(FN) XBLEND(FN, z_float, z_float, FLT_MAX, 4, 0, 0.f);
 void DirectUnit::rgba_float() { BLEND_SWITCH(BLEND); }
 
diff --git a/cinelerra-5.1/cinelerra/overlay_nearest_rgb_float.C b/cinelerra-5.1/cinelerra/overlay_nearest_rgb_float.C
index 61eb333c..9378cd7a 100644
--- a/cinelerra-5.1/cinelerra/overlay_nearest_rgb_float.C
+++ b/cinelerra-5.1/cinelerra/overlay_nearest_rgb_float.C
@@ -1,5 +1,5 @@
 #include "overlaynearest.h"
 // parallel build
-#define BLEND(FN) XBLEND_3NN(FN, z_float, z_float, 1.f, 3, 0, 0.f);
+#define BLEND(FN) XBLEND_3NN(FN, z_float, z_float, FLT_MAX, 3, 0, 0.f);
 void NNUnit::rgb_float() { BLEND_SWITCH(BLEND); }
 
diff --git a/cinelerra-5.1/cinelerra/overlay_nearest_rgba_float.C b/cinelerra-5.1/cinelerra/overlay_nearest_rgba_float.C
index 0e120691..61965415 100644
--- a/cinelerra-5.1/cinelerra/overlay_nearest_rgba_float.C
+++ b/cinelerra-5.1/cinelerra/overlay_nearest_rgba_float.C
@@ -1,5 +1,5 @@
 #include "overlaynearest.h"
 // parallel build
-#define BLEND(FN) XBLEND_3NN(FN, z_float, z_float, 1.f, 4, 0, 0.f);
+#define BLEND(FN) XBLEND_3NN(FN, z_float, z_float, FLT_MAX, 4, 0, 0.f);
 void NNUnit::rgba_float() { BLEND_SWITCH(BLEND); }
 
diff --git a/cinelerra-5.1/cinelerra/overlay_sample_rgb_float.C b/cinelerra-5.1/cinelerra/overlay_sample_rgb_float.C
index 5fd17134..93633799 100644
--- a/cinelerra-5.1/cinelerra/overlay_sample_rgb_float.C
+++ b/cinelerra-5.1/cinelerra/overlay_sample_rgb_float.C
@@ -1,5 +1,5 @@
 #include "overlaysample.h"
 // parallel build
-#define BLEND(FN) XSAMPLE(FN, z_float, z_float, 1.f, 3, 0, 0.f);
+#define BLEND(FN) XSAMPLE(FN, z_float, z_float, FLT_MAX, 3, 0, 0.f);
 void SampleUnit::rgb_float() { BLEND_SWITCH(BLEND); }
 
diff --git a/cinelerra-5.1/cinelerra/overlay_sample_rgba_float.C b/cinelerra-5.1/cinelerra/overlay_sample_rgba_float.C
index 84d517e0..6e2bc507 100644
--- a/cinelerra-5.1/cinelerra/overlay_sample_rgba_float.C
+++ b/cinelerra-5.1/cinelerra/overlay_sample_rgba_float.C
@@ -1,5 +1,5 @@
 #include "overlaysample.h"
 // parallel build
-#define BLEND(FN) XSAMPLE(FN, z_float, z_float, 1.f, 4, 0, 0.f);
+#define BLEND(FN) XSAMPLE(FN, z_float, z_float, FLT_MAX, 4, 0, 0.f);
 void SampleUnit::rgba_float() { BLEND_SWITCH(BLEND); }
 
diff --git a/cinelerra-5.1/cinelerra/overlayframe.h b/cinelerra-5.1/cinelerra/overlayframe.h
index 13c2e4bd..631af3f1 100644
--- a/cinelerra-5.1/cinelerra/overlayframe.h
+++ b/cinelerra-5.1/cinelerra/overlayframe.h
@@ -32,6 +32,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <float.h>
 
 #define DIRECT_COPY 0
 #define BILINEAR 1
-- 
2.35.7

Andrew-R

Andrew-R

2023-11-18 21:20

reporter   ~0005568

according to stackoverflow

https://stackoverflow.com/questions/4786663/limits-for-floating-point-types

define FLT_MAX 3.402823466E+38F

and minimum negative number is

https://stackoverflow.com/questions/2528039/why-is-flt-min-equal-to-zero

"If you want the minimum floating point number (including negative numbers), use -FLT_MAX"
Andrew-R

Andrew-R

2023-11-18 21:05

reporter   ~0005567

Note that according to EXR test page values in color channels in floating-point EXR can go much above 1000:

https://openexr.com/en/latest/_test_images/index.html
Andrew-R

Andrew-R

2023-11-18 21:03

reporter   ~0005566

Andrea tried removing clamp in histogram plugin, and I tried to remove limit in overlayer code.

overlay_overmode_nogl.diff (3,398 bytes)
diff --git a/cinelerra-5.1/cinelerra/ci b/cinelerra-5.1/cinelerra/ci
index bc987833..22858982 120000
--- a/cinelerra-5.1/cinelerra/ci
+++ b/cinelerra-5.1/cinelerra/ci
@@ -1 +1 @@
-../bin/cinelerra
\ No newline at end of file
+../bin/cin
\ No newline at end of file
diff --git a/cinelerra-5.1/cinelerra/overlay_direct_rgb_float.C b/cinelerra-5.1/cinelerra/overlay_direct_rgb_float.C
index 9b13df3e..926b70ed 100644
--- a/cinelerra-5.1/cinelerra/overlay_direct_rgb_float.C
+++ b/cinelerra-5.1/cinelerra/overlay_direct_rgb_float.C
@@ -1,5 +1,5 @@
 #include "overlaydirect.h"
 // parallel build
-#define BLEND(FN) XBLEND(FN, z_float, z_float, 1.f, 3, 0, 0.f);
+#define BLEND(FN) XBLEND(FN, z_float, z_float, 1000.f, 3, 0, 0.f);
 void DirectUnit::rgb_float() { BLEND_SWITCH(BLEND); }
 
diff --git a/cinelerra-5.1/cinelerra/overlay_direct_rgba_float.C b/cinelerra-5.1/cinelerra/overlay_direct_rgba_float.C
index f0c8afcf..54517f26 100644
--- a/cinelerra-5.1/cinelerra/overlay_direct_rgba_float.C
+++ b/cinelerra-5.1/cinelerra/overlay_direct_rgba_float.C
@@ -1,5 +1,5 @@
 #include "overlaydirect.h"
 // parallel build
-#define BLEND(FN) XBLEND(FN, z_float, z_float, 1.f, 4, 0, 0.f);
+#define BLEND(FN) XBLEND(FN, z_float, z_float, 1000.f, 4, 0, 0.f);
 void DirectUnit::rgba_float() { BLEND_SWITCH(BLEND); }
 
diff --git a/cinelerra-5.1/cinelerra/overlay_nearest_rgb_float.C b/cinelerra-5.1/cinelerra/overlay_nearest_rgb_float.C
index 61eb333c..36ad6b98 100644
--- a/cinelerra-5.1/cinelerra/overlay_nearest_rgb_float.C
+++ b/cinelerra-5.1/cinelerra/overlay_nearest_rgb_float.C
@@ -1,5 +1,5 @@
 #include "overlaynearest.h"
 // parallel build
-#define BLEND(FN) XBLEND_3NN(FN, z_float, z_float, 1.f, 3, 0, 0.f);
+#define BLEND(FN) XBLEND_3NN(FN, z_float, z_float, 1000.f, 3, 0, 0.f);
 void NNUnit::rgb_float() { BLEND_SWITCH(BLEND); }
 
diff --git a/cinelerra-5.1/cinelerra/overlay_nearest_rgba_float.C b/cinelerra-5.1/cinelerra/overlay_nearest_rgba_float.C
index 0e120691..6ce72240 100644
--- a/cinelerra-5.1/cinelerra/overlay_nearest_rgba_float.C
+++ b/cinelerra-5.1/cinelerra/overlay_nearest_rgba_float.C
@@ -1,5 +1,5 @@
 #include "overlaynearest.h"
 // parallel build
-#define BLEND(FN) XBLEND_3NN(FN, z_float, z_float, 1.f, 4, 0, 0.f);
+#define BLEND(FN) XBLEND_3NN(FN, z_float, z_float, 1000.f, 4, 0, 0.f);
 void NNUnit::rgba_float() { BLEND_SWITCH(BLEND); }
 
diff --git a/cinelerra-5.1/cinelerra/overlay_sample_rgb_float.C b/cinelerra-5.1/cinelerra/overlay_sample_rgb_float.C
index 5fd17134..84669f1d 100644
--- a/cinelerra-5.1/cinelerra/overlay_sample_rgb_float.C
+++ b/cinelerra-5.1/cinelerra/overlay_sample_rgb_float.C
@@ -1,5 +1,5 @@
 #include "overlaysample.h"
 // parallel build
-#define BLEND(FN) XSAMPLE(FN, z_float, z_float, 1.f, 3, 0, 0.f);
+#define BLEND(FN) XSAMPLE(FN, z_float, z_float, 1000.f, 3, 0, 0.f);
 void SampleUnit::rgb_float() { BLEND_SWITCH(BLEND); }
 
diff --git a/cinelerra-5.1/cinelerra/overlay_sample_rgba_float.C b/cinelerra-5.1/cinelerra/overlay_sample_rgba_float.C
index 84d517e0..44388d9b 100644
--- a/cinelerra-5.1/cinelerra/overlay_sample_rgba_float.C
+++ b/cinelerra-5.1/cinelerra/overlay_sample_rgba_float.C
@@ -1,5 +1,5 @@
 #include "overlaysample.h"
 // parallel build
-#define BLEND(FN) XSAMPLE(FN, z_float, z_float, 1.f, 4, 0, 0.f);
+#define BLEND(FN) XSAMPLE(FN, z_float, z_float, 1000.f, 4, 0, 0.f);
 void SampleUnit::rgba_float() { BLEND_SWITCH(BLEND); }
 
noclamp_in_histogram.diff (709 bytes)
diff --git a/cinelerra-5.1/plugins/histogram/histogram.C b/cinelerra-5.1/plugins/histogram/histogram.C
index c78c3c7c..975e2eab 100644
--- a/cinelerra-5.1/plugins/histogram/histogram.C
+++ b/cinelerra-5.1/plugins/histogram/histogram.C
@@ -234,7 +234,7 @@ float HistogramMain::calculate_level(float input, int mode, int use_value)
 
 	if( !EQUIV(config.gamma[mode], 0) ) {
 		output = pow(output, 1.0 / config.gamma[mode]);
-		CLAMP(output, 0, 1.0);
+		//CLAMP(output, 0, 1.0);
 	}
 
 // Apply value curve
@@ -247,7 +247,7 @@ float HistogramMain::calculate_level(float input, int mode, int use_value)
 			config.low_output[mode];
 	}
 
-	CLAMP(output, 0, 1.0);
+	//CLAMP(output, 0, 1.0);
 	return output;
 }
 

Issue History

Date Modified Username Field Change
2023-11-18 21:01 Andrew-R New Issue
2023-11-18 21:03 Andrew-R File Added: overlay_overmode_nogl.diff
2023-11-18 21:03 Andrew-R File Added: noclamp_in_histogram.diff
2023-11-18 21:03 Andrew-R Note Added: 0005566
2023-11-18 21:05 Andrew-R Note Added: 0005567
2023-11-18 21:20 Andrew-R Note Added: 0005568
2023-11-18 23:09 Andrew-R File Added: 0001-TEST-clamp-to-FLT_MAX-not-1.0f-in-rgba-float-modes.patch
2023-11-18 23:09 Andrew-R Note Added: 0005569
2023-11-19 03:27 Andrew-R File Added: 0002-Remove-clip-to-0.0-as-minimal-float-value-enables-ne.patch
2023-11-19 03:27 Andrew-R Note Added: 0005570
2023-11-19 06:19 Andrew-R Note Added: 0005571
2023-11-19 13:11 Andrea_Paz Note Added: 0005572
2023-11-19 15:21 Andrew-R Note Added: 0005573
2023-11-19 15:53 Andrew-R Note Added: 0005574
2023-11-19 19:16 Andrea_Paz Note Added: 0005575
2023-11-19 19:21 Andrew-R Note Added: 0005576
2023-11-19 20:50 Andrea_Paz Note Added: 0005577
2023-11-19 23:36 Andrew-R File Added: 0001-TEST-Simpler-unlimited-float-overlay.patch
2023-11-19 23:36 Andrew-R Note Added: 0005578
2023-11-20 09:25 Andrew-R File Added: 0002-Allow-negative-numbers-in-overlayer.patch
2023-11-20 09:25 Andrew-R Note Added: 0005579
2023-11-20 10:45 Andrea_Paz Note Added: 0005580
2023-11-20 10:52 Andrew-R Note Added: 0005581
2023-11-20 13:01 Andrea_Paz Note Added: 0005582
2023-11-20 17:24 Andrew-R Note Added: 0005583
2023-11-20 17:41 Andrew-R File Added: rgba_floa_test_gradient-fs8.png
2023-11-20 17:41 Andrew-R File Added: rgba_float_test_right_rings-fs8.png
2023-11-20 17:41 Andrew-R Note Added: 0005584
2023-11-20 19:15 Andrea_Paz Note Added: 0005585
2023-11-20 19:21 Andrew-R Note Added: 0005586
2023-11-20 19:26 Andrea_Paz Note Added: 0005587
2023-11-20 19:38 Andrew-R File Added: exr_enabled.png
2023-11-20 19:38 Andrew-R Note Added: 0005588
2023-11-20 20:08 Andrea_Paz Note Added: 0005589
2023-11-20 20:12 Andrea_Paz Note Edited: 0005589 View Revisions
2023-11-20 20:28 Andrew-R Note Added: 0005590
2023-11-20 21:09 Andrea_Paz Note Added: 0005591
2023-11-20 21:12 Andrew-R Note Added: 0005592
2023-11-20 21:21 Andrea_Paz File Added: configure.txt
2023-11-20 21:21 Andrea_Paz Note Added: 0005593
2023-11-20 21:22 Andrea_Paz Note Edited: 0005593 View Revisions
2023-11-26 21:09 Andrea_Paz Note Added: 0005595