61 int buf_size = avpkt->
size;
63 const unsigned char *encoded =
buf;
64 unsigned char *pixptr, *pixptr_end;
66 unsigned int dlen, p, row;
67 const unsigned char *lp, *dp, *ep;
69 unsigned int planes = c->
planes;
70 unsigned char *planemap = c->
planemap;
76 ep = encoded + buf_size;
79 dp = encoded + planes * (height << 1);
81 for (p = 0; p < planes; p++) {
83 lp = encoded + p * (height << 1);
86 for (row = 0; row <
height; row++) {
87 pixptr = frame->
data[0] + row * frame->
linesize[0] + planemap[p];
88 pixptr_end = pixptr + frame->
linesize[0];
89 if (ep - lp < row * 2 + 2)
91 dlen =
av_be2ne16(*(
const unsigned short *)(lp + row * 2));
96 if ((count = *dp++) <= 127) {
99 if (pixptr_end - pixptr < count * planes)
109 if (pixptr_end - pixptr < count * planes)
171 c->
planemap[0] = HAVE_BIGENDIAN ? 1 : 2;
172 c->
planemap[1] = HAVE_BIGENDIAN ? 2 : 1;
173 c->
planemap[2] = HAVE_BIGENDIAN ? 3 : 0;
174 c->
planemap[3] = HAVE_BIGENDIAN ? 0 : 3;