ffmpeg/libavutil
Ganesh Ajjanagadde 68e79b27a5 avutil/lls: speed up performance of solve_lls
This is a trivial rewrite of the loops that results in better
prefetching and associated cache efficiency. Essentially, the problem is
that modern prefetching logic is based on finite state Markov memory, a reasonable
assumption that is used elsewhere in CPU's in for instance branch
predictors.

Surrounding loops all iterate forward through the array, making the
predictor think of prefetching in the forward direction, but the
intermediate loop is unnecessarily in the backward direction.

Speedup is nontrivial. Benchmarks obtained by 10^6 iterations within
solve_lls, with START/STOP_TIMER. File is tests/data/fate/flac-16-lpc-cholesky.err.
Hardware: x86-64, Haswell, GNU/Linux.

new:
  17291 decicycles in solve_lls, 2096706 runs,    446 skips
  17255 decicycles in solve_lls, 4193657 runs,    647 skips
  17231 decicycles in solve_lls, 8384997 runs,   3611 skips
  17189 decicycles in solve_lls,16771010 runs,   6206 skips
  17132 decicycles in solve_lls,33544757 runs,   9675 skips
  17092 decicycles in solve_lls,67092404 runs,  16460 skips
  17058 decicycles in solve_lls,134188213 runs,  29515 skips

old:
  18009 decicycles in solve_lls, 2096665 runs,    487 skips
  17805 decicycles in solve_lls, 4193320 runs,    984 skips
  17779 decicycles in solve_lls, 8386855 runs,   1753 skips
  18289 decicycles in solve_lls,16774280 runs,   2936 skips
  18158 decicycles in solve_lls,33548104 runs,   6328 skips
  18420 decicycles in solve_lls,67091793 runs,  17071 skips
  18310 decicycles in solve_lls,134187219 runs,  30509 skips

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-26 09:20:46 -05:00
..
aarch64
arm avutil/attributes: add AV_GCC_VERSION_AT_MOST 2015-09-18 12:41:29 -03:00
avr32
bfin
mips mips: intreadwrite: Only execute that code for mips r1 or r2 2015-09-29 11:10:37 +02:00
ppc
sh4
tomi
x86 avutil/x86/bswap: Remove warning about bswap intrinsics with msvc. 2015-11-23 23:03:32 +11:00
Makefile avutil: install des.h, rc4.h and tree.h as public headers 2015-10-21 00:23:10 +02:00
adler32.c
adler32.h
aes.c lavu/aes: test CBC functionality 2015-10-28 09:38:21 -05:00
aes.h
aes_internal.h lavu/aes: align AVAES struct members 2015-10-28 04:23:14 -05:00
atomic.c
atomic.h
atomic_gcc.h
atomic_suncc.h
atomic_win32.h
attributes.h avutil/attributes: add av_warn_unused_result 2015-10-05 19:30:20 +02:00
audio_fifo.c
audio_fifo.h avutil/audio_fifo: add av_warn_unused_result 2015-10-28 23:05:31 -04:00
avassert.h
avstring.c avutil/avstring: Inline some tiny functions 2015-10-03 13:45:37 +02:00
avstring.h avutil/avstring: add av_warn_unused_result 2015-10-27 23:16:09 -04:00
avutil.h
avutilres.rc
base64.c
base64.h
blowfish.c avutil: undo FF_API_CRYPTO_CONTEXT deprecation 2015-10-16 19:13:38 -03:00
blowfish.h avutil: undo FF_API_CRYPTO_CONTEXT deprecation 2015-10-16 19:13:38 -03:00
bprint.c
bprint.h
bswap.h
buffer.c
buffer.h
buffer_internal.h
camellia.c avutil: use EINVAL instead of -1 for the return code of crypto related init functions 2015-10-18 15:17:58 -04:00
camellia.h
cast5.c avutil: use EINVAL instead of -1 for the return code of crypto related init functions 2015-10-18 15:17:58 -04:00
cast5.h avutil/cast5: update Doxygen for av_cast5_init with return information 2015-10-15 22:32:58 -04:00
channel_layout.c libavutil/channel_layout: Check strtol*() for failure 2015-11-05 19:28:19 +01:00
channel_layout.h
color_utils.c avutil/color_utils: Add basic transfer functions for each AVColorTransferCharacteristic 2015-09-10 23:53:05 +02:00
color_utils.h avutil/color_utils: Add basic transfer functions for each AVColorTransferCharacteristic 2015-09-10 23:53:05 +02:00
colorspace.h
common.h avutil: Move av_rint64_clip_* to internal.h 2015-11-15 03:47:09 +01:00
cpu.c lavu: add AESNI CPU flag 2015-10-28 04:23:14 -05:00
cpu.h lavu: add AESNI CPU flag 2015-10-28 04:23:14 -05:00
cpu_internal.h
crc.c avutil/crc: use EINVAL instead of -1 for the return code of av_crc_init() 2015-10-16 03:24:36 +02:00
crc.h
des.c avutil: use EINVAL instead of -1 for the return code of crypto related init functions 2015-10-18 15:17:58 -04:00
des.h avutil: undo FF_API_CRYPTO_CONTEXT deprecation 2015-10-16 19:13:38 -03:00
dict.c Merge commit '11c5f438ff83da5040e85bfa6299f56b321d32ef' 2015-10-14 14:01:11 +02:00
dict.h Merge commit '11c5f438ff83da5040e85bfa6299f56b321d32ef' 2015-10-14 14:01:11 +02:00
display.c
display.h
downmix_info.c
downmix_info.h
dynarray.h
error.c
error.h
eval.c avutil/eval: change sqrt to hypot 2015-11-21 08:51:49 -05:00
eval.h avutil/eval: minor typo 2015-11-01 19:35:01 -05:00
fifo.c avutil/fifo: add function av_fifo_generic_peek_at() 2015-10-14 20:23:58 +02:00
fifo.h avutil/fifo: add function av_fifo_generic_peek_at() 2015-10-14 20:23:58 +02:00
file.c
file.h avutil/file: add av_warn_unused_result to av_file_map 2015-10-16 17:18:39 -04:00
file_open.c avutil/file_open: avoid file handle inheritance on Windows 2015-11-02 17:40:49 +01:00
fixed_dsp.c
fixed_dsp.h
float_dsp.c avutil: merge avpriv_float_dsp_init into avpriv_float_dsp_alloc 2015-10-21 00:24:58 +02:00
float_dsp.h avutil: merge avpriv_float_dsp_init into avpriv_float_dsp_alloc 2015-10-21 00:24:58 +02:00
frame.c Merge commit '1aa24df74c052a73175c43e57d35b4835e537ec8' 2015-10-03 09:52:39 +02:00
frame.h Merge commit '1aa24df74c052a73175c43e57d35b4835e537ec8' 2015-10-03 09:52:39 +02:00
hash.c
hash.h
hmac.c lavu/hmac: remove deprecated type ids 2015-09-05 18:07:20 +02:00
hmac.h lavu/hmac: remove deprecated type ids 2015-09-05 18:07:20 +02:00
imgutils.c imgutils: Use designated initializers for AVClass 2015-11-23 18:30:25 -08:00
imgutils.h
integer.c integer: switch to av_assert 2012-08-09 01:44:15 +02:00
integer.h
internal.h avutil: Move av_rint64_clip_* to internal.h 2015-11-15 03:47:09 +01:00
intfloat.h
intmath.c intmath: remove av_ctz. 2015-10-11 18:03:10 -04:00
intmath.h avutil/intmath: fix undefined behavior in ff_ctzll_c() 2015-10-22 14:10:42 +02:00
intreadwrite.h
lfg.c
lfg.h
libavutil.v
libm.h avutil/libm: fix isnan compatibility hack 2015-11-24 21:33:13 -05:00
lls.c avutil/lls: speed up performance of solve_lls 2015-11-26 09:20:46 -05:00
lls.h
log.c avutil/log: fix zero length gnu_printf format string warning 2015-09-17 18:58:01 +02:00
log.h
log2_tab.c
lzo.c
lzo.h
macros.h
mathematics.c avutil/mathematics: make av_gcd more robust 2015-10-29 19:13:55 -04:00
mathematics.h avutil/mathematics: correct documentation for av_gcd 2015-10-30 13:42:04 -04:00
md5.c
md5.h
mem.c avutil/mem: Add av_fast_mallocz() 2015-11-18 22:05:16 +01:00
mem.h avutil/mem: Add av_fast_mallocz() 2015-11-18 22:05:16 +01:00
mem_internal.h
motion_vector.h avutil/motion_vector: export subpel motion information 2015-11-23 10:55:15 +01:00
murmur3.c
murmur3.h
opencl.c opencl: Use "opencl" as log context name 2015-10-17 01:16:50 -07:00
opencl.h opencl: Force the use of 1.2 APIs 2015-10-17 01:16:50 -07:00
opencl_internal.c
opencl_internal.h avutil/opencl_internal: add av_warn_unused_result 2015-10-31 10:40:54 -04:00
opt.c lavu/opt: enhance printing durations. 2015-11-07 16:04:09 +01:00
opt.h lavu/opt: add flag to return NULL when applicable in av_opt_get 2015-10-09 04:12:57 -05:00
parseutils.c
parseutils.h
pca.c
pca.h
pixdesc.c pixfmt: Add new SMPTE color primaries and transfer characteristic values 2015-09-17 10:31:43 +02:00
pixdesc.h Merge commit '7b02cb29d9d60cdd5ef321043d11d02023e7dc8f' 2015-09-12 13:03:04 +02:00
pixelutils.c
pixelutils.h
pixfmt.h pixfmt: Add new SMPTE color primaries and transfer characteristic values 2015-09-17 10:31:43 +02:00
qsort.h avutil/qsort: use the do while form for AV_QSORT, AV_MSORT 2015-10-23 08:41:16 -04:00
random_seed.c
random_seed.h
rational.c avutil/rational: use frexp rather than ad-hoc log to get floating point exponent 2015-10-30 23:18:43 -04:00
rational.h
rc4.c avutil: use EINVAL instead of -1 for the return code of crypto related init functions 2015-10-18 15:17:58 -04:00
rc4.h avutil: undo FF_API_CRYPTO_CONTEXT deprecation 2015-10-16 19:13:38 -03:00
replaygain.h
reverse.c
ripemd.c avutil/ripemd: make rol macro more robust by adding parentheses 2015-10-28 21:42:15 -04:00
ripemd.h
samplefmt.c
samplefmt.h
sha.c avutil: use EINVAL instead of -1 for the return code of crypto related init functions 2015-10-18 15:17:58 -04:00
sha.h
sha512.c avutil: use EINVAL instead of -1 for the return code of crypto related init functions 2015-10-18 15:17:58 -04:00
sha512.h
softfloat.c avutil/softfloat: Include negative numbers in cmp/gt tests 2015-11-08 15:04:05 +01:00
softfloat.h avutil/softfloat: use abort() instead of av_assert0(0) 2015-11-10 13:37:24 -03:00
softfloat_tables.h
stereo3d.c
stereo3d.h
tea.c
tea.h
thread.h Merge commit 'c53e796f8b69799b7ad6d28fbab981d37edf1bc9' 2015-10-14 23:02:35 +02:00
threadmessage.c
threadmessage.h
time.c
time.h
time_internal.h
timecode.c timecode: Support HFR values 2015-10-26 15:05:26 +01:00
timecode.h
timer.h
timestamp.h
tree.c avutil/tree: clean up pointer incompatibility warnings 2015-10-25 12:45:10 -04:00
tree.h avutil/tree: Document the guaranteed ordering of compare arguments for av_tree_find() 2015-10-25 17:28:47 +01:00
twofish.c avutil: use EINVAL instead of -1 for the return code of crypto related init functions 2015-10-18 15:17:58 -04:00
twofish.h
utf8.c
utils.c
version.h avutil/motion_vector: export subpel motion information 2015-11-23 10:55:15 +01:00
wchar_filename.h avutil/wchar_filename: add av_warn_unused_result 2015-10-30 13:47:28 -04:00
x86_cpu.h
xga_font_data.c
xga_font_data.h
xtea.c Merge commit '588b6215b4c74945994eb9636b0699028c069ed2' 2015-11-22 14:29:09 +00:00
xtea.h Merge commit '588b6215b4c74945994eb9636b0699028c069ed2' 2015-11-22 14:29:09 +00:00