diff dsputil.c @ 5289:f44baba9edc3 libavcodec

Integrate reference mpeg IDCT into dsputil.
author iive
date Wed, 11 Jul 2007 22:05:43 +0000
parents ef85411bb7e8
children d0351b81bc7c
line wrap: on
line diff
--- a/dsputil.c	Wed Jul 11 22:05:25 2007 +0000
+++ b/dsputil.c	Wed Jul 11 22:05:43 2007 +0000
@@ -3753,6 +3753,17 @@
 
 /* XXX: those functions should be suppressed ASAP when all IDCTs are
  converted */
+static void ff_mpeg_idct_put_c(uint8_t *dest, int line_size, DCTELEM *block)
+{
+    ff_mpeg_idct_c(block);
+    put_pixels_clamped_c(block, dest, line_size);
+}
+static void ff_mpeg_idct_add_c(uint8_t *dest, int line_size, DCTELEM *block)
+{
+    ff_mpeg_idct_c(block);
+    add_pixels_clamped_c(block, dest, line_size);
+}
+
 static void ff_jref_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
 {
     j_rev_dct (block);
@@ -3891,6 +3902,11 @@
             c->idct_add= ff_vp3_idct_add_c;
             c->idct    = ff_vp3_idct_c;
             c->idct_permutation_type= FF_NO_IDCT_PERM;
+        }else if(avctx->idct_algo==FF_IDCT_MPEG){
+            c->idct_put= ff_mpeg_idct_put_c;
+            c->idct_add= ff_mpeg_idct_add_c;
+            c->idct    = ff_mpeg_idct_c;
+            c->idct_permutation_type= FF_NO_IDCT_PERM;
         }else{ //accurate/default
             c->idct_put= simple_idct_put;
             c->idct_add= simple_idct_add;