diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2013-02-17 14:52:24 -0800 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-18 01:21:23 +0100 |
commit | c63f9fb37a7b7da03bed6d79115f7f2e36607808 (patch) | |
tree | f405ac2af54069fd224ea5a06c071a023869efff /libavcodec/h264_cavlc.c | |
parent | 54b2bddd22fb32a67038848b8d2394bee671b143 (diff) | |
download | ffmpeg-c63f9fb37a7b7da03bed6d79115f7f2e36607808.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: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264_cavlc.c')
-rw-r--r-- | libavcodec/h264_cavlc.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c index e6f4b25663..b75e653268 100644 --- a/libavcodec/h264_cavlc.c +++ b/libavcodec/h264_cavlc.c @@ -762,17 +762,12 @@ decode_intra_mb: h->slice_table[ mb_xy ]= h->slice_num; if(IS_INTRA_PCM(mb_type)){ - unsigned int x; const int mb_size = ff_h264_mb_sizes[h->sps.chroma_format_idc] * - h->sps.bit_depth_luma >> 3; + h->sps.bit_depth_luma; // We assume these blocks are very rare so we do not optimize it. - align_get_bits(&h->gb); - - // The pixels are stored in the same order as levels in h->mb array. - for(x=0; x < mb_size; x++){ - ((uint8_t*)h->mb)[x]= get_bits(&h->gb, 8); - } + h->intra_pcm_ptr = align_get_bits(&h->gb); + skip_bits_long(&h->gb, mb_size); // In deblocking, the quantizer is 0 h->cur_pic.f.qscale_table[mb_xy] = 0; |