aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_cabac.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2013-02-17 14:52:24 -0800
committerMartin Storsjö <martin@martin.st>2013-02-19 22:34:14 +0200
commit7ebfb466aec2c4628fcd42a72b29034efcaba4bc (patch)
treede856f2702d6366c7d5b22993d10a1fff2dca823 /libavcodec/h264_cabac.c
parent9918f57dcfc276cc8ecad3705875ca5877980c7a (diff)
downloadffmpeg-7ebfb466aec2c4628fcd42a72b29034efcaba4bc.tar.gz
h264: Don't store intra pcm samples in h->mb
Instead, keep them in the bitstream buffer until we read them verbatim, this saves a memcpy() and a subsequent clearing of the target buffer. decode_cabac+decode_mb for a sample file (CAPM3_Sony_D.jsv) goes from 6121.4 to 6095.5 cycles, i.e. 26 cycles faster. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/h264_cabac.c')
-rw-r--r--libavcodec/h264_cabac.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index 8fc6b953cc..beb7d36b7c 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -2004,7 +2004,8 @@ decode_intra_mb:
// The pixels are stored in the same order as levels in h->mb array.
if ((int) (h->cabac.bytestream_end - ptr) < mb_size)
return -1;
- memcpy(h->mb, ptr, mb_size); ptr+=mb_size;
+ h->intra_pcm_ptr = ptr;
+ ptr += mb_size;
ff_init_cabac_decoder(&h->cabac, ptr, h->cabac.bytestream_end - ptr);