TI MM H.264 Encoder User Guide
Introduction

Supported Features

TI’s embedded processors such as J721E having Imagination Technologies VXE384MP2 (ENCODER) for accelerating multimedia encode. "TI MM H.264 Video Encoder" supports:

  • H.264 encoding up to 1080p (1920x1080) resolutions
  • NV12 (two plane) format, 8-bit content support
  • Frame level encoding
  • I-Frame only encoding
    • This is the default mode supported in the driver
  • I & P Frame encoding
    • In order to enable I & P Frame encoding, driver code needs to be modified to set the required configuration
    • See Reconfiguring Driver below on how to change the default driver configuration
  • Two channel encoding up to 1080p (1920x1080) resolutions at 30fps.
    • Up to 8 channels of 1080p encoding can be supported at lower framerates assuming that the DDR_MCU2_1_NON_CACHE region is sized to have 176MB. If a smaller non-cache region is allocated in the memory map, the max number of channels and/or resolution of encoder will be lower.
    • In general it takes around 25 MB per channel of 1080p encoding/decoding, and will generally scale to other resolutions according to the megapixel size.
    • The following table lists tested sizes of DDR_MCU2_1_NON_CACHE and the observed max channels of 1920x1080 encoder.
      Channels DDR_MCU2_1_NON_CACHE
      5 112MB
      6 144MB
      7 144MB
      8 176MB
    • Simultaneous usecases with decoder may exceed the memory allocation if the DDR_MCU2_1_NON_CACHE region is too small for the number of encoder + decoder channels.
      • Please see SDK Documentation on the SDK memory map for more information on how to increase the carveout.
      • Be sure to manually update "mcu2_1/r5_mpu.xs" to correctly use MPU.setRegionMeta for the entire size of the mcu2_0 + mcu2+1 carveouts according to the memory map.
      • ex. if you're increasing the carveout from mcu2_1 carveout from 112MB to 240MB (16 of each reserved for mcu2_0 carveout, so total is 128MB vs 256MB)
        non_cache_base_addr = 0xD8000000;
        /* make DDR_MCU2_0_NON_CACHE, DDR_MCU2_1_NON_CACHE as non-cache */
        /* Note: MUST be 32MB aligned
        */
        attrs.enable = true;
        attrs.bufferable = false;
        attrs.cacheable = false;
        attrs.shareable = true;
        attrs.noExecute = true;
        attrs.accPerm = 1; /* RW at PL1 */
        attrs.tex = 0;
        attrs.subregionDisableMask = 0;
        -MPU.setRegionMeta(index++, non_cache_base_addr + 0*32*MB, MPU.RegionSize_32M, attrs);
        -MPU.setRegionMeta(index++, non_cache_base_addr + 1*32*MB, MPU.RegionSize_32M, attrs);
        -MPU.setRegionMeta(index++, non_cache_base_addr + 2*32*MB, MPU.RegionSize_32M, attrs);
        -MPU.setRegionMeta(index++, non_cache_base_addr + 3*32*MB, MPU.RegionSize_32M, attrs);
        +MPU.setRegionMeta(index++, non_cache_base_addr + 0*64*MB, MPU.RegionSize_64M, attrs);
        +MPU.setRegionMeta(index++, non_cache_base_addr + 1*64*MB, MPU.RegionSize_64M, attrs);
        +MPU.setRegionMeta(index++, non_cache_base_addr + 2*64*MB, MPU.RegionSize_64M, attrs);
        +MPU.setRegionMeta(index++, non_cache_base_addr + 3*64*MB, MPU.RegionSize_64M, attrs);
      • Be sure to follow the directions on updating and rebuilding the dtb/dtbo files that the gen_linker_mem_map.py script provides.

Non-Supported Features

"TI MM H.264 Video Encoder" does not support:

  • B-Frame encoding
  • Non NV12 pixel formats
  • Error recovery for crashes due to non-standard settings
  • Greater than two channels encoding

Reconfiguring Driver

File to change: psdk_rtos_auto_j7_xx/video_codec/ti-img-encode-decode/timmlib/encoder/mm_enc_create.c

Function: vxe_enc_s_fmt

Directory Structure

The main modules in Video Codec are listed below

Video Codec Modules Description
concerto Makefile build infrastructure
docs User documentation.
examples Application/Demo and Additional utility functions.
examples/apps/bios_cfg Application bios configuration for TI-RTOS on R5F and A72.
examples/apps/common Application common source code for TI-RTOS on R5F, and A72.
examples/apps/decoder Application/Demo sample application for single and multichannel usecase.
examples/apps/mcu2_0 R5F configuration.
examples/apps/mpu1 A72 configuration.
examples/utils Additional utility functions used.
lib MM Driver fw library.
makerules Build utility.
out Build/Generated files and executables.
ti-img-encode-decode MM Encoder Driver source code and firmware binary.
tools Scripts used to load and run the executables on CCS.

Known Limitations

  • QCIF resolution encoding not working
  • Only two simultaneous channels are supported with the current memory carveout setup for Video Codecs