Welcome to mirror list, hosted at ThFree Co, Russian Federation.

uberblit_resample.h « h « Kasumi « VirtualDub « thirdparty « src - github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a3bb7e70c0e3de1ed8e706b3b0df075f1f25d721 (plain)
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
75
76
77
78
79
80
81
82
83
#ifndef f_VD2_KASUMI_UBERBLIT_RESAMPLE_H
#define f_VD2_KASUMI_UBERBLIT_RESAMPLE_H

#include <vd2/system/vdstl.h>
#include <vd2/system/math.h>
#include "uberblit.h"
#include "uberblit_base.h"
#include <vd2/Kasumi/resample_kernels.h>

class IVDResamplerSeparableRowStage;
class IVDResamplerSeparableRowStage2;
class IVDResamplerSeparableColStage;

namespace nsVDPixmap {
	enum FilterMode {
		kFilterPoint,
		kFilterLinear,
		kFilterCubic,
		kFilterLanczos3,
		kFilterCount
	};
}

class VDPixmapGenResampleRow : public VDPixmapGenWindowBasedOneSource {
public:
	VDPixmapGenResampleRow();
	~VDPixmapGenResampleRow();

	void Init(IVDPixmapGen *src, uint32 srcIndex, uint32 width, float offset, float step, nsVDPixmap::FilterMode filterMode, float filterFactor, bool interpolationOnly);

	void Start();

	uint32 GetType(uint32 output) const {
		return mpSrc->GetType(mSrcIndex);
	}

protected:
	void Compute(void *dst0, sint32 y);
	void Compute8(void *dst0, sint32 y);
	void Compute32(void *dst0, sint32 y);
	void Compute128(void *dst0, sint32 y);

	IVDResamplerSeparableRowStage *mpRowStage;
	IVDResamplerSeparableRowStage2 *mpRowStage2;

	uint32				mRowFiltW;
	uint32				mBytesPerSample;

	VDResamplerAxis		mAxis;

	vdblock<void *>	mWindow;
	void				**mpAllocWindow;
	vdblock<uint32, vdaligned_alloc<uint32> >		mTempSpace;
};

class VDPixmapGenResampleCol : public VDPixmapGenWindowBasedOneSource {
public:
	VDPixmapGenResampleCol();
	~VDPixmapGenResampleCol();

	void Init(IVDPixmapGen *src, uint32 srcIndex, uint32 height, float offset, float step, nsVDPixmap::FilterMode filterMode, float filterFactor, bool interpolationOnly);

	void Start();

	uint32 GetType(uint32 output) const {
		return mpSrc->GetType(mSrcIndex);
	}

protected:
	void Compute(void *dst0, sint32 y);

	IVDResamplerSeparableColStage *mpColStage;

	uint32				mWinSize;
	uint32				mBytesPerSample;
	uint32				mBytesPerRow;

	VDResamplerAxis		mAxis;

	vdblock<const void *>	mWindow;
};

#endif