[FFmpeg-devel] [PATCH] h264: don't store intra pcm samples in h->mb.

Michael Niedermayer michaelni at gmx.at
Thu Feb 14 14:48:08 CET 2013


On Wed, Feb 13, 2013 at 10:23:47PM -0800, Ronald S. Bultje wrote:
> From: "Ronald S. Bultje" <rsbultje at gmail.com>
> 
> 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.
> ---
>  libavcodec/h264.h             |  1 +
>  libavcodec/h264_cabac.c       |  3 ++-
>  libavcodec/h264_cavlc.c       | 11 +++--------
>  libavcodec/h264_mb_template.c | 16 ++++++++--------
>  4 files changed, 14 insertions(+), 17 deletions(-)
> 
> diff --git a/libavcodec/h264.h b/libavcodec/h264.h
> index b0d44cc..ac57658 100644
> --- a/libavcodec/h264.h
> +++ b/libavcodec/h264.h
> @@ -391,6 +391,7 @@ typedef struct H264Context {
>      GetBitContext *inter_gb_ptr;
>  
>      DECLARE_ALIGNED(16, int16_t, mb)[16 * 48 * 2]; ///< as a dct coeffecient is int32_t in high depth, we need to reserve twice the space.
> +    const uint8_t *intra_pcm_ptr;
>      DECLARE_ALIGNED(16, int16_t, mb_luma_dc)[3][16 * 2];
>      int16_t mb_padding[256 * 2];        ///< as mb is addressed by scantable[i] and scantable is uint8_t we can either check that i is not too large or ensure that there is some unused stuff after mb

the mb writing code can write over the end, thats why mb_padding is
there. nothing should be placed between them

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130214/e03ce986/attachment.asc>


More information about the ffmpeg-devel mailing list