Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Embedded Acceleration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vipin Thomas
Embedded Acceleration
Commits
82c8b760
Commit
82c8b760
authored
3 years ago
by
Vipin Thomas
Browse files
Options
Downloads
Patches
Plain Diff
Update pixel.cpp
parent
f28b6f0e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pixel.cpp
+26
-26
26 additions, 26 deletions
pixel.cpp
with
26 additions
and
26 deletions
pixel.cpp
+
26
−
26
View file @
82c8b760
...
@@ -9,9 +9,9 @@ typedef ap_axis<32,0,0,0> pkt_t;
...
@@ -9,9 +9,9 @@ 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
addNum
=
0
;
static
int
addNum
=
0
;
static
int
decrpyt
=
0
;
//
static int decrpyt=0;
static
long
long
asciiNum
=
0
;
//
static long long asciiNum=0;
static
int
asciiVal
=
0
;
//
static int asciiVal=0;
long
long
convert
(
int
n
);
long
long
convert
(
int
n
);
long
long
toAscii
(
chr
number
);
long
long
toAscii
(
chr
number
);
...
@@ -38,28 +38,28 @@ void pixel(
...
@@ -38,28 +38,28 @@ void pixel(
#pragma HLS INTERFACE axis port=dout
#pragma HLS INTERFACE axis port=dout
pkt_t
pkt
=
din
.
read
();
pkt_t
pkt
=
din
.
read
();
pkt
.
data
=
stegno
(
character
,
pkt
.
data
,
position1
,
position2
);
// switch(selector)
// {
// case 0:
// pkt.data=stegno(character,pkt.data,position1,position2);
// break;
switch
(
selector
)
// case 1:
{
// stegnoDecrypt(pkt.data);
case
0
:
// break;
pkt
.
data
=
stegno
(
character
,
pkt
.
data
,
position1
,
position2
);
break
;
case
1
:
// default:
stegnoDecrypt
(
pkt
.
data
);
// break;
break
;
// }
default:
break
;
}
count_streams
++
;
count_streams
++
;
if
(
count_streams
==
stream_count
){
if
(
count_streams
==
stream_count
){
count_streams
=
0
;
count_streams
=
0
;
asciiVal
=
convertBinInt
(
asciiNum
);
//
asciiVal= convertBinInt(asciiNum);
pkt
.
data
=
asciiVal
;
//
pkt.data=asciiVal;
dout
.
write
(
pkt
);
//
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)
// 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)
...
@@ -72,7 +72,7 @@ void pixel(
...
@@ -72,7 +72,7 @@ void pixel(
int
stegno
(
int
c
,
int
data
,
int
position1
,
int
position2
){
int
stegno
(
int
c
,
int
data
,
int
position1
,
int
position2
){
charIn
=
toAscii
((
char
)
c
);
charIn
=
toAscii
((
char
)
c
);
if
((
count_streams
>
3
*
(
position1
-
1
))
&&
(
count_streams
<
3
*
(
position2
))){
if
((
count_streams
>
=
3
*
(
position1
-
1
))
&&
(
count_streams
<
3
*
(
position2
))){
addNum
=
charIn
%
10
;
addNum
=
charIn
%
10
;
charIn
=
(
int
)
charIn
/
10
;
charIn
=
(
int
)
charIn
/
10
;
...
@@ -82,13 +82,13 @@ int stegno(int c,int data,int position1,int position2){
...
@@ -82,13 +82,13 @@ int stegno(int c,int data,int position1,int position2){
}
}
void
stegnoDcrypt
(
int
data
){
//
void stegnoDcrypt(int data){
//
decrpyt
=
convert
(
data
)
%
10
;
//
decrpyt=convert(data)%10;
//
asciiNum
=
asciiNum
*
10
+
decrpyt
;
//
asciiNum=asciiNum*10+decrpyt;
//
}
//
}
long
long
convert
(
int
n
)
{
long
long
convert
(
int
n
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment