-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compresion #12
Compresion #12
Conversation
// Constructor for compressor | ||
SC_HAS_PROCESS(jpg_output); | ||
jpg_output(sc_module_name jpg_compressor, int im_rows = 480, int im_cols = 640): sc_module(jpg_compressor){ | ||
if(im_rows%Block_rows==0) {image_rows=im_rows;} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to use common single line notation like:
if (im_rows % Block_rows == 0) image_rows=im_rows;
* *5. Entropy compression by variable length encoding (huffman). Used to maximize compression. Not implemented here. | ||
*/ | ||
#define PI 3.1415926535897932384626433832795 | ||
#define Block_rows 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constants must be always in UPPER_CASE
*/ | ||
#define PI 3.1415926535897932384626433832795 | ||
#define Block_rows 8 | ||
#define Block_cols 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constants must be always in UPPER_CASE
SC_MODULE (jpg_output) { | ||
|
||
//input signals | ||
sc_in<sc_int<32> > PixelValue_signal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use consistent notation for methods and variable names like camelCase, snake_case, or PascalCase.
sc_in<sc_int<32> > col_signal; | ||
|
||
//output signals | ||
sc_out<sc_int<8> > Element_signal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use consistent notation for methods and variable names like camelCase, snake_case, or PascalCase.
double* image; | ||
int image_rows = 480; | ||
int image_cols = 640; | ||
signed char EOB = 127; // end of block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use consistent notation for methods and variable names like camelCase, snake_case, or PascalCase.
} // End of Constructor | ||
|
||
//------------Code Starts Here------------------------- | ||
void Starter() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use consistent notation for methods and variable names like camelCase, snake_case, or PascalCase.
} | ||
} | ||
|
||
void InputPixel() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use consistent notation for methods and variable names like camelCase, snake_case, or PascalCase.
// *Pixel = int(i_row[col]); | ||
//} | ||
|
||
void OutputByte() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use consistent notation for methods and variable names like camelCase, snake_case, or PascalCase.
} | ||
} | ||
|
||
void JPEG_compression() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use consistent notation for methods and variable names like camelCase, snake_case, or PascalCase.
image[i]=image[i]-128; | ||
} | ||
wait(100, SC_NS); | ||
int Number_of_blocks = image_rows*image_cols/(Block_rows*Block_cols); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use consistent notation for methods and variable names like camelCase, snake_case, or PascalCase.
} | ||
} | ||
|
||
void Quantization(int row_offset, int col_offset) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use consistent notation for methods and variable names like camelCase, snake_case, or PascalCase.
while(true) { | ||
wait(starter_event); | ||
int im_rows = row_signal.read(); | ||
if(im_rows%Block_rows==0) {image_rows=im_rows;} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to use common single-line notation like:
if (im_rows % Block_rows == 0) image_rows = im_rows;
This review applies to the code in general. |
agregando el modulo de compresion