mpp

了解hi3536 mpp


更新記錄

item note
20161004 第一版

目錄


vdec (video decoder)

hi3536 HiMPP 3.0

chip Decoding Module Max.VDEC CH Protocol Max. Max. Pixel per Second
hi3536 VDH 128 VDH: H.264/H.265 H.264: 8192x 8192 3M x 30FPS x 16 = 1440M
H.265: 4096x 4096
hi3521 VEDU 64 VEDU: H.264 H.264: 4096 x 4096 3M x 30FPS x 4 = 360 M

VEDU

  • Sending streams by stream
    接收任意長度碼流,因此由VDEC內部識別I/P/B
    不會馬上解碼,需等到下一個frame(即目前為完整frame)

  • Sending streams by frame
    接收1個完整Frame,因此馬上解碼
    若非完整Frame產會產生錯誤

hi3535 HiMPP 2.0

chip Decoding Module Max.VDEC CH Protocol Max. Max. Pixel per Second
hi3535 VDH , VEDUT 80 (VHD:64,VEDU:16) VDH: H.264 H.264 : 4096 x 54096 3M x 60FPS x 3 = 540M
VEDU: H.264 (不支援B Frame) H.264 : 1920 x 2048

video output unit (VOU)

Support display device, graphics layers, and cursor layer

chip HD Device SD Device Graphics Layer Hardware Cursor Layer
Hi3536 DHD0, DHD1 (support PIP) DSD0 G0-G2 HC0 , HC1
Hi3521A DHD0 (support PIP) DSD0 G0,G1 HC0
Hi3535 DHD0,DHD1 (support PIP) DSD0 G0-G3 HC0
  • Video Layer

    • The video layer that is always bound to an HD device is called VHDx
    • The video layer that is always bound to an SD device is called VSDx.
    • The video layer that can be dynamically bound is called PIP.
  • Hi3536

    • G0-G2 are alway bound to DHD0,DHD1,DSD0
    • HC0 is bound to DHD0 , HC1 is bound to DHD1 by default.

HD device and SD device

chip max Output Interface
Hi3536 HD0 3840 X 2160 @60 BT.1120, HDMI, VGA
HD1 1920 x 1080 @60 BT.1120, HDMI, VGA
SD0 960H (960x 480) CVBS
Hi3521A HD0 1920 x 1080 @60 or 1600 x 1200@60 HDMI/VGA
SD0 720X 576 @50 CVBS
Hi3535 HD 1920X 1200 @ 60 BT.1120 ,HDMI, VGA
SD0 720X 576 @50 CVBS

Output timing

chip Max
Hi3536 HDMI 3840x2160@60
VGA 2560x 1600@60
BT120 1920x1080@60
CVBS 960H
Hi3521A HDMI 1920x1080@60 ror 1600x1200@60
VGA 1920x1080@60 ror 1600x1200@60
CVBS 750x576@50

顯示模式

  • VIDEO_DISPLAY_MODE_PREVIEW
    以非阻塞式接收解碼圖像
    即當VO或VPSS的圖像Buffer滿時
    丟棄VDEC送過來的圖像,以達到不反壓VDEC解碼的目的

  • VIDEO_DISPLAY_MODE_PLAYBACK
    以阻塞式接收解碼圖像
    即當VO或VPSS的圖像Buffer滿時
    拒絕接收VDEC送過來的圖像,
    VDEC發現當前圖像發送失敗,將會重新發送
    此模式下,將會反壓VDEC解碼,以達到不丟棄任何一幀


程式流程

SAMPLE_VO_Preview_HDMI 流程

1.先建立SYS及VB
2.開啟VO (VoDev、VoLayer及VoChn)
3.建立VPSS (VpssGrp/Chn/GrpStart)
4.建立VDEC (Chn/Chn Enable)
5.最後才是bind
[SAMPLE_VO_Preview_HDMI]

SAMPLE_COMM_VDEC_SendStream 流程

SAMPLE_COMM_VDEC_SendStream
[SendStream]

改變輸出: 由4K變成1080P

change timing 流程
1.stop HDMI
2.關閉VO (disable VoChn, VoLayer)
3.unbind
4.改變vo 參數
5.開啟VO (enable Vo,VoLayer,VoChn)
6.bind
7.start HDMI
[change-timing]

exit process

1.先Unbind
2.之後再來處理VDEC,VPSS及VO
3.最後才是關閉System及VB
[exit process]

SAMPLE_VO_Preview_NonHomologous

SAMPLE_VO_DEV_DHD0:
將HDMI設定由VO_OUTPUT_3840x2160_30改為VO_OUTPUT_1080P60

SAMPLE_VO_DEV_DHD1:
將VGA設定由VO_OUTPUT_1080P30改為VO_OUTPUT_720P50

HDMI輸出4個分割 (vdec0-3)
VGA輸出1個分割 (vdec4)

1
2
3
4
5
6
7
8
9
10
11
FirMod  FirDev  FirChn  SecMod  SecDev  SecChn  TirMod  TirDev  TirChn SendCnt  rstCnt
vdec 0 0 vpss 0 0 vo 0 0 10615 0
vdec 0 1 vpss 1 0 vo 0 1 10621 0
vdec 0 2 vpss 2 0 vo 0 2 10620 0
vdec 0 3 vpss 3 0 vo 0 3 10620 0
vdec 0 4 vpss 4 0 vo 1 0 10620 0
vpss 0 0 vo 0 0 null 0 0 0 0
vpss 1 0 vo 0 1 null 0 0 0 0
vpss 2 0 vo 0 2 null 0 0 0 0
vpss 3 0 vo 0 3 null 0 0 0 0
vpss 4 0 vo 1 0 null 0 0 0 0

SAMPLE_VO_Playback_Homologous

  • 設定同時時出到VGA/HDMI/BT1120
    stVoPubAttr.enIntfType = VO_INTF_VGA|VO_INTF_HDMI|VO_INTF_BT1120;

  • 測試下例功能
    HI_MPI_VO_ResumeChn
    HI_MPI_VO_HideChn
    HI_MPI_VO_ShowChn
    HI_MPI_VO_SetChnFrameRate

    1
    2
    3
    4
    5
    6
    7
    8
    ================picture is  Pausing now!!===================
    ================picture go to Step!!===================
    ================picture go to Resume!!===================
    ================picture go to Hide!!===================
    ================picture go to Show!!===================
    ================picture go to 1/2X speed play!!===================
    ================picture go to 1/4X speed play!!===================
    ================picture go to normal!!===================

SAMPLE_VO_ZoomIn_HD0

  • 2個VpssGrpCnt Chn
    vpps[0]:clip
    vpss[1]:full

  • 開啟PIP Layer
    VoLayer = SAMPLE_VO_LAYER_VPIP;


HIMPP

himpp kernel module

  • himpp 提供相關的ko如下
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    # lsmod
    Module Size Used by Tainted: P
    tlv_320aic31 7893 0
    hi3536_adec 7562 0
    hi3536_aenc 49912 0
    hi3536_ao 223286 0
    hi3536_ai 119391 1 hi3536_aenc
    hi3536_aio 28641 0
    acodec 11614 0
    sil9024 19529 0
    hi3536_ive 77938 0
    hi3536_vda 576713 0
    hi3536_jpege 55206 0
    hi3536_h264e 178145 0
    hi3536_chnl 37110 0
    hi3536_venc 589886 2 hi3536_jpege,hi3536_h264e
    hi3536_rc 78685 0
    hi3536_hdmi 205751 0
    hifb 82502 0
    hi3536_vou 469883 5 hifb
    hi3536_vpss 333104 10
    hi3536_viu 154239 0
    hi3536_vgs 205026 0
    hi3536_region 76357 0
    hi3536_tde 111345 2 hifb,hi3536_region
    hi3536_jpegd 4861 0
    hi3536_vfmw 2491749 0
    hi3536_vdec 382545 5
    hi3536_sys 64605 3 hi3536_venc,hi3536_vdec
    hi3536_base 63512 25 hi3536_adec,hi3536_aenc,hi3536_ao,hi3536_ai,hi3536_aio,acodec,hi3536_ive,hi3536_vda,hi3536_jpege,hi3536_h264e,hi3536_chnl,hi3536_venc,hi3536_rc,hi3536_hdmi,hifb,hi3536_vou,hi3536_vpss,hi3536_viu,hi3536_vgs,hi3536_region,hi3536_tde,hi3536_vfmw,hi3536_vdec,hi3536_sys
    hiuser 1551 3 hi3536_vou,hi3536_vfmw,hi3536_vdec
    hi_media 7702 22 hi3536_base
    mmz 22795 7 hi3536_ao,hi3536_jpege,hi3536_h264e,hi3536_tde,hi3536_vdec,hi3536_sys,hi3536_base
[system]

HiMPP workflow

Video Input Unit (VIU)
Video processing subsystem (VPSS)
Video encoding(VENC) module
Video dencoding(VDEC) module
Video outpu unit (VOU)

[HiMPP]

VB Pool

  1. VB Pool需預先設定好空間
  2. VI由VB取得一塊記憶体空間(Bm),將VI資料填入此Bm
  3. Bm經由VPSS處理,,若後面無人使用(即VO/VENC等),此Bm將會在還給VB Pool
[VB Pool]

其它名詞定義

  • WBC
    WbcId: Write back (WBC) channel ID

未了解

  • SAMPLE_COMM_SYS_CalcPicVbBlkSize
if (PIXEL_FORMAT_YUV_SEMIPLANAR_422 == enPixFmt)
{
    u32BlkSize = u32Width * u32Height * 2;
}
else
{
    u32BlkSize = u32Width * u32Height * 3 / 2;
}

參考來源

  • HiMPP V3.0 Media Processing Software Development Reference.pdf