Mercurial > mplayer.hg
annotate libvo/vo_svga.c @ 507:6a3d6d7b3996
redirector for DVD related topics ;-)
author | lgb |
---|---|
date | Wed, 18 Apr 2001 19:10:05 +0000 |
parents | a77e23145686 |
children | 77e0094f0cce |
rev | line source |
---|---|
285 | 1 /* |
292 | 2 Video driver for SVGAlib - alpha, slow |
285 | 3 by Zoltan Mark Vician <se7en@sch.bme.hu> |
381 | 4 Code started: Mon Apr 1 23:25:47 2001 |
407 | 5 |
6 Uses HW acceleration if your card is supported by SVGAlib. | |
285 | 7 */ |
8 | |
9 #include <stdio.h> | |
10 #include <stdlib.h> | |
11 | |
12 #include <vga.h> | |
13 #include <vgagl.h> | |
14 | |
485 | 15 #include <limits.h> |
16 | |
285 | 17 #include "config.h" |
18 #include "video_out.h" | |
19 #include "video_out_internal.h" | |
20 | |
21 #include "yuv2rgb.h" | |
377 | 22 #include "mmx.h" |
285 | 23 |
407 | 24 extern void rgb15to16_mmx(char* s0,char* d0,int count); |
485 | 25 extern int vo_dbpp; |
504 | 26 extern int verbose; |
407 | 27 |
285 | 28 LIBVO_EXTERN(svga) |
29 | |
30 static vo_info_t vo_info = { | |
31 "SVGAlib", | |
32 "svga", | |
33 "Zoltan Mark Vician <se7en@sch.bme.hu>", | |
34 "" | |
35 }; | |
36 | |
37 // SVGAlib definitions | |
38 | |
39 GraphicsContext *screen; | |
40 GraphicsContext *virt; | |
41 | |
407 | 42 static uint8_t *scalebuf = NULL, *yuvbuf = NULL, *bppbuf = NULL; |
285 | 43 |
44 static uint32_t orig_w, orig_h, maxw, maxh; // Width, height | |
377 | 45 static float scaling = 1.0; |
285 | 46 static uint32_t x_pos, y_pos; // Position |
47 | |
483 | 48 // SVGAlib - list of detected modes |
49 typedef struct vga_modelist_s { | |
50 uint16_t modenum; | |
51 vga_modeinfo modeinfo; | |
52 struct vga_modelist_s *next; | |
53 } vga_modelist_t; | |
447 | 54 |
483 | 55 vga_modelist_t *modelist = NULL; |
56 | |
327 | 57 static uint8_t bpp; |
483 | 58 static uint8_t bpp_conv = 0; |
448
198b46b739d8
qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents:
447
diff
changeset
|
59 static uint32_t pformat; |
447 | 60 |
483 | 61 #define BPP_15 1 |
62 #define BPP_16 2 | |
63 #define BPP_24 4 | |
64 #define BPP_32 8 | |
65 static uint8_t bpp_avail = 0; | |
66 | |
285 | 67 static uint8_t checked = 0; |
483 | 68 |
485 | 69 static uint32_t add_mode(uint16_t mode, vga_modeinfo minfo) { |
483 | 70 vga_modelist_t *list; |
285 | 71 |
483 | 72 if (modelist == NULL) { |
485 | 73 modelist = (vga_modelist_t *) malloc(sizeof(vga_modelist_t)); |
483 | 74 if (modelist == NULL) { |
75 printf("vo_svga: add_mode() failed. Not enough memory for modelist."); | |
76 return(1); // error | |
77 } | |
485 | 78 modelist->modenum = mode; |
79 modelist->modeinfo = minfo; | |
80 modelist->next = NULL; | |
483 | 81 } else { |
82 list = modelist; | |
83 while (list->next != NULL) | |
84 list = list->next; | |
485 | 85 list->next = (vga_modelist_t *) malloc(sizeof(vga_modelist_t)); |
483 | 86 if (list->next == NULL) { |
87 printf("vo_svga: add_mode() failed. Not enough memory for modelist."); | |
88 return(1); // error | |
89 } | |
90 list = list->next; | |
91 list->modenum = mode; | |
92 list->modeinfo = minfo; | |
93 list->next = NULL; | |
94 } | |
485 | 95 return (0); |
483 | 96 } |
97 | |
98 static int checksupportedmodes() { | |
485 | 99 uint16_t i, max; |
483 | 100 vga_modeinfo *minfo; |
285 | 101 |
102 checked = 1; | |
103 vga_init(); | |
104 vga_disabledriverreport(); | |
485 | 105 max = vga_lastmodenumber(); |
106 for (i = 1; i < max; i++) | |
483 | 107 if (vga_hasmode(i) > 0) { |
108 minfo = vga_getmodeinfo(i); | |
109 switch (minfo->colors) { | |
110 case 32768: bpp_avail |= BPP_15; break; | |
111 case 65536: bpp_avail |= BPP_16; break; | |
112 } | |
113 switch (minfo->bytesperpixel) { | |
114 case 3: bpp_avail |= BPP_24; break; | |
115 case 4: bpp_avail |= BPP_32; break; | |
116 } | |
504 | 117 if (verbose >= 2) |
118 printf("vo_svga: Mode found: %s\n",vga_getmodename(i)); | |
483 | 119 if (add_mode(i, *minfo)) |
120 return(1); | |
121 } | |
485 | 122 return(0); |
285 | 123 } |
124 | |
125 static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, | |
126 uint32_t d_height, uint32_t fullscreen, char *title, | |
127 uint32_t format) { | |
483 | 128 uint32_t req_w = (d_width > 0 ? d_width : width); |
129 uint32_t req_h = (d_height > 0 ? d_height : height); | |
130 uint16_t vid_mode = 0; | |
131 uint8_t widescreen = (((req_w*1.0)/req_h) > (4.0/3)) ? 1 : 0; | |
485 | 132 uint16_t buf_w = USHRT_MAX, buf_h = USHRT_MAX; |
483 | 133 vga_modelist_t *list = modelist; |
387 | 134 |
285 | 135 if (!checked) { |
485 | 136 if (checksupportedmodes()) // Looking for available video modes |
483 | 137 return(1); |
285 | 138 } |
407 | 139 |
483 | 140 bpp_avail = 0; |
141 while (list != NULL) { | |
142 if ((list->modeinfo.width >= req_w) && (list->modeinfo.height >= req_h)) { | |
143 switch (list->modeinfo.colors) { | |
144 case 32768: bpp_avail |= BPP_15; break; | |
145 case 65536: bpp_avail |= BPP_16; break; | |
146 } | |
147 switch (list->modeinfo.bytesperpixel) { | |
148 case 3: bpp_avail |= BPP_24; break; | |
149 case 4: bpp_avail |= BPP_32; break; | |
150 } | |
151 } | |
152 list = list->next; | |
153 } | |
154 | |
285 | 155 pformat = format; |
411 | 156 |
483 | 157 // bpp check |
158 bpp_conv = 0; | |
411 | 159 if (!vo_dbpp) { |
160 if (format == IMGFMT_YV12) bpp = 32; | |
161 else bpp = format & 255; | |
504 | 162 if (verbose) |
163 printf("vo_svga: vo_dbpp == 0, bpp: %d\n",bpp); | |
483 | 164 switch (bpp) { |
165 case 32: if (!(bpp_avail & BPP_32)) { | |
166 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp); | |
485 | 167 printf("vo_svga: Maybe you should try -bpp\n"); |
483 | 168 return(1); |
169 } | |
170 break; | |
171 case 24: if (!(bpp_avail & BPP_24)) | |
172 if (!(bpp_avail & BPP_32)) { | |
173 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp); | |
485 | 174 printf("vo_svga: Maybe you should try -bpp\n"); |
483 | 175 return(1); |
176 } else { | |
177 bpp = 32; | |
178 bpp_conv = 1; | |
504 | 179 if (verbose) |
180 printf("vo_svga: BPP conversion 24->32\n"); | |
483 | 181 } |
182 break; | |
183 case 16: if (!(bpp_avail & BPP_16)) { | |
184 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp); | |
185 printf("vo_svga: Maybe you should try -bpp\n"); | |
186 return(1); | |
187 } | |
188 break; | |
189 case 15: if (!(bpp_avail & BPP_15)) | |
190 if (!(bpp_avail & BPP_16)) { | |
191 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp); | |
192 printf("vo_svga: Maybe you should try -bpp\n"); | |
193 return(1); | |
194 } else { | |
195 bpp = 16; | |
196 bpp_conv = 1; | |
504 | 197 if (verbose) |
198 printf("vo_svga: BPP conversion 15->16\n"); | |
483 | 199 } |
200 break; | |
201 } | |
411 | 202 } else { |
203 bpp = vo_dbpp; | |
504 | 204 if (verbose) |
205 printf("vo_svga: vo_dbpp == %d\n",bpp); | |
411 | 206 switch (bpp) { |
483 | 207 case 32: if (!(bpp_avail & BPP_32)) { |
485 | 208 printf("vo_svga: %dbpp not supported in %dx%d (or larger resoltuion) by HW or SVGAlib\n",bpp,req_w,req_h); |
411 | 209 return(1); |
210 } | |
485 | 211 break; |
483 | 212 case 24: if (!(bpp_avail & BPP_24)) { |
485 | 213 printf("vo_svga: %dbpp not supported in %dx%d (or larger resoltuion) by HW or SVGAlib\n",bpp,req_w,req_h); |
411 | 214 return(1); |
215 } | |
485 | 216 break; |
483 | 217 case 16: if (!(bpp_avail & BPP_16)) { |
485 | 218 printf("vo_svga: %dbpp not supported in %dx%d (or larger resoltuion) by HW or SVGAlib\n",bpp,req_w,req_h); |
411 | 219 return(1); |
220 } | |
485 | 221 break; |
483 | 222 case 15: if (!(bpp_avail & BPP_15)) { |
485 | 223 printf("vo_svga: %dbpp not supported in %dx%d (or larger resoltuion) by HW or SVGAlib\n",bpp,req_w,req_h); |
411 | 224 return(1); |
225 } | |
485 | 226 break; |
411 | 227 } |
228 } | |
483 | 229 |
230 list = modelist; | |
504 | 231 if (verbose) { |
232 printf("vo_svga: Looking for the best resolution...\n"); | |
233 printf("vo_svga: req_w: %d, req_h: %d, bpp: %d\n",req_w,req_h,bpp); | |
234 } | |
485 | 235 while (list != NULL) { |
483 | 236 if ((list->modeinfo.width >= req_w) && (list->modeinfo.height >= req_h)) { |
504 | 237 if (verbose) { |
238 switch (list->modeinfo.colors) { | |
239 case 32768: printf("vo_svga: vid_mode: %d, %dx%d 15bpp\n",list->modenum,list->modeinfo.width,list->modeinfo.height); | |
240 break; | |
241 case 65536: printf("vo_svga: vid_mode: %d, %dx%d 16bpp\n",list->modenum,list->modeinfo.width,list->modeinfo.height); | |
242 break; | |
243 } | |
244 switch (list->modeinfo.bytesperpixel) { | |
245 case 3: printf("vo_svga: vid_mode: %d, %dx%d 24bpp\n",list->modenum,list->modeinfo.width,list->modeinfo.height); | |
246 break; | |
247 case 4: printf("vo_svga: vid_mode: %d, %dx%d 32bpp\n",list->modenum,list->modeinfo.width,list->modeinfo.height); | |
248 break; | |
249 } | |
250 } | |
285 | 251 switch (bpp) { |
483 | 252 case 32: if (list->modeinfo.bytesperpixel == 4) |
485 | 253 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) { |
254 vid_mode = list->modenum; | |
255 buf_w = list->modeinfo.width; | |
256 buf_h = list->modeinfo.height; | |
257 } | |
258 break; | |
483 | 259 case 24: if (list->modeinfo.bytesperpixel == 3) |
485 | 260 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) { |
261 vid_mode = list->modenum; | |
262 buf_w = list->modeinfo.width; | |
263 buf_h = list->modeinfo.height; | |
264 } | |
265 break; | |
483 | 266 case 16: if (list->modeinfo.colors == 65536) |
485 | 267 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) { |
268 vid_mode = list->modenum; | |
269 buf_w = list->modeinfo.width; | |
270 buf_h = list->modeinfo.height; | |
271 } | |
272 break; | |
483 | 273 case 15: if (list->modeinfo.colors == 32768) |
485 | 274 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) { |
275 vid_mode = list->modenum; | |
276 buf_w = list->modeinfo.width; | |
277 buf_h = list->modeinfo.height; | |
278 } | |
279 break; | |
285 | 280 } |
483 | 281 } |
282 list = list->next; | |
407 | 283 } |
485 | 284 |
504 | 285 if (verbose) |
286 printf("vo_svga: vid_mode: %d\n",vid_mode); | |
407 | 287 vga_setlinearaddressing(); |
485 | 288 if (vga_setmode(vid_mode) == -1) { |
286 | 289 printf("vo_svga: vga_setmode(%d) failed.\n",vid_mode); |
483 | 290 uninit(); |
285 | 291 return(1); // error |
485 | 292 } |
293 if (gl_setcontextvga(vid_mode)) { | |
286 | 294 printf("vo_svga: gl_setcontextvga(%d) failed.\n",vid_mode); |
483 | 295 uninit(); |
285 | 296 return(1); // error |
286 | 297 } |
285 | 298 screen = gl_allocatecontext(); |
299 gl_getcontext(screen); | |
485 | 300 if (gl_setcontextvgavirtual(vid_mode)) { |
286 | 301 printf("vo_svga: gl_setcontextvgavirtual(%d) failed.\n",vid_mode); |
483 | 302 uninit(); |
285 | 303 return(1); // error |
286 | 304 } |
285 | 305 virt = gl_allocatecontext(); |
306 gl_getcontext(virt); | |
307 gl_setcontext(virt); | |
308 gl_clearscreen(0); | |
309 | |
485 | 310 if (bpp_conv) { |
483 | 311 bppbuf = malloc(maxw * maxh * BYTESPERPIXEL); |
485 | 312 if (bppbuf == NULL) { |
313 printf("vo_svga: bppbuf -> Not enough memory for buffering!\n"); | |
314 uninit(); | |
315 return (1); | |
316 } | |
483 | 317 } |
318 | |
285 | 319 orig_w = width; |
320 orig_h = height; | |
343 | 321 if ((fullscreen & 0x04) && (WIDTH != orig_w)) { |
483 | 322 if (!widescreen) { |
292 | 323 maxh = HEIGHT; |
324 scaling = maxh / (orig_h * 1.0); | |
325 maxw = (uint32_t) (orig_w * scaling); | |
326 scalebuf = malloc(maxw * maxh * BYTESPERPIXEL); | |
483 | 327 if (scalebuf == NULL) { |
485 | 328 printf("vo_svga: scalebuf -> Not enough memory for buffering!\n"); |
407 | 329 uninit(); |
330 return (1); | |
331 } | |
292 | 332 } else { |
333 maxw = WIDTH; | |
334 scaling = maxw / (orig_w * 1.0); | |
335 maxh = (uint32_t) (orig_h * scaling); | |
336 scalebuf = malloc(maxw * maxh * BYTESPERPIXEL); | |
483 | 337 if (scalebuf == NULL) { |
485 | 338 printf("vo_svga: scalebuf -> Not enough memory for buffering!\n"); |
407 | 339 uninit(); |
340 return (1); | |
341 } | |
292 | 342 } |
285 | 343 } else { |
344 maxw = orig_w; | |
345 maxh = orig_h; | |
346 } | |
347 x_pos = (WIDTH - maxw) / 2; | |
348 y_pos = (HEIGHT - maxh) / 2; | |
349 | |
350 if (pformat == IMGFMT_YV12) { | |
351 yuv2rgb_init(bpp, MODE_RGB); | |
352 yuvbuf = malloc(maxw * maxh * BYTESPERPIXEL); | |
483 | 353 if (yuvbuf == NULL) { |
485 | 354 printf("vo_svga: yuvbuf -> Not enough memory for buffering!\n"); |
407 | 355 uninit(); |
356 return (1); | |
357 } | |
285 | 358 } |
377 | 359 |
504 | 360 printf("vo_svga: SVGAlib resolution: %dx%d %dbpp - ", WIDTH, HEIGHT, bpp); |
293 | 361 if (maxw != orig_w || maxh != orig_h) printf("Video scaled to: %dx%d\n",maxw,maxh); |
285 | 362 else printf("No video scaling\n"); |
363 | |
364 return (0); | |
365 } | |
366 | |
367 static uint32_t query_format(uint32_t format) { | |
485 | 368 uint32_t res = 0; |
407 | 369 |
483 | 370 if (!checked) { |
371 if (checksupportedmodes()) // Looking for available video modes | |
372 return(0); | |
373 } | |
485 | 374 |
375 // if (vo_dbpp) => There is NO conversion!!! | |
376 if (vo_dbpp) { | |
377 switch (vo_dbpp) { | |
488 | 378 case 32: if ((format == IMGFMT_RGB32) || (format == IMGFMT_BGR32)) |
485 | 379 return ((bpp_avail & BPP_32) ? 1 : 0); |
380 break; | |
488 | 381 case 24: if ((format == IMGFMT_RGB24) || (format == IMGFMT_BGR24)) |
485 | 382 return ((bpp_avail & BPP_24) ? 1 : 0); |
383 break; | |
488 | 384 case 16: if ((format == IMGFMT_RGB16) || (format == IMGFMT_BGR16)) |
485 | 385 return ((bpp_avail & BPP_16) ? 1 : 0); |
386 break; | |
488 | 387 case 15: if ((format == IMGFMT_RGB15) || (format == IMGFMT_BGR15)) |
485 | 388 return ((bpp_avail & BPP_15) ? 1 : 0); |
389 break; | |
407 | 390 } |
488 | 391 } else { |
485 | 392 switch (format) { |
393 case IMGFMT_RGB32: | |
488 | 394 case IMGFMT_BGR32: return ((bpp_avail & BPP_32) ? 1 : 0); break; |
485 | 395 case IMGFMT_RGB24: |
488 | 396 case IMGFMT_BGR24: { |
485 | 397 res = (bpp_avail & BPP_24) ? 1 : 0; |
398 if (!res) | |
399 res = (bpp_avail & BPP_32) ? 1 : 0; | |
400 return (res); | |
401 } break; | |
402 case IMGFMT_RGB16: | |
488 | 403 case IMGFMT_BGR16: return ((bpp_avail & BPP_16) ? 1 : 0); break; |
485 | 404 case IMGFMT_RGB15: |
488 | 405 case IMGFMT_BGR15: { |
485 | 406 res = (bpp_avail & BPP_15) ? 1 : 0; |
407 if (!res) | |
408 res = (bpp_avail & BPP_16) ? 1 : 0; | |
409 return (res); | |
410 } break; | |
411 case IMGFMT_YV12: return (1); break; | |
285 | 412 } |
488 | 413 } |
285 | 414 return (0); |
415 } | |
416 | |
417 static const vo_info_t* get_info(void) { | |
418 return (&vo_info); | |
419 } | |
420 | |
421 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, | |
422 unsigned char *srca, int stride) { | |
327 | 423 switch (bpp) { |
424 case 32: | |
425 vo_draw_alpha_rgb32(w, h, src, srca, stride, virt->vbuf+4*(y0*WIDTH+x0), 4*WIDTH); | |
426 break; | |
427 case 24: | |
428 vo_draw_alpha_rgb24(w, h, src, srca, stride, virt->vbuf+3*(y0*WIDTH+x0), 3*WIDTH); | |
429 break; | |
430 case 16: | |
431 vo_draw_alpha_rgb16(w, h, src, srca, stride, virt->vbuf+2*(y0*WIDTH+x0), 2*WIDTH); | |
432 break; | |
433 case 15: | |
434 vo_draw_alpha_rgb15(w, h, src, srca, stride, virt->vbuf+2*(y0*WIDTH+x0), 2*WIDTH); | |
435 break; | |
436 } | |
285 | 437 } |
438 | |
439 static uint32_t draw_frame(uint8_t *src[]) { | |
440 if (pformat == IMGFMT_YV12) { | |
441 yuv2rgb(yuvbuf, src[0], src[1], src[2], orig_w, orig_h, orig_w * BYTESPERPIXEL, orig_w, orig_w / 2); | |
442 src[0] = yuvbuf; | |
443 } | |
483 | 444 if (scalebuf != NULL) { |
285 | 445 gl_scalebox(orig_w, orig_h, src[0], maxw, maxh, scalebuf); |
446 src[0] = scalebuf; | |
447 } | |
407 | 448 if (bpp_conv) { |
449 switch(bpp) { | |
485 | 450 case 32: { |
502 | 451 uint16_t *source = (uint16_t *) src[0]; |
452 uint16_t *dest = (uint16_t *) bppbuf; | |
453 uint16_t *end; | |
454 | |
485 | 455 end = source + (maxw * maxh * 2); |
456 while (source < end) { | |
457 *dest++ = *source++; | |
458 (uint8_t *)dest = (uint8_t *)source; | |
407 | 459 *(((uint8_t *)dest)+1) = 0; |
460 dest++; | |
485 | 461 source++; |
407 | 462 } |
485 | 463 } break; |
464 case 16: { | |
407 | 465 #ifdef HAVE_MMX |
466 rgb15to16_mmx(src[0],bppbuf,maxw * maxh * 2); | |
467 #else | |
502 | 468 uint16_t *source = (uint16_t *) src[0]; |
469 uint16_t *dest = (uint16_t *) bppbuf; | |
470 uint16_t *end; | |
407 | 471 register uint16_t srcdata; |
472 | |
485 | 473 end = source + (maxw * maxh); |
474 while (source < end) { | |
475 srcdata = *source++; | |
407 | 476 *dest++ = (srcdata & 0x1f) | ((srcdata & 0x7fe0) << 1); |
477 } | |
478 #endif | |
485 | 479 } break; |
407 | 480 } |
481 src[0] = bppbuf; | |
482 } | |
285 | 483 gl_putbox(x_pos, y_pos, maxw, maxh, src[0]); |
484 } | |
485 | |
486 static uint32_t draw_slice(uint8_t *image[], int stride[], | |
487 int w, int h, int x, int y) { | |
488 uint8_t *src = yuvbuf; | |
377 | 489 uint32_t sw, sh; |
490 | |
491 emms(); | |
492 sw = (uint32_t) (w * scaling); | |
493 sh = (uint32_t) (h * scaling); | |
285 | 494 yuv2rgb(yuvbuf, image[0], image[1], image[2], w, h, orig_w * BYTESPERPIXEL, stride[0], stride[1]); |
483 | 495 if (scalebuf != NULL) { |
377 | 496 gl_scalebox(w, h, yuvbuf, sw, sh, scalebuf); |
285 | 497 src = scalebuf; |
498 } | |
377 | 499 gl_putbox((int)(x * scaling) + x_pos, (int)(y * scaling) + y_pos, sw, sh, src); |
285 | 500 } |
501 | |
502 static void flip_page(void) { | |
292 | 503 if (y_pos) { |
504 gl_fillbox(0, 0, WIDTH, y_pos, 0); | |
505 gl_fillbox(0, HEIGHT - y_pos, WIDTH, y_pos, 0); | |
506 } else { | |
507 gl_fillbox(0, 0, x_pos, HEIGHT, 0); | |
508 gl_fillbox(WIDTH - x_pos, 0, x_pos, HEIGHT, 0); | |
327 | 509 } |
486 | 510 vo_draw_text(WIDTH, HEIGHT, draw_alpha); |
285 | 511 gl_copyscreen(screen); |
512 } | |
513 | |
514 static void check_events(void) { | |
515 } | |
516 | |
517 static void uninit(void) { | |
483 | 518 vga_modelist_t *list = modelist; |
519 | |
285 | 520 gl_freecontext(screen); |
521 gl_freecontext(virt); | |
522 vga_setmode(TEXT); | |
483 | 523 if (bppbuf != NULL) |
407 | 524 free(bppbuf); |
483 | 525 if (scalebuf != NULL) |
285 | 526 free(scalebuf); |
483 | 527 if (yuvbuf != NULL) |
285 | 528 free(yuvbuf); |
483 | 529 if (modelist != NULL) { |
530 while (modelist->next != NULL) { | |
531 list = modelist; | |
532 while (list->next != NULL) | |
533 list = list->next; | |
534 free(list); | |
535 } | |
536 free(modelist); | |
537 } | |
285 | 538 } |
539 |