Mercurial > libavcodec.hg
comparison indeo3.c @ 2244:4a0cfd63f078 libavcodec
greyscale decoding (option to skip u,v planes) support
author | alex |
---|---|
date | Tue, 21 Sep 2004 17:31:46 +0000 |
parents | 141a9539e270 |
children | 3d4a1f8e6a27 |
comparison
equal
deleted
inserted
replaced
2243:b8bad8bbbc64 | 2244:4a0cfd63f078 |
---|---|
221 | 221 |
222 iv_Decode_Chunk(s, s->cur_frame->Ybuf, s->ref_frame->Ybuf, hdr_width, | 222 iv_Decode_Chunk(s, s->cur_frame->Ybuf, s->ref_frame->Ybuf, hdr_width, |
223 hdr_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos, | 223 hdr_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos, |
224 min(hdr_width, 160)); | 224 min(hdr_width, 160)); |
225 | 225 |
226 if (!(s->avctx->flags & CODEC_FLAG_GRAY)) | |
227 { | |
228 | |
226 buf_pos = buf + 16 + offs2; | 229 buf_pos = buf + 16 + offs2; |
227 offs = le2me_32(*(uint32_t *)buf_pos); | 230 offs = le2me_32(*(uint32_t *)buf_pos); |
228 buf_pos += 4; | 231 buf_pos += 4; |
229 | 232 |
230 iv_Decode_Chunk(s, s->cur_frame->Vbuf, s->ref_frame->Vbuf, chroma_width, | 233 iv_Decode_Chunk(s, s->cur_frame->Vbuf, s->ref_frame->Vbuf, chroma_width, |
236 buf_pos += 4; | 239 buf_pos += 4; |
237 | 240 |
238 iv_Decode_Chunk(s, s->cur_frame->Ubuf, s->ref_frame->Ubuf, chroma_width, | 241 iv_Decode_Chunk(s, s->cur_frame->Ubuf, s->ref_frame->Ubuf, chroma_width, |
239 chroma_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos, | 242 chroma_height, buf_pos + offs * 2, fflags2, hdr_pos, buf_pos, |
240 min(chroma_width, 40)); | 243 min(chroma_width, 40)); |
244 | |
245 } | |
241 | 246 |
242 return 8; | 247 return 8; |
243 } | 248 } |
244 | 249 |
245 typedef struct { | 250 typedef struct { |
1078 memcpy(dest, src, s->cur_frame->y_w); | 1083 memcpy(dest, src, s->cur_frame->y_w); |
1079 src += s->cur_frame->y_w; | 1084 src += s->cur_frame->y_w; |
1080 dest += s->frame.linesize[0]; | 1085 dest += s->frame.linesize[0]; |
1081 } | 1086 } |
1082 | 1087 |
1088 if (!(s->avctx->flags & CODEC_FLAG_GRAY)) | |
1089 { | |
1083 src = s->cur_frame->Ubuf; | 1090 src = s->cur_frame->Ubuf; |
1084 dest = s->frame.data[1]; | 1091 dest = s->frame.data[1]; |
1085 for (y = 0; y < s->height / 4; y++) { | 1092 for (y = 0; y < s->height / 4; y++) { |
1086 memcpy(dest, src, s->cur_frame->uv_w); | 1093 memcpy(dest, src, s->cur_frame->uv_w); |
1087 src += s->cur_frame->uv_w; | 1094 src += s->cur_frame->uv_w; |
1092 dest = s->frame.data[2]; | 1099 dest = s->frame.data[2]; |
1093 for (y = 0; y < s->height / 4; y++) { | 1100 for (y = 0; y < s->height / 4; y++) { |
1094 memcpy(dest, src, s->cur_frame->uv_w); | 1101 memcpy(dest, src, s->cur_frame->uv_w); |
1095 src += s->cur_frame->uv_w; | 1102 src += s->cur_frame->uv_w; |
1096 dest += s->frame.linesize[2]; | 1103 dest += s->frame.linesize[2]; |
1104 } | |
1097 } | 1105 } |
1098 | 1106 |
1099 *data_size=sizeof(AVFrame); | 1107 *data_size=sizeof(AVFrame); |
1100 *(AVFrame*)data= s->frame; | 1108 *(AVFrame*)data= s->frame; |
1101 | 1109 |