diff options
author | Anton Khirnov <anton@khirnov.net> | 2015-01-17 22:28:46 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-03-21 11:27:15 +0100 |
commit | c377e04d8aa74d030672e9a4788a700b0695fc14 (patch) | |
tree | 86171a6dca7f3e538cdc00ed02c92b5f7a1f4c75 /libavcodec/h264.c | |
parent | 36d04801ba9d8622c2d759c172aea18561bac74d (diff) | |
download | ffmpeg-c377e04d8aa74d030672e9a4788a700b0695fc14.tar.gz |
h264: move top_borders into the per-slice context
Also change the method for allocating to the same one as used by
edge_emu_buffer.
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index e60d1fc349..b711c64fac 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -379,8 +379,6 @@ void ff_h264_free_tables(H264Context *h, int free_rbsp) hx = h->thread_context[i]; if (!hx) continue; - av_freep(&hx->top_borders[1]); - av_freep(&hx->top_borders[0]); av_freep(&hx->dc_val_base); av_freep(&hx->er.mb_index2xy); av_freep(&hx->er.error_status_table); @@ -401,9 +399,13 @@ void ff_h264_free_tables(H264Context *h, int free_rbsp) av_freep(&sl->bipred_scratchpad); av_freep(&sl->edge_emu_buffer); + av_freep(&sl->top_borders[0]); + av_freep(&sl->top_borders[1]); sl->bipred_scratchpad_allocated = 0; sl->edge_emu_buffer_allocated = 0; + sl->top_borders_allocated[0] = 0; + sl->top_borders_allocated[1] = 0; } } @@ -486,11 +488,6 @@ int ff_h264_context_init(H264Context *h) int yc_size = y_size + 2 * c_size; int x, y, i; - FF_ALLOCZ_OR_GOTO(h->avctx, h->top_borders[0], - h->mb_width * 16 * 3 * sizeof(uint8_t) * 2, fail) - FF_ALLOCZ_OR_GOTO(h->avctx, h->top_borders[1], - h->mb_width * 16 * 3 * sizeof(uint8_t) * 2, fail) - for (i = 0; i < h->nb_slice_ctx; i++) { h->slice_ctx[i].ref_cache[0][scan8[5] + 1] = h->slice_ctx[i].ref_cache[0][scan8[7] + 1] = |