From 36d04801ba9d8622c2d759c172aea18561bac74d Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 17 Jan 2015 22:28:46 +0100 Subject: h264: move the scratch buffers into the per-slice context Also change the method for allocating them. Instead of two possible alloc calls from different places, just ensure they are allocated at the start of each slice. This should be simpler and less bug-prone than the previous method. --- libavcodec/h264.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libavcodec/h264.h') diff --git a/libavcodec/h264.h b/libavcodec/h264.h index cf4bc1e..2c41584 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -399,6 +399,11 @@ typedef struct H264SliceContext { const uint8_t *intra_pcm_ptr; + uint8_t *bipred_scratchpad; + uint8_t *edge_emu_buffer; + int bipred_scratchpad_allocated; + int edge_emu_buffer_allocated; + /** * non zero coeff count cache. * is 64 if not available. @@ -708,8 +713,6 @@ typedef struct H264Context { int initial_cpb_removal_delay[32]; ///< Initial timestamps for CPBs int cur_chroma_format_idc; - uint8_t *bipred_scratchpad; - uint8_t *edge_emu_buffer; int16_t *dc_val_base; AVBufferPool *qscale_table_pool; -- cgit v1.1