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.
For meson
:
For xmake
:
- ccstudio
- TI C6000 toolchain < 8.0.0: for TI DSP DM6467. Go to ccstudio's App center to install TI-CGT 7.4.24
For TI C6000 toolchain > 8.0.0, refer https://github.com/ustc-ivclab/x264.
- 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
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
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
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
- select project
arm
- press Alt + CR to open properties
- select
Manage the project's target-configuration automatically
- change
Connection
according to your debug probe
- double click
TMS320DM6467.ccxml
- press
Target Configuration
- select
~/workspace_v12/x264-dsp/assets/gel/davincihd_arm.gel
for ARM926, ARM968_0, ARM968_1 - select
~/workspace_v12/x264-dsp/assets/gel/davincihd_dsp.gel
for C64XP - press Ctrl + S to save
- power on DSP
- press F11 to debug
- press
OK
- press
OK
to closeLaunching Debug Session
- change project
x264-dsp
onProject Explorer
- press F11 to debug
- press F8 to run
Refer Code Composer Studio User’s Guide to debug.
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
- codec
- TI DSP
- TMS320C6000 Assembly Language Tools:
- TMS320C6000 Optimizing C/C++ Compile
- Code Composer Studio™ User's Guide