Revision bbed9259 libavcodec/h263.c

View differences:

libavcodec/h263.c
49 49
#define MB_TYPE_B_VLC_BITS 4
50 50
#define TEX_VLC_BITS 9
51 51

  
52
#ifdef CONFIG_ENCODERS
52 53
static void h263_encode_block(MpegEncContext * s, DCTELEM * block,
53 54
			      int n);
54 55
static void h263_encode_motion(MpegEncContext * s, int val, int fcode);
......
56 57
static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block,
57 58
			       int n, int dc, UINT8 *scan_table, 
58 59
                               PutBitContext *dc_pb, PutBitContext *ac_pb);
60
#endif
61

  
59 62
static int h263_decode_motion(MpegEncContext * s, int pred, int fcode);
60 63
static int h263p_decode_umotion(MpegEncContext * s, int pred);
61 64
static int h263_decode_block(MpegEncContext * s, DCTELEM * block,
......
69 72
static void mpeg4_decode_sprite_trajectory(MpegEncContext * s);
70 73
static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, UINT16 **dc_val_ptr, int *dir_ptr);
71 74

  
72

  
73 75
extern UINT32 inverse[256];
74 76

  
75
static UINT16 mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
77
static UINT16 uni_DCtab_lum  [512][2];
78
static UINT16 uni_DCtab_chrom[512][2];
79

  
80
#ifdef CONFIG_ENCODERS
81
static UINT16 (*mv_penalty)[MAX_MV*2+1]= NULL;
76 82
static UINT8 fcode_tab[MAX_MV*2+1];
77 83
static UINT8 umv_fcode_tab[MAX_MV*2+1];
78 84

  
79
static UINT16 uni_DCtab_lum  [512][2];
80
static UINT16 uni_DCtab_chrom[512][2];
81 85
static UINT32 uni_mpeg4_intra_rl_bits[64*64*2*2];
82 86
static UINT8  uni_mpeg4_intra_rl_len [64*64*2*2];
83 87
static UINT32 uni_mpeg4_inter_rl_bits[64*64*2*2];
......
94 98
max level: 53/16
95 99
max run: 29/41
96 100
*/
101
#endif
102

  
97 103

  
98 104
int h263_get_picture_format(int width, int height)
99 105
{
......
364 370
    }
365 371
}
366 372

  
373
#ifdef CONFIG_ENCODERS
367 374
void mpeg4_encode_mb(MpegEncContext * s,
368 375
		    DCTELEM block[6][64],
369 376
		    int motion_x, int motion_y)
......
870 877
        }
871 878
    }
872 879
}
880
#endif
873 881

  
874 882
static int h263_pred_dc(MpegEncContext * s, int n, UINT16 **dc_val_ptr)
875 883
{
......
1061 1069
    return mot_val;
1062 1070
}
1063 1071

  
1072
#ifdef CONFIG_ENCODERS
1064 1073
static void h263_encode_motion(MpegEncContext * s, int val, int f_code)
1065 1074
{
1066 1075
    int range, l, bit_size, sign, code, bits;
......
1152 1161
{
1153 1162
    int f_code;
1154 1163
    int mv;
1164
    
1165
    if(mv_penalty==NULL)
1166
        mv_penalty= av_mallocz( sizeof(UINT16)*(MAX_FCODE+1)*(2*MAX_MV+1) );
1167
    
1155 1168
    for(f_code=1; f_code<=MAX_FCODE; f_code++){
1156 1169
        for(mv=-MAX_MV; mv<=MAX_MV; mv++){
1157 1170
            int len;
......
1189 1202
        umv_fcode_tab[mv]= 1;
1190 1203
    }
1191 1204
}
1205
#endif
1192 1206

  
1193 1207
static void init_uni_dc_tab(void)
1194 1208
{
......
1242 1256
    }
1243 1257
}
1244 1258

  
1259
#ifdef CONFIG_ENCODERS
1245 1260
static void init_uni_mpeg4_rl_tab(RLTable *rl, UINT32 *bits_tab, UINT8 *len_tab){
1246 1261
    int slevel, run, last;
1247 1262
    
......
1434 1449
	    }
1435 1450
    }
1436 1451
}
1452
#endif
1437 1453

  
1438 1454
/***************************************************/
1439 1455
/**
......
1832 1848
    }
1833 1849
#endif
1834 1850
}
1835

  
1851
#ifdef CONFIG_ENCODERS
1836 1852
static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n, int intra_dc, 
1837 1853
                               UINT8 *scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb)
1838 1854
{
......
1948 1964
    }
1949 1965
#endif
1950 1966
}
1951

  
1967
#endif
1952 1968

  
1953 1969

  
1954 1970
/***********************************************/

Also available in: Unified diff