-
Notifications
You must be signed in to change notification settings - Fork 0
/
decode.h
25 lines (17 loc) · 1021 Bytes
/
decode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <cmath>
#include <string>
#include <iostream>
#include "OutBufferedBitFileStream.h"
#include "InBufferedBitFileStream.h"
class Decoder {
public:
static void Decode(std::string inFileName, std::string outFileName);
private:
// decoding is much more straightforward: cascade down through these functions
static bool decodeFrame(InBufferedBitFileStream& in, int numChannels, int sampleDepth, OutBufferedBitFileStream& out);
static void decodeAllSubframes(InBufferedBitFileStream& in, int sampleDepth, int chanAsgn, std::vector<std::vector<int>>& result);
static void decodeSubframe(InBufferedBitFileStream& in, int sampleDepth, std::vector<long>& result);
static void decodeLPC(InBufferedBitFileStream& in, int lpcOrder, int sampleDepth, std::vector<long>& result);
static void decodeFseBlockToLPCErrors(InBufferedBitFileStream& in, int warmup, std::vector<long>& result);
static void calculateOriginalSignal(std::vector<long>& result, std::vector<int>& coefs, int shift);
};