Skip to content

Instantly share code, notes, and snippets.

View justinruggles's full-sized avatar

Justin Ruggles justinruggles

View GitHub Profile
From 926c0121c9fd3b7234f175648db87bdb6e3c15e5 Mon Sep 17 00:00:00 2001
From: Justin Ruggles <[email protected]>
Date: Fri, 20 Jul 2012 19:53:40 -0400
Subject: [PATCH] dsputil: x86: use cpuflags for apply_window_int16()
---
libavcodec/x86/dsputil_mmx.c | 12 +++---
libavcodec/x86/dsputil_yasm.asm | 79 +++++++++++++++++---------------------
2 files changed, 41 insertions(+), 50 deletions(-)
TEST fft-4
make: *** [fate-fft-4] Error 1
TEST ifft-4
make: *** [fate-ifft-4] Error 1
TEST mdct-4
TEST imdct-4
TEST rdft-4
TEST irdft-4
TEST dct1d-4
TEST idct1d-4
time of s->imdct_512.imdct_half() in ac3dec
C: 38800
3dnow: 7500
3dnow2: 6700
SSE: 3700
time of mdct in ac3enc
C: 41941
3dnow: 25469
3dnow2: 24576
make tests/tiny_psnr
float mono test:
avconv -cpuflags 0 -i <input> -filter:a aformat=sample_formats\=flt -channel_layout mono -y out_flt_mono_c.wav
avconv -cpuflags fma4 -i <input> -filter:a aformat=sample_formats\=flt -channel_layout mono -y out_flt_mono_fma4.wav
./tests/tiny_psnr out_flt_mono_c.wav out_flt_mono_fma4.wav
float stereo test:
avconv -cpuflags 0 -i <input> -filter:a aformat=sample_formats\=flt -channel_layout stereo -y out_flt_stereo_c.wav
avconv -cpuflags fma4 -i <input> -filter:a aformat=sample_formats\=flt -channel_layout stereo -y out_flt_stereo_fma4.wav
From ac7c4b9b628f14f9bd8f457a9d15b0fee31e44bb Mon Sep 17 00:00:00 2001
From: Justin Ruggles <[email protected]>
Date: Fri, 20 Jul 2012 15:24:40 -0400
Subject: [PATCH 1/4] dsputil: x86: convert PMINSD, PMAXSD, and CLIPD macros to use cpuflags
---
libavcodec/x86/dsputil_mmx.c | 6 ++--
libavcodec/x86/dsputil_yasm.asm | 67 +++++++++++++++++++--------------------
libavutil/x86/x86util.asm | 34 ++++++++++++-------
pb_perm_unpackw_0: db 0, 1, 2, 3, 16, 17, 18, 19, 8, 9, 10, 11, 24, 25, 26, 27
pb_perm_unpackw_1: db 8, 9, 10, 11, 24, 25, 26, 27, 12, 13, 14, 15, 28, 29, 30, 31
[...]
punpcklwd m0, m1 ; m0 = 0, 1, 6, 7, 12, 13, 18, 19
punpcklwd m2, m3 ; m2 = 4, 5, 10, 11, 16, 17, 22, 23
punpcklwd m4, m5 ; m4 = 2, 3, 8, 9, 14, 15, 20, 21
%if cpuflag(xop)
vpperm m1, m0, m4, [pb_perm_unpackw_0] ; m1 = 0, 1, 2, 3, 12, 13, 14, 15
@justinruggles
justinruggles / gist:3139463
Created July 18, 2012 22:44
ff_conv_s16p_to_flt_6ch
SECTION_RODATA 32
pb_shuf_unpack_even: db 11, 10, -1, -1, 9, 8, -1, -1, 3, 2, -1, -1, 1, 0, -1, -1
pb_shuf_unpack_odd: db 15, 14, -1, -1, 13, 12, -1, -1, 7, 6, -1, -1, 5, 4, -1, -1
SECTION_TEXT
;------------------------------------------------------------------------------
; void ff_conv_s16p_to_flt_6ch(float *dst, int16_t *const *src, int len,
; int channels);