{
MsrleContext *s = (MsrleContext *)avctx->priv_data;
+ /* no supplementary picture */
+ if (buf_size == 0)
+ return 0;
+
s->buf = buf;
s->size = buf_size;
s->frame.reference = 1;
+ s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE;
+ if (avctx->cr_available)
+ s->frame.buffer_hints |= FF_BUFFER_HINTS_REUSABLE;
+ else
+ s->frame.buffer_hints |= FF_BUFFER_HINTS_READABLE;
if (avctx->get_buffer(avctx, &s->frame)) {
av_log(avctx, AV_LOG_ERROR, " MS RLE: get_buffer() failed\n");
return -1;
avctx->release_buffer(avctx, &s->prev_frame);
/* shuffle frames */
+ if (!avctx->cr_available)
s->prev_frame = s->frame;
*data_size = sizeof(AVFrame);
NULL,
msrle_decode_end,
msrle_decode_frame,
- CODEC_CAP_DR1,
+ CODEC_CAP_DR1 | CODEC_CAP_CR,
};
}
#define COPY_PREV_BLOCK() \
+ if (!s->avctx->cr_available) {\
pixel_ptr = block_ptr; \
for (pixel_y = 0; pixel_y < 4; pixel_y++) { \
for (pixel_x = 0; pixel_x < 4; pixel_x++, pixel_ptr++) \
pixels[pixel_ptr] = prev_pixels[pixel_ptr]; \
pixel_ptr -= row_dec; \
- }
+ } \
+ }
typedef struct Msvideo1Context {
{
Msvideo1Context *s = (Msvideo1Context *)avctx->priv_data;
+ /* no supplementary picture */
+ if (buf_size == 0)
+ return 0;
+
s->buf = buf;
s->size = buf_size;
+ s->frame.reference = 1;
+ s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE;
+ if (avctx->cr_available)
+ s->frame.buffer_hints |= FF_BUFFER_HINTS_REUSABLE;
+ else
+ s->frame.buffer_hints |= FF_BUFFER_HINTS_READABLE;
if (avctx->get_buffer(avctx, &s->frame)) {
av_log(s->avctx, AV_LOG_ERROR, " MS Video-1 Video: get_buffer() failed\n");
return -1;
avctx->release_buffer(avctx, &s->prev_frame);
/* shuffle frames */
+ if (!avctx->cr_available)
s->prev_frame = s->frame;
*data_size = sizeof(AVFrame);
NULL,
msvideo1_decode_end,
msvideo1_decode_frame,
- CODEC_CAP_DR1,
+ CODEC_CAP_DR1 | CODEC_CAP_CR,
};
/* Skip blocks */
case 0x80:
while (n_blocks--) {
+ if (!s->avctx->cr_available) {
block_ptr = row_ptr + pixel_ptr;
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
for (pixel_x = 0; pixel_x < 4; pixel_x++){
}
block_ptr += row_inc;
}
- ADVANCE_BLOCK();
+ }
+ ADVANCE_BLOCK();
}
break;
{
RpzaContext *s = (RpzaContext *)avctx->priv_data;
+ /* no supplementary picture */
+ if (buf_size == 0)
+ return 0;
+
s->buf = buf;
s->size = buf_size;
s->frame.reference = 1;
+ s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE;
+ if (avctx->cr_available)
+ s->frame.buffer_hints |= FF_BUFFER_HINTS_REUSABLE;
+ else
+ s->frame.buffer_hints |= FF_BUFFER_HINTS_READABLE;
if (avctx->get_buffer(avctx, &s->frame)) {
av_log(avctx, AV_LOG_ERROR, " RPZA Video: get_buffer() failed\n");
return -1;
}
+ if (s->prev_frame.data[0] &&(s->frame.linesize[0] != s->prev_frame.linesize[0]))
+ av_log(avctx, AV_LOG_ERROR, "Buffer linesize changed: current %u, previous %u.\n"
+ "Expect wrong image and/or crash!\n",
+ s->frame.linesize[0], s->prev_frame.linesize[0]);
+
rpza_decode_stream(s);
if (s->prev_frame.data[0])
avctx->release_buffer(avctx, &s->prev_frame);
/* shuffle frames */
+ if (!avctx->cr_available)
s->prev_frame = s->frame;
*data_size = sizeof(AVFrame);
NULL,
rpza_decode_end,
rpza_decode_frame,
- CODEC_CAP_DR1,
+ CODEC_CAP_DR1 | CODEC_CAP_CR,
};