Mercurial > mplayer.hg
comparison libswscale/yuv2rgb.c @ 23488:63bc8943a1ad
Fix yuv2rgb C functions to work for widths divisible by 4 but not by 8
author | reimar |
---|---|
date | Fri, 08 Jun 2007 07:49:59 +0000 |
parents | 16cce5d6ff9f |
children | 2c8b8b4e63c8 |
comparison
equal
deleted
inserted
replaced
23487:559c4f075bf1 | 23488:63bc8943a1ad |
---|---|
274 unsigned int h_size= c->dstW>>3;\ | 274 unsigned int h_size= c->dstW>>3;\ |
275 while (h_size--) {\ | 275 while (h_size--) {\ |
276 int av_unused U, V;\ | 276 int av_unused U, V;\ |
277 int Y;\ | 277 int Y;\ |
278 | 278 |
279 #define EPILOG(dst_delta)\ | 279 #define EPILOG1(dst_delta)\ |
280 pu += 4;\ | 280 pu += 4;\ |
281 pv += 4;\ | 281 pv += 4;\ |
282 py_1 += 8;\ | 282 py_1 += 8;\ |
283 py_2 += 8;\ | 283 py_2 += 8;\ |
284 dst_1 += dst_delta;\ | 284 dst_1 += dst_delta;\ |
285 dst_2 += dst_delta;\ | 285 dst_2 += dst_delta;\ |
286 }\ | 286 }\ |
287 if (c->dstW & 4) {\ | |
288 int av_unused U, V;\ | |
289 int Y;\ | |
290 | |
291 #define EPILOG2()\ | |
292 }\ | |
287 }\ | 293 }\ |
288 return srcSliceH;\ | 294 return srcSliceH;\ |
289 } | 295 } |
290 | 296 |
297 #define EPILOG(dst_delta)\ | |
298 EPILOG1(dst_delta)\ | |
299 EPILOG2() | |
300 | |
291 PROLOG(yuv2rgb_c_32, uint32_t) | 301 PROLOG(yuv2rgb_c_32, uint32_t) |
292 RGB(0); | 302 RGB(0); |
293 DST1(0); | 303 DST1(0); |
294 DST2(0); | 304 DST2(0); |
295 | 305 |
302 DST2(2); | 312 DST2(2); |
303 | 313 |
304 RGB(3); | 314 RGB(3); |
305 DST2(3); | 315 DST2(3); |
306 DST1(3); | 316 DST1(3); |
307 EPILOG(8) | 317 EPILOG1(8) |
318 RGB(0); | |
319 DST1(0); | |
320 DST2(0); | |
321 | |
322 RGB(1); | |
323 DST2(1); | |
324 DST1(1); | |
325 EPILOG2() | |
308 | 326 |
309 PROLOG(yuv2rgb_c_24_rgb, uint8_t) | 327 PROLOG(yuv2rgb_c_24_rgb, uint8_t) |
310 RGB(0); | 328 RGB(0); |
311 DST1RGB(0); | 329 DST1RGB(0); |
312 DST2RGB(0); | 330 DST2RGB(0); |
320 DST2RGB(2); | 338 DST2RGB(2); |
321 | 339 |
322 RGB(3); | 340 RGB(3); |
323 DST2RGB(3); | 341 DST2RGB(3); |
324 DST1RGB(3); | 342 DST1RGB(3); |
325 EPILOG(24) | 343 EPILOG1(24) |
344 RGB(0); | |
345 DST1RGB(0); | |
346 DST2RGB(0); | |
347 | |
348 RGB(1); | |
349 DST2RGB(1); | |
350 DST1RGB(1); | |
351 EPILOG2() | |
326 | 352 |
327 // only trivial mods from yuv2rgb_c_24_rgb | 353 // only trivial mods from yuv2rgb_c_24_rgb |
328 PROLOG(yuv2rgb_c_24_bgr, uint8_t) | 354 PROLOG(yuv2rgb_c_24_bgr, uint8_t) |
329 RGB(0); | 355 RGB(0); |
330 DST1BGR(0); | 356 DST1BGR(0); |
339 DST2BGR(2); | 365 DST2BGR(2); |
340 | 366 |
341 RGB(3); | 367 RGB(3); |
342 DST2BGR(3); | 368 DST2BGR(3); |
343 DST1BGR(3); | 369 DST1BGR(3); |
344 EPILOG(24) | 370 EPILOG1(24) |
371 RGB(0); | |
372 DST1BGR(0); | |
373 DST2BGR(0); | |
374 | |
375 RGB(1); | |
376 DST2BGR(1); | |
377 DST1BGR(1); | |
378 EPILOG2() | |
345 | 379 |
346 // This is exactly the same code as yuv2rgb_c_32 except for the types of | 380 // This is exactly the same code as yuv2rgb_c_32 except for the types of |
347 // r, g, b, dst_1, dst_2 | 381 // r, g, b, dst_1, dst_2 |
348 PROLOG(yuv2rgb_c_16, uint16_t) | 382 PROLOG(yuv2rgb_c_16, uint16_t) |
349 RGB(0); | 383 RGB(0); |