📄 step2.c
字号:
/****************************************************************
* TU Eindhoven, Eindhoven, The Netherlands, June 2005
* Author : Jose Prats
* (jprats@step.es)
* Purpose : Perform the inverse DCT coding step of the JPEG
* decompression.
****************************************************************/
#include "jpeg.h"
#include "mtools.h" /* For mprintf() */
#include "stdcomm.h"
#include "fast_int_idct.h"
void main (void)
{
FBlock input;
PBlock output;
int blocks_remain; /* A value of zero is used by step1 to tell us that there are no more FBlocks.*/
int i = 0; /* Number of the current block. */
sc_my_address = 2; /* Set node number. */
if (verbose) {
mprintf("Processor Step%d up and running!\n", sc_my_address);
};
/* Process all blocks that we receive.*/
sc_receive(&blocks_remain, sizeof(int)); /* Check if there is at least one block. */
while(blocks_remain) {
sc_receive(&input, sizeof(FBlock)); /* Receive a block from the previous node:*/
if (verbose) {
mprintf("Received block %d...", i++);
};
IDCT(&input, &output);
if (verbose) {
mprintf(" IDCT performed...");
};
sc_send(ADDR_STEP2TO3, &output, sizeof(PBlock)); /* Send result to next node:*/
if (verbose) {
mprintf(" sent.\n");
};
sc_receive(&blocks_remain, sizeof(int)); /* Check if we are done. */
};
if (verbose) {
mprintf("All done!\n");
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -