URL
https://opencores.org/ocsvn/oc-h264-encoder/oc-h264-encoder/trunk
Subversion Repositories oc-h264-encoder
[/] [oc-h264-encoder/] [trunk/] [doc/] [x264_profiling/] [README] - Rev 27
Compare with Previous | Blame | View Log
**************************************************************************************
Rev 1.0 Initial version to get familiar with the process(SECTION 1).
Rev 1.1 Added common procedures to do encoder profiling and uploading the results to the repository(SECTION 2)
*************************************************************************************
**************************************************************************************
SECTION 1
**************************************************************************************
This section (consisting of 5 steps)is targeted at newbies who are unfamiliar with what to do after obtaining the
X264 encoder source from videolan.org
Options may have to be changed as needed for a particular situation.
This is basically summarized from the threads in the topic
"VLC x264 GCC profiling" under [Home » All forums » OC H.264 project]
System used for section 1 : Atom N270 (1.6 GHz) with 1GB DDR2 (667 MHz) running Ubuntu Netbook Remix
-----------------------------------------------------------------------------------------------------------------------
STEP 1 of 5:
To get all the x264 files:
test $ git clone git://git.videolan.org/x264.git
**************************************************************************************
STEP 2 of 5: Setup for enabling profiling, debug
test $ ./configure --disable-avis-input --disable-mp4-output --disable-pthread --enable-debug --enable-gprof
Platform: X86
System: LINUX
asm: yes
avis input: no
mp4 output: no
pthread: no
debug: yes
gprof: yes
PIC: no
shared: no
visualize: no
You can run 'make' or 'make fprofiled' now.
**************************************************************************************
STEP 3 of 5: Run the make script to build
test $ make -f Makefile
rm -f .depend
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX common/mc.c -MT common/mc.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX common/predict.c -MT common/predict.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX common/pixel.c -MT common/pixel.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX common/macroblock.c -MT common/macroblock.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX common/frame.c -MT common/frame.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX common/dct.c -MT common/dct.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MA
LLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX common/cpu.c -MT common/cpu.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX common/cabac.c -MT common/cabac.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX common/common.c -MT common/common.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX common/mdate.c -MT common/mdate.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX common/set.c -MT common/set.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX common/quant.c -MT common/quant.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_
MMX -DARCH_X86 -DSYS_LINUX common/vlc.c -MT common/vlc.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX encoder/analyse.c -MT encoder/analyse.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX encoder/me.c -MT encoder/me.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX encoder/ratecontrol.c -MT encoder/ratecontrol.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX encoder/set.c -MT encoder/set.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX encoder/macroblock.c -MT encoder/macroblock.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -D
SYS_LINUX encoder/cabac.c -MT encoder/cabac.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX encoder/cavlc.c -MT encoder/cavlc.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX encoder/encoder.c -MT encoder/encoder.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX encoder/lookahead.c -MT encoder/lookahead.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX common/x86/mc-c.c -MT common/x86/mc-c.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX common/x86/predict-c.c -MT common/x86/predict-c.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86
-DSYS_LINUX x264.c -MT x264.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX matroska.c -MT matroska.o -MM -g0 1>> .depend; gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX muxers.c -MT muxers.o -MM -g0 1>> .depend;
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o x264.o x264.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o matroska.o matroska.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o muxers.o muxers.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o common/mc.o common/mc.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o common/predict.o common/predict.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o common/pixel.o common/pixel.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o common/macroblock.o common/macroblock.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o common/frame.o common/frame.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o common/dct.o common/dct.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o common/cpu.o common/cpu.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o common/cabac.o common/cabac.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o common/common.o common/common.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o common/mdate.o common/mdate.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o common/set.o common/set.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o common/quant.o common/quant.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o common/vlc.o common/vlc.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o encoder/analyse.o encoder/analyse.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o encoder/me.o encoder/me.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o encoder/ratecontrol.o encoder/ratecontrol.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o encoder/set.o encoder/set.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o encoder/macroblock.o encoder/macroblock.c
encoder/macroblock.c: In function ‘x264_macroblock_probe_skip’:
encoder/macroblock.c:852: warning: ‘mvp[1]’ may be used uninitialized in this function
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o encoder/cabac.o encoder/cabac.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o encoder/cavlc.o encoder/cavlc.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o encoder/encoder.o encoder/encoder.c
encoder/encoder.c: In function ‘x264_slice_write’:
encoder/encoder.c:1279: warning: ‘bs_bak.i_bits_encoded’ may be used uninitialized in this function
encoder/encoder.c:1279: warning: ‘bs_bak.i_left’ may be used uninitialized in this function
encoder/encoder.c:1279: warning: ‘bs_bak.cur_bits’ may be used uninitialized in this function
encoder/encoder.c:1279: warning: ‘bs_bak.p_end’ may be used uninitialized in this function
encoder/encoder.c:1279: warning: ‘bs_bak.p’ may be used uninitialized in this function
encoder/encoder.c:1279: warning: ‘bs_bak.p_start’ may be used uninitialized in this function
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o encoder/lookahead.o encoder/lookahead.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o common/x86/mc-c.o common/x86/mc-c.c
gcc -O1 -g -Wall -I. -pg -DHAVE_MALLOC_H -march=i686 -mfpmath=sse -msse -DHAVE_MMX -DARCH_X86 -DSYS_LINUX -c -o common/x86/predict-c.o common/x86/predict-c.c
yasm -O2 -f elf -Icommon/x86/ -o common/x86/cabac-a.o common/x86/cabac-a.asm
yasm -O2 -f elf -Icommon/x86/ -o common/x86/dct-a.o common/x86/dct-a.asm
yasm -O2 -f elf -Icommon/x86/ -o common/x86/deblock-a.o common/x86/deblock-a.asm
yasm -O2 -f elf -Icommon/x86/ -o common/x86/mc-a.o common/x86/mc-a.asm
yasm -O2 -f elf -Icommon/x86/ -o common/x86/mc-a2.o common/x86/mc-a2.asm
yasm -O2 -f elf -Icommon/x86/ -o common/x86/pixel-a.o common/x86/pixel-a.asm
yasm -O2 -f elf -Icommon/x86/ -o common/x86/predict-a.o common/x86/predict-a.asm
yasm -O2 -f elf -Icommon/x86/ -o common/x86/quant-a.o common/x86/quant-a.asm
yasm -O2 -f elf -Icommon/x86/ -o common/x86/sad-a.o common/x86/sad-a.asm
yasm -O2 -f elf -Icommon/x86/ -o common/x86/cpu-a.o common/x86/cpu-a.asm
yasm -O2 -f elf -Icommon/x86/ -o common/x86/dct-32.o common/x86/dct-32.asm
yasm -O2 -f elf -Icommon/x86/ -o common/x86/pixel-32.o common/x86/pixel-32.asm
ar rc libx264.a common/mc.o common/predict.o common/pixel.o common/macroblock.o common/frame.o common/dct.o common/cpu.o common/cabac.o common/common.o common/mdate.o common/set.o common/quant.o common/vlc.o encoder/analyse.o encoder/me.o encoder/ratecontrol.o encoder/set.o encoder/macroblock.o encoder/cabac.o encoder/cavlc.o encoder/encoder.o encoder/lookahead.o common/x86/mc-c.o common/x86/predict-c.o common/x86/cabac-a.o common/x86/dct-a.o common/x86/deblock-a.o common/x86/mc-a.o common/x86/mc-a2.o common/x86/pixel-a.o common/x86/predict-a.o common/x86/quant-a.o common/x86/sad-a.o common/x86/cpu-a.o common/x86/dct-32.o common/x86/pixel-32.o
ranlib libx264.a
gcc -o x264 x264.o matroska.o muxers.o libx264.a -pg -lm
**************************************************************************************
STEP 4 of 5: Setup the required profile to run, specify the input YUV file, output file and resolution
test $ ./x264 --profile=baseline -o test_BUS_352x288_30_orig_01.264 BUS_352x288_30_orig_01.yuv 352x288
x264 [info]: 352x288 @ 25.00 fps
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
x264 [info]: profile Baseline, level 1.3
x264 [info]: frame I:1 Avg QP:19.53 size: 34850
x264 [info]: frame P:149 Avg QP:27.87 size: 4395
x264 [info]: mb I I16..4: 7.3% 0.0% 92.7%
x264 [info]: mb P I16..4: 0.1% 0.0% 0.7% P16..4: 47.6% 29.5% 14.0% 0.0% 0.0% skip: 8.0%
x264 [info]: coded y,uvDC,uvAC intra:94.1% 82.2% 65.0% inter:44.0% 14.1% 2.1%
x264 [info]: ref P L0 76.0% 15.3% 8.7%
x264 [info]: kb/s:919.6
encoded 150 frames, 12.46 fps, 920.37 kb/s
**************************************************************************************
STEP 5 of 5: Run profiling and redirect the results to a text file
test $ gprof -b x264 gmon.out >profile_test.txt
**************************************************************************************
SECTION 2 (originally posted by Gil onthe H.264 forum)
**************************************************************************************
VLC x264 GCC profiling
I suggest the following procedure for profiling:
1. use the executable from the repository /oc-h264-encoder/trunk/doc/x264_profiling/bin/x264 for encoding the .yuv file, using the format:
./x264 --profile=baseline -o test.264 test.yuv widthxheight
2. Check that the output test.264 is correct. you can play it on vlc player and check that it looks like the original .yuv file.
3. upload the gmon.out file made by the execution of x264 to the repository:
/oc-h264-encoder/trunk/doc/x264_profiling/gmon_files/
name it as follows:
file_name_widthxheight_gmon.out
for example: akiyo_qcif_176x144_gmon.out
4. when commiting, let the comment include the following info:
added profiling output for file: filename.yuv from: url with size: widthxheight
for example: added profiling output for file: akiyo_qcif.yuv from: http://trace.eas.asu.edu/yuv/akiyo/akiyo_qcif.7z with size: 176x144.
I think it would be good to start with the files from:http://trace.eas.asu.edu/yuv/
After we get enough gmon.out files, we can check their relative computation intensive functions and start debating which parts to implement in HW.