Mercurial > libavcodec.hg
comparison imgconvert.c @ 1207:162be12df86a libavcodec
fixed PIX_FMT_YUV422 conversions
author | bellard |
---|---|
date | Mon, 21 Apr 2003 15:15:59 +0000 |
parents | fd676abc754c |
children | 0f37976aa436 |
comparison
equal
deleted
inserted
replaced
1206:fd676abc754c | 1207:162be12df86a |
---|---|
536 uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1; | 536 uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1; |
537 int x; | 537 int x; |
538 | 538 |
539 p1 = src->data[0]; | 539 p1 = src->data[0]; |
540 lum1 = dst->data[0]; | 540 lum1 = dst->data[0]; |
541 cb1 = dst->data[0]; | 541 cb1 = dst->data[1]; |
542 cr1 = dst->data[0]; | 542 cr1 = dst->data[2]; |
543 | 543 |
544 for(;height >= 2; height -= 2) { | 544 for(;height >= 2; height -= 2) { |
545 p = p1; | 545 p = p1; |
546 lum = lum1; | 546 lum = lum1; |
547 cb = cb1; | 547 cb = cb1; |
580 uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1; | 580 uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1; |
581 int w; | 581 int w; |
582 | 582 |
583 p1 = src->data[0]; | 583 p1 = src->data[0]; |
584 lum1 = dst->data[0]; | 584 lum1 = dst->data[0]; |
585 cb1 = dst->data[0]; | 585 cb1 = dst->data[1]; |
586 cr1 = dst->data[0]; | 586 cr1 = dst->data[2]; |
587 for(;height >= 2; height -= 2) { | 587 for(;height > 0; height--) { |
588 p = p1; | 588 p = p1; |
589 lum = lum1; | 589 lum = lum1; |
590 cb = cb1; | 590 cb = cb1; |
591 cr = cr1; | 591 cr = cr1; |
592 for(w = width; w >= 2; w -= 2) { | 592 for(w = width; w >= 2; w -= 2) { |
613 const uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1; | 613 const uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1; |
614 int w; | 614 int w; |
615 | 615 |
616 p1 = dst->data[0]; | 616 p1 = dst->data[0]; |
617 lum1 = src->data[0]; | 617 lum1 = src->data[0]; |
618 cb1 = src->data[0]; | 618 cb1 = src->data[1]; |
619 cr1 = src->data[0]; | 619 cr1 = src->data[2]; |
620 for(;height >= 2; height -= 2) { | 620 for(;height > 0; height--) { |
621 p = p1; | 621 p = p1; |
622 lum = lum1; | 622 lum = lum1; |
623 cb = cb1; | 623 cb = cb1; |
624 cr = cr1; | 624 cr = cr1; |
625 for(w = width; w >= 2; w -= 2) { | 625 for(w = width; w >= 2; w -= 2) { |
630 p += 4; | 630 p += 4; |
631 lum += 2; | 631 lum += 2; |
632 cb++; | 632 cb++; |
633 cr++; | 633 cr++; |
634 } | 634 } |
635 p1 += src->linesize[0]; | 635 p1 += dst->linesize[0]; |
636 lum1 += dst->linesize[0]; | 636 lum1 += src->linesize[0]; |
637 cb1 += dst->linesize[1]; | 637 cb1 += src->linesize[1]; |
638 cr1 += dst->linesize[2]; | 638 cr1 += src->linesize[2]; |
639 } | 639 } |
640 } | 640 } |
641 | 641 |
642 #define SCALEBITS 10 | 642 #define SCALEBITS 10 |
643 #define ONE_HALF (1 << (SCALEBITS - 1)) | 643 #define ONE_HALF (1 << (SCALEBITS - 1)) |