VirtualBox

source: vbox/trunk/src/libs/ffmpeg-20060710/doc/optimization.txt@ 6184

最後變更 在這個檔案從6184是 5776,由 vboxsync 提交於 17 年 前

ffmpeg: exported to OSE

檔案大小: 5.0 KB
 
1optimization Tips (for libavcodec):
2
3What to optimize:
4If you plan to do non-x86 architecture specific optimizations (SIMD normally),
5then take a look in the i386/ directory, as most important functions are
6already optimized for MMX.
7
8If you want to do x86 optimizations then you can either try to finetune the
9stuff in the i386 directory or find some other functions in the C source to
10optimize, but there aren't many left.
11
12Understanding these overoptimized functions:
13As many functions tend to be a bit difficult to understand because
14of optimizations, it can be hard to optimize them further, or write
15architecture-specific versions. It is recommened to look at older
16revisions of the interesting files (for a web frontend try ViewVC at
17http://svn.mplayerhq.hu/ffmpeg/trunk/).
18Alternatively, look into the other architecture-specific versions in
19the i386/, ppc/, alpha/ subdirectories. Even if you don't exactly
20comprehend the instructions, it could help understanding the functions
21and how they can be optimized.
22
23NOTE: If you still don't understand some function, ask at our mailing list!!!
24(http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel)
25
26
27
28WTF is that function good for ....:
29The primary purpose of that list is to avoid wasting time to optimize functions
30which are rarely used
31
32put(_no_rnd)_pixels{,_x2,_y2,_xy2}
33 Used in motion compensation (en/decoding).
34
35avg_pixels{,_x2,_y2,_xy2}
36 Used in motion compensation of B-frames.
37 These are less important than the put*pixels functions.
38
39avg_no_rnd_pixels*
40 unused
41
42pix_abs16x16{,_x2,_y2,_xy2}
43 Used in motion estimation (encoding) with SAD.
44
45pix_abs8x8{,_x2,_y2,_xy2}
46 Used in motion estimation (encoding) with SAD of MPEG-4 4MV only.
47 These are less important than the pix_abs16x16* functions.
48
49put_mspel8_mc* / wmv2_mspel8*
50 Used only in WMV2.
51 it is not recommended that you waste your time with these, as WMV2
52 is an ugly and relatively useless codec.
53
54mpeg4_qpel* / *qpel_mc*
55 Used in MPEG-4 qpel motion compensation (encoding & decoding).
56 The qpel8 functions are used only for 4mv,
57 the avg_* functions are used only for B-frames.
58 Optimizing them should have a significant impact on qpel
59 encoding & decoding.
60
61qpel{8,16}_mc??_old_c / *pixels{8,16}_l4
62 Just used to work around a bug in an old libavcodec encoder version.
63 Don't optimize them.
64
65tpel_mc_func {put,avg}_tpel_pixels_tab
66 Used only for SVQ3, so only optimize them if you need fast SVQ3 decoding.
67
68add_bytes/diff_bytes
69 For huffyuv only, optimize if you want a faster ffhuffyuv codec.
70
71get_pixels / diff_pixels
72 Used for encoding, easy.
73
74clear_blocks
75 easiest to optimize
76
77gmc
78 Used for MPEG-4 gmc.
79 Optimizing this should have a significant effect on the gmc decoding
80 speed but it's very likely impossible to write in SIMD.
81
82gmc1
83 Used for chroma blocks in MPEG-4 gmc with 1 warp point
84 (there are 4 luma & 2 chroma blocks per macroblock, so
85 only 1/3 of the gmc blocks use this, the other 2/3
86 use the normal put_pixel* code, but only if there is
87 just 1 warp point).
88 Note: DivX5 gmc always uses just 1 warp point.
89
90pix_sum
91 Used for encoding.
92
93hadamard8_diff / sse / sad == pix_norm1 / dct_sad / quant_psnr / rd / bit
94 Specific compare functions used in encoding, it depends upon the
95 command line switches which of these are used.
96 Don't waste your time with dct_sad & quant_psnr, they aren't
97 really useful.
98
99put_pixels_clamped / add_pixels_clamped
100 Used for en/decoding in the IDCT, easy.
101 Note, some optimized IDCTs have the add/put clamped code included and
102 then put_pixels_clamped / add_pixels_clamped will be unused.
103
104idct/fdct
105 idct (encoding & decoding)
106 fdct (encoding)
107 difficult to optimize
108
109dct_quantize_trellis
110 Used for encoding with trellis quantization.
111 difficult to optimize
112
113dct_quantize
114 Used for encoding.
115
116dct_unquantize_mpeg1
117 Used in MPEG-1 en/decoding.
118
119dct_unquantize_mpeg2
120 Used in MPEG-2 en/decoding.
121
122dct_unquantize_h263
123 Used in MPEG-4/H.263 en/decoding.
124
125FIXME remaining functions?
126BTW, most of these functions are in dsputil.c/.h, some are in mpegvideo.c/.h.
127
128
129
130Alignment:
131Some instructions on some architectures have strict alignment restrictions,
132for example most SSE/SSE2 instructions on x86.
133The minimum guaranteed alignment is written in the .h files, for example:
134 void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
135
136
137
138Links:
139http://www.aggregate.org/MAGIC/
140
141x86-specific:
142http://developer.intel.com/design/pentium4/manuals/248966.htm
143
144The IA-32 Intel Architecture Software Developer's Manual, Volume 2:
145Instruction Set Reference
146http://developer.intel.com/design/pentium4/manuals/245471.htm
147
148http://www.agner.org/assem/
149
150AMD Athlon Processor x86 Code Optimization Guide:
151http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/22007.pdf
152
153GCC asm links:
154official doc but quite ugly
155http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html
156
157a bit old (note "+" is valid for input-output, even though the next disagrees)
158http://www.cs.virginia.edu/~clc5q/gcc-inline-asm.pdf
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette