build yuzuki-chameleon package with hw jpg decoder (#102)

This commit is contained in:
nihui
2024-03-02 23:33:37 +08:00
committed by GitHub
parent b79de2e2e2
commit 585cae279e
5 changed files with 83 additions and 3 deletions

View File

@@ -1172,6 +1172,16 @@ jobs:
export TOOLCHAIN_ROOT_PATH=$GITHUB_WORKSPACE/toolchain-sunxi-musl-gcc-830/toolchain
export STAGING_DIR=$GITHUB_WORKSPACE/toolchain-sunxi-musl-gcc-830/toolchain
- name: yuzuki-chameleon
single-core: false
cmake-toolchain: arm-openwrt-linux-gnueabi.toolchain.cmake
setup-toolchain-cmd: |
wget -q https://github.com/YuzukiHD/sunxi-bsp-toolchains/releases/download/1.0.0/toolchain-sunxi-glibc-arm-gcc-830.tar.gz
tar -xf toolchain-sunxi-glibc-arm-gcc-830.tar.gz
setup-env-cmd: |
export TOOLCHAIN_ROOT_PATH=$GITHUB_WORKSPACE/toolchain-sunxi-glibc-gcc-830/toolchain
export STAGING_DIR=$GITHUB_WORKSPACE/toolchain-sunxi-glibc-gcc-830/toolchain
- name: purple-pi
single-core: false
cmake-toolchain: arm-linux-gnueabihf.toolchain.cmake

View File

@@ -338,6 +338,19 @@ https://github.com/nihui/opencv-mobile/releases/latest
<img alt="opencv4-tinyvision" src="https://img.shields.io/badge/download-4.9.0-blue?style=for-the-badge">
</a>
</td>
<td>
<a href="https://yuzukihd.top">
<img alt="yuzuki-chameleon" src="https://github.com/YuzukiHD/YuzukiChameleon/blob/master/Bitmap/main.jpeg" width="auto" height="120">
<br /><b>yuzuki-chameleon</b>
</a>
<br />arm-openwrt-linux-gnueabi<br />
&#9989; HW JPG decoder<br />
<a href="https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.9.0-yuzuki-chameleon.zip">
<img alt="opencv4-yuzuki-chameleon" src="https://img.shields.io/badge/download-4.9.0-blue?style=for-the-badge">
</a>
</td>
</tr>
<tr>
<td>
<a href="http://www.industio.cn/product-item-5.html">
<img alt="purple-pi" src="https://img01.71360.com/file/read/www2/M00/38/09/wKj2K2MMbSKAXKhHAAJMw0S-VfY400.jpg" width="auto" height="120">
@@ -348,8 +361,6 @@ https://github.com/nihui/opencv-mobile/releases/latest
<img alt="opencv4-purple-pi" src="https://img.shields.io/badge/download-4.9.0-blue?style=for-the-badge">
</a>
</td>
</tr>
<tr>
<td>
<a href="https://www.myir.cn/shows/118/66.html">
<img alt="myir-t113i" src="https://srcc.myir.cn/images/20230918/c70910f0cb705987ced19d6888ef4288.jpg" width="auto" height="120">

View File

@@ -41,6 +41,7 @@ namespace cv {
// 0 = unknown
// 1 = t113-i
// 2 = tinyvision
// 3 = yuzuki-chameleon
static int get_device_model()
{
static int device_model = -1;
@@ -67,6 +68,11 @@ static int get_device_model()
// tinyvision
device_model = 2;
}
if (strncmp(buf, "sun50iw9", 8) == 0)
{
// yuzuki-chameleon
device_model = 3;
}
}
return device_model;
@@ -86,6 +92,11 @@ static bool is_device_whitelisted()
// tinyvision
return true;
}
if (device_model == 3)
{
// yuzuki-chameleon
return true;
}
return false;
}
@@ -1111,7 +1122,7 @@ int jpeg_decoder_aw_impl::decode(const unsigned char* jpgdata, int jpgsize, unsi
vconfig_v85x.nRotateHoldingFrameBufferNum = 0;
vconfig_v85x.nDecodeSmoothFrameBufferNum = 1;
VConfig* p_vconfig = get_device_model() == 2 ? (VConfig*)&vconfig_v85x : &vconfig;
VConfig* p_vconfig = (get_device_model() == 2 || get_device_model() == 3) ? (VConfig*)&vconfig_v85x : &vconfig;
int ret = InitializeVideoDecoder(vdec, &videoInfo, p_vconfig);
if (ret != 0)

View File

@@ -0,0 +1,24 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
if(DEFINED ENV{TOOLCHAIN_ROOT_PATH})
file(TO_CMAKE_PATH $ENV{TOOLCHAIN_ROOT_PATH} TOOLCHAIN_ROOT_PATH)
else()
message(FATAL_ERROR "TOOLCHAIN_ROOT_PATH env must be defined")
endif()
set(TOOLCHAIN_ROOT_PATH ${TOOLCHAIN_ROOT_PATH} CACHE STRING "root path to toolchain")
set(CMAKE_C_COMPILER "${TOOLCHAIN_ROOT_PATH}/bin/aarch64-openwrt-linux-gnu-gcc")
set(CMAKE_CXX_COMPILER "${TOOLCHAIN_ROOT_PATH}/bin/aarch64-openwrt-linux-gnu-g++")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_C_FLAGS "-march=armv8-a")
set(CMAKE_CXX_FLAGS "-march=armv8-a")
# cache flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "c++ flags")

View File

@@ -0,0 +1,24 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
if(DEFINED ENV{TOOLCHAIN_ROOT_PATH})
file(TO_CMAKE_PATH $ENV{TOOLCHAIN_ROOT_PATH} TOOLCHAIN_ROOT_PATH)
else()
message(FATAL_ERROR "TOOLCHAIN_ROOT_PATH env must be defined")
endif()
set(TOOLCHAIN_ROOT_PATH ${TOOLCHAIN_ROOT_PATH} CACHE STRING "root path to toolchain")
set(CMAKE_C_COMPILER "${TOOLCHAIN_ROOT_PATH}/bin/arm-openwrt-linux-gnueabi-gcc")
set(CMAKE_CXX_COMPILER "${TOOLCHAIN_ROOT_PATH}/bin/arm-openwrt-linux-gnueabi-g++")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_C_FLAGS "-march=armv7-a -mfloat-abi=hard -mfpu=neon")
set(CMAKE_CXX_FLAGS "-march=armv7-a -mfloat-abi=hard -mfpu=neon")
# cache flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "c++ flags")