[svn] / branches / dev-api-4 / xvidcore / src / image / image.c Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/src/image/image.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 889, Sat Feb 22 08:24:01 2003 UTC revision 890, Sat Feb 22 08:49:45 2003 UTC
# Line 60  Line 60 
60  #include "colorspace.h"  #include "colorspace.h"
61  #include "interpolate8x8.h"  #include "interpolate8x8.h"
62  #include "reduced.h"  #include "reduced.h"
 #include "../divx4.h"  
63  #include "../utils/mem_align.h"  #include "../utils/mem_align.h"
64    
65  #include "font.h"               // XXX: remove later  #include "font.h"               // XXX: remove later
# Line 564  Line 563 
563                          uint32_t width,                          uint32_t width,
564                          int height,                          int height,
565                          uint32_t edged_width,                          uint32_t edged_width,
566                          uint8_t * src,                          uint8_t * src[4],
567                          int src_stride,                          int src_stride[4],
568                          int csp,                          int csp,
569                          int interlacing)                          int interlacing)
570  {  {
# Line 574  Line 573 
573          const int height2 = height/2;          const int height2 = height/2;
574          //const int height_signed = (csp & XVID_CSP_VFLIP) ? -height : height;          //const int height_signed = (csp & XVID_CSP_VFLIP) ? -height : height;
575    
   
         //      int src_stride = width;  
   
         // --- xvid 2.1 compatiblity patch ---  
         // --- remove when xvid_dec_frame->stride equals real stride  
         /*  
         if ((csp & ~XVID_CSP_VFLIP) == XVID_CSP_RGB555 ||  
                 (csp & ~XVID_CSP_VFLIP) == XVID_CSP_RGB565 ||  
                 (csp & ~XVID_CSP_VFLIP) == XVID_CSP_YUY2 ||  
                 (csp & ~XVID_CSP_VFLIP) == XVID_CSP_YVYU ||  
                 (csp & ~XVID_CSP_VFLIP) == XVID_CSP_UYVY)  
         {  
                 src_stride *= 2;  
         }  
         else if ((csp & ~XVID_CSP_VFLIP) == XVID_CSP_RGB24)  
         {  
                 src_stride *= 3;  
         }  
         else if ((csp & ~XVID_CSP_VFLIP) == XVID_CSP_RGB32 ||  
                 (csp & ~XVID_CSP_VFLIP) == XVID_CSP_ABGR ||  
                 (csp & ~XVID_CSP_VFLIP) == XVID_CSP_RGBA)  
         {  
                 src_stride *= 4;  
         }  
         */  
         // ^--- xvid 2.1 compatiblity fix ---^  
   
576          switch (csp & ~XVID_CSP_VFLIP) {          switch (csp & ~XVID_CSP_VFLIP) {
577          case XVID_CSP_RGB555:          case XVID_CSP_RGB555:
578                  safe_packed_conv(                  safe_packed_conv(
579                          src, src_stride, image->y, image->u, image->v,                          src[0], src_stride[0], image->y, image->u, image->v,
580                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
581                          interlacing?rgb555i_to_yv12  :rgb555_to_yv12,                          interlacing?rgb555i_to_yv12  :rgb555_to_yv12,
582                          interlacing?rgb555i_to_yv12_c:rgb555_to_yv12_c, 2);                          interlacing?rgb555i_to_yv12_c:rgb555_to_yv12_c, 2);
# Line 612  Line 584 
584    
585          case XVID_CSP_RGB565:          case XVID_CSP_RGB565:
586                  safe_packed_conv(                  safe_packed_conv(
587                          src, src_stride, image->y, image->u, image->v,                          src[0], src_stride[0], image->y, image->u, image->v,
588                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
589                          interlacing?rgb565i_to_yv12  :rgb565_to_yv12,                          interlacing?rgb565i_to_yv12  :rgb565_to_yv12,
590                          interlacing?rgb565i_to_yv12_c:rgb565_to_yv12_c, 2);                          interlacing?rgb565i_to_yv12_c:rgb565_to_yv12_c, 2);
591                  break;                  break;
592    
593    
594          case XVID_CSP_RGB24:          case XVID_CSP_BGR:
595                  safe_packed_conv(                  safe_packed_conv(
596                          src, src_stride, image->y, image->u, image->v,                          src[0], src_stride[0], image->y, image->u, image->v,
597                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
598                          interlacing?bgri_to_yv12  :bgr_to_yv12,                          interlacing?bgri_to_yv12  :bgr_to_yv12,
599                          interlacing?bgri_to_yv12_c:bgr_to_yv12_c, 3);                          interlacing?bgri_to_yv12_c:bgr_to_yv12_c, 3);
600                  break;                  break;
601    
602          case XVID_CSP_RGB32:          case XVID_CSP_BGRA:
603                  safe_packed_conv(                  safe_packed_conv(
604                          src, src_stride, image->y, image->u, image->v,                          src[0], src_stride[0], image->y, image->u, image->v,
605                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
606                          interlacing?bgrai_to_yv12  :bgra_to_yv12,                          interlacing?bgrai_to_yv12  :bgra_to_yv12,
607                          interlacing?bgrai_to_yv12_c:bgra_to_yv12_c, 4);                          interlacing?bgrai_to_yv12_c:bgra_to_yv12_c, 4);
# Line 637  Line 609 
609    
610          case XVID_CSP_ABGR :          case XVID_CSP_ABGR :
611                  safe_packed_conv(                  safe_packed_conv(
612                          src, src_stride, image->y, image->u, image->v,                          src[0], src_stride[0], image->y, image->u, image->v,
613                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
614                          interlacing?abgri_to_yv12  :abgr_to_yv12,                          interlacing?abgri_to_yv12  :abgr_to_yv12,
615                          interlacing?abgri_to_yv12_c:abgr_to_yv12_c, 4);                          interlacing?abgri_to_yv12_c:abgr_to_yv12_c, 4);
# Line 645  Line 617 
617    
618          case XVID_CSP_RGBA :          case XVID_CSP_RGBA :
619                  safe_packed_conv(                  safe_packed_conv(
620                          src, src_stride, image->y, image->u, image->v,                          src[0], src_stride[0], image->y, image->u, image->v,
621                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
622                          interlacing?rgbai_to_yv12  :rgba_to_yv12,                          interlacing?rgbai_to_yv12  :rgba_to_yv12,
623                          interlacing?rgbai_to_yv12_c:rgba_to_yv12_c, 4);                          interlacing?rgbai_to_yv12_c:rgba_to_yv12_c, 4);
# Line 653  Line 625 
625    
626          case XVID_CSP_YUY2:          case XVID_CSP_YUY2:
627                  safe_packed_conv(                  safe_packed_conv(
628                          src, src_stride, image->y, image->u, image->v,                          src[0], src_stride[0], image->y, image->u, image->v,
629                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
630                          interlacing?yuyvi_to_yv12  :yuyv_to_yv12,                          interlacing?yuyvi_to_yv12  :yuyv_to_yv12,
631                          interlacing?yuyvi_to_yv12_c:yuyv_to_yv12_c, 2);                          interlacing?yuyvi_to_yv12_c:yuyv_to_yv12_c, 2);
# Line 661  Line 633 
633    
634          case XVID_CSP_YVYU:             /* u/v swapped */          case XVID_CSP_YVYU:             /* u/v swapped */
635                  safe_packed_conv(                  safe_packed_conv(
636                          src, src_stride, image->y, image->v, image->y,                          src[0], src_stride[0], image->y, image->v, image->y,
637                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
638                          interlacing?yuyvi_to_yv12  :yuyv_to_yv12,                          interlacing?yuyvi_to_yv12  :yuyv_to_yv12,
639                          interlacing?yuyvi_to_yv12_c:yuyv_to_yv12_c, 2);                          interlacing?yuyvi_to_yv12_c:yuyv_to_yv12_c, 2);
# Line 669  Line 641 
641    
642          case XVID_CSP_UYVY:          case XVID_CSP_UYVY:
643                  safe_packed_conv(                  safe_packed_conv(
644                          src, src_stride, image->y, image->u, image->v,                          src[0], src_stride[0], image->y, image->u, image->v,
645                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
646                          interlacing?uyvyi_to_yv12  :uyvy_to_yv12,                          interlacing?uyvyi_to_yv12  :uyvy_to_yv12,
647                          interlacing?uyvyi_to_yv12_c:uyvy_to_yv12_c, 2);                          interlacing?uyvyi_to_yv12_c:uyvy_to_yv12_c, 2);
# Line 677  Line 649 
649    
650          case XVID_CSP_I420:          case XVID_CSP_I420:
651                  yv12_to_yv12(image->y, image->u, image->v, edged_width, edged_width2,                  yv12_to_yv12(image->y, image->u, image->v, edged_width, edged_width2,
652                          src, src + src_stride*height, src + src_stride*height + (src_stride/2)*height2,                          src[0], src[0] + src_stride[0]*height, src[0] + src_stride[0]*height + (src_stride[0]/2)*height2,
653                          src_stride, src_stride/2, width, height, (csp & XVID_CSP_VFLIP));                          src_stride[0], src_stride[0]/2, width, height, (csp & XVID_CSP_VFLIP));
654                  break                  break
655                          ;                          ;
656          case XVID_CSP_YV12:             /* u/v swapped */          case XVID_CSP_YV12:             /* u/v swapped */
657                  yv12_to_yv12(image->y, image->v, image->u, edged_width, edged_width2,                  yv12_to_yv12(image->y, image->v, image->u, edged_width, edged_width2,
658                          src, src + src_stride*height, src + src_stride*height + (src_stride/2)*height2,                          src[0], src[0] + src_stride[0]*height, src[0] + src_stride[0]*height + (src_stride[0]/2)*height2,
659                          src_stride, src_stride/2, width, height, (csp & XVID_CSP_VFLIP));                          src_stride[0], src_stride[0]/2, width, height, (csp & XVID_CSP_VFLIP));
660                  break;                  break;
661    
662          case XVID_CSP_USER:          case XVID_CSP_USER:
663                  {          /*XXX: support for different u & v strides */
                         DEC_PICTURE * pic = (DEC_PICTURE*)src;  
664                          yv12_to_yv12(image->y, image->u, image->v, edged_width, edged_width2,                          yv12_to_yv12(image->y, image->u, image->v, edged_width, edged_width2,
665                                  pic->y, pic->u, pic->v, pic->stride_y, pic->stride_y,                          src[0], src[1], src[2], src_stride[0], src_stride[1],
666                                  width, height, (csp & XVID_CSP_VFLIP));                                  width, height, (csp & XVID_CSP_VFLIP));
                 }  
667                  break;                  break;
668    
669          case XVID_CSP_NULL:          case XVID_CSP_NULL:
# Line 759  Line 729 
729                           uint32_t width,                           uint32_t width,
730                           int height,                           int height,
731                           uint32_t edged_width,                           uint32_t edged_width,
732                           uint8_t * dst,                           uint8_t * dst[4],
733                           uint32_t dst_stride,                           uint32_t dst_stride[4],
734                           int csp,                           int csp,
735                           int interlacing)                           int interlacing)
736  {  {
# Line 773  Line 743 
743          image_dump_yuvpgm(image, edged_width, width, height, "\\decode.pgm");          image_dump_yuvpgm(image, edged_width, width, height, "\\decode.pgm");
744  */  */
745    
   
         // --- xvid 2.1 compatiblity patch ---  
         // --- remove when xvid_dec_frame->stride equals real stride  
         /*  
         if ((csp & ~XVID_CSP_VFLIP) == XVID_CSP_RGB555 ||  
                 (csp & ~XVID_CSP_VFLIP) == XVID_CSP_RGB565 ||  
                 (csp & ~XVID_CSP_VFLIP) == XVID_CSP_YUY2 ||  
                 (csp & ~XVID_CSP_VFLIP) == XVID_CSP_YVYU ||  
                 (csp & ~XVID_CSP_VFLIP) == XVID_CSP_UYVY)  
         {  
                 dst_stride *= 2;  
         }  
         else if ((csp & ~XVID_CSP_VFLIP) == XVID_CSP_RGB24)  
         {  
                 dst_stride *= 3;  
         }  
         else if ((csp & ~XVID_CSP_VFLIP) == XVID_CSP_RGB32 ||  
                 (csp & ~XVID_CSP_VFLIP) == XVID_CSP_ABGR ||  
                 (csp & ~XVID_CSP_VFLIP) == XVID_CSP_RGBA)  
         {  
                 dst_stride *= 4;  
         }  
         */  
         // ^--- xvid 2.1 compatiblity fix ---^  
   
   
746          switch (csp & ~XVID_CSP_VFLIP) {          switch (csp & ~XVID_CSP_VFLIP) {
747          case XVID_CSP_RGB555:          case XVID_CSP_RGB555:
748                  safe_packed_conv(                  safe_packed_conv(
749                          dst, dst_stride, image->y, image->u, image->v,                          dst[0], dst_stride[0], image->y, image->u, image->v,
750                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
751                          interlacing?yv12_to_rgb555i  :yv12_to_rgb555,                          interlacing?yv12_to_rgb555i  :yv12_to_rgb555,
752                          interlacing?yv12_to_rgb555i_c:yv12_to_rgb555_c, 2);                          interlacing?yv12_to_rgb555i_c:yv12_to_rgb555_c, 2);
# Line 810  Line 754 
754    
755          case XVID_CSP_RGB565:          case XVID_CSP_RGB565:
756                  safe_packed_conv(                  safe_packed_conv(
757                          dst, dst_stride, image->y, image->u, image->v,                          dst[0], dst_stride[0], image->y, image->u, image->v,
758                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
759                          interlacing?yv12_to_rgb565i  :yv12_to_rgb565,                          interlacing?yv12_to_rgb565i  :yv12_to_rgb565,
760                          interlacing?yv12_to_rgb565i_c:yv12_to_rgb565_c, 2);                          interlacing?yv12_to_rgb565i_c:yv12_to_rgb565_c, 2);
761                  return 0;                  return 0;
762    
763          case XVID_CSP_RGB24:      case XVID_CSP_BGR:
764                  safe_packed_conv(                  safe_packed_conv(
765                          dst, dst_stride, image->y, image->u, image->v,                          dst[0], dst_stride[0], image->y, image->u, image->v,
766                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
767                          interlacing?yv12_to_bgri  :yv12_to_bgr,                          interlacing?yv12_to_bgri  :yv12_to_bgr,
768                          interlacing?yv12_to_bgri_c:yv12_to_bgr_c, 3);                          interlacing?yv12_to_bgri_c:yv12_to_bgr_c, 3);
769                  return 0;                  return 0;
770    
771          case XVID_CSP_RGB32:          case XVID_CSP_BGRA:
772                  safe_packed_conv(                  safe_packed_conv(
773                          dst, dst_stride, image->y, image->u, image->v,                          dst[0], dst_stride[0], image->y, image->u, image->v,
774                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
775                          interlacing?yv12_to_bgrai  :yv12_to_bgra,                          interlacing?yv12_to_bgrai  :yv12_to_bgra,
776                          interlacing?yv12_to_bgrai_c:yv12_to_bgra_c, 4);                          interlacing?yv12_to_bgrai_c:yv12_to_bgra_c, 4);
# Line 834  Line 778 
778    
779          case XVID_CSP_ABGR:          case XVID_CSP_ABGR:
780                  safe_packed_conv(                  safe_packed_conv(
781                          dst, dst_stride, image->y, image->u, image->v,                          dst[0], dst_stride[0], image->y, image->u, image->v,
782                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
783                          interlacing?yv12_to_abgri  :yv12_to_abgr,                          interlacing?yv12_to_abgri  :yv12_to_abgr,
784                          interlacing?yv12_to_abgri_c:yv12_to_abgr_c, 4);                          interlacing?yv12_to_abgri_c:yv12_to_abgr_c, 4);
# Line 842  Line 786 
786    
787          case XVID_CSP_RGBA:          case XVID_CSP_RGBA:
788                  safe_packed_conv(                  safe_packed_conv(
789                          dst, dst_stride, image->y, image->u, image->v,                          dst[0], dst_stride[0], image->y, image->u, image->v,
790                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
791                          interlacing?yv12_to_rgbai  :yv12_to_rgba,                          interlacing?yv12_to_rgbai  :yv12_to_rgba,
792                          interlacing?yv12_to_rgbai_c:yv12_to_rgba_c, 4);                          interlacing?yv12_to_rgbai_c:yv12_to_rgba_c, 4);
# Line 850  Line 794 
794    
795          case XVID_CSP_YUY2:          case XVID_CSP_YUY2:
796                  safe_packed_conv(                  safe_packed_conv(
797                          dst, dst_stride, image->y, image->u, image->v,                          dst[0], dst_stride[0], image->y, image->u, image->v,
798                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
799                          interlacing?yv12_to_yuyvi  :yv12_to_yuyv,                          interlacing?yv12_to_yuyvi  :yv12_to_yuyv,
800                          interlacing?yv12_to_yuyvi_c:yv12_to_yuyv_c, 2);                          interlacing?yv12_to_yuyvi_c:yv12_to_yuyv_c, 2);
# Line 858  Line 802 
802    
803          case XVID_CSP_YVYU:             // u,v swapped          case XVID_CSP_YVYU:             // u,v swapped
804                  safe_packed_conv(                  safe_packed_conv(
805                          dst, dst_stride, image->y, image->v, image->u,                          dst[0], dst_stride[0], image->y, image->v, image->u,
806                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
807                          interlacing?yv12_to_yuyvi  :yv12_to_yuyv,                          interlacing?yv12_to_yuyvi  :yv12_to_yuyv,
808                          interlacing?yv12_to_yuyvi_c:yv12_to_yuyv_c, 2);                          interlacing?yv12_to_yuyvi_c:yv12_to_yuyv_c, 2);
# Line 866  Line 810 
810    
811          case XVID_CSP_UYVY:          case XVID_CSP_UYVY:
812                  safe_packed_conv(                  safe_packed_conv(
813                          dst, dst_stride, image->y, image->u, image->v,                          dst[0], dst_stride[0], image->y, image->u, image->v,
814                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),                          edged_width, edged_width2, width, height, (csp & XVID_CSP_VFLIP),
815                          interlacing?yv12_to_uyvyi  :yv12_to_uyvy,                          interlacing?yv12_to_uyvyi  :yv12_to_uyvy,
816                          interlacing?yv12_to_uyvyi_c:yv12_to_uyvy_c, 2);                          interlacing?yv12_to_uyvyi_c:yv12_to_uyvy_c, 2);
817                  return 0;                  return 0;
818    
819          case XVID_CSP_I420:          case XVID_CSP_I420:
820                  yv12_to_yv12(dst, dst + dst_stride*height, dst + dst_stride*height + (dst_stride/2)*height2,                  yv12_to_yv12(dst[0], dst[0] + dst_stride[0]*height, dst[0] + dst_stride[0]*height + (dst_stride[0]/2)*height2,
821                          dst_stride, dst_stride/2,                          dst_stride[0], dst_stride[0]/2,
822                          image->y, image->u, image->v, edged_width, edged_width2,                          image->y, image->u, image->v, edged_width, edged_width2,
823                          width, height, (csp & XVID_CSP_VFLIP));                          width, height, (csp & XVID_CSP_VFLIP));
824                  return 0;                  return 0;
825    
826          case XVID_CSP_YV12:             // u,v swapped          case XVID_CSP_YV12:             // u,v swapped
827                  yv12_to_yv12(dst, dst + dst_stride*height, dst + dst_stride*height + (dst_stride/2)*height2,                  yv12_to_yv12(dst[0], dst[0] + dst_stride[0]*height, dst[0] + dst_stride[0]*height + (dst_stride[0]/2)*height2,
828                          dst_stride, dst_stride/2,                          dst_stride[0], dst_stride[0]/2,
829                          image->y, image->v, image->u, edged_width, edged_width2,                          image->y, image->v, image->u, edged_width, edged_width2,
830                          width, height, (csp & XVID_CSP_VFLIP));                          width, height, (csp & XVID_CSP_VFLIP));
831                  return 0;                  return 0;
832    
833          case XVID_CSP_USER:          case XVID_CSP_USER :            // u,v swapped
834                  {                  yv12_to_yv12(dst[0], dst[1], dst[2],
835                          DEC_PICTURE * pic = (DEC_PICTURE*)dst;                          dst_stride[0], dst_stride[1],   /* v: dst_stride[2] */
836                          pic->y = image->y;                          image->y, image->v, image->u, edged_width, edged_width2,
837                          pic->u = image->u;                          width, height, (csp & XVID_CSP_VFLIP));
838                          pic->v = image->v;                  return 0;
839                          pic->stride_y = edged_width;  
840                          pic->stride_uv = edged_width / 2;          case XVID_CSP_INTERNAL :
841                  }                  dst[0] = image->y;
842                    dst[1] = image->u;
843                    dst[2] = image->v;
844                    dst_stride[0] = edged_width;
845                    dst_stride[1] = edged_width/2;
846                    dst_stride[2] = edged_width/2;
847                  return 0;                  return 0;
848    
849          case XVID_CSP_NULL:          case XVID_CSP_NULL:
850          case XVID_CSP_EXTERN:          case XVID_CSP_SLICE:
851                  return 0;                  return 0;
852    
853          }          }
# Line 1094  Line 1043 
1043  }  }
1044    
1045  void  void
1046  output_slice(IMAGE * cur, int std, int width, XVID_DEC_PICTURE* out_frm, int mbx, int mby,int mbl) {  output_slice(IMAGE * cur, int std, int width, xvid_image_t* out_frm, int mbx, int mby,int mbl) {
1047    uint8_t *dY,*dU,*dV,*sY,*sU,*sV;    uint8_t *dY,*dU,*dV,*sY,*sU,*sV;
1048    int std2 = std >> 1;    int std2 = std >> 1;
1049    int w = mbl << 4, w2,i;    int w = mbl << 4, w2,i;
# Line 1103  Line 1052 
1052      w = width;      w = width;
1053    w2 = w >> 1;    w2 = w >> 1;
1054    
1055    dY = (uint8_t*)out_frm->y + (mby << 4) * out_frm->stride_y + (mbx << 4);    dY = (uint8_t*)out_frm->plane[0] + (mby << 4) * out_frm->stride[0] + (mbx << 4);
1056    dU = (uint8_t*)out_frm->u + (mby << 3) * out_frm->stride_u + (mbx << 3);    dU = (uint8_t*)out_frm->plane[1] + (mby << 3) * out_frm->stride[1] + (mbx << 3);
1057    dV = (uint8_t*)out_frm->v + (mby << 3) * out_frm->stride_v + (mbx << 3);    dV = (uint8_t*)out_frm->plane[2] + (mby << 3) * out_frm->stride[2] + (mbx << 3);
1058    sY = cur->y + (mby << 4) * std + (mbx << 4);    sY = cur->y + (mby << 4) * std + (mbx << 4);
1059    sU = cur->u + (mby << 3) * std2 + (mbx << 3);    sU = cur->u + (mby << 3) * std2 + (mbx << 3);
1060    sV = cur->v + (mby << 3) * std2 + (mbx << 3);    sV = cur->v + (mby << 3) * std2 + (mbx << 3);
1061    
1062    for(i = 0 ; i < 16 ; i++) {    for(i = 0 ; i < 16 ; i++) {
1063      memcpy(dY,sY,w);      memcpy(dY,sY,w);
1064      dY += out_frm->stride_y;      dY += out_frm->stride[0];
1065      sY += std;      sY += std;
1066    }    }
1067    for(i = 0 ; i < 8 ; i++) {    for(i = 0 ; i < 8 ; i++) {
1068      memcpy(dU,sU,w2);      memcpy(dU,sU,w2);
1069      dU += out_frm->stride_u;      dU += out_frm->stride[1];
1070      sU += std2;      sU += std2;
1071    }    }
1072    for(i = 0 ; i < 8 ; i++) {    for(i = 0 ; i < 8 ; i++) {
1073      memcpy(dV,sV,w2);      memcpy(dV,sV,w2);
1074      dV += out_frm->stride_v;      dV += out_frm->stride[2];
1075      sV += std2;      sV += std2;
1076    }    }
1077  }  }
# Line 1169  Line 1118 
1118          int i,j;          int i,j;
1119    
1120          /* luma: j,i in block units */          /* luma: j,i in block units */
1121          if ((flags & XVID_DEC_DEBLOCKY))  
         {  
1122                  for (j = 1; j < mb_height*2; j++)               /* horizontal deblocking */                  for (j = 1; j < mb_height*2; j++)               /* horizontal deblocking */
1123                  for (i = 0; i < mb_width*2; i++)                  for (i = 0; i < mb_width*2; i++)
1124                  {                  {
# Line 1193  Line 1141 
1141                                                     edged_width, nblocks);                                                     edged_width, nblocks);
1142                          }                          }
1143                  }                  }
1144          }  
1145    
1146    
1147          /* chroma */          /* chroma */
1148          if ((flags & XVID_DEC_DEBLOCKUV))  
         {  
1149                  for (j = 1; j < mb_height; j++)         /* horizontal deblocking */                  for (j = 1; j < mb_height; j++)         /* horizontal deblocking */
1150                  for (i = 0; i < mb_width; i++)                  for (i = 0; i < mb_width; i++)
1151                  {                  {
# Line 1226  Line 1173 
1173                                                     edged_width2, nblocks);                                                     edged_width2, nblocks);
1174                          }                          }
1175                  }                  }
1176          }  
1177    
1178  }  }
1179    

Legend:
Removed from v.889  
changed lines
  Added in v.890

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4