comparison h263.c @ 4655:f0ce30e115ac libavcodec

dont malloc() static mv_penalty arrays
author michael
date Tue, 13 Mar 2007 22:47:05 +0000
parents 6679d37a3338
children 1f1a0e67b961
comparison
equal deleted inserted replaced
4654:bda54c0d6766 4655:f0ce30e115ac
85 static uint8_t uni_DCtab_lum_len[512]; 85 static uint8_t uni_DCtab_lum_len[512];
86 static uint8_t uni_DCtab_chrom_len[512]; 86 static uint8_t uni_DCtab_chrom_len[512];
87 static uint16_t uni_DCtab_lum_bits[512]; 87 static uint16_t uni_DCtab_lum_bits[512];
88 static uint16_t uni_DCtab_chrom_bits[512]; 88 static uint16_t uni_DCtab_chrom_bits[512];
89 89
90 static uint8_t (*mv_penalty)[MAX_MV*2+1]= NULL; 90 static uint8_t mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
91 static uint8_t fcode_tab[MAX_MV*2+1]; 91 static uint8_t fcode_tab[MAX_MV*2+1];
92 static uint8_t umv_fcode_tab[MAX_MV*2+1]; 92 static uint8_t umv_fcode_tab[MAX_MV*2+1];
93 93
94 static uint32_t uni_mpeg4_intra_rl_bits[64*64*2*2]; 94 static uint32_t uni_mpeg4_intra_rl_bits[64*64*2*2];
95 static uint8_t uni_mpeg4_intra_rl_len [64*64*2*2]; 95 static uint8_t uni_mpeg4_intra_rl_len [64*64*2*2];
1795 static void init_mv_penalty_and_fcode(MpegEncContext *s) 1795 static void init_mv_penalty_and_fcode(MpegEncContext *s)
1796 { 1796 {
1797 int f_code; 1797 int f_code;
1798 int mv; 1798 int mv;
1799 1799
1800 if(mv_penalty==NULL)
1801 mv_penalty= av_mallocz( sizeof(uint8_t)*(MAX_FCODE+1)*(2*MAX_MV+1) );
1802
1803 for(f_code=1; f_code<=MAX_FCODE; f_code++){ 1800 for(f_code=1; f_code<=MAX_FCODE; f_code++){
1804 for(mv=-MAX_MV; mv<=MAX_MV; mv++){ 1801 for(mv=-MAX_MV; mv<=MAX_MV; mv++){
1805 int len; 1802 int len;
1806 1803
1807 if(mv==0) len= mvtab[0][1]; 1804 if(mv==0) len= mvtab[0][1];