IPNC_RDK_McFW_UserGuide
?
?
?
?
IPNC RDK
文件版本 2.10
多通道框架(MCFW)
軟件用戶指南
?
?
?
?
TABLE OF CONTENTS
?
1? 介紹.. 3
1.1? 概述.. 3
1.2 關鍵首字母縮略詞和詞匯.. 3
2? 安裝和構建.. 4
2.1 從屬包.. 4
2.2? 安裝 IPNC RDK. 5
2.3? 構建 the IPNC RDK. 5
2.4? 運行 the IPNC RDK. 5
3? 頂層設計.. 5
3.1? 軟件層.. 5
3.2 ??? McFW API10
3.3 ??? Link API12
3.4? 鏈.. 21
4? 目錄結構.. 31
4.1? 接口文件.. 31
4.2? 模板示例代碼.. 33
4.3? 庫.. 33
5? 額外細節.. 34
5.1??? 內部處理器通信詳細信息.. 34
5.2??? 內存映射詳細信息.. 34
5.3?? 顯示控制器和顯示功能詳細信息.. 34
5.4? IPNC 應用程序配置.. 35
5.5? 智能/視頻分析.. 43
5.6? 視頻幀緩沖接口.. 43
?
?
?
?
1? 介紹
1.1 ?概述
IPNC RDK是用于TIDM8127和DM385 SOC平臺的多處理器軟件開發框架,針對監控IPNC,混合IPNC和視頻分析等應用進行了優化。
IPNC RDK中的軟件框架允許用戶創建涉及傳感器視頻捕獲,ISP處理,分辨率縮放,視頻噪聲濾波器,視頻顯示(SC,噪聲濾波和編碼)和視頻流等的不同多通道數據流。?
1.2 關鍵首字母縮略詞和詞匯
| 術語 | 描述 |
| IPNC | IP網絡攝像機-圖像傳感器輸入網絡流,ISP將它轉換為YUV其轉換為數字編碼的比特流和網絡流。 |
| IPNC RDK | IPNC參考設計工具包- 包括多通道軟件框架,硬件平臺。 |
| ISS | 成像子系統-兩個硬件模塊的文件所涉及軟件驅動包 |
| HDVPSS | 高清晰度視頻處理子系統- 簡稱為硬件模塊文件中涉及軟件驅動程序包 |
| HDVICP | 高清晰度視頻和圖像協處理器-文檔中涉到的主要為軟件編解碼器包和硬件IP區塊 |
| Ducati | 雙核M3處理器控制HDVPSS和HDVICP硬件引擎 |
| Video M3 | ARM Cortex ?? M3核(內嵌Ducati 子系統) 控制HDVICP 編解碼器。 |
| VPSS M3 / DSS M3 / ISS M3 | ARM Cortex ?? M3核(內嵌Ducati 子系統) 控制 HDVPSS和ISS 驅動 |
| NF | 噪聲濾波器 - 參考文檔中的硬件噪聲濾波器模塊以及支持它的軟件組件 ? |
| SC | 標量 - 參考文檔中的硬件標量塊以及軟件 組件支持它 |
| McFW | 多通道架構-多通道應用IPNC開發的軟件框架。 |
| Links | 最小的軟件組件控制功能單元(如捕獲,DEI,顯示器) -具有輸入隊列和輸出隊列 |
| IPC | 處理器間通信 |
| ListMP | 共享區域-具有跨處理器共享存儲SYSLINK組件 |
| SR | 共享區域-具有跨處理器共享存儲SYSLINK組件 |
| VA | 視頻分析 |
?
2? 安裝和構建
2.1 從屬包
IPNC RDK依賴于以下附加軟件包。
Please referto the Release Notes for exact package version required for the current releaseof IPNC RDK有關當前版本的IPNCRDK所需的精確軟件包版本,請參閱發行說明
| 包名稱 | 軟件包版本 |
| A8 Linux - Code Sorcery Code Generation tools | 有關軟件包版本,請參閱發行說明 |
| ARM M3代碼生成工具 | |
| DSP c6x代碼生成工具* | |
| Linux PSP | |
| XDC | |
| BIOS | |
| Syslink | |
| IPC | |
| XDIAS | |
| Framework components | |
| IVAHD HDVICP2 API | |
| H264 encoder | |
| HDVPSS drivers | |
| ISS drivers |
2.2 ?安裝 IPNC RDK
有關安裝IPNC RDK的說明,請參閱隨發行的軟件包提供的安裝指南。
2.3 ?構建 the IPNC RDK
有關安裝IPNC RDK的說明,請參閱隨發行的軟件包提供的安裝指南。
2.4 ?運行 the IPNC RDK
有關執行IPNC RDK提供的默認應用程序的說明,請參閱隨發行的軟件包提供的安裝指南。
3? 頂層設計
3.1 ?軟件層
軟件使用不同的層實現,如下所示。
分層的量基于模塊性(更多抽象/層)和易用性(更少層數)之間的平衡來完成。
| ?
| ?
| ?
|
?
下面描述軟件的不同層,
| 層 | Processor? Applicable | Description | TI SW Package |
| Linux | HOST A8 | Linux操作系統,包括文件系統,SATA,以太網,USB等IO驅動程序 | Linux PSP |
| BIOS6 | VPSS M3 Video M3 DSP | BIOS RTOS用作操作系統 Video-M3, VPSS-M3, DSP. 視頻-M3,VPSS-M3,DSP。 Provides features like threads, semaphores, interrupts. 提供線程,信號量,中斷等功能。 ? | BIOS XDC(用于BIOS和其他配置) ? |
?
| Layer | Processor? Applicable | Description | TI SW Package |
| ? | ? | 隊列和鏈路之間的消息傳遞使用BIOS信號量實現。 | ? |
| Syslink / IPC | HOST A8 VPSS M3 Video M3 DSP | 用于處理器之間通信的軟件api。提供諸如處理器加載和引導,多堆棧,多鏈表(ListMP)功能,消息隊列,通知等 | Syslink IPC |
| HDVPSS Drivers | VPSS M3 | HDVPSS驅動器,如采集,顯示, 去隔行,縮放基于FVID2界面上控制和配置 HDVPSS硬件 ? | HDVPSS |
| ISS Drivers | VPSS M3 | ISS驅動程序,如捕獲,傳感器配置,基于FVID2接口的縮放,以控制和配置ISS硬件 | ISS |
| Video Encode | Video M3 | 基于XDM / XDIAS接口的視頻編碼API。Uses framework components for用于框架組件 資源分配 | XDIAS Framework components IVAHD HDVICP2 API MJPEG encoder H264 encoder |
| ALG | VPSS M3 | 用于視頻處理和高級功能的高級算法。例如-視頻穩定,AWB,AE,閃爍檢測等 | ISS |
| Face Detect | VPSS M3 | 面部檢測引擎驅動程序可以做到高達32張人臉的實時檢測 | ISS |
| Links | HOST A8 VPSS M3 Video M3 DSP | 實施單個鏈接。一些鏈路是特定于處理器的,而一些鏈路在處理器之間是公共的 ? | IPNC RDK |
| Link API | HOST A8 | 鏈接API允許用戶創建,連接和HOSTA8控制環節,VPSS M3,M3的視頻和DSP。 | McFW |
?
| Layer | Processor? Applicable | Description | TI SW Package |
| ? | ? | Link API用于創建鏈接鏈,形成用戶定義的用例。 連接到彼此的鏈接是平臺相關的。 | ? |
| McFW API | HOST A8 | 多通道應用程序特定API,允許用戶使用單個簡化的API接口為IPNC,NVR設置和控制預定義的應用程序特定鏈。 這使得用戶可以直接使用的鏈接,而無需了解詳細的鏈路API。 該McFW API是平臺獨立的,相同的API將在DM812x工作,DM385 | McFW |
| RTSP Stack | HOST A8 | 開源的的C ++庫,用于多媒體流,采用開放的標準協議開源包(RTP / RTCP,RTSP,SIP) | Open source |
| User Application | HOST A8 | 通常GUI和其他應用程序特定組件,如文件讀/寫,網絡流。 User application can use the McFW API for pre-defined usecases 用戶應用可以利用預先定義的用例的McFW API OR 要么 User application can use the link API and create their own custom chains. 用戶應用可以利用鏈接API,并創建自己的定制鏈。 NOTE: User application NEED NOT create “links” of their own for say file write. 注意:用戶應用程序不需要創建自己的“鏈接”用于說文件寫入。 Users can write their own custom implementation of processing steps outside of the link API. 用戶可以在鏈接API之外編寫自己的自定義實現的處理步驟。 IPNC RDK provides three kinds of demos IPNC RDK提供了三種類型demos 。 “chains” demo, this uses the“鏈”demos,這里使用 ? | Customer specific |
| Layer | Processor? Applicable | Description | TI SW Package |
| ? | ? | link API . “McFW” demo, this uses the McFW API ??????????????????????????????????????????????????????? -??? | ? |
3.2 ???? McFWAPI
McFW API基于以下原則
?多通道視頻系統由以下四個子系統組成
1.攝像/捕捉 –這個子系統實現了視頻拍攝。攝像機組件通過并行輸入視頻端口從bayer傳感器捕獲,并可選地提供兩個縮放輸出。 The capture link captures multi-channels from input video ports(VIP).捕獲鏈路從輸入視頻端口(VIP)捕獲多通道。
2.顯示 - 這將從捕獲和解碼子系統接收作為輸入,并通過不同的用戶定義的鑲嵌圖案組成并通過多個通道呈現在多個顯示設備上。?
3.編碼 - 這將由包括“子碼流”編碼的捕獲和編碼視頻作為輸入,并且給用戶提供編碼比特流 ?
4.視頻處理 - 這將由捕獲/攝像機和處理視頻作為輸入,取決于配置的引擎,如噪聲過濾器,mjpeg編碼。
視頻分析 - 這將輸入作為QVGA輸入從標量和運行DMVA算法
API隱藏平臺級別詳細信息,如YUV格式轉換,要使用的標量,要使用的視頻噪聲過濾器,并允許用戶專注于廣泛級子系統,而不是低級硬件資源和約束。
The hardware blocks (noise filter, scaler,isp) used inside a sub-system depend on the top level system configuration doneby the user depending on their use-case.在子系統內部使用的硬件塊(噪聲濾波器,縮放器,isp)取決于用戶根據其使用情況完成的頂級系統配置。
User will see the same block diagram for alluse-cases on all platforms.用戶將在所有平臺上看到所有用例的相同框圖。 Thedetailed blocks inside the sub-system will depend on the system levelconfiguration selected by the user.子系統內的詳細塊將取決于用戶選擇的系統級配置。 The blocks inside the subsystem will also depend on the platformlike DM812x or DM385.子系統內部的塊也將取決于平臺,如DM812x或DM385。
Thus McFW API allows user to use the same APIfor different products across different platforms, thus allowing user to keeptheir GUI and other applications portable to different product lines andplatforms. 因此,McFW API允許用戶針對不同平臺的不同產品使用相同的API,從而允許用戶保持其GUI和其他應用程序可移植到不同的產品線和平臺。
3.2.1 ?McFW API 系統框架圖??????????????????????????????????????????????????????Primary stream, Secondary stream,
?
?
示例,三流IPNC用例的簡單流程圖如下所示。
?
?
3.3 ???? LinkAPI
注:大多數用戶并不需要知道內部軟件架構的底層細節,但有必要了解軟件如何才能最有效地運行在系統內部。
A link is the basic processing step in avideo data flow.鏈接是視頻數據流中的基本處理單元。 A link consists of aBIOS6/Linux thread coupled with a message box (implemented using OSsemaphores).鏈接由BIOS6 / Linux線程和消息框(使用OS信號量實現)組成。 Since each link runs as aseparate thread, links can run in parallel to each other.由于每個鏈接作為單獨的線程運行,鏈接可以彼此并行地運行。 The message box associated with a link allows user application aswell as other links to talk to that link.與鏈接相關聯的消息框允許用戶應用程序以及其他鏈接與該鏈接對話。 The link implements a specific interface which allows other linksto exchange video frames and/or bit streams with the link.鏈路實現特定接口,其允許其他鏈路與鏈路交換視頻幀和/或比特流。
Link API allows user to create,control and connect the links. Link API允許用戶創建,控制和連接鏈接。
McFW API uses Link API to make achain depending on the top level system configuration provided by the user.McFW API使用Link API根據用戶提供的頂級系統配置制作一個鏈。
Alternatively user's can use the link APIdirectly to make custom use-cases not supported by the McFW API.或者,用戶可以直接使用鏈接API來創建McFW API不支持的自定義用例。
?3.3.1 ?“鏈接”的內部軟件體系結構
在McFW內部使用的SW架構基于以下原則,
視頻處理工作加載在不同處理器之間劃分,如下所示
| Processor | OS | Used for |
| HOST A8 | Linux | 系統設置和控制,GUI,IO外設控制如SATA,以太網,USB,音頻 |
| VPSS M3 | BIOS6? | HDVPSS控制視頻采集,視頻顯示,縮放,視頻噪聲濾波 |
| Video M3 | BIOS6 | HDVICP2視頻壓縮(H264編碼,MJPEG編碼) |
| DSP | BIOS6 | SW OSD,自定義視頻處理算法 |
?
在每個處理器中,每個處理步驟如捕獲或顯示將在其自己的獨立線程中運行。這種獨立的執行線程在這個框架中被稱為“link”。
?Example links include, capture, display,DEI, Noise Filter, encode, decode示例鏈接包括,捕獲,顯示,DEI,噪聲濾波器,編碼,解碼
Eachthread or link is capable of handling processing of video frames from multiplechannels, each having different properties like width, height, data format etc.每個線程或link能夠處理來自多個通道的視頻幀,每個通道具有諸如寬度,高度,數據格式等不同的屬性。
A link will“connect” to other links to make a chain or a data flow.鏈接將“連接”到其他鏈接以形成鏈或數據流。This connection and control canbe done by the user from the HOST A8 side.這種連接和控制可以由用戶從HOST A8側完成。
Once a chain is setupand started, each link in the chain will exchange frames will its next link,using a well defined interface, to make the video processing data flow.一旦鏈建立和啟動,鏈中的每個link將交換幀,其下一個鏈路,使用良好定義的接口,使視頻處理數據流。
The frameworkallows links on different processors to exchange frames directly with eachother without any intervention of the HOST A8.該框架允許不同處理器上的鏈路直接彼此交換幀,而不需要HOST A8的任何干預。
Once a chain isrunning, user can send control commands to individual links to control theirrun-time behavior.一旦鏈運行,用戶可以向單個link發送控制命令以控制其運行時行為。Example, changing encode Qp, frame rate control etc.例如,改變編碼Qp,幀速率控制等。
An example chain is shown below, in thischain multiple channels of video are captured, encoded via HDVICP encode linkand then stream out on the network示例鏈如下所示,在該鏈中,多通道的視頻由捕獲,通過HDVICP編碼link編碼,然后在網絡上流出
?
3CH 1080p + D1 YUV420 + 1080p @ 60fps
?
?
?
Encode支持:
HDVICP H.264
H.264 1080p 60fps
H.264 D1 30fps
MJPEG 1080p 5fps
?
3.3.2 ?link接口
link接口包括
Link API – whichis used by chains or user applications for configuring and controlling the link Link API - 鏈或用戶應用程序用于配置和控制link
Inter Link API –which is used by other links for exchanging frames between two links Inter Link API - 由其他鏈路用于在兩個link之間交換幀
Link OutputQueue – is the queue which is used by another link (via the inter link API) toexchange frames with that linklink輸出隊列 - 是另一個link(通過link間link API)用來與該link交換幀的隊列
3.3.3 ?將消息傳遞到鏈接?
每個鏈接由系統級唯一的32位鏈接ID(如“system_linkId.h”中定義)標識。
The link ID determines on which processor the link runs as shownbelow.鏈路ID確定鏈路在哪個處理器上運行,如下所示。
?
| 位 | 描述 |
| 0..27 | 鏈接ID |
| 28..31 | 此鏈接運行的處理器ID 0: DSP (C64x) 1: Video M3 2: VPSS M3 3: HOST A8 |
每個link API在向link發送消息時需要鏈接ID作為參數。
When amessage is sent to a link by the user, based on the link ID the functioninternally knows whether this is a local link, in which case it sends themessage using normal BIOS/Linux APIs, else it will use Syslink MessageQ to sendthe message to the appropriate processor.當用戶發送消息到鏈接時,基于鏈接ID,函數內部知道這是否是本地鏈接,在這種情況下,它使用正常的BIOS / LinuxAPI發送消息,否則它將使用Syslink MessageQ發送消息發送到適當的處理器。Once the MessageQ message reachesthe target processor, it invokes the local BIOS APIs to forward the message tothe intended link.一旦MessageQ消息到達目標處理器,它調用本地BIOS API將消息轉發到目標鏈路。This allows user to control the links on VPSS M3, Video M3 and DSPfrom HOST A8.這允許用戶控制來自HOSTA8的VPSS M3,視頻M3和DSP上的鏈路。The user need not directly know about the processor and mechanism(Syslink message Q) that is used for this message passing.用戶不需要直接了解用于該消息傳遞的處理器和機制(Syslink消息Q)。
3.3.4 ??? link API
此API允許link由用戶或鏈控制。
The followingAPIs are part of the link API.以下API link接API的一部分。
The API arguments are typically specific to the link implementation. API參數通常特定于鏈接實現。
?
| API | Description |
| System_linkCreate | 創建鏈接 - 分配驅動程序,編解碼器,內存資源。 |
| System_linkGetInfo | 獲取有關通道數量,每個通道的屬性等link的信息。MUST be called after System_linkCreate() for a link System_linkCreate()中的鏈接后,必須調用 |
| System_linkStart | 啟動link - 啟動驅動程序或編解碼器 |
| System_linkControl | 發送帶有可選參數的link特定控制命令 |
| System_linkStop | 停止鏈接 - 停止驅動程序或編解碼器 |
| System_linkDelete | 刪除一個link- 釋放驅動程序,編解碼器,內存資源 |
?
3.3.5 ??? Inter Link API
此API由link用于相互交換幀。Users of a link typically neednot be aware of this API.link的用戶通常不需要知道這個API。
Each link needs to implement a few functions and register thefunction pointers with the system frame work along with its link ID.每個link需要實現一些功能,并注冊與系統框架一起工作的函數指針及link ID。This registration is done once during system init.此注冊在系統初始化期間執行一次。
?
| API | Description |
| System_GetLinkInfoCb | 返回關于link的信息的功能,如通道數,每個通道的屬性 |
| System_LinkGetOutputFramesCb | 將捕獲或生成或輸出幀返回給調用者的函數(另一個鏈接) |
| System_LinkPutEmptyFramesCb | 將消費的幀釋放回原始鏈接以便重用的功能 |
| System_LinkGetOutputBitBufsCb | 返回生成的函數或輸出比特流幀到調用者(另一鏈接) - 僅對Encode Link有效 |
| System_LinkPutEmptyBitBufsCb | 函數來釋放所消耗的位流的幀回原始鏈路重用-有效僅用于編碼鏈接 |
任何想從另一個link獲取幀的link將使用系統API“System_getLinksFullFrames()”從上一個link獲取幀。This internally will index into thesystem wide link information table and invoke the link specificSystem_LinkGetOutputFramesCb() function callback.這將在內部索引到系統范圍的kink信息表,并調用特定于鏈接的System_LinkGetOutputFramesCb()函數回調。
Similarlywhen a link wants to release the frames back to the original link after theframes have been consumed, it will call the API “System_putLinksEmptyFrames()”.類似地,當鏈路想要在幀被消耗之后將幀釋放回原始鏈路時,它將調用API“System_putLinksEmptyFrames()”。Thisinternally will index into the system wide link information table and invokethe link specific System_ LinkPutEmptyFramesCb () function callback.這在內部將索引到系統范圍的鏈接信息表,并調用鏈接特定的System_LinkPutEmptyFramesCb()函數回調。
This way alink need not exactly know which link it is exchanging frames with.這樣,鏈路不需要精確地知道它正在與哪個鏈路交換幀。All it needs is a link ID of theprevious link in the data flow.它所需要的是數據流中上一個鏈接的鏈接ID。Thisallows user to user the same link in many different data flows withoutmodifying the link implementation.這允許用戶在許多不同的數據流中使用相同的鏈路,而不修改link的實現。
3.3.6 ?鏈路輸出隊列
鏈接將具有一個或多個輸出隊列,其將把捕獲或生成的幀放入其中。 A link owns it output queue and takescare of memory allocation for the frames that will go into its output queue.鏈接擁有它的輸出隊列,并負責處理將進入其輸出隊列的幀的內存分配。
Most linkshave only one output queue, but some links have multiple output queue's.大多數鏈接只有一個輸出隊列,但有些鏈接有多個輸出隊列。These multiple output queue's allowthat link to be used in different data flows without changing the linkimplementation.這些多個輸出隊列允許該鏈路在不改變鏈路實現的情況下在不同的數據流中使用。
Example,Noise filter link can be configured to output its channel frames over twooutput queues, such that 8CH of 16CH goto one output queue and other 8CH go toother output queue.示例,噪聲濾波器鏈路可以被配置為在兩個輸出隊列上輸出其信道幀,使得16CH到8個輸出隊列中的8CH和其他8CH到另一個輸出隊列。This allows noise filter to feed to two different DEI links in somedata flows.這允許噪聲濾波器饋送到一些數據流中的兩個不同的DEI鏈路。
An outputqueue can hold frames from multiple channels of multiples sizes and differentdata formats.輸出隊列可以保存來自多個大小和不同數據格式的多個通道的幀。ie it's a hetrogeous queue.即它是一個hetrogeous隊列。
Theinformation of the content in the queue can be known by using the System_linkGetInfo()API.通過使用System_linkGetInfo()API可以知道隊列中的內容的信息。This internally will call the link specific System_GetLinkInfoCb()function callback.這在內部將調用特定于鏈接的System_GetLinkInfoCb()函數回調。
The datastructure FIVD2_Frame, used by VPSS driver, is used for exchanging frameinformation between links. VPSS驅動程序使用的數據結構FIVD2_Frame用于在鏈路之間交換幀信息。This allows frame information toflow between links without any additional translation.這允許幀信息在鏈路之間流動而不需要任何額外的翻譯。Among other information it has a“channelNum” field which allows a link to indentify the channel with the framedata.在其他信息中,它具有“channelNum”字段,其允許鏈路用幀數據來標識信道。
A link willtypically call the System_getLinksFullFrames() with the link ID and que ID ofthe previous link when it wants to process the input frames.當鏈接想要處理輸入幀時,鏈接通常會調用具有前一鏈接的鏈接ID和隊列ID的System_getLinksFullFrames()。
A link whenit has generated output frames for consumption by the next link will send amessage “SYSTEM_CMD_NEW_DATA” to the next link.當鏈路生成輸出幀供下一鏈路使用時,鏈路將向下一鏈路發送消息“SYSTEM_CMD_NEW_DATA”。
When a link receives “SYSTEM_CMD_NEW_DATA” it will call當鏈接接收到“SYSTEM_CMD_NEW_DATA”時,它將調用
System_getLinksFullFrames(). System_getLinksFullFrames()。After processing the input frames itwill release the input frames using System_putLinksEmptyFrames()在處理輸入幀之后,它將使用System_putLinksEmptyFrames()釋放輸入幀,
Thus a linkneeds to know因此鏈路需要知道
?Previous link ID and Previous Link QueID to get input frames上一個鏈接ID和上一個鏈接Que ID以獲取輸入幀
?And Next Link ID, in order to informthe next link when new frames are generated.和下一鏈路ID,以便在生成新幀時通知下一鏈路。
Thisinformation of previous link ID and next link ID is passed to a link using theSystem_linkCreate() API.使用System_linkCreate()API將上一個鏈接ID和下一個鏈接ID的信息傳遞到鏈接。
Thus previouslink ID and next link ID is what “connects” one link to another link.因此,先前鏈路ID和下一鏈路ID是將一個鏈路“連接”到另一鏈路。
3.3.7 ??? IPC Link
稱為IPC(處理器間通信)鏈路的特殊鏈路用于跨越處理器交換幀。
Example, A local processor link likecapture will exchange frames with the IPC Link and the IPC Link will turn makeuse of use of appropriate Syslink/IPC APIs to send the received frames acrossprocessors.例如,像捕獲的本地處理器鏈路將與IPC鏈路交換幀,并且IPC鏈路將利用適當的Syslink / IPC API來發送在處理器之間接收的幀。
Thus a capture link can be implemented asif it will only talk to a link on the same processor.因此,捕獲鏈路可以被實現為好像它將僅與相同處理器上的鏈路通話。 This will keep the implementation of the capture link simple andefficient.這將保持捕獲鏈路的實現簡單和有效。
The special IPC link will handle thecomplexity of sending frames between processors and it will take care of anycache operations or other such inter processor synchronization functions.特殊的IPC鏈接將處理在處理器之間發送幀的復雜性,并且它將負責任何高速緩存操作或其它這樣的處理器間同步功能。
The inter link frame exchange mechanismsthat are used, depend on where the links are located in order to reduce interlink frame exchange overheads.所使用的鏈路幀交換機制取決于鏈路所在的位置,以便減少鏈路幀間交換開銷。
The following three inter link frameexchange mechanisms are used使用以下三個鏈路幀交換機制
Intra-processor links 幀內處理器links
o Example, from capture to noise filterwhich run on the same processor.實例,從捕捉到噪聲濾波器在相同的處理器上運行。
Simple and efficient array based queue'sare used for frame exchange.簡單和高效的基于陣列的隊列用于幀交換。
Inter M3 (Video / VPSS) links 內部M3(視頻/ VPSS)link
o Example from NF to encode (via IPC M3OUT/IN Link) which run on VPSS M3 and Video M3 (sharing a uni-cache).例如從NF到編碼(通過IPC M3 OUT / IN連接),這對VPSS M3和M3視頻(共用一個單緩存)上運行。
IPC ListMP with Notify is used with frameinformation pointer (FVID2_Frame) being passed directly without any cacheoperations and address translation since both M3 share the same uni-cache.具有Notify的IPC ListMP與幀信息指針(FVID2_Frame)一起被直接傳遞而沒有任何高速緩存操作和地址轉換,因為兩個M3共享相同的單一高速緩存。
Inter processor (M3 to A8 or DSP) 內部處理器(M3至A8或DSP)
o Example from encode to Bitstream IN (viaIPC OUT/IN Link) which run on Video M3 and Host A8. 例如,從編碼到比特流(通過IPC OUT / IN連接),這對視頻M3和主機A8運行。
IPC ListMP with Notify is used with frameinformation being passed with address and information translation includingcache operations, if applicable帶有通知的IPC ListMP用于通過地址和信息轉換傳遞的幀信息,包括高速緩存操作(如果適用)
3.3.8 ?框架結構
?
Linksexchange frames.鏈接交換幀。 The frame buffers (video data) can be sent across processors forprocessing using these frames.可以在處理器之間發送幀緩沖器(視頻數據)以便使用這些幀進行處理。
TheFVID2 header has sufficient information that can be used to in transportationof frame buffers. FVID2頭具有足夠的信息,可用于幀緩沖區的傳輸。
FVID2header has many parameters but as an application writer its important to understandfollowing ones FVID2頭有許多參數,但作為應用程序編寫者,了解以下的重要
channelNum- Identifies channel channelNum - 標識通道
Addr[][]- Pointer to the frame buffer Addr [] [] - 指向幀緩沖區的指針
perFrameCfg- Information about frame configuration perFrameCfg - 有關幀配置的信息
AppData -Application data can be plugged in here, currently it has systemInformation AppData - 應用程序數據可以在這里插入,目前它有systemInformation
?
3.4 ?鏈
NOTE:Most users don’t need to know lowlevel details of how to make chains since McFW API hides this detail from theuser, but its useful to know how the software operates internally in order toget the most out of the system.
注:大多數用戶并不需要知道如何自McFW API隱藏從用戶這一細節做出鏈底層的細節,但其有用知道軟件如何才能最有效地系統的內部操作。
A chain is connection of links in alogical order to make a video processing data flow.鏈是以邏輯順序連接鏈路以產生視頻處理數據流。A chain is constructed using Link APIs.鏈使用Link API構建。
Differentchains can be constructed for different applications.可以為不同的應用構建不同的鏈。Chains can be “destroyed” and then reconstructed in a different wayswithout needing a reboot.鏈可以“銷毀”,然后以不同的方式重建,而不需要重新啟動。
McFW API根據用戶傳遞的頂層系統配置構造一些預定義的鏈。
3.4.1 ?鏈執行順序
鏈執行按以下順序執行。
A chain createsthe links using System_linkCreate() API.鏈使用System_linkCreate()API創建鏈接。Links MUST be created in the order ofsource link to sink link.鏈路必須按源鏈路到宿鏈路的順序創建。
A source is a link which has no previous link.源是沒有先前鏈接的鏈接。Example, Capture示例,捕獲
A sink is a link which has no next link.宿是沒有下一個鏈路的鏈路。Example, Display示例,顯示
The order ofcreating a link is important since when a link is created it queries itsprevious link to get information about the expected number of channels andchannel properties, based on a which a link will configure itself.創建鏈接的順序很重要,因為當鏈接被創建時,它基于鏈接將對其自身進行配置來查詢其先前的鏈接以獲得關于預期的信道數量和信道屬性的信息。Hence a “previous” link needs tocreated before the “next” link因此,需要在“下一個”鏈接之前創建“先前”鏈接
Next the chainis started by calling System_linkStart() for each link in the chain.接下來,通過為鏈中的每個鏈接調用System_linkStart()來啟動鏈。The links are started in theorder of sink link to source link.鏈路按照宿鏈路到源鏈路的順序開始。This is not a hard requirementbut is usually desired in the application, since this allows all links to getready to receive input before the source link itself is started.這不是硬要求,但通常在應用程序中是需要的,因為這允許所有鏈路在源鏈路本身啟動之前準備好接收輸入。
Once a chain isrunning control commands can be sent to individual links to control the dataflow.一旦鏈運行,控制命令可以發送到各個鏈路以控制數據流。System_linkControl() API is used tosend control commands.System_linkControl()API用于發送控制命令。Example, command to SW Mosaic Link tochang Mosaic layout at run-time.示例,SW圖案鑲嵌的命令鏈接到運行時的圖案鑲嵌布局。
?The control commands that aresupported depend on the type of link.支持的控制命令取決于鏈路的類型。
NOTE,depending on the link System_linkControl() can be called even before callingSystem_linkCreate().注意,根據鏈接,System_linkControl()甚至可以在調用System_linkCreate()之前調用。
After the useris done with a chain he can stop it by calling System_linkStop() API for eachlink of the chain.在用戶完成鏈后,他可以通過為鏈的每個鏈接調用System_linkStop()API來停止它。A chains MUST be stopped in the orderof source to sink.一個鏈必須按源到sink的順序停止。
A link can wait on a output buffer which could be held by the nextlink.鏈路可以等待可以由下一鏈路保持的輸出緩沖器。If the next link is stopped before aprevious link is stopped, then the previous could wait for ever on a bufferwhich never arrives since the next link is no longer active.如果下一鏈接在前一鏈接停止之前停止,則先前可以在從未到達的緩沖器上等待,因為下一鏈接不再活動。Hence a previous link MUST be stoppedbefore stopping the next link.因此,在停止下一鏈路之前必須停止先前的鏈路。
Finally after achain is stopped, it can be destroyed by calling最后一個鏈停止后,它可以通過調用銷毀
System_linkDelete()API on each link in the chain.在鏈中的每個鏈接上的System_linkDelete()API。Link delete can be called in any orderon the links.鏈接刪除可以在鏈接上以任何順序調用。
刪除鏈后,可以使用相同的序列創建和啟動新鏈。
?
3.4.2 ?鏈示例代碼
多通道捕獲到SW嵌合體到顯示鏈的示例代碼如下所示。Some details are left out for clarity.為了清楚起見,省略了一些細節。?
| 數據流 |
| 16CH 720x240 YUV422I 60fps 1CH 1920x1080 YUV422I 60fps (1080p60) 4x4 Mosaic Layout ? |
| 鏈接包含文件 |
| #include <ti/vsi/interfaces/system.h> #include <ti/vsi/interfaces/captureLink.h> #include <ti/vsi/interfaces/displayLink.h> #include <ti/vsi/interfaces/swMsLink.h> #include <ti/vsi/interfaces/systemLink_m3vpss.h> |
| 鏈接創建參數結構 |
| CaptureLink_CreateParams??? capturePrm; SwMsLink_CreateParams?????? swMsPrm; DisplayLink_CreateParams??? displayPrm; |
| Setup Capture link parameters |
| capturePrm.tilerEnable = FALSE; // 不使用 tiler內存輸出 capturePrm.numVipInst = 4; // 使用4個視頻端口 ? // 捕獲鏈接后的下一個鏈接是SW Mosaic DEI 鏈接 capturePrm.outQueParams[0].nextLink = SYSTEM_LINK_ID_SW_MS_DEI_0; ? |
?
| // 為每個視頻捕獲端口配置 for(vipInstId=0; vipInstId<capturePrm.numVipInst; vipInstId++) {??? // 設置捕獲端口 ID? capturePrm.vipInst[vipInstId].vipInstId =?????????? ????????????? SYSTEM_CAPTURE_INST_VIP0_PORTA+vipInstId; ? ?? // 設置捕獲外部設備 ID??? capturePrm.vipInst[vipInstId].videoDecoderId???? =???? ????????????? SYSTEM_DEVICE_VID_DEC_TVP5158_DRV; ? ?? //設置輸入數據格式為16-bit YUV422??? capturePrm.vipInst[vipInstId].inDataFormat =? ????????????? SYSTEM_DF_YUV422P; ? ?? // 設置捕獲視頻標準為4路D1 multiplxed 捕獲 (每端口)???? capturePrm.vipInst[vipInstId].standard =? ????? ????????SYSTEM_STD_MUX_4CH_D1; ? // 每通道輸出端口數量為一 ???? capturePrm.vipInst[vipInstId].numOutput =? 1; ? ???? //輸出數據格式是YUV422I????? capturePrm.vipInst[vipInstId].outParams[0].dataFormat =?????????????????? SYSTEM_DF_YUV422I_YUYV ? ????? // inline scaling disabled since this is multi-channel capture?????? capturePrm.vipInst[vipInstId].outParams[0].scEnable = FALSE; ? ????? // 所有通道映射到輸出隊列 ID = 0 ????? capturePrm.vipInst[vipInstId].outParams[0].outQueId = 0; } ? |
| 設置 SW Mosaic 鏈接參數 |
| // 一個鏈接是捕捉, 一個鏈接 que ID = 0 swMsPrm.inQueParams.prevLinkId = SYSTEM_LINK_ID_CAPTURE; swMsPrm.inQueParams.prevLinkQueId = 0; |
?
| ? // 下一個鏈接是顯示 swMsPrm.outQueParams.nextLink???? = SYSTEM_LINK_ID_DISPLAY_1; ? // SW Mosaic 調用周期是 16ms or 60fps swMsPrm.timerPeriod?????????????? = 16; ? // 初始布局是,顯示貞大小為 1080p60 swMsPrm.layoutPrm.outLayoutMode = SYSTEM_LAYOUT_MODE_16CH; swMsPrm.layoutPrm.outRes = SYSTEM_DISPLAY_RES_1080P60; ? // CHx mapped to WINx. 最大 16 windows possible in 4x4 layout. for(winId=0; winId<16; winId++) ??? swMsPrm.layoutPrm.win2ChMap[winId] = winId; ? |
| 設置顯示鏈接參數 |
| // 一個鏈接是 SW Mosaic 鏈接, 一個鏈接 que ID = 0 displayPrm.inQueParams.prevLinkId??? = SYSTEM_LINK_ID_SW_MS_DEI_0; displayPrm.inQueParams.prevLinkQueId = 0; ? // display resolution is same as SW Mosaic link output frame size, 1080p60 displayPrm.displayRes??????????????? = swMsPrm.layoutPrm.outRes; |
| 初始化顯示控制器 –這是必需的,以便使顯示。There is no separate display controller link. 沒有單獨的顯示控制器鏈接。Instead a command is sent to the generic VPSS Link which in turn calls the display controller API on the VPSS M3 processor. 相反,命令被發送到通用VPSS鏈路,其又調用VPSS M3處理器上的顯示控制器API。 |
| SystemVpss_DisplayCtrlInitParam prm; ? // 顯示控制器分辨率和顯示器鏈接一樣 prm.hdDisplayRes = displayPrm.displayRes; ? //發送命令到VPSS M3 link 來初始化顯示控制器 System_linkControl( ??????? SYSTEM_LINK_ID_M3VPSS, ??????? SYSTEM_M3VPSS_CMD_GET_DISPLAYCTRL_INIT, &prm,??????????? sizeof(prm), ??????? TRUE |
?
| ??????? ); |
| 創建鏈接 |
| // 按照源的順序創建sink System_linkCreate (SYSTEM_LINK_ID_CAPTURE, &capturePrm, sizeof(capturePrm)); System_linkCreate(SYSTEM_LINK_ID_SW_MS_DEI_0, &swMsPrm, sizeof(swMsPrm)); System_linkCreate(SYSTEM_LINK_ID_DISPLAY_1, &displayPrm, sizeof(displayPrm)); |
| 啟動鏈接 |
| // start in the order of sink to source System_linkStart(SYSTEM_LINK_ID_DISPLAY_1); System_linkStart(SYSTEM_LINK_ID_SW_MS_DEI_0); System_linkStart(SYSTEM_LINK_ID_CAPTURE); |
| 運行時控制鏈接 |
| while(1) { ??? //?? sleep few seconds???? sleep(10); ? ?? //? 改變mosaic 布局, 保持其他布局參數和初始化時刻的一樣 ?? swMsPrm.layoutPrm.outLayoutMode = SYSTEM_LAYOUT_MODE_7CH_PLUS_1CH;??? System_linkControl( ???????????? SYSTEM_LINK_ID_SW_MS_DEI_0,? ???????????? SYSTEM_SW_MS_LINK_CMD_SWITCH_LAYOUT,? &swMsPrm.layoutPrm,?????????????? sizeof(swMsPrm.layoutPrm),? ??? ??????????TRUE ????????????? ); ? ?? // 檢查鏈是否按照用戶輸入的做 ??? if(userIsDone())??????? break; } |
| 停止鏈接 |
| // 按源到sink的順序停止 System_linkStop(SYSTEM_LINK_ID_CAPTURE); System_linkStop(SYSTEM_LINK_ID_SW_MS_DEI_0); |
| System_linkStop(SYSTEM_LINK_ID_DISPLAY_1); |
| 刪除鏈接 |
| // 任何順序都可以 System_linkDelete(SYSTEM_LINK_ID_CAPTURE); System_linkDelete(SYSTEM_LINK_ID_SW_MS_DEI_0); System_linkDelete(SYSTEM_LINK_ID_DISPLAY_1); |
| 銷毀顯示器控制 |
| //發送命令到VPSS M3鏈接以初始化顯示控制器。No parameters are passed for de-init沒有傳遞參數用于de-init System_linkControl( ??????? SYSTEM_LINK_ID_M3VPSS, SYSTEM_M3VPSS_CMD_GET_DISPLAYCTRL_DEINIT, ??????? NULL, ??????? 0, ??????? TRUE ??????? ); ? |
?
4? 目錄結構
4.1 ?接口文件
McFW的接口文件可以在以下位置找到。所有的接口API都可以從Host A8端調用。
| Interface files base path | ? |
| ipnc_rdk\mcfw\interfaces | ? |
| McFW API - Interface files ipnc_rdk\mcfw\interfaces | ? |
| ti_vcap.h | 視頻捕捉子系統接口 |
| ti_vcam.h | 攝像機 (ISP) 子系統接口 |
| ti_vdec.h | 視頻解碼子系統接口 |
| ti_vdis.h | 視頻顯示子系統接口 |
| ti_vdis_timings.h | 視頻顯示子系統接口 (timings) |
| ti_venc.h | 視頻編碼子系統接口 |
| ti_mjpeg.h | 基于SIMCOP的視頻編碼(MJPEG) |
?
| ? | 子系統接口 | |
| ti_vsys.h | 系統配置接口 | |
| ti_media_common_def.h | 公共數據結構定義 | |
| ti_media_error_def.h | 錯誤定義 | |
| ti_media_std.h | 數據類型 | |
| Link API - Interface files ipnc_rdk\mcfw\interfaces\link_api | ||
| system.h | Common Link APIs and 數據結構 | |
| system_common.h | 系統級const,數據結構,所有處理器共用的函數。 User does not use the const 's, function's, data structure defined in this file directly用戶不使用常量的,函數,數據結構,在這個文件中定義的直接 | |
| system_const.h | 常見的全系統的常量和枚舉的。用戶可以使用const,在鏈接API中的此文件中定義 | |
| system_debug.h | 定義的控制調試信息的打印。如果修改這需要重建BIOS和linux端代碼以使更改生效。 ? | |
| system_linkId.h | 32位鏈接ID,proc ID和其他實用程序宏來操作鏈接ID | |
| system_tiler.h | APIs to allocate memory from Tiler region | |
| systemLink_common.h | 系統鏈接API,它在所有從處理器的常見 (VPSS M4, Video M3, DSP) (VPSS M4,Video M3,DSP) ? | |
| systemLink_m3video.h | System Link API specific to Video M3 processor | |
| systemLink_m3vpss.h | System Link API specific to VPSS M3 processor | |
| systemLink_c6xdsp.h | System Link API specific to C64x processor | |
| captureLink.h | 視頻捕獲 Link API | |
| sclrLink.h | HDVPSS Scalar Link API | |
| ispLink.h | ISP Memory to memory Link API | |
| glbceLink.h | GLBCE Link API | |
| avsync.h | 音頻視頻同步 Link API | |
| algLink.h | 算法 Link API | |
| cameraLink.h | 圖像捕獲 (ISS) API Link | |
| decLink.h | 視頻解碼 (H264) Link API | |
| deiLink.h | Deinterlacer Link API | |
| displayLink.h | 顯示 Link API | |
| dupLink.h | 幀復制器 Link API | |
| encLink.h | 視頻編碼 (H264) Link API? | |
| grpxLink.h | 圖形 Link API | |
| ipcLink.h | IPC (內部處理器間的通信) Link API | |
| mergeLink.h | 框架合并 Link API | |
| vaLink.h | 視頻分析 (C64x) Link API | |
| swosdLink.h | 軟件 OSD Link API | |
| swMsLink.h | 軟件 mosaic Link API | |
| mjpegLink.h | MJPEG 編碼 (SIMCOP) API Link | |
| nsfLink.h | 噪聲濾波器 Link API | |
| vnfLink.h | 視頻噪聲濾波器 (SIMCOP) API Link | |
| fdLink.h | 面部檢測引擎 Link | |
| osdLink.h | OSD link | |
| nullLink.h | Dummy / Null sink Link API | |
| nullSrcLink.h | Dummy / Null source Link API | |
| swMsLink.h | Software Mosaic Link API | |
| vidbitstream.h | 視頻比特流的數據結構.不被用戶直接使用. | |
?
4.2 ?模板示例代碼
| McFW API Examples | ? |
| ipnc_rdk\ipnc_mcfw\demos\mcfw_api_demos | 多demos展示McFW APIs的用法 |
| ipnc_rdk\ipnc_mcfw\demos\ mcfw_api_demos\stream | 連接到RTSP流棧和音頻/視頻流服務器的鏈路 |
| ipnc_rdk\ipnc_mcfw\demos\ mcfw_api_demos\itt | 圖像調整工具服務器線程. 此線程偵聽TCP端口上的ITT連接,并協調客戶端CMD/DATA發送和接收 |
| ipnc_rdk\ipnc_mcfw\demos\audio_sample | 視頻捕捉 / 回放示例代碼 |
?
4.3 ?庫
| McFW API Examples | ? |
| ipnc_rdk\demos\mcfw_api_demos | 多demos展示McFW APIs的用法 |
?
5? 額外細節
5.1 ???內部處理器通信詳細信息
5.2 ???內存映射詳細信息
請參閱隨發行版提供的IPNC_RDK_MemoryMapAnalysis.pdf
The memorymap of the complete IPNC RDK software is controlled in the following files:完整的IPNC RDK軟件的存儲器映射在以下文件中進行控制:
ipnc_rdk\ipnc_mcfw\mcfw\src_bios6\cfg\config_512M.bld ipnc_rdk \ ipnc_mcfw \ mcfw \ src_bios6 \cfg \ config_512M.bld
To modify thememory map, user needs to modify the above mentioned files, but the followingkey considerations are required:要修改內存映射,用戶需要修改上述文件,但需要以下關鍵注意事項:
§? Code section of Video and VPSS M3 has to lie in the top256MB of the available memory map視頻和VPSS M3的代碼段必須位于可用內存映射的頂部256MB
§? A section of minimum 2MB need to be reserved forSyslink-Notify support in linux kernel.在Linux內核中,需要為Syslink-Notify支持保留一個最小2MB的段。 Linux kernel uses this memory to communicate with VPSS M3 in IPNCRDK. Linux內核使用此內存與IPNC RDK中的VPSS M3通信。 Any change in address for this section requires an update ofbootargs for “ notifyk.vpssm3_sva ” boot parameter在地址段中的任何改變都需要bootargs的更新“notifyk.vpssm3_sva”啟動參數
§? A section of minimum 2MB is required to be reserved forFBDev buffer for IPNC RDK.對于IPNC RDK,需要為FBDev緩沖區保留最小2MB的段。 Any change in the buffer base address need to be updated in thefollowing line in ipnc_rdk \ ipnc_mcfw \bin\ load.sh o insmod./kermod/vpss.ko omx=1 sbufaddr= 0xbfb00000在緩沖區基址需要的任何變化在以下行ipnc_rdk\ ipnc_mcfw\ BIN \ load.sh
§? Insmod./kermod/vpss.ko OMX = 1 sbufaddr = 0xbfb00000更新
§? A section of 1MB is required for remote debug prints tobe shared across all cores.要在所有內核之間共享遠程調試打印,需要1MB的部分。 In current system, A8 utility continuously reads the shared memoryand dumps the debug messages on A8.在當前系統中,A8實用程序連續讀取共享內存,并在A8上轉儲調試消息。 Any change to this address need a change in the following line in對此地址的任何更改都需要更改以下行
ipnc_rdk\ipnc_mcfw\bin\scripts\wait_cmd.sh,ipnc_rdk\ipnc_mcfw\bin\scripts\send_cmd.sh and ipnc_rdk\ipnc_mcfw\bin\scripts\send_str.sh
o../bin/remote_debug_client.out0xbff00000 --waitch $1 $2
5.3 ??顯示控制器和顯示功能詳細信息
5.3.1 ?靜態改變顯示分辨率
MCFW支持在靜態時改變VGA顯示的顯示分辨率。Following VESA resolutions aretested on display VGA, ON-chip HDMI, OFF-chip HDMI.以下VESA分辨率在顯示VGA,片上HDMI,關閉芯片HDMI上測試。
?1080P60 (1920 * 1080) 1080P60(1920 * 1080)
?720P (1280 * 720) 720P(1280* 720)
?XGA (1024 * 768) XGA(1024* 768)
?SXGA (1280 * 1024) SXGA(1280* 1024)
By default, for ti812x HDMIand DVO2 are tied together .默認情況下,ti812x HDMI和DVO2捆綁在一起 。Itmeans when these VENCs are configured same resolution must be passed to DVO2and HDCOMP.這意味著當這些VENC配置相同時,必須將分辨率傳遞給DVO2和HDCOMP。Also, same content will be displayed onboth outputs.此外,相同的內容將顯示在兩個輸出上。Regarding clocks, VENC 'D' clock drivesHDMI (on chip HDMI) and VENC 'A' clock drives DVO2 and HDCOMP.關于時鐘,VENC'D'時鐘驅動HDMI(片上HDMI),VENC'A'時鐘驅動DVO2和HDCOMP。Thereis no change regarding SD VENC and SD VENC clock.關于SD VENC和SD VENC時鐘沒有變化。
If DisplayController configuration needs to be changed it can be done by modifying defaultconfiguration set for gSystem_dctrlTriDisplayConfig in system_dctrl_ti814x.c Tounderstand the mesh of components in display controller please referHDVPSS_UserGuide.pdf in hdvpss package, UserGuideHdvpssDisplayDriver section.如果顯示控制器配置需要改變它可以通過在system_dctrl_ti814x.c修改默認配置集為gSystem_dctrlTriDisplayConfig要理解部件的網眼中顯示控制器請參照hdvpss包,UserGuideHdvpssDisplayDriver部 HDVPSS_UserGuide.pdf來完成
?5.4 ?IPNC 應用程序配置
IPNC RDK適用于DM8127和DM385 soc平臺。主要有四種用例配置可供用戶選擇,如下所示:
1.???Tri-stream 低功耗模式
2.???Tri-stream 全功能模式
3.???捕獲顯示模式
除了上述四個選項之外,還向用戶提供了用于選擇諸如TILER模式的一些高級選項的靈活性。In this section we discussdetails of the above configurability options and the steps for configuration.在本節中,我們將討論上述可配置性選項的詳細信息和配置步驟。
還請注意,DM38x不支持C64x,并且具有比DM812x更低的DDR帶寬。From usecaseperspective the VA and C64x related data flows will not apply to DM38x versionof RDK.從使用者角度來看,VA和C64x相關數據流將不適用于DM38x版本的RDK。
5.4.1 ?平臺選擇
用戶需要在編譯IPNC RDK之前定義目標平臺。 Currently supported options are:當前支持的選項有:
IPNC_DEVICE:= DM385, DM388 or DMVA3 IPNC_DEVICE:= DM385,DM388或DMVA3
IPNC_DEVICE:= DM812x IPNC_DEVICE:= DM812x
Pleasecomment off the platform which is not targeted. 請注釋掉沒有定位的平臺。
5.4.2 ?三流低功率
IPNC三流低功耗應用程序已配置為演示具有最低功耗配置的三流配置(1080p 60fps + D1 30fps + MJPEG 5fps)。實現低功耗DSS和DSP已關閉。這意味著功能,如額外的標量; dsp框架,hd-vpss視頻噪聲過濾器,hdmi視頻輸出等將不可用。
For selecting low power configurationfollow the following steps:對于選擇低功耗配置,請按照以下步驟操作:
OpenRules.makefile and make the following changeRules.make中打開文件,并進行以下更改
IPNC_CONFIG := LOW_POWERIPNC_CONFIG:= LOW_POWER
Run'make all'command to regenerate the binaries運行“make all”命令來重新生成二進制文件
5.4.3 ?三流全功能
IPNC三流全功能應用在標準低功耗配置中增加了視頻噪聲濾波器和面部檢測功能。 HDMI & SD Display are also available in full featureconfiguration mode. HDMI和SD顯示也可在全功能配置模式下使用。
To enable full-feature configuration usermust follow the following procedure:要啟用全功能配置,用戶必須遵循以下過程:
OpenRules.makefile and make IPNC_CONFIG := FULL_FEATURERules.make中打開文件并進行IPNC_CONFIG:=FULL_FEATURE
Run'make all'command to regenerate the binaries運行“make all”命令來重新生成二進制文件
5.4.4 ??全功能NF 選擇
IPNC三流全功能應用程序實現兩個噪聲濾波器路徑。 First path uses the 3D noise filter from the DSS subsystem and thesecond path uses the ISS NSF2+TNF implementation in the SIMCOP.第一路徑使用來自DSS子系統的3D噪聲濾波器,第二路徑使用SIMCOP中的ISS NSF2 + TNF實現。 The user can do the noise filter selection using the followingcompile time switch:用戶可以使用以下編譯時開關進行噪聲濾波器選擇:
Select'VNF MODE'menu item from Camera Page.選擇攝像機Page“VNF MODE”菜單項。
HIGH SPEED will choose DSS VNF and HIGHQUALITY will choose ISS VNF.HIGH SPEED將選擇DSS VNF,HIGH QUALITY將選擇ISS VNF。If DM388, HIGH QUALITY willchoose MCTNF如果DM388,HIGH QUALITY將選擇MCTNF
5.4.5 ?智能分析或視頻分析模式
IPNC三流完整功能usecase實現Smart Analytics示例。 To enable Smart Analyticsexample user must follow the following procedure:要啟用SmartAnalytics示例用戶,必須遵循以下過程:
1.Select'SMART ANALYTICS'menu item from Example drop down menus.從實例“智能分析”菜單項下拉菜單。
2.Once the application is restartedSmart Analytics links appears on left side panel.應用程序重新啟動后,Smart Analytics鏈接將顯示在左側面板上。
?
5.4.6 ?捕獲顯示模式
IPNC用戶程序集實現一個例子,只做傳感器捕獲,YUV轉換和顯示。 This is an important examplebecause it allows users to use a simple application for testing image qualitybefore encode and also helps during sensor bringups.這是一個重要的例子,因為它允許用戶使用一個簡單的應用程序在編碼之前測試圖像質量,也有助于在傳感器提出。
To switch on capture-display example chain,user must follow the following steps:要打開capture-display示例鏈,用戶必須按照以下步驟操作:
1.OpenRules.makefile and make CAPTURE_DISPLAY_MODE_ON := YESRules.make中打開文件并進行CAPTURE_DISPLAY_MODE_ON:= YES
2.Run'make all'command to regenerate the binaries運行“make all”命令來重新生成二進制文件
5.4.7 ?將RAW或YUV發送到A8
在捕獲顯示模式下,用戶還可以選擇將在ISS中捕獲的RAW或YUV幀發送到A8,這允許在A8上運行的應用程序將圖像幀保存在文件系統中或通過網絡發送它們,以進行任何調試和調整目的。 It also shows an example of IPCcommunications between M3 and A8 for sharing frame buffers.它還示出了用于共享幀緩沖器的M3和A8之間的IPC通信的示例。
Toconfigure this option in Rules.make:要在Rules.make中配置此選項:
1.SetFRAMES_TO_A8 to YUV, YUV frames of the secondary stream will do a round tripM3-A8-M3 to reach the SD display.將FRAMES_TO_A8設置為YUV,輔助流的YUV幀將進行往返M3-A8-M3以到達SD顯示。
2.SetFRAMES_TO_A8 to RAW, RAW frames will be sent to A8 and then back to M3 beforegetting converted to YUV.將FRAMES_TO_A8設置為RAW,RAW幀將發送到A8,然后返回到M3,然后再轉換為YUV。
3.SetFRAMES_TO_A8 to NO, which is the default option, will disable the above IPCframe exchange.將FRAMES_TO_A8設置為NO(默認選項)將禁用上述IPC幀交換。
Thisoption only applies in the capture display mode.此選項僅適用于捕獲顯示模式。 When YUV or RAW frames exchange isswitched on, the sensor output frame rate is configured to 30fps.當YUV或RAW幀交換打開時,傳感器輸出幀速率配置為30fps
5.4.8 ?????? 256MB 內存映射
IPNC RDK還支持256MB內存映射作為縮減內存示例:
Open Rules.make file andmake MEMORY_CONFIG := 256MB 1.Rules.make中打開文件并進行MEMORY_CONFIG:=256MB
Run ' make all 'command to regenerate the binaries 2.運行“make all”命令來重新生成二進制文件
5.4.9 ??? TILER 模式
IPNC RDK支持TILER模式,用戶可以評估TILER模式功能以及DDR使用效率的相關改進。 Currently TILER mode is limited to Low Power configuration only.當前TILER模式僅限于低功率配置。 For selecting the TILERmode:選擇TILER模式:
1.OpenRules.makefile and make IPNC_TILER_ENABLE := YESRules.make中打開文件并進行IPNC_TILER_ENABLE:= YES
CAMERA_TILER_ENABLE := YESCAMERA_TILER_ENABLE:= YES
BTE_ENABLE := YESBTE_ENABLE:= YES
2.Run'make all'command to regenerate the binaries Note: 運行“make all”命令來重新生成二進制文件注意:
In this release TILER mode is enabled onlyfor low power mode.在此版本中,TILER模式僅在低功耗模式下使能。
?
IPNC LowPower Demo Tristream1080p60fps + D1@30fps +MJPEG@5fps
IPNC FullFeature Demo 1080p60fps + D1@30fps + MJPEG@5fps +ISS/DSSVNF + FD(face-detect) +VA
IPNC FullFeature Demo 1080p60fps+ D1@30fps + MJPEG@5fps +
MCTNF + FD(face-detect) +VA
?
IPNC CaptureDisplay Demo
5.5 ?智能/視頻分析
智能/視頻分析(VA)算法檢測和跟蹤視頻流中的對象。支持的基本VA算法是Trip Zone,攝像機篡改檢測和對象計數。VA算法在C647 DSP上運行。當VA事件發生時,事件是SWOS顯示的,并且還由Web GUI指示。
5.6 ?視頻幀緩沖接口
IPNC RDK還提供訪問視頻幀緩沖區的接口,可以是RAW或YUV幀。
McFWprovides the following APIs for interacting with video frame buffers McFW提供以下API用于與視頻幀緩沖區交互
Receivingframe buffers:接收幀緩沖區:
Vcam_getFullVideoFrames Vcam_getFullVideoFrames– API to get captured RAW/YUV frames from the front end (camera) - API來獲得拍攝的RAW / YUV從前端幀(相機)
Vcam_putEmptyVideoFrames Vcam_putEmptyVideoFrames– - - API to free RAW/YUV frame buffers consumed bythe application API來釋放應用程序所消耗的RAW / YUV幀緩沖區
Sendingframe buffers:發送幀緩沖區:
Vdis_putFullVideoFrames Vdis_putFullVideoFrames– API to send RAW/YUV frames to the back end -API發送RAW / YUV幀發送到后端
(display) (顯示)
Vdis_getEmptyVideoFrames Vdis_getEmptyVideoFrames– - - API to take back RAW/YUV frame buffersconsumed by McFW API以收回McFW使用的RAW / YUV幀緩沖區
The keydata structure having the frame buffer info is:具有幀緩沖區信息的關鍵數據結構是:
VIDEO_FRAMEBUF_LIST_S . VIDEO_FRAMEBUF_LIST_S。
Definedin ipnc_rdk/mcfw/interfaces/ti_media_common_def.h as typedef struct {在ipnc_rdk / mcfw / interfaces / ti_media_common_def.h中定義為typedef struct {
UInt32 numFrames; UInt32 numFrames;
VIDEO_FRAMEBUF_S frames[VIDEO_FRAMEBUF_MAX]; VIDEO_FRAMEBUF_S frames[VIDEO_FRAMEBUF_MAX];
} VIDEO_ FRAMEBUF_LIST_S; } VIDEO_ FRAMEBUF_LIST_S;
TheVIDEO_ FRAMEBUF_LIST_S structure has the following members: VIDEO_ FRAMEBUF_LIST_S結構具有以下成員:
numBufs :Indicates the number of valid entries in the frames array (details follow) numBufs:表示frames數組中的有效條目數(詳細信息如下)
Thisnumber should be <= VIDEO_FRAMEBUF_MAX此數字應為<=VIDEO_FRAMEBUF_MAX
frames:Array of VIDEO_FRAMEBUF_S structures frames:VIDEO_FRAMEBUF_S結構的數組
Eachelement in this array represents _one_ RAW/YUV frame from aparticular channel此數組中的每個元素都代表一個特定的頻道_one_ RAW / YUV框架
TheVIDEO_FRAMEBUF_S has the following members:VIDEO_FRAMEBUF_S具有以下成員:
addr:Buffer start address for each field/plan of the frame buffer. addr:幀緩沖區的每個字段/計劃的緩沖區起始地址。This is the user space virtual address.這是用戶空間虛擬地址。The application should use this address if it wants to access theframe buffer via CPU (eg: memcpy)如果應用程序想要通過CPU訪問幀緩沖區(例如:memcpy),則應使用此地址。
phyAddr:Physical address of start for each field/plan of the frame buffer. phyAddr:幀緩沖區的每個字段/計劃的開始的物理地址。Can be used for EDMA APIs可用于EDMA API
channelNum:Channel ID. channelNum:通道ID。Should be from 0 to VCAM_STRM_MAX-1應該從0到VCAM_STRM_MAX-1
timestamp:Timestamp associated with the frame. timestamp:與幀相關聯的時間戳。
fid:Indentifies whether this is a top field/bottom field/frame. fid:標識這是頂場還是底場/幀。
0: Evenfield or Frame based, 1: Odd Field – frameWidth: Width of the frame in pixels. 0:偶場或基于幀,1:奇數場- frameWidth:以像素為單位幀的寬度。
frameHeight:Height of the frame in lines. frameHeight:行的高度。
framePitch:Stride for each plan of the frame. framePitch:幀的每個計劃的步幅。
Frame Receive Operation幀接收操作
In orderto receive notifications about available RAW/YUV frames on the Linux side, theuser application needs to call the below function:為了在Linux端接收關于可用RAW / YUV幀的通知,用戶應用程序需要調用以下函數:
Int32 Vcam_ registerCallback(VCAM_CALLBACK_S * callback, Ptr arg) – Create time API toregister application callback. INT32 Vcam_ registerCallback(VCAM_CALLBACK_S *回調,PTR ARG) -創建時間API來注冊應用程序的回調。
The callback will be invoked each time whennew frame buffers are available.每當新的幀緩沖區可用時,將調用回調。
The application can use the callback tosynchronize invocation of the Vcam_getFullVideoFrames應用程序可以使用回調同步Vcam_getFullVideoFrames的調用API. API。
The usageof above functions is demonstrated in the capture display use case withFRAMES_TO_A8 option enabled.在啟用FRAMES_TO_A8選項的捕獲顯示用例中演示了上述函數的用法。 One taskis created and waits for the notification from VCAM of the available RAW/YUVframes, then it takes these buffers from VCAM and eventually send them to VDISfor consummation.創建一個任務,并等待來自VCAM的可用RAW / YUV幀的通知,然后從VCAM獲取這些緩沖區,并最終將它們發送到VDIS以完成。 At the same time it takes consumedframes from VDIS and releases them back to VCAM.同時,它從VDIS消耗幀并將其釋放回VCAM。
Pleaserefer to the source code in ti_mcfw_ipcframes.c for more implementationdetails.有關更多實現詳細信息,請參閱ti_mcfw_ipcframes.c中的源代碼。
?
?
?
總結
以上是生活随笔為你收集整理的IPNC_RDK_McFW_UserGuide的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: UG模具设计之后模滑块成型
- 下一篇: 从零开始上传开源项目到Maven中央仓库