Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/libs/jxr/image/encode/encode.h
4393 views
1
//*@@@+++@@@@******************************************************************
2
//
3
// Copyright © Microsoft Corp.
4
// All rights reserved.
5
//
6
// Redistribution and use in source and binary forms, with or without
7
// modification, are permitted provided that the following conditions are met:
8
//
9
// • Redistributions of source code must retain the above copyright notice,
10
// this list of conditions and the following disclaimer.
11
// • Redistributions in binary form must reproduce the above copyright notice,
12
// this list of conditions and the following disclaimer in the documentation
13
// and/or other materials provided with the distribution.
14
//
15
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25
// POSSIBILITY OF SUCH DAMAGE.
26
//
27
//*@@@---@@@@******************************************************************
28
29
#ifndef WMI_ENCODE_H
30
#define WMI_ENCODE_H
31
32
#include "strcodec.h"
33
34
/*************************************************************************
35
struct / class definitions
36
*************************************************************************/
37
38
Int EncodeMacroblockDC(CWMImageStrCodec*, CCodingContext *, Int, Int);
39
Int EncodeMacroblockLowpass(CWMImageStrCodec*, CCodingContext *, Int, Int);
40
Int EncodeMacroblockHighpass(CWMImageStrCodec*, CCodingContext *, Int, Int);
41
42
Int quantizeMacroblock(CWMImageStrCodec *);
43
Void transformMacroblock(CWMImageStrCodec *);
44
Void predMacroblockEnc(CWMImageStrCodec *);
45
46
Void AdaptLowpassEnc(CCodingContext *pContext);
47
Void AdaptHighpassEnc(CCodingContext *pContext);
48
Void ResetCodingContextEnc(CCodingContext *pContext);
49
Int AllocateCodingContextEnc(struct CWMImageStrCodec *pSC, Int iNumContexts, Int iTrimFlexBits);
50
Void FreeCodingContextEnc(struct CWMImageStrCodec *pSC);
51
Void predCBPEnc(CWMImageStrCodec *pSC, CCodingContext *pContext);
52
53
/*************************************************************************
54
Forward transform definitions
55
*************************************************************************/
56
/** 2-point pre filter for boundaries (only used in 420 UV DC subband) **/
57
Void strPre2(PixelI *, PixelI *);
58
59
/** 2x2 pre filter (only used in 420 UV DC subband) **/
60
Void strPre2x2(PixelI *, PixelI *, PixelI *, PixelI *);
61
62
/** 4-point pre filter for boundaries **/
63
Void strPre4(PixelI *, PixelI *, PixelI *, PixelI *);
64
65
/** data allocation in working buffer (first stage) **/
66
67
/** Y, 444 U and V **/
68
/** 0 1 2 3 **/
69
/** 32 33 34 35 **/
70
/** 64 65 66 67 **/
71
/** 96 97 98 99 **/
72
73
/** 420 U and V **/
74
/** 0 2 4 6 **/
75
/** 64 66 68 70 **/
76
/** 128 130 132 134 **/
77
/** 192 194 196 198 **/
78
79
/** 4x4 foward DCT for first stage **/
80
Void strDCT4x4FirstStage(PixelI *);
81
Void strDCT4x4FirstStage420UV(PixelI *);
82
83
Void strDCT4x4Stage1(PixelI*);
84
85
/** 4x4 pre filter for first stage **/
86
Void strPre4x4FirstStage(PixelI *);
87
Void strPre4x4FirstStage420UV(PixelI *);
88
89
Void strPre4x4Stage1Split(PixelI* p0, PixelI* p1, Int iOffset);
90
Void strPre4x4Stage1(PixelI* p, Int iOffset);
91
92
/** data allocation in working buffer (second stage)**/
93
94
/** Y, 444 U and V **/
95
/** 0 4 8 12 **/
96
/** 128 132 136 140 **/
97
/** 256 260 264 268 **/
98
/** 384 388 392 396 **/
99
100
/** 420 U and V **/
101
/** 0 8 **/
102
/** 256 264 **/
103
104
/** 4x4 foward DCT for second stage **/
105
Void strDCT4x4SecondStage(PixelI *);
106
Void strNormalizeEnc(PixelI *, Bool);
107
Void strDCT2x2dnEnc(PixelI *, PixelI *, PixelI *, PixelI *);
108
109
/** 4x4 pre filter for second stage **/
110
Void strPre4x4Stage2Split(PixelI* p0, PixelI* p1);
111
112
#endif // ENCODE_H
113
114
115