[FFmpeg-devel] [PATCH] avoid aligned stack variable in dnxhdenc.c

Baptiste Coudurier baptiste.coudurier
Mon May 25 22:12:51 CEST 2009


Hi Reimar,

On 5/25/2009 1:49 AM, Reimar D?ffinger wrote:
> Hello,
> haven't actually tested but can't imagine it would have any really bad
> effect, e.g. on speed.

Could please benchmark it quickly ? DNxHD works at very high bitrate and
is pretty sensible to cache IIRC. Not sure if this has any impact, but
I'd like to double check nonetheless.

> Index: dnxhdenc.c
> ===================================================================
> --- dnxhdenc.c  (revision 18938)
> +++ dnxhdenc.c  (working copy)
> @@ -416,7 +416,7 @@
>              dnxhd_get_blocks(ctx, mb_x, mb_y);
>  
>              for (i = 0; i < 8; i++) {
> -                DECLARE_ALIGNED_16(DCTELEM, block[64]);
> +                DCTELEM *block = ctx->blocks[8];
>                  DCTELEM *src_block = ctx->blocks[i];
>                  int overflow, nbits, diff, last_index;
>                  int n = dnxhd_switch_matrix(ctx, i);
> Index: dnxhdenc.h
> ===================================================================
> --- dnxhdenc.h  (revision 18938)
> +++ dnxhdenc.h  (working copy)
> @@ -54,7 +54,7 @@
>      int interlaced;
>      int cur_field;
>  
> -    DECLARE_ALIGNED_16(DCTELEM, blocks[8][64]);
> +    DECLARE_ALIGNED_16(DCTELEM, blocks[9][64]);
>  

This is not really obvious, it's supposed to be 8 blocks because of
4:2:2. DECLARE_ALIGNED_16(DCTELEM, tmp_block[64]); should be better IMHO.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list