[FFmpeg-devel] [PATCH 0/4] Exploit compile-time constant

Christophe Gisquet christophe.gisquet at gmail.com
Mon Jul 28 19:17:24 CEST 2014


MAX_PB_SIZE is used or assumed for various buffer strides. In some cases,
it is used as constant parameter(s) to functions.

Make use of that knowledge to:
- not pass the parameter
- avoid extra GPR usage
- precompute addresses / offsets

Premature optimization and overall not that useful.
Before:
46092 decicycles in oma, 1028766 runs, 19810 skips
10174 decicycles in chroma, 2065859 runs, 31293 skips

After:
45634 decicycles in luma, 1027414 runs, 21162 skips
9932 decicycles in chroma, 2063780 runs, 33372 skips

Christophe Gisquet (4):
  hevc: move MAX_PB_SIZE declaration
  hevcdsp: remove compilation-time-fixed parameter
  hevcdsp: remove more instances of compile-time-fixed parameters
  x86: hevcdsp: use compilation-time-fixed constant

 libavcodec/hevc.c             | 12 +++----
 libavcodec/hevc.h             |  1 -
 libavcodec/hevcdsp.h          | 14 ++++----
 libavcodec/hevcdsp_template.c | 83 +++++++++++++++++++++----------------------
 libavcodec/x86/hevc_mc.asm    | 38 ++++++++++----------
 libavcodec/x86/hevcdsp.h      |  8 ++---
 libavcodec/x86/hevcdsp_init.c | 26 +++++++-------
 7 files changed, 91 insertions(+), 91 deletions(-)

-- 
1.9.2.msysgit.0



More information about the ffmpeg-devel mailing list