[FFmpeg-devel] [PATCH 9/9] simple_idct: align with x86 version
Christophe Gisquet
christophe.gisquet at gmail.com
Sun Oct 11 16:06:13 CEST 2015
This is slightly beneficial to omse (0.1691 to 0.1688). The x86 idct
is thus marked as a valid simple implementation.
---
libavcodec/simple_idct_template.c | 15 +++------------
libavcodec/x86/idctdsp_init.c | 8 +++-----
2 files changed, 6 insertions(+), 17 deletions(-)
diff --git a/libavcodec/simple_idct_template.c b/libavcodec/simple_idct_template.c
index 0585679..b38a039 100644
--- a/libavcodec/simple_idct_template.c
+++ b/libavcodec/simple_idct_template.c
@@ -66,7 +66,6 @@
#elif BIT_DEPTH == 10 || BIT_DEPTH == 12
-# if BIT_DEPTH == 10
#define W1 22725 // 90901
#define W2 21407 // 85627
#define W3 19265 // 77062
@@ -75,6 +74,7 @@
#define W6 8867 // 35468
#define W7 4520 // 18081
+# if BIT_DEPTH == 10
# ifdef EXTRA_SHIFT
#define ROW_SHIFT 13
#define COL_SHIFT 18
@@ -84,18 +84,9 @@
#define COL_SHIFT 19
#define DC_SHIFT 2
# endif
-
# else
-#define W1 45451
-#define W2 42813
-#define W3 38531
-#define W4 32767
-#define W5 25746
-#define W6 17734
-#define W7 9041
-
-#define ROW_SHIFT 16
-#define COL_SHIFT 17
+#define ROW_SHIFT 15
+#define COL_SHIFT 16
#define DC_SHIFT -1
# endif
diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c
index bcf7e5b..8b25ff9 100644
--- a/libavcodec/x86/idctdsp_init.c
+++ b/libavcodec/x86/idctdsp_init.c
@@ -86,11 +86,11 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
c->add_pixels_clamped = ff_add_pixels_clamped_sse2;
}
- if (ARCH_X86_64 && avctx->lowres == 0) {
- if (avctx->bits_per_raw_sample == 10 &&
+ if (ARCH_X86_64 && avctx->lowres == 0 &&
(avctx->idct_algo == FF_IDCT_AUTO ||
avctx->idct_algo == FF_IDCT_SIMPLEAUTO ||
avctx->idct_algo == FF_IDCT_SIMPLE)) {
+ if (avctx->bits_per_raw_sample == 10) {
if (EXTERNAL_SSE2(cpu_flags)) {
c->idct_put = ff_simple_idct10_put_sse2;
c->idct_add = NULL;
@@ -106,9 +106,7 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
}
}
- if (avctx->bits_per_raw_sample == 12 &&
- (avctx->idct_algo == FF_IDCT_AUTO ||
- avctx->idct_algo == FF_IDCT_SIMPLEMMX)) {
+ if (avctx->bits_per_raw_sample == 12) {
if (EXTERNAL_SSE2(cpu_flags)) {
c->idct_put = ff_simple_idct12_put_sse2;
c->idct_add = NULL;
--
2.6.0
More information about the ffmpeg-devel
mailing list