diff options
author | James Darnley <jdarnley@obe.tv> | 2017-06-02 15:20:19 +0200 |
---|---|---|
committer | James Darnley <jdarnley@obe.tv> | 2017-06-28 17:27:35 +0200 |
commit | d7246ea9f229db64ed909d7446196128d6f53de0 (patch) | |
tree | 62bf59089de984c19802bac0daf9b3dfb52230ff /libavcodec/x86/idctdsp_init.c | |
parent | 8b19467d07d5782b4140f61363f24361efb87ff6 (diff) | |
download | ffmpeg-d7246ea9f229db64ed909d7446196128d6f53de0.tar.gz |
avcodec/x86: add an 8-bit simple IDCT function based on the x86-64 high depth functions
Includes add/put functions
Rounding contributed by Ronald S. Bultje
Diffstat (limited to 'libavcodec/x86/idctdsp_init.c')
-rw-r--r-- | libavcodec/x86/idctdsp_init.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c index f1c915aa00..9da60d1a1e 100644 --- a/libavcodec/x86/idctdsp_init.c +++ b/libavcodec/x86/idctdsp_init.c @@ -94,9 +94,32 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, c->idct_add = ff_simple_idct_add_sse2; c->perm_type = FF_IDCT_PERM_SIMPLE; } + + if (ARCH_X86_64 && + !high_bit_depth && + avctx->lowres == 0 && + (avctx->idct_algo == FF_IDCT_AUTO || + avctx->idct_algo == FF_IDCT_SIMPLEAUTO || + avctx->idct_algo == FF_IDCT_SIMPLEMMX)) { + c->idct = ff_simple_idct8_sse2; + c->idct_put = ff_simple_idct8_put_sse2; + c->idct_add = ff_simple_idct8_add_sse2; + c->perm_type = FF_IDCT_PERM_TRANSPOSE; + } } if (ARCH_X86_64 && avctx->lowres == 0) { + if (EXTERNAL_AVX(cpu_flags) && + !high_bit_depth && + (avctx->idct_algo == FF_IDCT_AUTO || + avctx->idct_algo == FF_IDCT_SIMPLEAUTO || + avctx->idct_algo == FF_IDCT_SIMPLEMMX)) { + c->idct = ff_simple_idct8_avx; + c->idct_put = ff_simple_idct8_put_avx; + c->idct_add = ff_simple_idct8_add_avx; + c->perm_type = FF_IDCT_PERM_TRANSPOSE; + } + if (avctx->bits_per_raw_sample == 10 && (avctx->idct_algo == FF_IDCT_AUTO || avctx->idct_algo == FF_IDCT_SIMPLEAUTO || |