1 /*
2  * Copyright (c) 2011 Intel Corporation. All Rights Reserved.
3  * Copyright (c) Imagination Technologies Limited, UK
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the
7  * "Software"), to deal in the Software without restriction, including
8  * without limitation the rights to use, copy, modify, merge, publish,
9  * distribute, sub license, and/or sell copies of the Software, and to
10  * permit persons to whom the Software is furnished to do so, subject to
11  * the following conditions:
12  *
13  * The above copyright notice and this permission notice (including the
14  * next paragraph) shall be included in all copies or substantial portions
15  * of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20  * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
21  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24  */
25 
26 #ifndef TOPAZHP_DEFAULT_PARAMS_H
27 #define TOPAZHP_DEFAULT_PARAMS_H
28 
29 /* moved from rc.h as only used in Host code */
30 #define TH_SKIP_IPE			6
31 #define TH_INTER			60
32 #define TH_INTER_QP			10
33 #define TH_INTER_MAX_LEVEL	1500
34 #define TH_SKIP_SPE			6
35 #define SPE_ZERO_THRESHOLD	6
36 
37 #define UNINIT_PARAM 0xCDCDCDCD
38 #define UNINIT_PARAM_BYTE 0xCD
39 
40 
41 /* Comandline Params defaults */
42 #define TOPAZHP_DEFAULT_ui32pseudo_rand_seed		UNINIT_PARAM
43 #define TOPAZHP_DEFAULT_bRCBiases					true
44 #define TOPAZHP_DEFAULT_uJPEGQuality				90
45 #define TOPAZHP_DEFAULT_iFrameCount					2
46 
47 #define TOPAZHP_DEFAULT_iFrameSpeed					1
48 #define TOPAZHP_DEFAULT_uiFcode						4
49 #define TOPAZHP_DEFAULT_uiSlicesPerFrame			1
50 #define TOPAZHP_DEFAULT_iJitterMagnitude			1
51 #define TOPAZHP_DEFAULT_bEnableIntra				1
52 #define TOPAZHP_DEFAULT_iFineYSearchSize			2
53 #define TOPAZHP_DEFAULT_eMinBlockSize				E4x4Blocks
54 #define TOPAZHP_DEFAULT_uVaryQpStep					1
55 #define TOPAZHP_DEFAULT_uIterations					1
56 
57 #define TOPAZHP_DEFAULT_eRCEnable					ERCDisable
58 #define TOPAZHP_DEFAULT_eRCMode						IMG_RCMODE_NONE
59 
60 #define TOPAZHP_DEFAULT_iQP_Luma					params->iQP_Luma
61 #define TOPAZHP_DEFAULT_iQP_Chroma					TOPAZHP_DEFAULT_iQP_Luma
62 #define TOPAZHP_DEFAULT_iQP_ILuma					TOPAZHP_DEFAULT_iQP_Luma
63 #define TOPAZHP_DEFAULT_iQP_PLuma					TOPAZHP_DEFAULT_iQP_Luma
64 #define TOPAZHP_DEFAULT_iQP_IChroma					TOPAZHP_DEFAULT_iQP_Luma
65 #define TOPAZHP_DEFAULT_iQP_PChroma					TOPAZHP_DEFAULT_iQP_Luma
66 
67 #define TOPAZHP_DEFAULT_uTHInter					TH_INTER
68 #define TOPAZHP_DEFAULT_uTHInterQP					TH_INTER_QP
69 #define TOPAZHP_DEFAULT_uTHInterMaxLevel			TH_INTER_MAX_LEVEL
70 #define TOPAZHP_DEFAULT_uTHSkipIPE					TH_SKIP_IPE
71 #define TOPAZHP_DEFAULT_uTHSkipSPE					TH_SKIP_SPE
72 #define TOPAZHP_DEFAULT_uiSpeZeroThreshold			SPE_ZERO_THRESHOLD
73 #define TOPAZHP_DEFAULT_bPowerTest					IMG_FALSE
74 
75 #define TOPAZHP_DEFAULT_uCABACBinLimit				2800
76 
77 // advised number
78 #define TOPAZHP_DEFAULT_uCABACBinFlex				2800
79 
80 // Fairly random defaults.
81 #define TOPAZHP_DEFAULT_iMvcalcGridMBXStep			7
82 #define TOPAZHP_DEFAULT_iMvcalcGridMBYStep			13
83 #define TOPAZHP_DEFAULT_iMvcalcGridSubStep			3
84 #define TOPAZHP_DEFAULT_uDupVectorThreshold			1
85 #define TOPAZHP_DEFAULT_uZeroBlock4x4Threshold		6
86 #define TOPAZHP_DEFAULT_uZeroBlock8x8Threshold		4
87 
88 #define TOPAZHP_DEFAULT_bH2648x8Transform			false
89 #define TOPAZHP_DEFAULT_bZeroDetectionDisable		false
90 #define TOPAZHP_DEFAULT_bH264IntraConstrained		false
91 #define TOPAZHP_DEFAULT_uDirectVecBias				UNINIT_PARAM
92 #define TOPAZHP_DEFAULT_uIPESkipVecBias				UNINIT_PARAM
93 
94 #define TOPAZHP_DEFAULT_iInterMBBias				UNINIT_PARAM
95 #define TOPAZHP_DEFAULT_iInterMBBiasB				UNINIT_PARAM
96 #define TOPAZHP_DEFAULT_iIntra16Bias				UNINIT_PARAM
97 
98 //register defaults
99 #define TOPAZHP_DEFAULT_uChunksPerMb				0x40
100 #define TOPAZHP_DEFAULT_uMaxChunks					0xA0
101 #define TOPAZHP_DEFAULT_uPriorityChunks				(TOPAZHP_DEFAULT_uMaxChunks - 0x60)
102 
103 #define TOPAZHP_DEFAULT_bUseOffScreenMVUserSetting	false;
104 
105 #define TOPAZHP_DEFAULT_ui8EnableSelStatsFlags		0
106 #define TOPAZHP_DEFAULT_bEnableInpCtrl				false;
107 #define TOPAZHP_DEFAULT_bEnableAIR					false;
108 
109 // 0 = _ALL_ MBs over threshold will be marked as AIR Intras, -1 = Automatically generate 10% Blocks Per Frame
110 #define TOPAZHP_DEFAULT_i32NumAIRMBs				-1
111 // -1 = Automatically generate and adjust threshold
112 #define TOPAZHP_DEFAULT_i32AIRThreshold				-1
113 // -1 = Random (0 - NumAIRMbs) skip between frames in AIR table
114 #define TOPAZHP_DEFAULT_i16AIRSkipCnt				-1
115 
116 #define TOPAZHP_DEFAULT_uBasePipe					0
117 
118 //Set the default to 10
119 #define TOPAZHP_DEFAULT_uiCbrBufferTenths			10
120 
121 /*default value for CARC*/
122 #define TOPAZHP_DEFAULT_uCARCThreshold               1
123 #define TOPAZHP_DEFAULT_uCARCCutoff	                    15
124 #define TOPAZHP_DEFAULT_uCARCPosRange               5
125 #define TOPAZHP_DEFAULT_uCARCPosScale                12
126 #define TOPAZHP_DEFAULT_uCARCNegRange               5
127 #define TOPAZHP_DEFAULT_uCARCNegScale                12
128 #define TOPAZHP_DEFAULT_uCARCShift                        3
129 #define TOPAZHP_DEFAULT_ui8InterIntraIndex                3
130 #define TOPAZHP_DEFAULT_ui8CodedSkippedIndex        3
131 
132 #define TOPAZHP_DEFAULT_ui8MPEG2IntraDCPrecision    10
133 #define TOPAZHP_DEFAULT_uDebugCRCs                         0
134 
135 // Default to adaptive rounding active
136 #define TOPAZHP_DEFAULT_bTPAdaptiveRoundingDisable	false
137 
138 #define TOPAZHP_DEFAULT_ui16VirtRatio				1
139 #define TOPAZHP_DEFAULT_ui16ChunksPerPic			1
140 #define TOPAZHP_DEFAULT_bHierarchical				false
141 #define TOPAZHP_DEFAULT_bForceReferences			false
142 #define TOPAZHP_DEFAULT_bBaseMvcParams				true
143 #define TOPAZHP_DEFAULT_bIPEHighLatency				true
144 #define TOPAZHP_DEFAULT_uAppQuant					2
145 #define TOPAZHP_DEFAULT_bUseFirmwareALLRC			false
146 #define TOPAZHP_DEFAULT_ui8Fourcc					"YUV"
147 
148 
149 
150 /* Context defaults */
151 #define TOPAZHP_DEFAULT_ui32IdrSec					0
152 #define TOPAZHP_DEFAULT_ui32VopTimeResolution		15
153 // Only used for MPEG2, other formats must ensure this is set to zero
154 #define TOPAZHP_DEFAULT_ui8ActiveSourceBuffer		ACTIVE_BUFFER_NONE
155 
156 #endif /* TOPAZHP_DEFAULT_PARAMS_H */
157