diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2013-02-11 18:08:45 -0800 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-14 00:15:02 +0100 |
commit | faf8eca08dcb069e205c720476cad638b36699ef (patch) | |
tree | 665f4cda2ed32311f6c66422b44c94b0e68438dc | |
parent | c230af9bccc3cadb373f9007ba14fffb6c2acc75 (diff) | |
download | ffmpeg-faf8eca08dcb069e205c720476cad638b36699ef.tar.gz |
h264: remove clear_blocks call in threading init.
Init code in that if statement goes down from 26716 cycles to 26047
cycles, i.e. the removal of the clear_blocks and smaller memcpy()
together save around 670 cycles.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/h264.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index cbf64c6995..26386b9914 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1253,7 +1253,9 @@ static int decode_update_thread_context(AVCodecContext *dst, // copy all fields after MpegEnc memcpy(&h->s + 1, &h1->s + 1, - sizeof(H264Context) - sizeof(MpegEncContext)); + offsetof(H264Context, intra_gb) - sizeof(MpegEncContext)); + memcpy(&h->cabac, &h1->cabac, + sizeof(H264Context) - offsetof(H264Context, cabac)); memset(h->sps_buffers, 0, sizeof(h->sps_buffers)); memset(h->pps_buffers, 0, sizeof(h->pps_buffers)); @@ -1273,9 +1275,6 @@ static int decode_update_thread_context(AVCodecContext *dst, h->bipred_scratchpad = NULL; h->thread_context[0] = h; - - s->dsp.clear_blocks(h->mb); - s->dsp.clear_blocks(h->mb + (24 * 16 << h->pixel_shift)); } /* frame_start may not be called for the next thread (if it's decoding |