@@ -250,6 +250,35 @@ extern u32 (*pollInputLineBufTestFunc)(void);
250250/* Get the base address of on-chip sram used for input MB line buffer. */
251251i32 EWLGetInputLineBufferBase (const void * instance , EWLLinearMem_t * info );
252252
253+ /* Build hardware configuration structure */
254+ static inline EWLHwConfig_t EWLBuildHwConfig (uint32_t cfgval , uint32_t cfgval2 )
255+ {
256+ EWLHwConfig_t cfg_info ;
257+
258+ cfg_info .maxEncodedWidth = cfgval & ((1U << 12U ) - 1U );
259+ cfg_info .h264Enabled = (cfgval >> 27U ) & 1U ;
260+ cfg_info .vp8Enabled = (cfgval >> 26U ) & 1U ;
261+ cfg_info .jpegEnabled = (cfgval >> 25U ) & 1U ;
262+ cfg_info .vsEnabled = (cfgval >> 24U ) & 1U ;
263+ cfg_info .rgbEnabled = (cfgval >> 28U ) & 1U ;
264+ cfg_info .searchAreaSmall = (cfgval >> 29U ) & 1U ;
265+ cfg_info .scalingEnabled = (cfgval >> 30U ) & 1U ;
266+ cfg_info .busType = (cfgval >> 20U ) & 15U ;
267+ cfg_info .synthesisLanguage = (cfgval >> 16U ) & 15U ;
268+ cfg_info .busWidth = (cfgval >> 12U ) & 15U ;
269+ cfg_info .addr64Support = (cfgval2 >> 31U ) & 1U ;
270+ cfg_info .dnfSupport = (cfgval2 >> 30U ) & 1U ;
271+ cfg_info .rfcSupport = (cfgval2 >> 28U ) & 3U ;
272+ cfg_info .enhanceSupport = (cfgval2 >> 27U ) & 1U ;
273+ cfg_info .instantSupport = (cfgval2 >> 26U ) & 1U ;
274+ cfg_info .svctSupport = (cfgval2 >> 25U ) & 1U ;
275+ cfg_info .inAxiIdSupport = (cfgval2 >> 24U ) & 1U ;
276+ cfg_info .inLoopbackSupport = (cfgval2 >> 23U ) & 1U ;
277+ cfg_info .irqEnhanceSupport = (cfgval2 >> 22U ) & 1U ;
278+
279+ return cfg_info ;
280+ }
281+
253282#ifdef __cplusplus
254283}
255284#endif
0 commit comments