PandA-2024.02
jpeg2bmp.c
Go to the documentation of this file.
1 /*
2 +--------------------------------------------------------------------------+
3 | CHStone : a suite of benchmark programs for C-based High-Level Synthesis |
4 | ======================================================================== |
5 | |
6 | * Collected and Modified : Y. Hara, H. Tomiyama, S. Honda, |
7 | H. Takada and K. Ishii |
8 | Nagoya University, Japan |
9 | |
10 | * Remark : |
11 | 1. This source code is modified to unify the formats of the benchmark |
12 | programs in CHStone. |
13 | 2. Test vectors are added for CHStone. |
14 | 3. If "main_result" is 0 at the end of the program, the program is |
15 | correctly executed. |
16 | 4. Please follow the copyright of each benchmark program. |
17 +--------------------------------------------------------------------------+
18 */
19 /*
20  * Copyright (C) 2008
21  * Y. Hara, H. Tomiyama, S. Honda, H. Takada and K. Ishii
22  * Nagoya University, Japan
23  * All rights reserved.
24  *
25  * Disclaimer of Warranty
26  *
27  * These software programs are available to the user without any license fee or
28  * royalty on an "as is" basis. The authors disclaims any and all warranties,
29  * whether express, implied, or statuary, including any implied warranties or
30  * merchantability or of fitness for a particular purpose. In no event shall the
31  * copyright-holder be liable for any incidental, punitive, or consequential damages
32  * of any kind whatsoever arising from the use of these programs. This disclaimer
33  * of warranty extends to the user of these programs and user's customers, employees,
34  * agents, transferees, successors, and assigns.
35  *
36  */
37 /*
38  * Transformation: JPEG -> BMP
39  *
40  * @(#) $Id: jpeg2bmp.c,v 1.2 2003/07/18 10:19:21 honda Exp $
41  */
42 
43 /*
44  * Buffer for reading JPEG file
45  */
46 unsigned char JpegFileBuf[JPEG_FILE_SIZE];
47 
48 
49 int
51 {
52  int ci;
53  unsigned char *c;
54  int i, j;
55 
56  /*
57  * Store input data in buffer
58  */
59  c = JpegFileBuf;
60  for (i = 0; i < JPEGSIZE; i++)
61 
62  {
63  ci = hana_jpg[i];
64  *c++ = ci;
65  }
66 
68 
69  for (i = 0; i < RGB_NUM; i++)
70  {
71  for (j = 0; j < BMP_OUT_SIZE; j++)
72  {
73  if (OutData_comp_buf[i][j] != hana_bmp[i][j])
74  {
75  main_result++;
76  }
77  }
78  }
80  {
81  main_result++;
82  }
84  {
85  main_result++;
86  }
87  return (0);
88 }
unsigned char JpegFileBuf[JPEG_FILE_SIZE]
Definition: jpeg2bmp.c:46
int OutData_image_width
Definition: init.h:42
#define JPEG_FILE_SIZE
Definition: global.h:51
const unsigned char hana_jpg[JPEGSIZE]
Definition: init.h:59
int main_result
Definition: mips.c:38
#define JPEGSIZE
Definition: init.h:57
int out_length
Definition: init.h:1266
int out_width
Definition: init.h:1265
void jpeg_read(unsigned char *read_buf)
Definition: jfif_read.c:89
const unsigned char hana_bmp[RGB_NUM][BMP_OUT_SIZE]
Definition: init.h:385
#define BMP_OUT_SIZE
Definition: global.h:56
#define RGB_NUM
Definition: decode.h:57
int OutData_image_height
Definition: init.h:43
int jpeg2bmp_main()
Definition: jpeg2bmp.c:50
unsigned char OutData_comp_buf[RGB_NUM][BMP_OUT_SIZE]
Definition: init.h:46

Generated on Mon Feb 12 2024 13:02:49 for PandA-2024.02 by doxygen 1.8.13