aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2002-06-05 18:48:07 +0000
committerFabrice Bellard <fabrice@bellard.org>2002-06-05 18:48:07 +0000
commit8ee14970d61d19a971050268384911b49a436c2d (patch)
treecce3198768281ca46dd75343fecef382564266d4
parentd36a2466753fc18f3143837a56aa7123f8991f33 (diff)
downloadffmpeg-8ee14970d61d19a971050268384911b49a436c2d.tar.gz
added ff_idct_put/add
Originally committed as revision 672 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/dsputil.c27
-rw-r--r--libavcodec/dsputil.h2
2 files changed, 27 insertions, 2 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index 8e91ab34b2..d76cc8d486 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -23,6 +23,8 @@
#include "simple_idct.h"
void (*ff_idct)(DCTELEM *block);
+void (*ff_idct_put)(UINT8 *dest, int line_size, DCTELEM *block);
+void (*ff_idct_add)(UINT8 *dest, int line_size, DCTELEM *block);
void (*av_fdct)(DCTELEM *block);
void (*get_pixels)(DCTELEM *block, const UINT8 *pixels, int line_size);
void (*diff_pixels)(DCTELEM *block, const UINT8 *s1, const UINT8 *s2, int stride);
@@ -1244,6 +1246,20 @@ void clear_blocks_c(DCTELEM *blocks)
memset(blocks, 0, sizeof(DCTELEM)*6*64);
}
+/* XXX: those functions should be suppressed ASAP when all IDCTs are
+ converted */
+void gen_idct_put(UINT8 *dest, int line_size, DCTELEM *block)
+{
+ ff_idct (block);
+ put_pixels_clamped(block, dest, line_size);
+}
+
+void gen_idct_add(UINT8 *dest, int line_size, DCTELEM *block)
+{
+ ff_idct (block);
+ add_pixels_clamped(block, dest, line_size);
+}
+
void dsputil_init(void)
{
int i, j;
@@ -1260,7 +1276,7 @@ void dsputil_init(void)
}
#ifdef SIMPLE_IDCT
- ff_idct = simple_idct;
+ ff_idct = NULL;
#else
ff_idct = j_rev_dct;
#endif
@@ -1299,7 +1315,14 @@ void dsputil_init(void)
#endif
#ifdef SIMPLE_IDCT
- if(ff_idct == simple_idct) use_permuted_idct=0;
+ if (ff_idct == NULL) {
+ ff_idct_put = simple_idct_put;
+ ff_idct_add = simple_idct_add;
+ use_permuted_idct=0;
+ } else {
+ ff_idct_put = gen_idct_put;
+ ff_idct_add = gen_idct_add;
+ }
#endif
if(use_permuted_idct)
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
index 062b510ab0..85373336c8 100644
--- a/libavcodec/dsputil.h
+++ b/libavcodec/dsputil.h
@@ -54,6 +54,8 @@ void dsputil_init(void);
/* pixel ops : interface with DCT */
extern void (*ff_idct)(DCTELEM *block);
+extern void (*ff_idct_put)(UINT8 *dest, int line_size, DCTELEM *block);
+extern void (*ff_idct_add)(UINT8 *dest, int line_size, DCTELEM *block);
extern void (*get_pixels)(DCTELEM *block, const UINT8 *pixels, int line_size);
extern void (*diff_pixels)(DCTELEM *block, const UINT8 *s1, const UINT8 *s2, int stride);
extern void (*put_pixels_clamped)(const DCTELEM *block, UINT8 *pixels, int line_size);