Credit Andrea/Andrew - allow for out-of-range values for HDR video; so no clipping...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / overlayframe.h
index 620f8e18e8f1ff18cb2160c07db42d4119b82893..4775e8df0004c9f5c2c529c37b779b3b31a7be0a 100644 (file)
@@ -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 < -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;
@@ -334,7 +335,6 @@ ZTYP(float);        ZTYP(double);
   ALPHA_STORE(out, ofs, mx); \
   out[3] = aclip(a, mx)
 
-
 #define BLEND_SWITCH(FN) \
        switch( mode ) { \
         case TRANSFER_NORMAL:          FN(NORMAL); \
@@ -420,6 +420,23 @@ public:
 
        void process_package(LoadPackage *package);
        DirectEngine *engine;
+
+       DirectPackage *pkg;
+       int ix, iy, ox, ow;
+       VFrame *output, *input;
+       int mode;
+       float fade;
+
+       void rgb_float();
+       void rgba_float();
+       void rgb888();
+       void yuv888();
+       void rgba8888();
+       void yuva8888();
+       void rgb161616();
+       void yuv161616();
+       void rgba16161616();
+       void yuva16161616();
 };
 
 class NNUnit : public LoadClient
@@ -429,8 +446,25 @@ public:
        ~NNUnit();
 
        void process_package(LoadPackage *package);
-
        NNEngine *engine;
+
+       NNPackage *pkg;
+       int ix, iy, ox, ow;
+       VFrame *output, *input;
+       int mode;
+       float fade;
+       int *ly;
+
+       void rgb_float();
+       void rgba_float();
+       void rgb888();
+       void yuv888();
+       void rgba8888();
+       void yuva8888();
+       void rgb161616();
+       void yuv161616();
+       void rgba16161616();
+       void yuva16161616();
 };
 
 class SampleUnit : public LoadClient
@@ -440,8 +474,28 @@ public:
        ~SampleUnit();
 
        void process_package(LoadPackage *package);
-
        SampleEngine *engine;
+
+       SamplePackage *pkg;
+       VFrame *voutput, *vinput;
+       int mode;
+       float fade;
+
+       int i1i, i2i, o1i, o2i, oh, kd;
+       float i1f, i2f, o1f, o2f, *k;
+       int *lookup_sx0, *lookup_sx1, *lookup_sk;
+       float *lookup_wacc;
+
+       void rgb_float();
+       void rgba_float();
+       void rgb888();
+       void yuv888();
+       void rgba8888();
+       void yuva8888();
+       void rgb161616();
+       void yuv161616();
+       void rgba16161616();
+       void yuva16161616();
 };