[FFmpeg-devel] [PATCH 3/3] avcodec/ff_init_vlc_sparse: use a local array for static vlcs avoiding malloc()

Nicolas George nicolas.george at normalesup.org
Sat Jul 13 13:58:11 CEST 2013


Le quintidi 25 messidor, an CCXXI, Michael Niedermayer a écrit :
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  libavcodec/bitstream.c |   14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
> index aac32a5..d748de5 100644
> --- a/libavcodec/bitstream.c
> +++ b/libavcodec/bitstream.c
> @@ -270,6 +270,7 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
>  {
>      VLCcode *buf;
>      int i, j, ret;
> +    VLCcode localbuf[1500];

It may be obvious for people who know the VLC code, but can you explain
where the 1500 constant comes from?

Regards,

-- 
  Nicolas George
-------------- 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/20130713/b84d701f/attachment.asc>


More information about the ffmpeg-devel mailing list