---
configure | 3 +++
libavcodec/Makefile | 3 ++-
libavcodec/dct-test.c | 4 ++--
libavcodec/dsputil.c | 2 ++
libavcodec/faandct.c | 2 +-
libavcodec/faandct.h | 3 ++-
libavcodec/mpegvideo_enc.c | 9 +++++----
7 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/configure b/configure
index 7418bca..1cd3332 100755
--- a/configure
+++ b/configure
@@ -115,6 +115,7 @@ Component options:
--enable-x11grab enable X11 grabbing [no]
--disable-network disable network support [no]
--disable-dct disable DCT code
+ --disable-faandct disable floating point AAN DCT code
--disable-mdct disable MDCT code
--disable-rdft disable RDFT code
--disable-fft disable FFT code
@@ -934,6 +935,7 @@ CONFIG_LIST="
doc
dwt
dxva2
+ faandct
fastdiv
fft
frei0r
@@ -1691,6 +1693,7 @@ enable swscale
enable asm
enable debug
enable doc
+enable faandct
enable fastdiv
enable network
enable optimizations
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 4dc218a..2d7b55e 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -24,10 +24,11 @@ OBJS = allcodecs.o
\
# parts needed for many different codecs
OBJS-$(CONFIG_AANDCT) += aandcttab.o
OBJS-$(CONFIG_AC3DSP) += ac3dsp.o
-OBJS-$(CONFIG_ENCODERS) += faandct.o jfdctfst.o jfdctint.o
+OBJS-$(CONFIG_ENCODERS) += jfdctfst.o jfdctint.o
OBJS-$(CONFIG_DCT) += dct.o dct32_fixed.o dct32_float.o
OBJS-$(CONFIG_DWT) += dwt.o
OBJS-$(CONFIG_DXVA2) += dxva2.o
+OBJS-$(CONFIG_FAANDCT) += faandct.o
FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o cos_fixed_tables.o
OBJS-$(CONFIG_FFT) += avfft.o fft_fixed.o fft_float.o \
$(FFT-OBJS-yes)
diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index 1787ef6..f0db737 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -35,7 +35,7 @@
#include "libavutil/cpu.h"
#include "libavutil/common.h"
#include "libavutil/lfg.h"
-
+#include "config.h"
#include "simple_idct.h"
#include "aandcttab.h"
#include "faandct.h"
@@ -74,7 +74,7 @@ struct algo {
int nonspec;
};
-#ifndef FAAN_POSTSCALE
+#if !FAAN_POSTSCALE && CONFIG_FAANDCT
#define FAAN_SCALE SCALE_PERM
#else
#define FAAN_SCALE NO_PERM
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index f5b7d07..5088c6a 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -2789,10 +2789,12 @@ av_cold void ff_dsputil_init(DSPContext* c,
AVCodecContext *avctx)
c->fdct = ff_fdct_ifast;
c->fdct248 = ff_fdct_ifast248;
}
+#if CONFIG_FAANDCT
else if(avctx->dct_algo==FF_DCT_FAAN) {
c->fdct = ff_faandct;
c->fdct248 = ff_faandct248;
}
+#endif
else {
c->fdct = ff_jpeg_fdct_islow_8; //slow/accurate/default
c->fdct248 = ff_fdct248_islow_8;
diff --git a/libavcodec/faandct.c b/libavcodec/faandct.c
index a986f65..17abae6 100644
--- a/libavcodec/faandct.c
+++ b/libavcodec/faandct.c
@@ -29,7 +29,7 @@
#include "faandct.h"
#define FLOAT float
-#ifdef FAAN_POSTSCALE
+#if FAAN_POSTSCALE
# define SCALE(x) postscale[x]
#else
# define SCALE(x) 1
diff --git a/libavcodec/faandct.h b/libavcodec/faandct.h
index da8c0e4..b034a02 100644
--- a/libavcodec/faandct.h
+++ b/libavcodec/faandct.h
@@ -30,8 +30,9 @@
#define AVCODEC_FAANDCT_H
#include "dsputil.h"
+#include "config.h"
-#define FAAN_POSTSCALE
+#define FAAN_POSTSCALE 1
void ff_faandct(DCTELEM * data);
void ff_faandct248(DCTELEM * data);
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 7074dda..ce44360 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -30,6 +30,7 @@
#include "libavutil/intmath.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
+#include "config.h"
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
@@ -80,7 +81,7 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
int i;
if (dsp->fdct == ff_jpeg_fdct_islow_8 ||
dsp->fdct == ff_jpeg_fdct_islow_10
-#ifdef FAAN_POSTSCALE
+#if FAAN_POSTSCALE && CONFIG_FAANDCT
|| dsp->fdct == ff_faandct
#endif
) {
@@ -96,7 +97,7 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
(qscale * quant_matrix[j]));
}
} else if (dsp->fdct == ff_fdct_ifast
-#ifndef FAAN_POSTSCALE
+#if !FAAN_POSTSCALE && CONFIG_FAANDCT
|| dsp->fdct == ff_faandct
#endif
) {
@@ -139,7 +140,7 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
for (i = intra; i < 64; i++) {
int64_t max = 8191;
if (dsp->fdct == ff_fdct_ifast
-#ifndef FAAN_POSTSCALE
+#if !FAAN_POSTSCALE && CONFIG_FAANDCT
|| dsp->fdct == ff_faandct
#endif
) {
@@ -3475,7 +3476,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s,
int best_score=256*256*256*120;
if ( s->dsp.fdct == ff_fdct_ifast
-#ifndef FAAN_POSTSCALE
+#if !FAAN_POSTSCALE && CONFIG_FAANDCT
|| s->dsp.fdct == ff_faandct
#endif
)
--
1.7.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel