#include "libavutil/internal.h"
#include "libavutil/timer.h"
#include "avcodec.h"
+#include "blockdsp.h"
#include "dsputil.h"
#include "h264chroma.h"
#include "internal.h"
ff_init_block_index(s);
ff_update_block_index(s);
- s->dsp.clear_blocks(s->block[0]);
+ s->bdsp.clear_blocks(s->block[0]);
s->dest[0] = s->current_picture.f->data[0] + (s->mb_y * 16 * s->linesize) + s->mb_x * 16;
s->dest[1] = s->current_picture.f->data[1] + (s->mb_y * (16 >> s->chroma_y_shift) * s->uvlinesize) + s->mb_x * (16 >> s->chroma_x_shift);
/* init common dct for both encoder and decoder */
av_cold int ff_dct_common_init(MpegEncContext *s)
{
+ ff_blockdsp_init(&s->bdsp, s->avctx);
ff_dsputil_init(&s->dsp, s->avctx);
ff_h264chroma_init(&s->h264chroma, 8); //for lowres
ff_hpeldsp_init(&s->hdsp, s->avctx->flags);
+ ff_mpegvideodsp_init(&s->mdsp);
ff_videodsp_init(&s->vdsp, s->avctx->bits_per_raw_sample);
if (s->avctx->debug & FF_DEBUG_NOMC) {
{
int alloc_size = FFALIGN(FFABS(linesize) + 64, 32);
+ if (s->avctx->hwaccel || s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
+ return 0;
+
if (linesize < 24) {
av_log(s->avctx, AV_LOG_ERROR, "Image too small, temporary buffers cannot function\n");
return AVERROR_PATCHWELCOME;
// VC1 computes luma and chroma simultaneously and needs 19X19 + 9x9
// at uvlinesize. It supports only YUV420 so 24x24 is enough
// linesize * interlaced * MBsize
- FF_ALLOCZ_OR_GOTO(s->avctx, s->edge_emu_buffer, alloc_size * 4 * 24,
+ // we also use this buffer for encoding in encode_mb_internal() needig an additional 32 lines
+ FF_ALLOCZ_OR_GOTO(s->avctx, s->edge_emu_buffer, alloc_size * 4 * 68,
fail);
FF_ALLOCZ_OR_GOTO(s->avctx, s->me.scratchpad, alloc_size * 4 * 16 * 2,
if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame && !s->er.error_occurred)
ff_thread_report_progress(&s->current_picture_ptr->tf, s->mb_y, 0);
}
-
-#if CONFIG_ERROR_RESILIENCE
-void ff_mpeg_set_erpic(ERPicture *dst, Picture *src)
-{
- int i;
-
- memset(dst, 0, sizeof(*dst));
- if (!src) {
- dst->f = NULL;
- dst->tf = NULL;
- return;
- }
-
- dst->f = src->f;
- dst->tf = &src->tf;
-
- for (i = 0; i < 2; i++) {
- dst->motion_val[i] = src->motion_val[i];
- dst->ref_index[i] = src->ref_index[i];
- }
-
- dst->mb_type = src->mb_type;
- dst->field_picture = src->field_picture;
-}
-
-void ff_mpeg_er_frame_start(MpegEncContext *s)
-{
- ERContext *er = &s->er;
-
- ff_mpeg_set_erpic(&er->cur_pic, s->current_picture_ptr);
- ff_mpeg_set_erpic(&er->next_pic, s->next_picture_ptr);
- ff_mpeg_set_erpic(&er->last_pic, s->last_picture_ptr);
-
- er->pp_time = s->pp_time;
- er->pb_time = s->pb_time;
- er->quarter_sample = s->quarter_sample;
- er->partitioned_frame = s->partitioned_frame;
-
- ff_er_frame_start(er);
-}
-#endif /* CONFIG_ERROR_RESILIENCE */