diff dsputil.c @ 1567:e08df4d22d27 libavcodec

* introducing dct248 into the DSP context. * simple/accurate implementation of dct248 * DV encoding now supports 2-4-8 DCT * DV encoding gets a bit faster (but still miles away from what I think it could do) * misc. DV codec cleanups
author romansh
date Fri, 24 Oct 2003 18:28:01 +0000
parents 5d53c03186a1
children aa4dc16c0f18
line wrap: on
line diff
--- a/dsputil.c	Thu Oct 23 23:24:38 2003 +0000
+++ b/dsputil.c	Fri Oct 24 18:28:01 2003 +0000
@@ -44,6 +44,19 @@
     53, 60, 61, 54, 47, 55, 62, 63
 };
 
+/* Specific zigzag scan for 248 idct. NOTE that unlike the
+   specification, we interleave the fields */
+const uint8_t ff_zigzag248_direct[64] = {
+     0,  8,  1,  9, 16, 24,  2, 10,
+    17, 25, 32, 40, 48, 56, 33, 41,
+    18, 26,  3, 11,  4, 12, 19, 27,
+    34, 42, 49, 57, 50, 58, 35, 43,
+    20, 28,  5, 13,  6, 14, 21, 29,
+    36, 44, 51, 59, 52, 60, 37, 45,
+    22, 30,  7, 15, 23, 31, 38, 46,
+    53, 61, 54, 62, 39, 47, 55, 63,
+};
+
 /* not permutated inverse zigzag_direct + 1 for MMX quantizer */
 uint16_t __align8 inv_zigzag_direct16[64];
 
@@ -2869,12 +2882,18 @@
     int i;
 
 #ifdef CONFIG_ENCODERS
-    if(avctx->dct_algo==FF_DCT_FASTINT)
+    if(avctx->dct_algo==FF_DCT_FASTINT) {
         c->fdct = fdct_ifast;
-    else if(avctx->dct_algo==FF_DCT_FAAN)
+	c->fdct248 = ff_fdct248_islow; // FIXME: need an optimized version
+    } 
+    else if(avctx->dct_algo==FF_DCT_FAAN) {
         c->fdct = ff_faandct;
-    else
+	c->fdct248 = ff_fdct248_islow; // FIXME: need an optimized version
+    } 
+    else {
         c->fdct = ff_jpeg_fdct_islow; //slow/accurate/default
+	c->fdct248 = ff_fdct248_islow;
+    }
 #endif //CONFIG_ENCODERS
 
     if(avctx->idct_algo==FF_IDCT_INT){