diff mpeg12.c @ 1162:8c15d82c1893 libavcodec

some static -> dynamic alloc & 16->8 bit
author michaelni
date Mon, 31 Mar 2003 11:13:14 +0000
parents 9a5c29575902
children 0e3c0c4a7b3d
line wrap: on
line diff
--- a/mpeg12.c	Mon Mar 31 01:49:18 2003 +0000
+++ b/mpeg12.c	Mon Mar 31 11:13:14 2003 +0000
@@ -73,7 +73,7 @@
 static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred);
 
 #ifdef CONFIG_ENCODERS
-static uint16_t mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
+static uint8_t (*mv_penalty)[MAX_MV*2+1]= NULL;
 static uint8_t fcode_tab[MAX_MV*2+1];
 
 static uint32_t uni_mpeg1_ac_vlc_bits[64*64*2];
@@ -670,6 +670,8 @@
 		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;