summaryrefslogtreecommitdiff
path: root/libavcodec/x86/flacdsp_init.c
diff options
context:
space:
mode:
authorJames Darnley <james.darnley@gmail.com>2014-08-12 23:22:02 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-13 01:14:47 +0200
commit0081a14e7d1e44536400df19ad6c9ea8118db2e9 (patch)
treec332e6e548a984cb078419c7bec1e56999a65d40 /libavcodec/x86/flacdsp_init.c
parent7cafdfe9c7992e95f08b320fc7b4f1512e4e2afb (diff)
lavc/flacenc: add sse4 version of the 16-bit lpc encoder
From 1.8 to 2.4 times faster. Runtime is reduced by 2 to 39%. The speed-up generally increases with compression_level. This lpc encoder is not used with levels < 3 so it provides no speed-up in these cases. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/x86/flacdsp_init.c')
-rw-r--r--libavcodec/x86/flacdsp_init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/x86/flacdsp_init.c b/libavcodec/x86/flacdsp_init.c
index a071b3d3b7..ad88e5bbd1 100644
--- a/libavcodec/x86/flacdsp_init.c
+++ b/libavcodec/x86/flacdsp_init.c
@@ -27,6 +27,8 @@ void ff_flac_lpc_32_sse4(int32_t *samples, const int coeffs[32], int order,
void ff_flac_lpc_32_xop(int32_t *samples, const int coeffs[32], int order,
int qlevel, int len);
+void ff_flac_enc_lpc_16_sse4(int32_t *, const int32_t *, int, int, const int32_t *,int);
+
av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt,
int bps)
{
@@ -36,6 +38,8 @@ av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt,
if (EXTERNAL_SSE4(cpu_flags)) {
if (bps > 16 && CONFIG_FLAC_DECODER)
c->lpc = ff_flac_lpc_32_sse4;
+ if (bps == 16 && CONFIG_FLAC_ENCODER && CONFIG_GPL)
+ c->lpc_encode = ff_flac_enc_lpc_16_sse4;
}
if (EXTERNAL_XOP(cpu_flags)) {
if (bps > 16 && CONFIG_FLAC_DECODER)