Skip to content
Snippets Groups Projects
Commit 6aa88cc6 authored by Vipin Thomas's avatar Vipin Thomas
Browse files

Update pixel.cpp

parent 06c200a5
No related branches found
No related tags found
No related merge requests found
...@@ -8,22 +8,19 @@ using namespace std; ...@@ -8,22 +8,19 @@ using namespace std;
typedef ap_axis<32,0,0,0> pkt_t; typedef ap_axis<32,0,0,0> pkt_t;
static int count_streams = 0; static int count_streams = 0;
static long long charIn=0; static long long charIn=0;
//static int decrpyt=0; int addNum=0;
//static long long asciiNum=0;
//static int asciiVal=0;
long long convert(int n); long long convert(int n);
long long toAscii(chr number); long long toAscii(char number);
int convertBinInt(long long n); int convertBinInt(long long n);
void stegnoDcrypt(int data);
int stegno(int data);
void pixel( void pixel(
ap_int<32> position1, ap_int<32> position1,
ap_int<32> position2, ap_int<32> position2,
ap_int<32> stream_count, ap_int<32> stream_count,
ap_int<32> character, ap_int<32> character,
ap_int<32> selector,
hls::stream< pkt_t > &din, hls::stream< pkt_t > &din,
hls::stream< pkt_t > &dout hls::stream< pkt_t > &dout
) { ) {
...@@ -32,7 +29,6 @@ void pixel( ...@@ -32,7 +29,6 @@ void pixel(
#pragma HLS INTERFACE s_axilite port=position2 #pragma HLS INTERFACE s_axilite port=position2
#pragma HLS INTERFACE s_axilite port=stream_count #pragma HLS INTERFACE s_axilite port=stream_count
#pragma HLS INTERFACE s_axilite port=character #pragma HLS INTERFACE s_axilite port=character
#pragma HLS INTERFACE s_axilite port=selector
#pragma HLS INTERFACE axis port=din #pragma HLS INTERFACE axis port=din
#pragma HLS INTERFACE axis port=dout #pragma HLS INTERFACE axis port=dout
...@@ -43,57 +39,26 @@ void pixel( ...@@ -43,57 +39,26 @@ void pixel(
if((count_streams >= 3 * (position1 - 1)) && (count_streams < 3 * (position2))){ if((count_streams >= 3 * (position1 - 1)) && (count_streams < 3 * (position2))){
pkt.data=stegno(pkt.data); addNum=charIn%10;
charIn=(int)charIn/10;
} pkt.data-=addNum;
// switch(selector)
// {
// case 0:
// pkt.data=stegno(character,pkt.data,position1,position2);
// break;
// case 1: }
// stegnoDecrypt(pkt.data);
// break;
// default:
// break;
// }
count_streams++; count_streams++;
if (count_streams == stream_count){ if (count_streams == stream_count){
count_streams = 0; count_streams = 0;
charIn=0; charIn=0;
// asciiVal= convertBinInt(asciiNum); addNum=0;
// pkt.data=asciiVal;
// dout.write(pkt);
}
// pending: have to make count=0 when TLAST signal is active - for w not in the range of 0 to n(size of the array) }
//(count_streams==(position1+3*count_streams*w))&&((position1+3*count_streams*w) < position2) || (count_streams2==(position1
//+3*count_streams*w)) && ((position2-3*count_streams*w) > position1)
dout.write(pkt); dout.write(pkt);
} }
int stegno(int data){
int addNum=charIn%10;
charIn=(int)charIn/10;
return convertBinInt((convert(data)/10)*10+addNum);
}
//void stegnoDcrypt(int data){
//
// decrpyt=convert(data)%10;
//
// asciiNum=asciiNum*10+decrpyt;
//
//}
long long convert(int n) { long long convert(int n) {
long long bin = 0; long long bin = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment