Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <string.h>
#include <ap_int.h>
#define HORIZONTAL_PIXEL_WIDTH 800
#define VERTICAL_PIXEL_WIDTH 600
#define ALL_PIXEL_VALUE (HORIZONTAL_PIXEL_WIDTH*VERTICAL_PIXEL_WIDTH)
int laplacian_fil(int x0y0, int x1y0, int x2y0, int x0y1, int x1y1, int x2y1, int x0y2, int x1y2, int x2y2);
int conv_rgb2y(int rgb);
@formalism
formalism / DctQuant.hs
Created March 22, 2015 14:06
Forward DCT implemented in Haskell. Familiarize myself how to use mutable vector in ST monad. DCT algorithm might contain bugs :). Modified from ijgjpeg fdctflt.
module DctQuant where
import Prelude hiding (mapM_, read)
import Data.Vector.Mutable
import Data.Vector
import Control.Monad.ST
import Control.Monad.Primitive (PrimMonad, PrimState)
fdct :: PrimMonad m => Vector Float -> m (MVector (PrimState m) Float)
fdct vi = do