41 int transparent, interlaced = 1, skip, opaque_length, i, j, k;
44 while (extradata_size >= 24) {
45 uint32_t atom_size =
AV_RB32(extradata);
46 if (!memcmp(&extradata[4],
"APRGAPRG0001", 12)) {
47 interlaced = extradata[19] != 1;
50 if (atom_size && atom_size <= extradata_size) {
51 extradata += atom_size;
52 extradata_size -= atom_size;
57 if (avctx->
height == 486) {
62 opaque_length = 2 * avctx->
width * (avctx->
height + skip) + 4 * interlaced;
63 if (avpkt->
size < opaque_length) {
68 avpkt->
size >= opaque_length * 2 + 4;
69 srca = src + opaque_length + 5;
78 src += avctx->
width * skip;
79 srca += avctx->
width * skip;
82 for (i = 0; i < interlaced + 1; i++) {
83 src += avctx->
width * skip;
84 srca += avctx->
width * skip;
85 if (interlaced && avctx->
height == 486) {
97 for (j = 0; j < avctx->
height >> interlaced; j++) {
98 for (k = 0; k < avctx->
width >> 1; k++) {
101 a[2 * k ] = 0xFF - (transparent ? *srca++ : 0);
104 y[2 * k + 1] = *src++;
105 a[2 * k + 1] = 0xFF - (transparent ? *srca++ : 0);
109 y += (interlaced + 1) * pic->
linesize[0];
110 u += (interlaced + 1) * pic->
linesize[1];
111 v += (interlaced + 1) * pic->
linesize[2];
112 a += (interlaced + 1) * pic->
linesize[3];