Encoder.h 544 Bytes
Newer Older
Nianchen Deng's avatar
sync    
Nianchen Deng committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once
#include "../utils/common.h"

class Encoder {
public:
    Encoder(unsigned int multires, unsigned int chns, bool catInput)
        : _multires(multires), _chns(chns), _catInput(catInput) {
        _genFreqArray();
    }

    unsigned int outDim() const { return _chns * ((int)_catInput + _multires * 2); }
    void encode(sptr<CudaArray<float>> output, sptr<CudaArray<float>> input);

private:
    unsigned int _multires;
    unsigned int _chns;
    bool _catInput;
    sptr<CudaArray<float>> _freqs;

    void _genFreqArray();
};