X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=resample_effect.h;h=7538a68c143e8bd29cdac1078b94bd456bf2c9f6;hp=b06b09b57ae9af67f18e938396adc8ab8ddbdd0d;hb=1fb55b14a6c694e082f0261e86f26d4f82948821;hpb=9c12e38b7cd88a77ef297d080b7c41e6bd6326fb diff --git a/resample_effect.h b/resample_effect.h index b06b09b..7538a68 100644 --- a/resample_effect.h +++ b/resample_effect.h @@ -18,9 +18,11 @@ #include #include #include +#include #include #include "effect.h" +#include "fp16.h" namespace movit { @@ -28,6 +30,22 @@ class EffectChain; class Node; class SingleResamplePassEffect; +// Public so that it can be benchmarked externally. +template +struct Tap { + T weight; + T pos; +}; +struct ScalingWeights { + unsigned src_bilinear_samples; + unsigned dst_samples, num_loops; + + // Exactly one of these is set. + std::unique_ptr[]> bilinear_weights_fp16; + std::unique_ptr[]> bilinear_weights_fp32; +}; +ScalingWeights calculate_scaling_weights(unsigned src_size, unsigned dst_size, float zoom, float offset); + class ResampleEffect : public Effect { public: ResampleEffect(); @@ -61,6 +79,7 @@ private: float offset_x, offset_y; float zoom_x, zoom_y; float zoom_center_x, zoom_center_y; + float unused; }; class SingleResamplePassEffect : public Effect { @@ -110,6 +129,7 @@ private: int input_width, input_height, output_width, output_height; float offset, zoom; + float unused; int last_input_width, last_input_height, last_output_width, last_output_height; float last_offset, last_zoom; int src_bilinear_samples, num_loops;