Skip to content

This is a complete implementation of H.264 codec ported for TI C6000 DSP. By using linear assembly language, we can take full advantage of DSP architecture. We tried to optimize several core routines, including DCT, Intra-Predict, Inter-Predict, CABAC, etc. maintainers: @ustc-ivclab/x264-transplant

Notifications You must be signed in to change notification settings

ustc-ivclab/x264-dsp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

x264-dsp

This is a complete implementation of H.264 codec ported for TI C6000 DSP. By using linear assembly language, we can take full advantage of DSP architecture. We tried to optimize several core routines, including DCT, Intra-Predict, Inter-Predict, CABAC, etc.

Add an optional downsample module.

Dependencies

Build Systems

For meson:

For xmake:

Toolchains

For TI C6000 toolchain > 8.0.0, refer https://github.com/ustc-ivclab/x264.

Optional Dependencies

  • check: for unit test
    • meson test -Cbuild
  • bin2c: use bin2c to convert a yuv to a c array. Or use xmake's builtin bin2c.
    • meson setup build -Dbin2c=true -Dinput_filename=/the/path/of/WxH.yuv
    • xmake f --bin2c=y

Build

meson

meson setup build
# or cross compiling for TI DSP. make sure *.cmd in project root
meson setup --cross-file meson/ti-c6000.txt build
meson compile -Cbuild

See meson configure build to know how to configure.

xmake

xmake

See xmake f --menu to know how to configure.

For input file,

xmake f --bin2c=yes --input\ filename=/the/path/of/1280x720.yuv

Note: TI-CGT cannot support too large /the/path/of/WxH.yuv! Otherwise, you will met the following error when ccs.projectBuild.

terminate called after throwing an instance of 'std::bad_alloc'
  what():  St9bad_alloc

INTERNAL ERROR: /opt/ccstudio/ccs/tools/compiler/c6000_7.4.24/bin/ilk6x aborted while
                processing file /tmp/TIXXXXXXXXX

This is a serious problem.  Please contact Customer
Support with this message and a copy of the input file
and help us to continue to make the tools more robust.

Try to reduce the size of YUV file:

head -c13824000 /720p/the/path/of/WxH.yuv > /the/path/of/WxH.yuv

Burn

You must create an arm project to activate DSP core by gel files.

ccstudio -noSplash -data ~/workspace_v12 -application com.ti.ccstudio.apps.projectCreate -ccs.device ARM9.TMS320DM6467 -ccs.name arm -ccs.template com.ti.common.project.core.emptyProjectWithMainTemplate
  1. select project arm
  2. press Alt + CR to open properties

project explorer

  1. select Manage the project's target-configuration automatically
  2. change Connection according to your debug probe

Connection

ccxml

  1. double click TMS320DM6467.ccxml
  2. press Target Configuration

Target Configuration

  1. select ~/workspace_v12/x264-dsp/assets/gel/davincihd_arm.gel for ARM926, ARM968_0, ARM968_1
  2. select ~/workspace_v12/x264-dsp/assets/gel/davincihd_dsp.gel for C64XP
  3. press Ctrl + S to save

arm

dsp

  1. power on DSP
  2. press F11 to debug
  3. press OK
  1. press OK to close Launching Debug Session

Launching Debug Session

  1. change project x264-dsp on Project Explorer
  2. press F11 to debug
  3. press F8 to run

Refer Code Composer Studio User’s Guide to debug.

Usage

Download a test YUV from release. Note the file name must respect YUView filename rules to contain resolution.

If you don't use bin2c, you must move YUV file to the path which x264 can find.

# For DSP
mv /the/path/yuv/1280x720.yuv ~/workspace_v12/x264-dsp/Release
# For PC
mv /the/path/yuv/1280x720.yuv .

Or tell the precious path:

the/path/of/x264 /the/path/yuv/1280x720.yuv

After running, out.264 will occur in ~/workspace_v12/x264-dsp/Release for DSP and current directory for PC.

You can use ffplay to check the correctness of 264 format.

ffplay /the/path/of/out.264

Documents

About

This is a complete implementation of H.264 codec ported for TI C6000 DSP. By using linear assembly language, we can take full advantage of DSP architecture. We tried to optimize several core routines, including DCT, Intra-Predict, Inter-Predict, CABAC, etc. maintainers: @ustc-ivclab/x264-transplant

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 98.5%
  • Shell 0.5%
  • Meson 0.4%
  • Lua 0.4%
  • Python 0.2%
  • MATLAB 0.0%