comparison Meerwald/cmp_dct8x8.c @ 8:f83ef905a63d

fixing many warnings increase capacity for coordinates in bruyn fix some uninit. variables
author Peter Meerwald <pmeerw@cosy.sbg.ac.at>
date Tue, 22 Apr 2008 13:36:05 +0200
parents be303a3f5ea8
children bd669312f068
comparison
equal deleted inserted replaced
7:2b350281f8b0 8:f83ef905a63d
95 if (argc > 1) { 95 if (argc > 1) {
96 usage(); 96 usage();
97 exit(1); 97 exit(1);
98 } 98 }
99 99
100 if (argc == 1 && *argv[0] != '-') 100 if (argc == 1 && *argv[0] != '-') {
101 if ((in = fopen(argv[0], "rb")) == NULL) { 101 if ((in = fopen(argv[0], "rb")) == NULL) {
102 fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]); 102 fprintf(stderr, "%s: unable to open input file %s\n", progname, argv[0]);
103 exit(1); 103 exit(1);
104 } 104 }
105 else 105 else
106 strcpy(input_name, argv[0]); 106 strcpy(input_name, argv[0]);
107 107 }
108
108 if (!orig) { 109 if (!orig) {
109 fprintf(stderr, "%s: original image file not specified, use -i file option\n", progname); 110 fprintf(stderr, "%s: original image file not specified, use -i file option\n", progname);
110 exit(1); 111 exit(1);
111 } 112 }
112 113
117 if (in_cols != orig_cols || in_rows != orig_rows) { 118 if (in_cols != orig_cols || in_rows != orig_rows) {
118 fprintf(stderr, "%s: input image %s does not match dimensions of original image %s\n", progname, input_name, orig_name); 119 fprintf(stderr, "%s: input image %s does not match dimensions of original image %s\n", progname, input_name, orig_name);
119 exit(1); 120 exit(1);
120 } 121 }
121 122
123 cols = in_cols;
124 rows = in_rows;
125 format = in_format;
126 maxval = in_maxval;
127
122 if (cols % NJPEG) { 128 if (cols % NJPEG) {
123 fprintf(stderr, "%s: image width %d not a multiple of %d\n", progname, cols, NJPEG); 129 fprintf(stderr, "%s: image width %d not a multiple of %d\n", progname, cols, NJPEG);
124 exit(1); 130 exit(1);
125 } 131 }
126 132
127 if (rows % NJPEG) { 133 if (rows % NJPEG) {
128 fprintf(stderr, "%s: image height %d not a multiple of %d\n", progname, rows, NJPEG); 134 fprintf(stderr, "%s: image height %d not a multiple of %d\n", progname, rows, NJPEG);
129 exit(1); 135 exit(1);
130 } 136 }
131
132 cols = in_cols;
133 rows = in_rows;
134 format = in_format;
135 maxval = in_maxval;
136 137
137 input_image = pgm_allocarray(cols, NJPEG); 138 input_image = pgm_allocarray(cols, NJPEG);
138 orig_image = pgm_allocarray(cols, NJPEG); 139 orig_image = pgm_allocarray(cols, NJPEG);
139 140
140 init_dct_8x8(); 141 init_dct_8x8();

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.