s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_bitexact;
s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_c;
-#if ARCH_X86
- ff_MPV_common_init_x86(s);
-#elif ARCH_ALPHA
- ff_MPV_common_init_axp(s);
-#elif ARCH_ARM
- ff_MPV_common_init_arm(s);
-#elif ARCH_BFIN
- ff_MPV_common_init_bfin(s);
-#elif ARCH_PPC
- ff_MPV_common_init_ppc(s);
-#endif
+ if (ARCH_ALPHA)
+ ff_MPV_common_init_axp(s);
+ if (ARCH_ARM)
+ ff_MPV_common_init_arm(s);
+ if (ARCH_BFIN)
+ ff_MPV_common_init_bfin(s);
+ if (ARCH_PPC)
+ ff_MPV_common_init_ppc(s);
+ if (ARCH_X86)
+ ff_MPV_common_init_x86(s);
/* load & permutate scantables
* note: only wmv uses different ones
FF_ALLOCZ_OR_GOTO(s->avctx, s->edge_emu_buffer, alloc_size * 2 * 24,
fail);
- FF_ALLOCZ_OR_GOTO(s->avctx, s->me.scratchpad, alloc_size * 2 * 16 * 2,
+ FF_ALLOCZ_OR_GOTO(s->avctx, s->me.scratchpad, alloc_size * 2 * 16 * 3,
fail)
s->me.temp = s->me.scratchpad;
s->rd_scratchpad = s->me.scratchpad;
av_buffer_unref(&pic->hwaccel_priv_buf);
+ if (pic->needs_realloc)
+ free_picture_tables(pic);
+
memset((uint8_t*)pic + off, 0, sizeof(*pic) - off);
}
s->flags = s->avctx->flags;
s->flags2 = s->avctx->flags2;
- if (s->width && s->height) {
- /* set chroma shifts */
- av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt,
- &s->chroma_x_shift,
- &s->chroma_y_shift);
+ /* set chroma shifts */
+ av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt,
+ &s->chroma_x_shift,
+ &s->chroma_y_shift);
- /* convert fourcc to upper case */
- s->codec_tag = avpriv_toupper4(s->avctx->codec_tag);
+ /* convert fourcc to upper case */
+ s->codec_tag = avpriv_toupper4(s->avctx->codec_tag);
- s->stream_codec_tag = avpriv_toupper4(s->avctx->stream_codec_tag);
+ s->stream_codec_tag = avpriv_toupper4(s->avctx->stream_codec_tag);
+ if (s->width && s->height) {
s->avctx->coded_frame = &s->current_picture.f;
if (s->encoding) {
}
}
+ ff_mpeg_unref_picture(s, &s->current_picture);
+
if (!s->encoding) {
ff_release_unused_pictures(s, 1);
// s->current_picture_ptr->quality = s->new_picture_ptr->quality;
s->current_picture_ptr->f.key_frame = s->pict_type == AV_PICTURE_TYPE_I;
- ff_mpeg_unref_picture(s, &s->current_picture);
if ((ret = ff_mpeg_ref_picture(s, &s->current_picture,
s->current_picture_ptr)) < 0)
return ret;
ff_xvmc_field_end(s);
} else if ((s->er.error_count || s->encoding) &&
!s->avctx->hwaccel &&
- !(s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) &&
s->unrestricted_mv &&
s->current_picture.reference &&
!s->intra_only &&
}
if (!avctx->hwaccel &&
- !(avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) &&
draw_edges &&
cur->reference &&
!(avctx->flags & CODEC_FLAG_EMU_EDGE)) {