~ubuntu-branches/ubuntu/utopic/libav/utopic

« back to all changes in this revision

Viewing changes to libswscale/swscale_unscaled.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-12-21 15:32:13 UTC
  • mto: (1.2.18)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: package-import@ubuntu.com-20121221153213-fudzrugjzivtv0wp
Tags: upstream-9~beta3
ImportĀ upstreamĀ versionĀ 9~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
    }
99
99
}
100
100
 
 
101
static void fill_plane9or10(uint8_t *plane, int stride, int width,
 
102
                            int height, int y, uint8_t val,
 
103
                            const int dst_depth, const int big_endian)
 
104
{
 
105
    int i, j;
 
106
    uint16_t *dst = (uint16_t *) (plane + stride * y);
 
107
#define FILL8TO9_OR_10(wfunc) \
 
108
    for (i = 0; i < height; i++) { \
 
109
        for (j = 0; j < width; j++) { \
 
110
            wfunc(&dst[j], (val << (dst_depth - 8)) |  \
 
111
                               (val >> (16 - dst_depth))); \
 
112
        } \
 
113
        dst += stride / 2; \
 
114
    }
 
115
    if (big_endian) {
 
116
        FILL8TO9_OR_10(AV_WB16);
 
117
    } else {
 
118
        FILL8TO9_OR_10(AV_WL16);
 
119
    }
 
120
}
 
121
 
101
122
static void copyPlane(const uint8_t *src, int srcStride,
102
123
                      int srcSliceY, int srcSliceH, int width,
103
124
                      uint8_t *dst, int dstStride)
677
698
        // ignore palette for GRAY8
678
699
        if (plane == 1 && !dst[2]) continue;
679
700
        if (!src[plane] || (plane == 1 && !src[2])) {
 
701
            int val = (plane == 3) ? 255 : 128;
680
702
            if (is16BPS(c->dstFormat))
681
703
                length *= 2;
682
 
            fillPlane(dst[plane], dstStride[plane], length, height, y,
683
 
                      (plane == 3) ? 255 : 128);
 
704
            if (is9_OR_10BPS(c->dstFormat)) {
 
705
                fill_plane9or10(dst[plane], dstStride[plane],
 
706
                                length, height, y, val,
 
707
                                desc_dst->comp[plane].depth_minus1 + 1,
 
708
                                isBE(c->dstFormat));
 
709
            } else
 
710
                fillPlane(dst[plane], dstStride[plane], length, height, y,
 
711
                          val);
684
712
        } else {
685
713
            if (is9_OR_10BPS(c->srcFormat)) {
686
714
                const int src_depth = desc_src->comp[plane].depth_minus1 + 1;