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

Function cmv_process_header

libavcodec/eacmv.c:115–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115static void cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t *buf_end)
116{
117 int pal_start, pal_count, i;
118
119 if(buf+16>=buf_end) {
120 av_log(s->avctx, AV_LOG_WARNING, "truncated header\n");
121 return;
122 }
123
124 s->width = AV_RL16(&buf[4]);
125 s->height = AV_RL16(&buf[6]);
126 if (s->avctx->width!=s->width || s->avctx->height!=s->height)
127 avcodec_set_dimensions(s->avctx, s->width, s->height);
128
129 s->avctx->time_base.num = 1;
130 s->avctx->time_base.den = AV_RL16(&buf[10]);
131
132 pal_start = AV_RL16(&buf[12]);
133 pal_count = AV_RL16(&buf[14]);
134
135 buf += 16;
136 for (i=pal_start; i<pal_start+pal_count && i<AVPALETTE_COUNT && buf+2<buf_end; i++) {
137 s->palette[i] = AV_RB24(buf);
138 buf += 3;
139 }
140}
141
142#define EA_PREAMBLE_SIZE 8
143#define MVIh_TAG MKTAG('M', 'V', 'I', 'h')

Callers 1

cmv_decode_frameFunction · 0.85

Calls 4

av_logFunction · 0.85
avcodec_set_dimensionsFunction · 0.85
AV_RB24Function · 0.85
AV_RL16Function · 0.50

Tested by

no test coverage detected