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

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Hardware

develop board

debugger

TI 00IC-XDS100V3. See targetConfigs to modify it.

Software

Build Systems

Toolchains

Optional Dependencies

  • check: for unit test: meson test -Cbuild
  • direnv uses .envrc in order to:
    • add the path of toolchains to $PATH
    • export C6X_C_DIR to let compiler cl6x know where are header files and libraries.

Run direnv allow to activate it.

Build

meson setup build --cross-file=meson/ti-c6000.txt -Dbuildtype=release
meson compile -Cbuild

See meson configure build to know how to configure.

Burn and Run

# load /the/path/of/352x288.yuv to DDR2 and run:
#   build/x264.out --input=352x288.yuv --frames=10
scripts/burn.js /the/path/of/352x288.yuv -- build/x264.out --input=352x288.yuv --frames=10
ffplay build/out.264

Some test yuv files.

Usage

See --help:

meson setup build/host -Dbuildtype=release
meson compile -Cbuild/host
build/host/x264 --help

Here are some details:

--disable-ddr-input/--disable-ddr-output

There are two methods to pass input/output file to/from TI DSP:

  • CIO. for only debug, allow TI DSP read/write host machine filesystem, we can get frame number from file size
  • loadRaw()/saveRaw(). load/save a file from/to DDR2. We must tell frame number

By default, in TI DSP, it will enable DDR input/output. In PC, it always read/write from itself's filesystem.

$ scripts/burn.js -- build/x264.out --input=../../352x288.yuv --disable-ddr-input
# ...
../../352x288.yuv [info]: 352x288p 0:0 @ 25/1 fps (cfr)
x264 [info]: profile Constrained Baseline, level 1.3
x264 [info]: frame I:1     Avg QP:29.00  size:  5403
encoded 1 frames, 4.28 fps, 1080.60 kb/s
$ scripts/burn.js ../352x288.yuv -- build/x264.out --input=../../352x288.yuv --frames=1
# ...
../../352x288.yuv [info]: 352x288p 0:0 @ 25/1 fps (cfr)
x264 [info]: profile Constrained Baseline, level 1.3
x264 [info]: frame I:1     Avg QP:29.00  size:  5403
encoded 1 frames, 4.97 fps, 1080.60 kb/s

--input/--output

In PC, related path is based on $PWD. In TI DSP, related path is based on the directory of x264.out.

$ build/host/x264 --input=../352x288.yuv
../352x288.yuv [info]: 352x288p 0:0 @ 25/1 fps (cfr)
x264 [info]: profile Constrained Baseline, level 1.3
x264 [info]: frame I:1     Avg QP:29.00  size:  5403
encoded 1 frames, 227.69 fps, 1080.60 kb/s
# add an extra ../ because build/x264.out is in build/
$ scripts/burn.js -- build/x264.out --input=../../352x288.yuv --disable-ddr-input
# ...

If you use DDR input, it will ignore --input. however, x264 get width and height from --input's WxH. So the following commands are same:

scripts/burn.js ../352x288.yuv -- build/x264.out --input=../../352x288.yuv --frames=1
scripts/burn.js ../352x288.yuv -- build/x264.out --input=foo352x288bar.yuv --frames=1

scripts/burn.js ../352x288.yuv will loadRaw() ../352x288.yuv to DDR. If the power is on, the step only need to be done once:

scripts/burn.js ../352x288.yuv
scripts/burn.js -- build/x264.out --input=../../352x288.yuv --frames=1

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.7%
  • Meson 0.4%
  • jq 0.4%
  • Batchfile 0.3%
  • JavaScript 0.1%
  • Shell 0.1%