diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-08 13:02:38 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-08 13:02:53 +0100 |
commit | dcc9009e141c312537d64bf771d89fbee576806c (patch) | |
tree | 46865e457d8f89b8e36ce5ad7160ae1491462452 /libavcodec/vp9.c | |
parent | 16ae337bd8d46d98664ede2484dd635dae939771 (diff) | |
parent | 024fac5cd4f74d237b7b285355d7e463c1911196 (diff) | |
download | ffmpeg-dcc9009e141c312537d64bf771d89fbee576806c.tar.gz |
Merge remote-tracking branch 'rbultje/vp9-simd'
* rbultje/vp9-simd:
vp9: make mv bounds 32bit.
vp9: reset contextual caches on frame size change with mt enabled.
vp9/x86: idct_32x32_add_ssse3 sub-8x8-idct.
vp9/x86: idct_32x32_add_ssse3 sub-16x16-idct.
vp9/x86: idct_32x32_add_ssse3.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vp9.c')
-rw-r--r-- | libavcodec/vp9.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index 78b8d2c23b..b4e8d4e5eb 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -232,7 +232,7 @@ typedef struct VP9Context { // block reconstruction intermediates int16_t *block_base, *block, *uvblock_base[2], *uvblock[2]; uint8_t *eob_base, *uveob_base[2], *eob, *uveob[2]; - VP56mv min_mv, max_mv; + struct { int x, y; } min_mv, max_mv; DECLARE_ALIGNED(32, uint8_t, tmp_y)[64*64]; DECLARE_ALIGNED(32, uint8_t, tmp_uv)[2][32*32]; } VP9Context; @@ -3450,6 +3450,13 @@ static void adapt_probs(VP9Context *s) } } +static void free_buffers(VP9Context *s) +{ + av_freep(&s->above_partition_ctx); + av_freep(&s->b_base); + av_freep(&s->block_base); +} + static av_cold int vp9_decode_free(AVCodecContext *ctx) { VP9Context *s = ctx->priv_data; @@ -3468,11 +3475,9 @@ static av_cold int vp9_decode_free(AVCodecContext *ctx) ff_thread_release_buffer(ctx, &s->next_refs[i]); av_frame_free(&s->next_refs[i].f); } - av_freep(&s->above_partition_ctx); + free_buffers(s); av_freep(&s->c_b); s->c_b_size = 0; - av_freep(&s->b_base); - av_freep(&s->block_base); return 0; } @@ -3762,7 +3767,10 @@ static int vp9_decode_update_thread_context(AVCodecContext *dst, const AVCodecCo int i, res; VP9Context *s = dst->priv_data, *ssrc = src->priv_data; - // FIXME scalability, size, etc. + // detect size changes in other threads + if (s->above_partition_ctx && (s->cols != ssrc->cols || s->rows != ssrc->rows)) { + free_buffers(s); + } for (i = 0; i < 2; i++) { if (s->frames[i].tf.f->data[0]) |