OpenCores
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] - Blame information for rev 33

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 17 gshankara
**************************************************************************************
2 27 gshankara
Rev 1.0  Initial version to get familiar with the process(SECTION 1).
3
 
4
Rev 1.1  Added common procedures to do encoder profiling and uploading the results to the repository(SECTION 2)
5
*************************************************************************************
6
 
7
 
8
 
9 17 gshankara
**************************************************************************************
10 27 gshankara
                                     SECTION 1
11
**************************************************************************************
12
This section (consisting of 5 steps)is targeted at newbies who are unfamiliar with what to do after obtaining the
13 17 gshankara
X264 encoder source from videolan.org
14
 
15
Options may have to be changed as needed for a particular situation.
16
 
17
This is basically summarized from the threads in the topic
18
"VLC x264 GCC profiling" under [Home » All forums » OC H.264 project]
19
 
20 27 gshankara
System used for section 1  : Atom N270 (1.6 GHz) with 1GB DDR2 (667 MHz) running Ubuntu Netbook Remix
21
-----------------------------------------------------------------------------------------------------------------------
22 17 gshankara
 
23
STEP 1 of 5:
24
 
25
To get all the x264 files:
26
test $ git clone git://git.videolan.org/x264.git
27
 
28
**************************************************************************************
29
 
30
STEP 2 of 5: Setup for enabling profiling, debug
31
 
32
test $ ./configure --disable-avis-input --disable-mp4-output --disable-pthread --enable-debug --enable-gprof
33
 
34
Platform:   X86
35
System:     LINUX
36
asm:        yes
37
avis input: no
38
mp4 output: no
39
pthread:    no
40
debug:      yes
41
gprof:      yes
42
PIC:        no
43
shared:     no
44
visualize:  no
45
 
46
You can run 'make' or 'make fprofiled' now.
47
 
48
**************************************************************************************
49
STEP 3 of 5: Run the make script to build
50
 
51
test $ make -f Makefile
52
 
53
rm -f .depend
54
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_MALLOC_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 -DSYS_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;
55
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
56
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
57
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
58
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
59
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
60
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
61
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
62
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
63
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
64
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
65
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
66
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
67
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
68
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
69
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
70
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
71
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
72
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
73
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
74
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
75
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
76
encoder/macroblock.c: In function ‘x264_macroblock_probe_skip’:
77
encoder/macroblock.c:852: warning: ‘mvp[1]’ may be used uninitialized in this function
78
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
79
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
80
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
81
encoder/encoder.c: In function ‘x264_slice_write’:
82
encoder/encoder.c:1279: warning: ‘bs_bak.i_bits_encoded’ may be used uninitialized in this function
83
encoder/encoder.c:1279: warning: ‘bs_bak.i_left’ may be used uninitialized in this function
84
encoder/encoder.c:1279: warning: ‘bs_bak.cur_bits’ may be used uninitialized in this function
85
encoder/encoder.c:1279: warning: ‘bs_bak.p_end’ may be used uninitialized in this function
86
encoder/encoder.c:1279: warning: ‘bs_bak.p’ may be used uninitialized in this function
87
encoder/encoder.c:1279: warning: ‘bs_bak.p_start’ may be used uninitialized in this function
88
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
89
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
90
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
91
yasm -O2 -f elf -Icommon/x86/ -o common/x86/cabac-a.o common/x86/cabac-a.asm
92
yasm -O2 -f elf -Icommon/x86/ -o common/x86/dct-a.o common/x86/dct-a.asm
93
yasm -O2 -f elf -Icommon/x86/ -o common/x86/deblock-a.o common/x86/deblock-a.asm
94
yasm -O2 -f elf -Icommon/x86/ -o common/x86/mc-a.o common/x86/mc-a.asm
95
yasm -O2 -f elf -Icommon/x86/ -o common/x86/mc-a2.o common/x86/mc-a2.asm
96
yasm -O2 -f elf -Icommon/x86/ -o common/x86/pixel-a.o common/x86/pixel-a.asm
97
yasm -O2 -f elf -Icommon/x86/ -o common/x86/predict-a.o common/x86/predict-a.asm
98
yasm -O2 -f elf -Icommon/x86/ -o common/x86/quant-a.o common/x86/quant-a.asm
99
yasm -O2 -f elf -Icommon/x86/ -o common/x86/sad-a.o common/x86/sad-a.asm
100
yasm -O2 -f elf -Icommon/x86/ -o common/x86/cpu-a.o common/x86/cpu-a.asm
101
yasm -O2 -f elf -Icommon/x86/ -o common/x86/dct-32.o common/x86/dct-32.asm
102
yasm -O2 -f elf -Icommon/x86/ -o common/x86/pixel-32.o common/x86/pixel-32.asm
103
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
104
ranlib libx264.a
105
gcc -o x264 x264.o matroska.o muxers.o libx264.a -pg -lm
106
 
107
**************************************************************************************
108
STEP 4 of 5: Setup the required profile to run, specify the input YUV file, output file and resolution
109
 
110
test $ ./x264 --profile=baseline -o test_BUS_352x288_30_orig_01.264 BUS_352x288_30_orig_01.yuv 352x288
111
 
112
x264 [info]: 352x288 @ 25.00 fps
113
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
114
x264 [info]: profile Baseline, level 1.3
115
x264 [info]: frame I:1     Avg QP:19.53  size: 34850
116
x264 [info]: frame P:149   Avg QP:27.87  size:  4395
117
x264 [info]: mb I  I16..4:  7.3%  0.0% 92.7%
118
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%
119
x264 [info]: coded y,uvDC,uvAC intra:94.1% 82.2% 65.0% inter:44.0% 14.1% 2.1%
120
x264 [info]: ref P L0  76.0% 15.3%  8.7%
121
x264 [info]: kb/s:919.6
122
 
123
encoded 150 frames, 12.46 fps, 920.37 kb/s
124
 
125
**************************************************************************************
126
STEP 5 of 5: Run profiling and redirect the results to a text file
127
 
128
test $ gprof -b x264 gmon.out >profile_test.txt
129
 
130
 
131 27 gshankara
**************************************************************************************
132
                               SECTION 2 (originally posted by Gil onthe H.264 forum)
133
**************************************************************************************
134
 
135
VLC x264 GCC profiling
136
 
137
I suggest the following procedure for profiling:
138
 
139
1. use the executable from the repository /oc-h264-encoder/trunk/doc/x264_profiling/bin/x264 for encoding the .yuv file, using the format:
140
 
141
./x264 --profile=baseline -o test.264 test.yuv widthxheight
142
 
143
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.
144
 
145
3. upload the gmon.out file made by the execution of x264 to the repository:
146
 
147
/oc-h264-encoder/trunk/doc/x264_profiling/gmon_files/
148
 
149
 name it as follows:
150
 
151
 file_name_widthxheight_gmon.out
152
 
153
 for example: akiyo_qcif_176x144_gmon.out
154
 
155
4. when commiting, let the comment include the following info:
156
added profiling output for file: filename.yuv from: url with size: widthxheight
157
 
158
for example: added profiling output for file: akiyo_qcif.yuv from: http://trace.eas.asu.edu/yuv/akiyo/akiyo_qcif.7z with size: 176x144.
159
 
160
I think it would be good to start with the files from:http://trace.eas.asu.edu/yuv/
161
 
162
After we get enough gmon.out files, we can check their relative computation intensive functions and start debating which parts to implement in HW.
163
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.