mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
43 lines
923 B
C++
43 lines
923 B
C++
#ifndef DCT_H
|
|
#define DCT_H
|
|
|
|
#include "DCTCommon.h"
|
|
|
|
#include <vector>
|
|
#include <stdint.h>
|
|
|
|
namespace dct {
|
|
|
|
class DCTInternal;
|
|
|
|
struct DCTTable {
|
|
enum class Type {
|
|
Luma,
|
|
Chroma,
|
|
Delta
|
|
};
|
|
|
|
static DCTTable generate(int quality, Type type);
|
|
static DCTTable initializeEmpty();
|
|
|
|
std::vector<int16_t> table;
|
|
};
|
|
|
|
class DCT {
|
|
public:
|
|
DCT(DCTTable const &dctTable);
|
|
~DCT();
|
|
|
|
void forward(uint8_t const *pixels, int16_t *coefficients, int width, int height, int bytesPerRow);
|
|
void inverse(int16_t const *coefficients, uint8_t *pixels, int width, int height, int coefficientsPerRow, int bytesPerRow);
|
|
void forward4x4(int16_t const *normalizedCoefficients, int16_t *coefficients, int width, int height);
|
|
void inverse4x4(int16_t const *coefficients, int16_t *normalizedCoefficients, int width, int height);
|
|
|
|
private:
|
|
DCTInternal *_internal;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|