summaryrefslogtreecommitdiff
path: root/libavcodec/svq3.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2013-02-17 17:01:26 -0800
committerMartin Storsjö <martin@martin.st>2013-02-19 22:34:33 +0200
commitfae6fd5b873911cfcd7f7b3d72de6598af5e003a (patch)
tree36bc84ff86d5bff411ccf5e6323469a8c33cf10f /libavcodec/svq3.c
parent7ebfb466aec2c4628fcd42a72b29034efcaba4bc (diff)
h264/svq3: Stop using draw_edges
Instead, only extend edges on-demand when the motion vector actually crosses the visible decoded area using ff_emulated_edge_mc(). This changes decoding time for cathedral from 8.722sec to 8.706sec, i.e. 0.2% faster overall. More generally (VP8 uses this also), low-motion content gets significant speed improvements, whereas high-motion content tends to decode in approximately the same time. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/svq3.c')
-rw-r--r--libavcodec/svq3.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index e24004affd..8b7218e487 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -291,9 +291,7 @@ static inline void svq3_mc_dir_part(SVQ3Context *s,
if (mx < 0 || mx >= s->h_edge_pos - width - 1 ||
my < 0 || my >= s->v_edge_pos - height - 1) {
- if ((h->flags & CODEC_FLAG_EMU_EDGE))
- emu = 1;
-
+ emu = 1;
mx = av_clip(mx, -16, s->h_edge_pos - width + 15);
my = av_clip(my, -16, s->v_edge_pos - height + 15);
}
@@ -1050,6 +1048,11 @@ static int get_buffer(AVCodecContext *avctx, Picture *pic)
pic->f.reference = !(h->pict_type == AV_PICTURE_TYPE_B);
ret = ff_get_buffer(avctx, &pic->f);
+ if (!h->edge_emu_buffer) {
+ h->edge_emu_buffer = av_mallocz(pic->f.linesize[0] * 17);
+ if (!h->edge_emu_buffer)
+ return AVERROR(ENOMEM);
+ }
h->linesize = pic->f.linesize[0];
h->uvlinesize = pic->f.linesize[1];
@@ -1225,8 +1228,8 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
(h->pict_type == AV_PICTURE_TYPE_P && mb_type < 8) ? (mb_type - 1) : -1;
}
- ff_draw_horiz_band(avctx, &h->dsp, s->cur_pic, s->last_pic->f.data[0] ? s->last_pic : NULL,
- 16 * h->mb_y, 16, h->picture_structure, 0, 1,
+ ff_draw_horiz_band(avctx, NULL, s->cur_pic, s->last_pic->f.data[0] ? s->last_pic : NULL,
+ 16 * h->mb_y, 16, h->picture_structure, 0, 0,
h->low_delay, h->mb_height * 16, h->mb_width * 16);
}