Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page provides detailed information related to Design Module 5 - VCU TRD PCIe design.

Table of Contents

Table of Contents
excludeTable of Contents

1 Overview

The primary goal of this Design is to demonstrate the file-based VCU transcode, encode and decode capabilities over PCIe present in Zynq UltraScale+ EV devices.

...

The below figure shows the PCIe software block diagram

...

1.1 Board Setup

Refer below link for Board Setup

1.2 Run Flow

The TRD package is released with the source code, Vivado project, Petalinux BSP, host software required for PCIe and SD card image that enables the user to run the demonstration. It also includes the binaries necessary to configure and boot the ZCU106 board. Prior to running the steps mentioned in this wiki page, download the TRD package and extract its contents to a directory referred to as ‘TRD_HOME' which is the home directory.

...

Code Block
rdf0428-zcu106-vcu-trd-2020.-1
├── apu
│   └── vcu_petalinux_bsp
├── images
│   ├── vcu_10g
│   ├── vcu_audio
│   ├── vcu_hdmi_multistream_xv20
│   ├── vcu_hdmi_rx
│   ├── vcu_hdmi_tx
│   ├── vcu_llp2_hdmi_nv12
│   ├── vcu_llp2_hdmi_nv16
│   ├── vcu_llp2_hdmi_xv20
│   ├── vcu_llp2_sdi_xv20
│   ├── vcu_multistream_nv12
│   ├── vcu_pcie
│   ├── vcu_sdirx
│   ├── vcu_sditx
│   └── vcu_sdi_xv20
├── pcie_host_package
│   ├── COPYING
│   ├── include
│   ├── libxdma
│   ├── LICENSE
│   ├── readme.txt
│   ├── RELEASE
│   ├── tools
│   ├── test
│   └── xdma
├── pl
│   ├── constrs
│   ├── designs
│   ├── prebuild
│   ├── README.md
│   └── srcs
└── README.txt

...

Code Block
rdf0428-zcu106-vcu-trd-2020.-1
├── apu
│   └── vcu_petalinux_bsp
│       └── xilinx-vcu-zcu106-v2020.1-final.bsp
├── images
│   ├── vcu_pcie
│   │   ├── autostart.sh
│   │   ├── BOOT.BIN
│   │   ├── boot.scr
│   │   ├── image.ub
│   │   ├── system.dtb
│   │   └── vcu
├── pcie_host_package
├── pl
│   ├── constrs
│   ├── designs
│   │   ├── zcu106_pcie
│   ├── prebuild
│   │   ├── zcu106_pcie
│   ├── README.md
│   └── srcs
│       ├── hdl
│       └── ip
└── README.txt

HOST PACKAGE

The PCIe HOST application(pcie_host_app) supports Transcode, Decode and Encode use cases.

Transcode

The host application will read an input(.mp4 or .ts) file from the HOST machine and sends it to the zcu106 board; which is connected as an endpoint device to the PCIe slot of HOST machine. The data received from the HOST will be decoded, then again encoded with provided encoder type and mpegtsmux using VCU hardware. Transcoded data are written back to the HOST machine in .ts file format.

...

We support NV12, NV16, XV15 and XV20 formats. Need to mention format as per your choice. For NV12 format and encoder type AVC we support 3 profiles Baseline, High and Main. For NV12 format and  encoder type HEVC default profile selected from the application. For NV16, XV15 and XV20 no need to provide profile as an argument, profile selected form the application.

Decode

The host application will read an input(.mp4 or .ts) file from the HOST machine and sends it to the zcu106 board which is connected as an endpoint device to the PCIe slot of HOST machine. The data received from the HOST will be decoded using VCU hardware; then writes the decoded data back to the HOST machine in .yuv file format.

...

We support NV12, NV16, XV15 and XV20 formats. No Need to mention format, decoder will take care  for given input file.

Encode

The host application will read an input(.yuv) file from the HOST machine and sends it to the zcu106 board which is connected as an endpoint device to the PCIe slot of HOST machine. The data received from the HOST will be encoded with provided encoder type; then mpegtsmux using VCU hardware and writes the encoded data back to the HOST machine in .ts file format.

...

Directory

File description

xdma/

Contains the Xilinx PCIe DMA kernel module driver files

libxdma/

Contains support files for the kernel driver module, which interfaces directly with the XDMA IP

include/

Contains all include files required for compiling drivers

etc/

Contains rules for the Xilinx PCIe DMA kernel module and software. The files in this directory should be copied to the /etc/ directory on your Linux system.

tools/

Contains example application software and PCIe host application to exercise the provided kernel module driver and Xilinx PCIe DMA IP

test/

Contains example application software to exercise the provided kernel module driver and Xilinx PCIe DMA IP

Steps to run use cases

  • The user needs to copy all the files from the $TRD_HOME/images/vcu_pcie/ to FAT32 formatted SD card directory

  • Insert the ZCU106 board into the PCIe slot of the HOST machine and power on the board; then power on the HOST machine

...

 Finally, run the pcie_host_app on HOST machine then run pcie_transcode device application on ZCU106 board target to initiate the transfer.

HOST APPLICATION

Run the below command to initiate a file transfer from the HOST machine and transcode, encode or decode it from the ZCU106 device. After running the application on HOST user need to start device application(pcie_transcode) on the zcu106 target to initiate the transfer.

...

Code Block
usage: ./pcie_host_app [OPTIONS]

-i represents input file name.
-o represents output file name.
        Default: out.ts.
-c represents encoder's l2 cache. It's a boolean parameter. Range of this value is [0-1].
       Default:1 [Enable].
-w represents encoder's low bandwidth. It's a boolean parameter. Range of this value is [0-1].
      Default:0 [Disable].
-f represents encoder's filler data. It's a boolean parameter. Range of this value is [0-1].
      Default:0 [Disable].
-r represents encoder's bitrate. Range of this value is [1-60000]. Unit is in Kbps.
      Default:60000.
-g represents encoder's GOP length. Range of this value is [1-1000].
      Default:60.
-b represents encoder's b-frames. Range of this value is [0-4].
      Default:0.
-s represents encoder's slice value. Range of this value is [4-22].
      Default:8.
-q represents encoder's QP mode. Range of this value is [0 or 2]. O stands for uniform and 2 stands for auto.
     Default:2 [auto].
-m represents encoder's rate control mode. Range of this value is [1-2]. 1 stands for VBR and 2 stands for CBR.
      Default:2 [CBR].
-e represents encoder's encoder type. Range of this value is [0-1]. O stands for AVC and 1 stands for HEVC.
      Default:0 [AVC].
-p represents encoder's GOP mode. Range if this value is [0, 3 or 4]: O stands for basic, 3 stands for low-delay-p and 4 stands for low-delay-b.
       Default:0 [BASIC].
-u represents use case type. Range of this value is [0, 1 or 2]: O stands for encode, 1 stands for decode and 2 stands for transcode.
-d represents input resolution. Range of this value is [1920x1080 or 3840x2160]: 1920x1080 represents width x height of input video frame.
-F represents input FPS. Range of this value is [30 or 60]: this parameter is used for encode use case.
-n input profile Range of this value is [0(NV12), 1(NV16), 2(XV15), 3(XV20)]: this parameters used for encode/transcode use case.
-t input profile. Range of this value is [0, 1, or 2]: O is for Base line, 1 is for high and 2 is for main profile.
		Default:1 for AVC and 2 for HEVC.
-h represents help.
-v (verbose) print usage help and exit

DEVICE APPLICATION

After booting the ZCU106 board with the SD images, to run the transcode, encode or decode the use case first run the host side application mentioned above and run the device application on the zcu106 device with the mentioned commands below. The host application will send file data to the device for transcoding , encoding or decoding it on the ZCU106 device and receives the transcoded, encoded or decoded data and saves it on to the host machine.

Code Block
pcie_transcode

1.3 Build Flow

Refer below link for Build Flow

Zynq UltraScale+ MPSoC VCU TRD 2020.1 - Build Flow

...

2 Other Information

2.1 Known Issues

2.2 Limitations

2.3 Optimum VCU Encoder parameters for use-cases:

Quality: Low bitrate AVC encoding:

...