-
Notifications
You must be signed in to change notification settings - Fork 142
lib: introduction of the VC8000NanoE video encoder library #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
hfruchet-st
wants to merge
6
commits into
zephyrproject-rtos:main
Choose a base branch
from
hfruchet-st:iso_stm32n6_vc8000nanoe
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1459cdf
lib: add vc8000nanoe h264 video encoding stack
hfruchet-st d070c1b
lib: vc8000nanoe: avoid bool redefinition
hfruchet-st 31748f8
lib: vc8000nanoe: avoid min/max redefinition
hfruchet-st 1a87a15
lib: vc8000nanoe: add trace support
hfruchet-st db93758
lib: vc8000nanoe: fix some trace points
hfruchet-st 654c100
lib: vc8000nanoe: trace pointers in hexa
hfruchet-st File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright (c) 2025 STMicroelectronics | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
zephyr_library_compile_definitions(H1_HAVE_ENCDEBUG_H) | ||
#zephyr_library_compile_definitions(CONFIG_VENC_DEBUG) | ||
zephyr_include_directories(inc) | ||
zephyr_include_directories(source/common) | ||
zephyr_include_directories(source/h264) | ||
|
||
zephyr_library_sources(source/common/encasiccontroller.c) | ||
zephyr_library_sources(source/common/encasiccontroller_v2.c) | ||
zephyr_library_sources(source/common/encpreprocess.c) | ||
zephyr_library_sources(source/common/encswhwregisters.c) | ||
|
||
zephyr_library_sources(source/h264/H264Cabac.c) | ||
zephyr_library_sources(source/h264/H264CodeFrame.c) | ||
zephyr_library_sources(source/h264/H264Denoise.c) | ||
zephyr_library_sources(source/h264/H264EncApi.c) | ||
zephyr_library_sources(source/h264/H264Init.c) | ||
zephyr_library_sources(source/h264/H264Mad.c) | ||
zephyr_library_sources(source/h264/H264NalUnit.c) | ||
zephyr_library_sources(source/h264/H264PictureBuffer.c) | ||
zephyr_library_sources(source/h264/H264PictureParameterSet.c) | ||
zephyr_library_sources(source/h264/H264PutBits.c) | ||
zephyr_library_sources(source/h264/H264RateControl.c) | ||
zephyr_library_sources(source/h264/H264Sei.c) | ||
zephyr_library_sources(source/h264/H264SequenceParameterSet.c) | ||
zephyr_library_sources(source/h264/H264Slice.c) | ||
zephyr_library_sources(source/h264/h264encapi_ext.c) | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Copyright (c) 2023 STMicroelectronics | ||
|
||
This software component is licensed by STMicroelectronics under the **BSD-3-Clause** license. You may not use this software except in compliance with this license. You may obtain a copy of the license [here](https://opensource.org/licenses/BSD-3-Clause). |
Binary file added
BIN
+5.36 MB
lib/vc8000nanoe/doc/Hantro.VC8000NanoE.V50x.SW.Integration.Guide-v1.02-20200708.pdf
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
/* | ||
* Copyright (c) 2015-2022, Verisilicon Inc. - All Rights Reserved | ||
* Copyright (c) 2011-2014, Google Inc. - All Rights Reserved | ||
* | ||
* | ||
******************************************************************************** | ||
* | ||
* This software is distributed under the terms of | ||
* BSD-3-Clause. The following provisions apply : | ||
* | ||
******************************************************************************** | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* 3. Neither the name of the copyright holder nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
******************************************************************************** | ||
* | ||
* Description : Basic type definitions. | ||
* | ||
******************************************************************************** | ||
*/ | ||
|
||
#ifndef BASETYPE_H_INCLUDED | ||
#define BASETYPE_H_INCLUDED | ||
|
||
#include <stdint.h> | ||
|
||
#define VOLATILE volatile | ||
|
||
#ifdef __linux__ /* typedefs for Linux */ | ||
|
||
#include <stddef.h> /* for size_t, NULL, etc. */ | ||
|
||
typedef unsigned char u8; | ||
typedef signed char i8; | ||
typedef unsigned short u16; | ||
typedef signed short i16; | ||
typedef unsigned int u32; | ||
typedef signed int i32; | ||
typedef unsigned long long u64; | ||
typedef int64_t i64; | ||
|
||
typedef size_t ptr_t; | ||
|
||
#ifdef ADDRESS_WIDTH_64 | ||
#define PRT_PTR "lx" | ||
#else | ||
#define PRT_PTR "x" | ||
#endif | ||
|
||
#ifndef __cplusplus | ||
typedef enum { | ||
false = 0, | ||
true = 1 | ||
} bool; | ||
#endif | ||
|
||
#else /* __symbian__ or __win__ or whatever, customize it to suit well */ | ||
|
||
#include <stdbool.h> | ||
|
||
#ifndef _SIZE_T_DEFINED | ||
typedef uint32_t size_t; | ||
|
||
#define _SIZE_T_DEFINED | ||
#endif | ||
|
||
#ifndef NULL | ||
#ifdef __cplusplus | ||
#define NULL 0 | ||
#else /* */ | ||
#define NULL ((void *)0) | ||
#endif /* */ | ||
#endif | ||
|
||
typedef uint32_t ptr_t; | ||
|
||
typedef uint8_t u8; | ||
typedef int8_t i8; | ||
typedef uint16_t u16; | ||
typedef int16_t i16; | ||
typedef uint32_t u32; | ||
typedef int32_t i32; | ||
typedef uint64_t u64; | ||
typedef int64_t i64; | ||
|
||
|
||
#ifndef __cplusplus | ||
#ifndef __bool_true_false_are_defined | ||
typedef enum { | ||
false = 0, | ||
true = 1 | ||
} bool; | ||
#endif | ||
#endif | ||
|
||
#endif | ||
|
||
#if defined(VC1SWDEC_16BIT) || defined(MP4ENC_ARM11) | ||
typedef uint16_t u16x; | ||
typedef int16_t i16x; | ||
#else | ||
typedef uint16_t u16x; | ||
typedef int16_t i16x; | ||
#endif | ||
|
||
#endif /* BASETYPE_H_INCLUDED */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
/* | ||
* Copyright (c) 2015-2022, Verisilicon Inc. - All Rights Reserved | ||
* Copyright (c) 2011-2014, Google Inc. - All Rights Reserved | ||
* | ||
* | ||
******************************************************************************** | ||
* | ||
* This software is distributed under the terms of | ||
* BSD-3-Clause. The following provisions apply : | ||
* | ||
******************************************************************************** | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, this | ||
* list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* 3. Neither the name of the copyright holder nor the names of its contributors | ||
* may be used to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
******************************************************************************** | ||
* | ||
* Abstract : For test/fpga_verification/example purpose. operations on Input | ||
* line buffer. | ||
* | ||
******************************************************************************** | ||
*/ | ||
|
||
#ifndef ENC_INPUTLINEBUFREGISTER_H | ||
#define ENC_INPUTLINEBUFREGISTER_H | ||
|
||
#include "basetype.h" | ||
|
||
typedef u32 (*getHEncRdMbLines)(const void *inst); | ||
typedef i32 (*setHEncWrMbLines)(const void *inst, u32 lines); | ||
|
||
typedef struct | ||
{ | ||
u8 *buf; | ||
ptr_t busAddress; | ||
} lineBufMem; | ||
|
||
/* struct for input mb line buffer */ | ||
typedef struct | ||
{ | ||
/* src picture related pointers */ | ||
u8 *src; /* source buffer */ | ||
u8 *lumSrc; | ||
u8 *cbSrc; | ||
u8 *crSrc; | ||
|
||
/* line buffer related pointers */ | ||
u8 *buf; /* line buffer virtual address */ | ||
u32 *reg; /* virtual address of registers in line buffer, only for fpga verification purpose */ | ||
ptr_t busAddress; /* line buffer bus address */ | ||
lineBufMem lumBuf; /*luma address in line buffer */ | ||
lineBufMem cbBuf; /*cb address in line buffer */ | ||
lineBufMem crBuf; /*cr address in line buffer */ | ||
|
||
/* encoding parameters */ | ||
u32 inputFormat; /* format of input video */ | ||
u32 pixOnRow; /* pixels in one line */ | ||
u32 encWidth; | ||
u32 encHeight; | ||
u32 srcHeight; | ||
u32 srcVerOffset; | ||
|
||
/* parameters of line buffer mode */ | ||
i32 wrCnt; | ||
u32 depth; /* number of MB_row lines in the input line buffer */ | ||
u32 loopBackEn; | ||
u32 hwHandShake; | ||
|
||
/*functions */ | ||
getHEncRdMbLines getMbLines; /* get read mb lines from encoder register */ | ||
setHEncWrMbLines setMbLines; /* set written mb lines to encoder register */ | ||
|
||
/* encoder instance */ | ||
void *inst; | ||
}inputLineBufferCfg; | ||
|
||
#ifdef PCIE_FPGA_VERI_LINEBUF | ||
#include "encswhwregisters.h" | ||
/* HW Register field names */ | ||
typedef enum { | ||
InputlineBufWrCntr, | ||
InputlineBufDepth, | ||
InputlineBufHwHandshake, | ||
InputlineBufPicHeight, | ||
InputlineBufRdCntr, | ||
} lineBufRegName; | ||
|
||
#define LINE_BUF_SWREG_AMOUNT 4 /*4x 32-bit*/ | ||
|
||
static const regField_s lineBufRegisterDesc[] = { | ||
/* HW ID register, read-only */ | ||
{InputlineBufWrCntr , 0x000, 0x000001ff, 0, 0, RW, "slice_wr_cntr. +slice_depth when one slice is filled into slice_fifo"}, | ||
{InputlineBufDepth , 0x000, 0x0003fe00, 9, 0, RW, "slice_depth. unit is MB line"}, | ||
{InputlineBufHwHandshake , 0x000, 0x00040000, 18, 0, RW, "slice_hw_mode_en. active high. enable bit of slice_fifo hardware mode. should be disabled before the start of next frame."}, | ||
{InputlineBufPicHeight , 0x000, 0x0ff80000, 19, 0, RW, "pic_height. same value of swreg14[18:10] in H1."}, | ||
{InputlineBufRdCntr , 0x008, 0x000001ff, 0, 0, RO, "slice_rd_cntr. read only"}, | ||
}; | ||
#endif | ||
|
||
void HEncInitInputLineBufSrcPtr (inputLineBufferCfg *lineBufCfg); | ||
void HEncInitInputLineBufPtr (inputLineBufferCfg *lineBufCfg); | ||
i32 HEncInitInputLineBuffer(inputLineBufferCfg *lineBufCfg, const void *ewl); | ||
void HEncStartInputLineBuffer(inputLineBufferCfg * lineBufCfg); | ||
void HEncInputMBLineBufDone (void *pAppData); | ||
|
||
#endif | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please drop this file - it's large and unneeded. (Also, I'm a bit worried about licensing...)