int tmpbuf_size;
} FrapsContext;
-
/**
* initializes decoder
* @param avctx codec context
else if (Uoff)
dst[i] += 0x80;
if (get_bits_left(&gb) < 0) {
- ff_free_vlc(&vlc);
+ ff_vlc_free(&vlc);
return AVERROR_INVALIDDATA;
}
}
dst += stride;
}
- ff_free_vlc(&vlc);
+ ff_vlc_free(&vlc);
return 0;
}
int buf_size = avpkt->size;
uint32_t header;
unsigned int version,header_size;
- unsigned int x, y;
const uint32_t *buf32;
uint32_t *luma1,*luma2,*cb,*cr;
uint32_t offs[4];
}
f->pict_type = AV_PICTURE_TYPE_I;
- f->key_frame = 1;
+ f->flags |= AV_FRAME_FLAG_KEY;
avctx->pix_fmt = version & 1 ? is_pal ? AV_PIX_FMT_PAL8 : AV_PIX_FMT_BGR24 : AV_PIX_FMT_YUVJ420P;
avctx->color_range = version & 1 ? AVCOL_RANGE_UNSPECIFIED
}
buf32 = (const uint32_t*)buf;
- for (y = 0; y < avctx->height / 2; y++) {
+ for (ptrdiff_t y = 0; y < avctx->height / 2; y++) {
luma1 = (uint32_t*)&f->data[0][ y * 2 * f->linesize[0] ];
luma2 = (uint32_t*)&f->data[0][ (y * 2 + 1) * f->linesize[0] ];
cr = (uint32_t*)&f->data[1][ y * f->linesize[1] ];
cb = (uint32_t*)&f->data[2][ y * f->linesize[2] ];
- for (x = 0; x < avctx->width; x += 8) {
+ for (ptrdiff_t x = 0; x < avctx->width; x += 8) {
*luma1++ = *buf32++;
*luma1++ = *buf32++;
*luma2++ = *buf32++;
if (is_pal) {
uint32_t *pal = (uint32_t *)f->data[1];
- for (y = 0; y < 256; y++) {
+ for (unsigned y = 0; y < 256; y++) {
pal[y] = AV_RL32(buf) | 0xFF000000;
buf += 4;
}
- for (y = 0; y <avctx->height; y++)
+ for (ptrdiff_t y = 0; y < avctx->height; y++)
memcpy(&f->data[0][y * f->linesize[0]],
&buf[y * avctx->width],
avctx->width);
} else {
/* Fraps v1 is an upside-down BGR24 */
- for (y = 0; y<avctx->height; y++)
+ for (ptrdiff_t y = 0; y < avctx->height; y++)
memcpy(&f->data[0][(avctx->height - y - 1) * f->linesize[0]],
&buf[y * avctx->width * 3],
3 * avctx->width);
return buf_size;
}
-
/**
* closes decoder
* @param avctx codec context
*/
static av_cold int decode_end(AVCodecContext *avctx)
{
- FrapsContext *s = (FrapsContext*)avctx->priv_data;
+ FrapsContext *s = avctx->priv_data;
av_freep(&s->tmpbuf);
return 0;
}
-
const FFCodec ff_fraps_decoder = {
.p.name = "fraps",
- .p.long_name = NULL_IF_CONFIG_SMALL("Fraps"),
+ CODEC_LONG_NAME("Fraps"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_FRAPS,
.priv_data_size = sizeof(FrapsContext),
.close = decode_end,
FF_CODEC_DECODE_CB(decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
- .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};