{
int i, j, k, cbp, val, mb_type, motion_type;
const int mb_block_count = 4 + (1 << s->chroma_format);
+ int ret;
av_dlog(s->avctx, "decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y);
mpeg2_fast_decode_block_intra(s, *s->pblocks[i], i);
} else {
for (i = 0; i < mb_block_count; i++)
- if (mpeg2_decode_block_intra(s, *s->pblocks[i], i) < 0)
- return -1;
+ if ((ret = mpeg2_decode_block_intra(s, *s->pblocks[i], i)) < 0)
+ return ret;
}
} else {
for (i = 0; i < 6; i++)
- if (mpeg1_decode_block_intra(s, *s->pblocks[i], i) < 0)
- return -1;
+ if ((ret = mpeg1_decode_block_intra(s, *s->pblocks[i], i)) < 0)
+ return ret;
}
} else {
if (mb_type & MB_TYPE_ZERO_MV) {
for (i = 0; i < mb_block_count; i++) {
if (cbp & (1 << 11)) {
- if (mpeg2_decode_block_non_intra(s, *s->pblocks[i], i) < 0)
- return -1;
+ if ((ret = mpeg2_decode_block_non_intra(s, *s->pblocks[i], i)) < 0)
+ return ret;
} else {
s->block_last_index[i] = -1;
}
} else {
for (i = 0; i < 6; i++) {
if (cbp & 32) {
- if (mpeg1_decode_block_inter(s, *s->pblocks[i], i) < 0)
- return -1;
+ if ((ret = mpeg1_decode_block_inter(s, *s->pblocks[i], i)) < 0)
+ return ret;
} else {
s->block_last_index[i] = -1;
}
{
AVCodecContext *avctx = s->avctx;
Mpeg1Context *s1 = (Mpeg1Context *) s;
+ int ret;
/* start frame decoding */
if (s->first_field || s->picture_structure == PICT_FRAME) {
AVFrameSideData *pan_scan;
- if (ff_mpv_frame_start(s, avctx) < 0)
- return -1;
+ if ((ret = ff_mpv_frame_start(s, avctx)) < 0)
+ return ret;
ff_mpeg_er_frame_start(s);
}
if (avctx->hwaccel) {
- if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0)
- return -1;
+ if ((ret = avctx->hwaccel->start_frame(avctx, buf, buf_size)) < 0)
+ return ret;
}
return 0;
AVCodecContext *avctx = s->avctx;
const int lowres = s->avctx->lowres;
const int field_pic = s->picture_structure != PICT_FRAME;
+ int ret;
s->resync_mb_x =
s->resync_mb_y = -1;
if ((CONFIG_MPEG1_XVMC_HWACCEL || CONFIG_MPEG2_XVMC_HWACCEL) && s->pack_pblocks)
ff_xvmc_init_block(s); // set s->block
- if (mpeg_decode_mb(s, s->block) < 0)
- return -1;
+ if ((ret = mpeg_decode_mb(s, s->block)) < 0)
+ return ret;
// Note motion_val is normally NULL unless we want to extract the MVs.
if (s->current_picture.motion_val[0] && !s->encoding) {
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
int i, v;
+ int ret;
/* start new MPEG-1 context decoding */
s->out_format = FMT_MPEG1;
setup_hwaccel_for_pixfmt(avctx);
ff_mpv_idct_init(s);
- if (ff_mpv_common_init(s) < 0)
- return -1;
+ if ((ret = ff_mpv_common_init(s)) < 0)
+ return ret;
s1->mpeg_enc_ctx_allocated = 1;
for (i = 0; i < 64; i++) {
if (s->first_slice) {
skip_frame = 0;
s->first_slice = 0;
- if (mpeg_field_start(s2, buf, buf_size) < 0)
- return -1;
+ if ((ret = mpeg_field_start(s2, buf, buf_size)) < 0)
+ return ret;
}
if (!s2->current_picture_ptr) {
av_log(avctx, AV_LOG_ERROR,