国产肉体XXXX裸体137大胆,国产成人久久精品流白浆,国产乱子伦视频在线观看,无码中文字幕免费一区二区三区 国产成人手机在线-午夜国产精品无套-swag国产精品-国产毛片久久国产

新聞中心

EEPW首頁 > 新品快遞 > G2D圖像處理硬件調用和測試-基于米爾-全志T113-i國產開發(fā)板

G2D圖像處理硬件調用和測試-基于米爾-全志T113-i國產開發(fā)板

作者: 時間:2024-04-10 來源:EEPW 收藏


本文引用地址:http://m.ptau.cn/article/202404/457413.htm

概述:

MYC-YT113i

真正的國產,100%國產物料認證

國產T113-i處理器配備2*Cortex-A7@1.2GHz ,RISC-V

外置DDR3接口、支持視頻編解碼器、HiFi4 DSP

接口豐富:視頻采集接口、顯示器接口、USB2.0 接口、CAN 接口、千兆以太網接口

工業(yè)級:-40℃~+85℃、尺寸37mm*39mm

郵票孔+LGA,140+50PIN

1712761829259072.png

-全志T113-i國產

1712761916489747.png

-全志T113-i國產

全志T113-i 2D圖形加速硬件支持情況

Supports layer size up to 2048 x 2048 pixels

Supports pre-multiply alpha image data

Supports color key

Supports two pipes Porter-Duff alpha blending

Supports multiple video formats 4:2:0, 4:2:2, 4:1:1 and multiple pixel formats (8/16/24/32 bits graphicslayer)

Supports memory scan order option

Supports any format convert function

Supports 1/16× to 32× resize ratio

Supports 32-phase 8-tap horizontal anti-alias filter and 32-phase 4-tap vertical anti-alias filter

Supports window clip

Supports FillRectangle, BitBlit, StretchBlit and MaskBlit

Supports horizontal and vertical flip, clockwise 0/90/180/270 degree rotate for normal buffer

Supports horizontal flip, clockwise 0/90/270 degree rotate for LBC buffer

可以看到 g2d 硬件支持相當多的2D圖像處理,包括顏色空間轉換,分辨率縮放,圖層疊加,旋轉等。

1712761961613096.png

備注:本文不具體介紹代碼,代碼參見:

1.開發(fā)環(huán)境配置

基礎開發(fā)環(huán)境搭建參考上上上一篇

除了工具鏈外,我們使用 opencv-mobile 加載輸入圖片和保存結果,用來查看顏色轉換是否正常

g2d硬件直接采用標準的 Linux ioctl 操縱,只需要引入相關結構體定義即可,無需鏈接so

此外,g2d的輸入和輸出數據必須在dmaion buffer上,因此還需要dmaion.h頭文件,用來分配和釋放dmaion buffer

2.基于C語言實現的YUV轉RGB

這里復用之前T113-i JPG解碼的函數

3.基于ARM neon指令集優(yōu)化的YUV轉RGB

考慮到armv7編譯器的自動neon優(yōu)化能力較差,這里針對性的編寫 arm neon inline assembly 實現YUV2RGB內核部分,達到最優(yōu)化的性能,榨干cpu性能。

4.基于G2D圖形硬件的YUV轉RGB

我們先實現 dmaion buffer 管理器,參考

這里貼的代碼省略了異常錯誤處理的邏輯,有個坑是 linux-4.9 和 linux-5.4 用法不一樣,電子的這個T113-i系統(tǒng)是linux-5.4,所以不兼容4.9內核的ioctl用法習慣。

5.然后再實現 G2D圖形硬件 YUV轉RGB 的轉換器

1.提前分配好YUV和RGB的dmaion buffer

2.將YUV數據拷貝到dmaion buffer,flush cache完成同步

3.配置轉換參數,ioctl調用G2D_CMD_BITBLT_H完成轉換

4.flush cache完成同步,從dmaion buffer拷貝出RGB數據

5.釋放dmaion buffer

6.G2D圖像硬件YUV轉RGB測試

考慮到dmaion buffer分配和釋放都比較耗時,我們提前做好,循環(huán)調用步驟3的G2D轉換,統(tǒng)計耗時,并在top工具中查看CPU占用率

sh-4.4# LD_LIBRARY_PATH=. ./g2dtest

INFO   : cedarc <CedarPluginVDInit:84>: register mjpeg decoder success!

this device is not whitelisted for jpeg decoder cvi

this device is not whitelisted for jpeg decoder cvi

this device is not whitelisted for jpeg decoder cvi

this device is not whitelisted for jpeg encoder rkmpp

INFO   : cedarc <log_set_level:43>: Set log level to 5 from /vendor/etc/cedarc.conf

ERROR  : cedarc <DebugCheckConfig:316>: now cedarc log level:5

ERROR  : cedarc <VideoEncCreate:241>: now cedarc log level:5

yuv420sp2rgb 46.61

yuv420sp2rgb 42.04

yuv420sp2rgb 41.32

yuv420sp2rgb 42.06

yuv420sp2rgb 41.69

yuv420sp2rgb 42.05

yuv420sp2rgb 41.29

yuv420sp2rgb 41.30

yuv420sp2rgb 42.14

yuv420sp2rgb 41.33

yuv420sp2rgb_neon 10.57

yuv420sp2rgb_neon 7.21

yuv420sp2rgb_neon 6.77

yuv420sp2rgb_neon 8.31

yuv420sp2rgb_neon 7.60

yuv420sp2rgb_neon 6.80

yuv420sp2rgb_neon 6.77

yuv420sp2rgb_neon 7.01

yuv420sp2rgb_neon 7.11

yuv420sp2rgb_neon 7.06

yuv420sp2rgb_g2d 4.32

yuv420sp2rgb_g2d 4.69

yuv420sp2rgb_g2d 4.56

yuv420sp2rgb_g2d 4.57

yuv420sp2rgb_g2d 4.52

yuv420sp2rgb_g2d 4.54

yuv420sp2rgb_g2d 4.52

yuv420sp2rgb_g2d 4.58

yuv420sp2rgb_g2d 4.60

yuv420sp2rgb_g2d 4.67

可以看到 ARM neon 的優(yōu)化效果非常明顯,而使用G2D圖形硬件能獲得進一步加速,并且能顯著降低CPU占用率!

image.png

1712762020682852.png

7.轉換結果對比和分析

C和neon的轉換結果完全一致,但是g2d轉換后的圖片有明顯的色差

1712762082599321.png

1712762126200592.png

G2D圖形硬件只支持 G2D_BT601,G2D_BT709,G2D_BT2020 3種YUV系數,而JPG所使用的YUV系數是改版BT601,因此產生了色差

從g2d內核驅動中也可以得知,暫時沒有方法為g2d設置自定義的YUV系數,g2d不適合用于JPG的編解碼,但依然適合攝像頭和視頻編解碼的顏色空間轉換



評論


相關推薦

技術專區(qū)

關閉