[FFmpeg-devel] [PATCH] Move H.264 DSP functions from dsputil.c to h264dsp.c

Panagiotis Issaris takis.issaris
Thu Jul 26 18:43:08 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

The attached patch moves the H.264 DSP functions from dsputil.c to
h264dsp.c. Regression tests succeed with this patch applied.

 Makefile  |    2
 dsputil.c |  320 ---------------------------------------------
 h264dsp.c |  321 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 325 insertions(+), 318 deletions(-)


I've tested the impact on the current SVN revision (9802) using various
scenarios.

First I checked how the patch altered a minimally configured ffmpeg's
codesize:

./configure --disable-decoders --disable-demuxers --disable-parsers
- --disable-protocols --disable-muxers --disable-encoders --disable-vhook
- --disable-network --disable-zlib --disable-mmx

Without this patch:
 323522       0    4484  328006   50146 libavcodec/dsputil.o
 592586     904    8920  602410   9312a ffmpeg
- -rw-r--r-- 1 takis takis 888916 2007-07-26 17:37 libavcodec/dsputil.o
- -rwxr-xr-x 1 takis takis 598076 2007-07-26 17:37 ffmpeg
 4191 libavcodec/dsputil.c
   81 libavcodec/h264dsp.c


With this patch:
   text    data     bss     dec     hex filename
 297858       0    4484  302342   49d06 libavcodec/dsputil.o
 566922     904    8920  576746   8ccea ffmpeg
- -rwxr-xr-x 1 takis takis 571388 2007-07-26 17:34 ffmpeg
- -rw-r--r-- 1 takis takis 807848 2007-07-26 17:34 libavcodec/dsputil.o
 3877 libavcodec/dsputil.c
  402 libavcodec/h264dsp.c

Save 25664 bytes for ffmpeg in text segment,
26688 bytes in ffmpeg executable size.
dsputil.o shrinks 25664 bytes.



Then I checked the impact on an ffmpeg which uses the default config,
just the h264 decoder disabled:

./configure --enable-gpl --disable-decoder=h264

Without this patch:
   text    data     bss     dec     hex filename
 333134       0    4484  337618   526d2 libavcodec/dsputil.o
4537582   45496 1023920 5606998  558e56 ffmpeg
- -rw-r--r-- 1 takis takis 914008 2007-07-26 18:04 libavcodec/dsputil.o
- -rw-r--r-- 1 takis takis 16240790 2007-07-26 18:07 libavcodec/libavcodec.a
- -rwxr-xr-x 1 takis takis 4599668 2007-07-26 18:08 ffmpeg

With this patch:
   text    data     bss     dec     hex filename
 307470       0    4484  311954   4c292 libavcodec/dsputil.o
4511918   45496 1023920 5581334  552a16 ffmpeg
- -rw-r--r-- 1 takis takis 832916 2007-07-26 18:10 libavcodec/dsputil.o
- -rw-r--r-- 1 takis takis 16159698 2007-07-26 18:13 libavcodec/libavcodec.a
- -rwxr-xr-x 1 takis takis 4574004 2007-07-26 18:14 ffmpeg



And finally, the impact when the default config is used:

./configure --enable-gpl

Without this patch:
./configure --enable-gpl
   text    data     bss     dec     hex filename
 333214       0    4484  337698   52722 libavcodec/dsputil.o
4537662   45496 1023952 5607110  558ec6 ffmpeg
- -rw-r--r-- 1 takis takis 914296 2007-07-26 17:57 libavcodec/dsputil.o
- -rw-r--r-- 1 takis takis 16241134 2007-07-26 18:00 libavcodec/libavcodec.a
- -rwxr-xr-x 1 takis takis 4600116 2007-07-26 18:00 ffmpeg

With this patch:
   text    data     bss     dec     hex filename
  25676       0       0   25676    644c libavcodec/h264dsp.o
 307550       0    4484  312034   4c2e2 libavcodec/dsputil.o
4537720   45496 1023952 5607168  558f00 ffmpeg
- -rw-r--r-- 1 takis takis 833420 2007-07-26 17:48 libavcodec/dsputil.o
- -rw-r--r-- 1 takis takis 16270266 2007-07-26 17:51 libavcodec/libavcodec.a
- -rwxr-xr-x 1 takis takis 4600160 2007-07-26 17:51 ffmpeg



This patch replaces the loopfilter one. If preferred, I can send it as
separate patches.


With friendly regards,
Takis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGqM8c9kOxLuzz4CkRAi3lAJ9HlVmKxGzIwWaWLSq/SyIv+wX6YACfeAZt
HVPhy1wAibzV6/QyadCR8Oo=
=eciq
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pi-20070726T173035-ffmpeg-dsputil_to_h264dsp.diff
Type: text/x-patch
Size: 27713 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070726/91f25060/attachment.bin>



More information about the ffmpeg-devel mailing list