From c3922c6ec2ec759d864667bc607a87bc72a86cdd Mon Sep 17 00:00:00 2001 From: jzhou Date: Fri, 11 Dec 2009 22:11:09 +0000 Subject: [PATCH] a missing file --- .../Scheduling/Tracking/BlurPieceL.java | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 Robust/src/Benchmarks/Scheduling/Tracking/BlurPieceL.java diff --git a/Robust/src/Benchmarks/Scheduling/Tracking/BlurPieceL.java b/Robust/src/Benchmarks/Scheduling/Tracking/BlurPieceL.java new file mode 100644 index 00000000..bca39fac --- /dev/null +++ b/Robust/src/Benchmarks/Scheduling/Tracking/BlurPieceL.java @@ -0,0 +1,141 @@ +public class BlurPieceL { + flag toblur; + flag toaddBP; + flag finish; + + /* current processing image related */ + int[] m_image; + int m_rows; + int m_cols; + + /* results related */ + float[] m_result; + int m_rows_rs; + int m_rows_re; + int m_cols_r; + + /* id indicating the piece # */ + int m_id; + int m_range; + + /* constructor */ + public BlurPieceL(int id, + int range, + int[] data) { + this.m_id = id; + this.m_range = range; + this.m_image = data; + this.m_rows = data[0]; + this.m_cols = data[1]; + } + + public int getId() { + return this.m_id; + } + + public int getRows() { + return this.m_rows; + } + + public int getCols() { + return this.m_cols; + } + + public float[] getResult() { + return this.m_result; + } + + public int getRowsRS() { + return this.m_rows_rs; + } + + public int getRowsRE() { + return this.m_rows_re; + } + + public int getColsR() { + return this.m_cols_r; + } + + public void blur() { + int rows, cols; + float temp; + int[] kernel, imageIn; + int rows_k, cols_k; + int k, i, j; + int kernelSize, startCol, endCol, halfKernel, startRow, endRow, kernelSum; + int[] inputs; + float[] image; + + inputs = this.m_image; + rows = this.m_rows; + cols = this.m_cols; + this.m_rows_rs = this.m_id * this.m_range; + this.m_rows_re = (this.m_id + 1) * this.m_range; + if(rows < this.m_rows_re) { + this.m_rows_re = rows; + } + this.m_cols_r = this.m_cols; + image = this.m_result = new float[(this.m_rows_re-this.m_rows_rs)*cols]; + + kernel = new int[5]; + rows_k = 1; + cols_k = 5; + + kernel[0] = 1; + kernel[1] = 4; + kernel[2] = 6; + kernel[3] = 4; + kernel[4] = 1; + + kernelSize = 5; + kernelSum = 16; + + startCol = 2; //((kernelSize)/2); + endCol = cols - 2; //round(cols - (kernelSize/2)); + halfKernel = 2; //(kernelSize-1)/2; + + if((this.m_rows_re <= 2) || (this.m_rows_rs >= rows - 2)) { + return; + } + startRow = (2>this.m_rows_rs)?2:(this.m_rows_rs); //(kernelSize)/2; + endRow = ((rows-2)