Skip to content

Commit bddf291

Browse files
committed
lib: vc8000nanoe: add hardware config helper
Add hardware config helper. Signed-off-by: Hugues Fruchet <[email protected]>
1 parent a9f5d91 commit bddf291

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

lib/vc8000nanoe/README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,6 @@ Patch List:
9393
* Trace pointers in hexa
9494
Impacted files: inc/encdebug.h
9595
source/h264/H264EncApi.c
96+
97+
* Add hardware configuration info helper needed by EWL
98+
Impacted files: inc/ewl.h

lib/vc8000nanoe/inc/ewl.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,35 @@ extern u32 (*pollInputLineBufTestFunc)(void);
250250
/* Get the base address of on-chip sram used for input MB line buffer. */
251251
i32 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

Comments
 (0)