From 7ebfb466aec2c4628fcd42a72b29034efcaba4bc Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 17 Feb 2013 14:52:24 -0800 Subject: h264: Don't store intra pcm samples in h->mb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ö --- libavcodec/h264_cavlc.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'libavcodec/h264_cavlc.c') 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; -- cgit v1.2.3