MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / indeo3_decode_frame

Function indeo3_decode_frame

libavcodec/indeo3.c:1075–1128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1073}
1074
1075static int indeo3_decode_frame(AVCodecContext *avctx,
1076 void *data, int *data_size,
1077 AVPacket *avpkt)
1078{
1079 const uint8_t *buf = avpkt->data;
1080 int buf_size = avpkt->size;
1081 Indeo3DecodeContext *s=avctx->priv_data;
1082 uint8_t *src, *dest;
1083 int y;
1084
1085 if (iv_decode_frame(avctx, buf, buf_size) < 0)
1086 return -1;
1087
1088 if(s->frame.data[0])
1089 avctx->release_buffer(avctx, &s->frame);
1090
1091 s->frame.reference = 0;
1092 if(avctx->get_buffer(avctx, &s->frame) < 0) {
1093 av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
1094 return -1;
1095 }
1096
1097 src = s->cur_frame->Ybuf;
1098 dest = s->frame.data[0];
1099 for (y = 0; y < s->height; y++) {
1100 memcpy(dest, src, s->cur_frame->y_w);
1101 src += s->cur_frame->y_w;
1102 dest += s->frame.linesize[0];
1103 }
1104
1105 if (!(s->avctx->flags & CODEC_FLAG_GRAY))
1106 {
1107 src = s->cur_frame->Ubuf;
1108 dest = s->frame.data[1];
1109 for (y = 0; y < s->height / 4; y++) {
1110 memcpy(dest, src, s->cur_frame->uv_w);
1111 src += s->cur_frame->uv_w;
1112 dest += s->frame.linesize[1];
1113 }
1114
1115 src = s->cur_frame->Vbuf;
1116 dest = s->frame.data[2];
1117 for (y = 0; y < s->height / 4; y++) {
1118 memcpy(dest, src, s->cur_frame->uv_w);
1119 src += s->cur_frame->uv_w;
1120 dest += s->frame.linesize[2];
1121 }
1122 }
1123
1124 *data_size=sizeof(AVFrame);
1125 *(AVFrame*)data= s->frame;
1126
1127 return buf_size;
1128}
1129
1130static av_cold int indeo3_decode_end(AVCodecContext *avctx)
1131{

Callers

nothing calls this directly

Calls 2

iv_decode_frameFunction · 0.85
av_logFunction · 0.85

Tested by

no test coverage detected