Skip to content
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

Merged
merged 2 commits into from
Jun 11, 2024
Merged

Compresion #12

merged 2 commits into from
Jun 11, 2024

Conversation

facruzso
Copy link
Collaborator

agregando el modulo de compresion

@facruzso facruzso merged commit d81c21e into dev Jun 11, 2024
@ErickOF ErickOF added the enhancement New feature or request label Jun 11, 2024
// 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;}
Copy link
Owner

@ErickOF ErickOF Jun 11, 2024

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
Copy link
Owner

@ErickOF ErickOF Jun 11, 2024

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
Copy link
Owner

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;
Copy link
Owner

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;
Copy link
Owner

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
Copy link
Owner

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() {
Copy link
Owner

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() {
Copy link
Owner

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() {
Copy link
Owner

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() {
Copy link
Owner

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);
Copy link
Owner

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) {
Copy link
Owner

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;}
Copy link
Owner

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;

@ErickOF
Copy link
Owner

ErickOF commented Jun 11, 2024

This review applies to the code in general.

@ErickOF ErickOF added this to the project1 milestone Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants