]> bicyclesonthemoon.info Git - ott/enhance/commitdiff
fix indexing bugs & such stuff
authorb <rowerynaksiezycu@gmail.com>
Tue, 15 Nov 2022 21:27:33 +0000 (22:27 +0100)
committerb <rowerynaksiezycu@gmail.com>
Tue, 15 Nov 2022 21:27:33 +0000 (22:27 +0100)
bluenh.c
core.c

index bb0f61bfba01d35e45114686c2f760aadb01adfa..323f24c81491daa99941eb191816c0e7006e1808 100644 (file)
--- a/bluenh.c
+++ b/bluenh.c
@@ -194,9 +194,9 @@ void calculate_bluenh_parameters (struct bluenh_data *data)
        data->r_high = (ILint64)(data->f) - (ILint64)(data->e);
        data->s_high = (ILint64)(data->c) - (ILint64)(data->b);
        data->t_high =((ILint64)(data->e))*((ILint64)(data->c))-((ILint64)(data->b))*((ILint64)(data->f));
-       data->r_high = (ILint64)(data->e) - (ILint64)(data->d);
-       data->s_high = (ILint64)(data->b) - (ILint64)(data->a);
-       data->t_high =((ILint64)(data->d))*((ILint64)(data->b))-((ILint64)(data->a))*((ILint64)(data->e));
+       data->r_low = (ILint64)(data->e) - (ILint64)(data->d);
+       data->s_low = (ILint64)(data->b) - (ILint64)(data->a);
+       data->t_low =((ILint64)(data->d))*((ILint64)(data->b))-((ILint64)(data->a))*((ILint64)(data->e));
 }
 
 static inline ILuint bluenh_linear (ILuint x, ILint64 r, ILint64 s, ILint64 t, ILuint max)
diff --git a/core.c b/core.c
index 2a789dfd8868e43e58e8d0bcc8195ecda11d7d03..9b2ed4b2688eb78b2682c4bf6bd0f85a46a43898 100644 (file)
--- a/core.c
+++ b/core.c
@@ -1053,10 +1053,10 @@ int perform_action (
        uint_fast8_t skip_frame;
        uint_fast8_t skip_line;
        uint_fast8_t skip_pixel;
-       ILint actual_frames = 0xFFFFFFFF;
-       ILint actual_width  = 0xFFFFFFFF;
-       ILint actual_height = 0xFFFFFFFF;
-       ILint actual_colours= 0xFFFFFFFF;
+       ILint actual_frames = 0x7FFFFFFF;
+       ILint actual_width  = 0x7FFFFFFF;
+       ILint actual_height = 0x7FFFFFFF;
+       ILint actual_colours= 0x7FFFFFFF;
        ILint x, y, f;
        struct PixelInfo *p;
        int r = 0;
@@ -1130,7 +1130,7 @@ int perform_action (
        for (f = 0; (f < frames) && (r == 0); ++f)
        {
                skip_frame = 0;
-               for (i=0; i<n; ++n)
+               for (i=0; i<n; ++i)
                {
                        p[i].f_window = f;
                        p[i].f_pict = p[i].f0 + f;
@@ -1313,7 +1313,7 @@ int perform_action (
                                                
                                                p[i].x_window = 0;
                                                p[i].x_pict = p[i].x0;
-                                               p[i].pixel_offset = p[i].line_offset + (p[i].x_pict * p[i].info.image_bytes_per_pixel);                                         
+                                               p[i].pixel_offset = p[i].line_offset + (p[i].x_pict * p[i].info.image_bytes_per_pixel);
                                        }
                                        if (!skip_line)
                                        {
@@ -1508,7 +1508,7 @@ int perform_action (
                                                        {
                                                                ++(p[i].x_window);
                                                                ++(p[i].x_pict);
-                                                               p[i].pixel_offset = p[i].info.image_bytes_per_pixel;
+                                                               p[i].pixel_offset += p[i].info.image_bytes_per_pixel;
                                                        }
                                                }
                                        }