This repository has been archived by the owner on Sep 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codec_inst.h
74 lines (59 loc) · 2.3 KB
/
codec_inst.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <vfw.h>
#include "threading.h"
class CodecInst
{
public:
ThreadData m_threads[2];
CompressClass m_compressWorker;
int m_started; //if the codec has been properly initialized yet
BYTE* m_buffer;
BYTE* m_prevFrame;
BYTE* m_in;
BYTE* m_out;
BYTE* m_buffer2;
BYTE* m_deltaBuffer;
BYTE* m_colorTransBuffer;
size_t m_length;
size_t m_width;
size_t m_height;
unsigned int m_format; //input format for compressing, output format for decompression. Also the bitdepth.
unsigned int m_compressFormat;
unsigned int m_compressed_size;
bool m_nullframes;
bool m_deltaframes;
CodecInst();
~CodecInst();
DWORD GetState(LPVOID pv, DWORD dwSize);
DWORD SetState(LPVOID pv, DWORD dwSize);
DWORD Configure(HWND hwnd);
DWORD GetInfo(ICINFO* icinfo, DWORD dwSize);
DWORD CompressQuery(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
DWORD CompressGetFormat(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
DWORD CompressBegin(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
DWORD CompressGetSize(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
DWORD Compress(ICCOMPRESS* icinfo, DWORD dwSize);
DWORD CompressEnd();
DWORD DecompressQuery(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
DWORD DecompressGetFormat(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
DWORD DecompressBegin(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
DWORD Decompress(ICDECOMPRESS* idcinfo);
DWORD DecompressGetPalette(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut);
DWORD DecompressEnd();
BOOL QueryConfigure();
void InitDecompressionThreads(const BYTE* in, BYTE* out, size_t length, ThreadData* thread);
DWORD InitThreads(bool encode);
void EndThreads();
DWORD CompressYUV16(ICCOMPRESS* icinfo);
DWORD CompressYV12(ICCOMPRESS* icinfo);
unsigned int HandleTwoCompressionThreads(unsigned int chan_size);
void Decode3Channels(BYTE* dst1, unsigned int len1, BYTE* dst2, unsigned int len2, BYTE* dst3, unsigned int len3);
void YUY2Decompress(DWORD flags);
void YV12Decompress(DWORD flags);
void ReduceResDecompress(DWORD flags);
};
CodecInst* Open(ICOPEN* icinfo);
DWORD Close(CodecInst* pinst);
void __stdcall DetectFlags(bool* SSE2);