https://github.com/halide/Halide
Raw File
Tip revision: 0abe228fd9f187176c3af0726a1dc663e76242a8 authored by Alex Reinking on 17 February 2021, 06:12:43 UTC
Fix subsetted build issues with arm32/64, hexagon. Fixes #5744. Fixes #5628 (#5745)
Tip revision: 0abe228
haar_x_generator.cpp
#include "Halide.h"

#include "daubechies_constants.h"

namespace {

Halide::Var x("x"), y("y"), c("c");

class haar_x : public Halide::Generator<haar_x> {
public:
    Input<Buffer<float>> in_{"in", 2};
    Output<Buffer<float>> out_{"out", 3};

    void generate() {
        Func in = Halide::BoundaryConditions::repeat_edge(in_);

        out_(x, y, c) = mux(c,
                            {(in(2 * x, y) + in(2 * x + 1, y)),
                             (in(2 * x, y) - in(2 * x + 1, y))}) /
                        2;
        out_.unroll(c, 2);
    }
};

}  // namespace

HALIDE_REGISTER_GENERATOR(haar_x, haar_x)
back to top