step2.c

来自「基于4个mips核的noc设计」· C语言 代码 · 共 47 行

C
47
字号
/**************************************************************** *  TU Eindhoven, Eindhoven, The Netherlands, November 2003 *  Author  :   Mathijs Visser *              (Mathijs.Visser@student.tue.nl) *  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 + =
减小字号Ctrl + -
显示快捷键?