diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2013-02-17 14:52:24 -0800 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-02-19 22:34:14 +0200 |
commit | 7ebfb466aec2c4628fcd42a72b29034efcaba4bc (patch) | |
tree | de856f2702d6366c7d5b22993d10a1fff2dca823 /libavcodec/h264_cavlc.c | |
parent | 9918f57dcfc276cc8ecad3705875ca5877980c7a (diff) | |
download | ffmpeg-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_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 9585b77830..4b44cbefa9 100644 --- a/libavcodec/h264_cavlc.c +++ b/libavcodec/h264_cavlc.c @@ -761,17 +761,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; |