[Ffmpeg-cvslog] r8389 - in trunk/libavcodec: h263.c mpeg12.c mpegvideo.c

michael subversion
Tue Mar 13 23:47:05 CET 2007


Author: michael
Date: Tue Mar 13 23:47:05 2007
New Revision: 8389

Modified:
   trunk/libavcodec/h263.c
   trunk/libavcodec/mpeg12.c
   trunk/libavcodec/mpegvideo.c

Log:
dont malloc() static mv_penalty arrays


Modified: trunk/libavcodec/h263.c
==============================================================================
--- trunk/libavcodec/h263.c	(original)
+++ trunk/libavcodec/h263.c	Tue Mar 13 23:47:05 2007
@@ -87,7 +87,7 @@ static uint8_t uni_DCtab_chrom_len[512];
 static uint16_t uni_DCtab_lum_bits[512];
 static uint16_t uni_DCtab_chrom_bits[512];
 
-static uint8_t (*mv_penalty)[MAX_MV*2+1]= NULL;
+static uint8_t mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
 static uint8_t fcode_tab[MAX_MV*2+1];
 static uint8_t umv_fcode_tab[MAX_MV*2+1];
 
@@ -1797,9 +1797,6 @@ static void init_mv_penalty_and_fcode(Mp
     int f_code;
     int mv;
 
-    if(mv_penalty==NULL)
-        mv_penalty= av_mallocz( sizeof(uint8_t)*(MAX_FCODE+1)*(2*MAX_MV+1) );
-
     for(f_code=1; f_code<=MAX_FCODE; f_code++){
         for(mv=-MAX_MV; mv<=MAX_MV; mv++){
             int len;

Modified: trunk/libavcodec/mpeg12.c
==============================================================================
--- trunk/libavcodec/mpeg12.c	(original)
+++ trunk/libavcodec/mpeg12.c	Tue Mar 13 23:47:05 2007
@@ -94,7 +94,7 @@ static const enum PixelFormat pixfmt_xvm
                                            PIX_FMT_XVMC_MPEG2_MC,
                                            -1};
 #ifdef CONFIG_ENCODERS
-static uint8_t (*mv_penalty)[MAX_MV*2+1]= NULL;
+static uint8_t mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
 static uint8_t fcode_tab[MAX_MV*2+1];
 
 static uint8_t  uni_mpeg1_ac_vlc_len [64*64*2];
@@ -859,8 +859,6 @@ void ff_mpeg1_encode_init(MpegEncContext
                 mpeg1_chr_dc_uni[i+255]= bits + (code<<8);
         }
 
-        mv_penalty= av_mallocz( sizeof(uint8_t)*(MAX_FCODE+1)*(2*MAX_MV+1) );
-
         for(f_code=1; f_code<=MAX_FCODE; f_code++){
             for(mv=-MAX_MV; mv<=MAX_MV; mv++){
                 int len;

Modified: trunk/libavcodec/mpegvideo.c
==============================================================================
--- trunk/libavcodec/mpegvideo.c	(original)
+++ trunk/libavcodec/mpegvideo.c	Tue Mar 13 23:47:05 2007
@@ -107,7 +107,7 @@ static const uint8_t ff_default_chroma_q
 };
 
 #ifdef CONFIG_ENCODERS
-static uint8_t (*default_mv_penalty)[MAX_MV*2+1]=NULL;
+static uint8_t default_mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
 static uint8_t default_fcode_tab[MAX_MV*2+1];
 
 enum PixelFormat ff_yuv420p_list[2]= {PIX_FMT_YUV420P, -1};
@@ -633,7 +633,6 @@ static void MPV_encode_defaults(MpegEncC
         int i;
         done=1;
 
-        default_mv_penalty= av_mallocz( sizeof(uint8_t)*(MAX_FCODE+1)*(2*MAX_MV+1) );
         memset(default_fcode_tab , 0, sizeof(uint8_t)*(2*MAX_MV+1));
 
         for(i=-16; i<16; i++){




More information about the ffmpeg-cvslog mailing list