X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=flow_main.cpp;h=dc82d229ca8b121bcb92496b7a7114ac8b06a1a6;hb=3795723be95f2fe82f3c8b8b45b1a905b2c811fd;hp=a961a60a9aa805df282ddd7b4a4e6fd4d428c1ea;hpb=f96a233d97789c748000975e486e8b89c5c7d472;p=nageru diff --git a/flow_main.cpp b/flow_main.cpp index a961a60..dc82d22 100644 --- a/flow_main.cpp +++ b/flow_main.cpp @@ -1,6 +1,8 @@ #define NO_SDL_GLEXT 1 -#include +#include "flow.h" +#include "gpu_timers.h" +#include "util.h" #include #include @@ -9,21 +11,16 @@ #include #include #include - -#include -#include -#include -#include - -#include "flow.h" -#include "gpu_timers.h" -#include "util.h" - #include +#include #include -#include +#include +#include #include +#include #include +#include +#include #include #define BUFFER_OFFSET(i) ((char *)nullptr + (i)) @@ -264,15 +261,15 @@ void compute_flow_only(int argc, char **argv, int optind) glCreateTextures(GL_TEXTURE_2D_ARRAY, 1, &tex_gray); glTextureStorage3D(tex_gray, levels, GL_R8, width1, height1, 2); - GrayscaleConversion gray; - gray.exec(image_tex, tex_gray, width1, height1, /*num_layers=*/2); - glGenerateTextureMipmap(tex_gray); - OperatingPoint op = operating_point3; if (!enable_variational_refinement) { op.variational_refinement = false; } - DISComputeFlow compute_flow(width1, height1, op); + + DISComputeFlow compute_flow(width1, height1, op); // Must be initialized before gray. + GrayscaleConversion gray; + gray.exec(image_tex, tex_gray, width1, height1, /*num_layers=*/2); + glGenerateTextureMipmap(tex_gray); if (enable_warmup) { in_warmup = true; @@ -379,7 +376,7 @@ void interpolate_image(int argc, char **argv, int optind) } DISComputeFlow compute_flow(width1, height1, op); GrayscaleConversion gray; - Interpolate interpolate(width1, height1, op, /*split_ycbcr_output=*/false); + Interpolate interpolate(op, /*split_ycbcr_output=*/false); GLuint tex_gray; glCreateTextures(GL_TEXTURE_2D_ARRAY, 1, &tex_gray); @@ -418,7 +415,7 @@ void interpolate_image(int argc, char **argv, int optind) int main(int argc, char **argv) { - static const option long_options[] = { + static const option long_options[] = { { "smoothness-relative-weight", required_argument, 0, 's' }, // alpha. { "intensity-relative-weight", required_argument, 0, 'i' }, // delta. { "gradient-relative-weight", required_argument, 0, 'g' }, // gamma.