diff dsputil.c @ 2259:12e75af1d44c libavcodec

1/8 resolution decoding
author michael
date Sun, 26 Sep 2004 10:01:40 +0000
parents 5f64a30339e5
children cd43603c46f9
line wrap: on
line diff
--- a/dsputil.c	Sun Sep 26 09:00:37 2004 +0000
+++ b/dsputil.c	Sun Sep 26 10:01:40 2004 +0000
@@ -3382,6 +3382,19 @@
     add_pixels_clamped2_c(block, dest, line_size);
 }
 
+static void ff_jref_idct1_put(uint8_t *dest, int line_size, DCTELEM *block)
+{
+    uint8_t *cm = cropTbl + MAX_NEG_CROP;
+
+    dest[0] = cm[(block[0] + 4)>>3];
+}
+static void ff_jref_idct1_add(uint8_t *dest, int line_size, DCTELEM *block)
+{
+    uint8_t *cm = cropTbl + MAX_NEG_CROP;
+
+    dest[0] = cm[dest[0] + ((block[0] + 4)>>3)];
+}
+
 /* init static data */
 void dsputil_static_init(void)
 {
@@ -3430,6 +3443,11 @@
         c->idct_add= ff_jref_idct2_add;
         c->idct    = j_rev_dct2;
         c->idct_permutation_type= FF_NO_IDCT_PERM;
+    }else if(avctx->lowres==3){
+        c->idct_put= ff_jref_idct1_put;
+        c->idct_add= ff_jref_idct1_add;
+        c->idct    = j_rev_dct1;
+        c->idct_permutation_type= FF_NO_IDCT_PERM;
     }else{
         if(avctx->idct_algo==FF_IDCT_INT){
             c->idct_put= ff_jref_idct_put;