From f618466c25d43f3bae9e40920273bf77de1e1149 Mon Sep 17 00:00:00 2001 From: leochanj105 Date: Mon, 19 Oct 2020 23:09:30 -0400 Subject: initial sd-vbs initial sd-vbs add sd-vbs sd-vbs --- .../src/matlabPyrTools/MEX/wrap.c | 281 +++++++++++++++++++++ 1 file changed, 281 insertions(+) create mode 100755 SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/MEX/wrap.c (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/MEX/wrap.c') diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/MEX/wrap.c b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/MEX/wrap.c new file mode 100755 index 0000000..a081123 --- /dev/null +++ b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/MEX/wrap.c @@ -0,0 +1,281 @@ +/* +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; File: wrap.c +;;; Author: Eero Simoncelli +;;; Description: Circular convolution on 2D images. +;;; Creation Date: Spring, 1987. +;;; MODIFICATIONS: +;;; 6/96: Switched array types to double float. +;;; 2/97: made more robust and readable. Added STOP arguments. +;;; ---------------------------------------------------------------- +;;; Object-Based Vision and Image Understanding System (OBVIUS), +;;; Copyright 1988, Vision Science Group, Media Laboratory, +;;; Massachusetts Institute of Technology. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +*/ + +#include + +#include "convolve.h" + +/* + -------------------------------------------------------------------- + Performs correlation (i.e., convolution with filt(-x,-y)) of FILT + with IMAGE followed by subsampling (a.k.a. REDUCE in Burt&Adelson81). + The operations are combined to avoid unnecessary computation of the + convolution samples that are to be discarded in the subsampling + operation. The convolution is done in 9 sections so that mod + operations are not performed unnecessarily. The subsampling lattice + is specified by the START, STEP and STOP parameters. + -------------------------------------------------------------------- */ + +/* abstract out the inner product computation */ +#define INPROD(YSTART,YIND,XSTART,XIND) \ + { \ + sum=0.0; \ + for (y_im=YSTART, filt_pos=0, x_filt_stop=x_fdim; \ + x_filt_stop<=filt_size; \ + y_im++, x_filt_stop+=x_fdim) \ + for (x_im=XSTART ; \ + filt_pos