Revision b16569d2 libavcodec/imgconvert.c

View differences:

libavcodec/imgconvert.c
883 883
            pix_fmt == PIX_FMT_RGB555LE)
884 884
            w = width * 2;
885 885
        else if (pix_fmt == PIX_FMT_UYYVYY411)
886
          w = width + width/2;
886
            w = width + width/2;
887 887
        else if (pix_fmt == PIX_FMT_PAL8)
888
          w = width;
888
            w = width;
889 889
        else
890
          w = width * (pf->depth * pf->nb_channels / 8);
890
            w = width * (pf->depth * pf->nb_channels / 8);
891 891

  
892 892
        data_planes = 1;
893 893
        h = height;
......
901 901
    oh = h;
902 902

  
903 903
    for (i=0; i<data_planes; i++) {
904
         if (i == 1) {
905
             w = ((width >> pf->x_chroma_shift) * pf->depth + 7) / 8;
906
             h = height >> pf->y_chroma_shift;
907
         } else if (i == 3) {
908
             w = ow;
909
             h = oh;
910
         }
911
         s = src->data[i];
912
         for(j=0; j<h; j++) {
913
             memcpy(dest, s, w);
914
             dest += w;
915
             s += src->linesize[i];
916
         }
904
        if (i == 1) {
905
            w = ((width >> pf->x_chroma_shift) * pf->depth + 7) / 8;
906
            h = height >> pf->y_chroma_shift;
907
        } else if (i == 3) {
908
            w = ow;
909
            h = oh;
910
        }
911
        s = src->data[i];
912
        for(j=0; j<h; j++) {
913
            memcpy(dest, s, w);
914
            dest += w;
915
            s += src->linesize[i];
916
        }
917 917
    }
918 918

  
919 919
    if (pf->pixel_type == FF_PIXEL_PALETTE)

Also available in: Unified diff