MCPcopy Create free account
hub / github.com/cisco/openh264 / InitFunctionPointers

Function InitFunctionPointers

codec/encoder/core/src/encoder.cpp:157–232  ·  view source on GitHub ↗

! * \brief initialize function pointers that potentially used in Wels encoding * \param pEncCtx sWelsEncCtx* * \return successful - 0; otherwise none 0 for failed */

Source from the content-addressed store, hash-verified

155 * \return successful - 0; otherwise none 0 for failed
156 */
157int32_t InitFunctionPointers (sWelsEncCtx* pEncCtx, SWelsSvcCodingParam* pParam, uint32_t uiCpuFlag) {
158 int32_t iReturn = ENC_RETURN_SUCCESS;
159 SWelsFuncPtrList* pFuncList = pEncCtx->pFuncList;
160 bool bScreenContent = (SCREEN_CONTENT_REAL_TIME == pParam->iUsageType);
161
162 /* Functionality utilization of CPU instructions dependency */
163 pFuncList->pfSetMemZeroSize8 = WelsSetMemZero_c; // confirmed_safe_unsafe_usage
164 pFuncList->pfSetMemZeroSize64Aligned16 = WelsSetMemZero_c; // confirmed_safe_unsafe_usage
165 pFuncList->pfSetMemZeroSize64 = WelsSetMemZero_c; // confirmed_safe_unsafe_usage
166#if defined(X86_ASM)
167 if (uiCpuFlag & WELS_CPU_MMXEXT) {
168 pFuncList->pfSetMemZeroSize8 = WelsSetMemZeroSize8_mmx; // confirmed_safe_unsafe_usage
169 pFuncList->pfSetMemZeroSize64Aligned16 = WelsSetMemZeroSize64_mmx; // confirmed_safe_unsafe_usage
170 pFuncList->pfSetMemZeroSize64 = WelsSetMemZeroSize64_mmx; // confirmed_safe_unsafe_usage
171 }
172 if (uiCpuFlag & WELS_CPU_SSE2) {
173 pFuncList->pfSetMemZeroSize64Aligned16 = WelsSetMemZeroAligned64_sse2; // confirmed_safe_unsafe_usage
174 }
175#endif//X86_ASM
176
177#if defined(HAVE_NEON)
178 if (uiCpuFlag & WELS_CPU_NEON) {
179 pFuncList->pfSetMemZeroSize8 = WelsSetMemZero_neon;
180 pFuncList->pfSetMemZeroSize64Aligned16 = WelsSetMemZero_neon;
181 pFuncList->pfSetMemZeroSize64 = WelsSetMemZero_neon;
182 }
183#endif
184
185#if defined(HAVE_NEON_AARCH64)
186 if (uiCpuFlag & WELS_CPU_NEON) {
187 pFuncList->pfSetMemZeroSize8 = WelsSetMemZero_AArch64_neon;
188 pFuncList->pfSetMemZeroSize64Aligned16 = WelsSetMemZero_AArch64_neon;
189 pFuncList->pfSetMemZeroSize64 = WelsSetMemZero_AArch64_neon;
190 }
191#endif
192
193 InitExpandPictureFunc (& (pFuncList->sExpandPicFunc), uiCpuFlag);
194
195 /* Intra_Prediction_fn*/
196 WelsInitIntraPredFuncs (pFuncList, uiCpuFlag);
197
198 /* ME func */
199 WelsInitMeFunc (pFuncList, uiCpuFlag, bScreenContent);
200
201 /* sad, satd, average */
202 WelsInitSampleSadFunc (pFuncList, uiCpuFlag);
203
204 //
205 WelsInitBGDFunc (pFuncList, pParam->bEnableBackgroundDetection);
206 WelsInitSCDPskipFunc (pFuncList, bScreenContent &&
207 (pParam->bEnableSceneChangeDetect) &&
208 (pEncCtx->pSvcParam->iComplexityMode < HIGH_COMPLEXITY));
209
210 // for pfGetVarianceFromIntraVaa function ptr adaptive by CPU features, 6/7/2010
211 InitIntraAnalysisVaaInfo (pFuncList, uiCpuFlag);
212
213 /* Motion compensation */
214 /*init pixel average function*/

Callers 1

WelsInitEncoderExtFunction · 0.85

Calls 12

InitExpandPictureFuncFunction · 0.85
WelsInitIntraPredFuncsFunction · 0.85
WelsInitMeFuncFunction · 0.85
WelsInitSampleSadFuncFunction · 0.85
WelsInitBGDFuncFunction · 0.85
WelsInitSCDPskipFuncFunction · 0.85
InitIntraAnalysisVaaInfoFunction · 0.85
InitCoeffFuncFunction · 0.85
WelsInitEncodingFuncsFunction · 0.85
WelsBlockFuncInitFunction · 0.85

Tested by

no test coverage detected