summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2014-08-28 19:32:45 -0700
committerDiego Biurrun <diego@biurrun.de>2014-09-07 13:36:26 -0700
commit1274ea8dbaec44355bde07f6bb31fec0c4e6fd2d (patch)
treec517d38cce7cf1e78e232c114ebe63f0429cd873 /libavcodec
parentfcf597625c7a991ca389f3a9b8ff4f5e383301c0 (diff)
Split off floating point AAN (I)DCT into separate components
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/Makefile8
-rw-r--r--libavcodec/dct-test.c10
-rw-r--r--libavcodec/fdctdsp.c2
-rw-r--r--libavcodec/idctdsp.c2
-rw-r--r--libavcodec/mpegvideo_enc.c6
5 files changed, 19 insertions, 9 deletions
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index c8d820bf7a..178b61e530 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -36,8 +36,9 @@ OBJS-$(CONFIG_BSWAPDSP) += bswapdsp.o
OBJS-$(CONFIG_CABAC) += cabac.o
OBJS-$(CONFIG_DCT) += dct.o dct32_fixed.o dct32_float.o
OBJS-$(CONFIG_ERROR_RESILIENCE) += error_resilience.o
-OBJS-$(CONFIG_FDCTDSP) += fdctdsp.o faandct.o \
- jfdctfst.o jfdctint.o
+OBJS-$(CONFIG_FAANDCT) += faandct.o
+OBJS-$(CONFIG_FAANIDCT) += faanidct.o
+OBJS-$(CONFIG_FDCTDSP) += fdctdsp.o jfdctfst.o jfdctint.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)
@@ -51,8 +52,7 @@ OBJS-$(CONFIG_HPELDSP) += hpeldsp.o
OBJS-$(CONFIG_HUFFMAN) += huffman.o
OBJS-$(CONFIG_HUFFYUVDSP) += huffyuvdsp.o
OBJS-$(CONFIG_HUFFYUVENCDSP) += huffyuvencdsp.o
-OBJS-$(CONFIG_IDCTDSP) += idctdsp.o faanidct.o \
- simple_idct.o jrevdct.o
+OBJS-$(CONFIG_IDCTDSP) += idctdsp.o simple_idct.o jrevdct.o
OBJS-$(CONFIG_IIRFILTER) += iirfilter.o
OBJS-$(CONFIG_INTRAX8) += intrax8.o intrax8dsp.o
OBJS-$(CONFIG_LIBXVID) += libxvid_rc.o
diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index fed5ff282d..32cbe8c52c 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -56,18 +56,22 @@ struct algo {
int nonspec;
};
-static const struct algo fdct_tab[4] = {
+static const struct algo fdct_tab[] = {
{ "REF-DBL", ff_ref_fdct, FF_IDCT_PERM_NONE },
- { "FAAN", ff_faandct, FF_IDCT_PERM_NONE },
{ "IJG-AAN-INT", ff_fdct_ifast, FF_IDCT_PERM_NONE },
{ "IJG-LLM-INT", ff_jpeg_fdct_islow_8, FF_IDCT_PERM_NONE },
+#if CONFIG_FAANDCT
+ { "FAAN", ff_faandct, FF_IDCT_PERM_NONE },
+#endif /* CONFIG_FAANDCT */
};
static const struct algo idct_tab[] = {
- { "FAANI", ff_faanidct, FF_IDCT_PERM_NONE },
{ "REF-DBL", ff_ref_idct, FF_IDCT_PERM_NONE },
{ "INT", ff_j_rev_dct, FF_IDCT_PERM_LIBMPEG2 },
{ "SIMPLE-C", ff_simple_idct_8, FF_IDCT_PERM_NONE },
+#if CONFIG_FAANIDCT
+ { "FAANI", ff_faanidct, FF_IDCT_PERM_NONE },
+#endif /* CONFIG_FAANIDCT */
#if CONFIG_MPEG4_DECODER
{ "XVID", ff_xvid_idct, FF_IDCT_PERM_NONE, 0, 1 },
#endif /* CONFIG_MPEG4_DECODER */
diff --git a/libavcodec/fdctdsp.c b/libavcodec/fdctdsp.c
index 696fa01e94..f299eae272 100644
--- a/libavcodec/fdctdsp.c
+++ b/libavcodec/fdctdsp.c
@@ -33,9 +33,11 @@ av_cold void ff_fdctdsp_init(FDCTDSPContext *c, AVCodecContext *avctx)
} else if (avctx->dct_algo == FF_DCT_FASTINT) {
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 /* CONFIG_FAANDCT */
} else {
c->fdct = ff_jpeg_fdct_islow_8; // slow/accurate/default
c->fdct248 = ff_fdct248_islow_8;
diff --git a/libavcodec/idctdsp.c b/libavcodec/idctdsp.c
index 2a979bc581..a9b8727468 100644
--- a/libavcodec/idctdsp.c
+++ b/libavcodec/idctdsp.c
@@ -158,11 +158,13 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
c->idct_add = ff_jref_idct_add;
c->idct = ff_j_rev_dct;
c->perm_type = FF_IDCT_PERM_LIBMPEG2;
+#if CONFIG_FAANIDCT
} else if (avctx->idct_algo == FF_IDCT_FAAN) {
c->idct_put = ff_faanidct_put;
c->idct_add = ff_faanidct_add;
c->idct = ff_faanidct;
c->perm_type = FF_IDCT_PERM_NONE;
+#endif /* CONFIG_FAANIDCT */
} else { // accurate/default
c->idct_put = ff_simple_idct_put_8;
c->idct_add = ff_simple_idct_add_8;
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 380eff67da..17322e5046 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -89,8 +89,10 @@ void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64],
for (qscale = qmin; qscale <= qmax; qscale++) {
int i;
if (fdsp->fdct == ff_jpeg_fdct_islow_8 ||
- fdsp->fdct == ff_jpeg_fdct_islow_10 ||
- fdsp->fdct == ff_faandct) {
+#if CONFIG_FAANDCT
+ fdsp->fdct == ff_faandct ||
+#endif /* CONFIG_FAANDCT */
+ fdsp->fdct == ff_jpeg_fdct_islow_10) {
for (i = 0; i < 64; i++) {
const int j = s->idsp.idct_permutation[i];
/* 16 <= qscale * quant_matrix[i] <= 7905