comparison msmpeg4.c @ 1325:1cbc2380d172 libavcodec

CONFIG_ENCODERS cleanup
author michaelni
date Sun, 22 Jun 2003 11:08:22 +0000
parents a979fab41ed8
children b5c65adac96a
comparison
equal deleted inserted replaced
1324:7d328fd9d8a5 1325:1cbc2380d172
56 #define DEFAULT_INTER_INDEX 3 56 #define DEFAULT_INTER_INDEX 3
57 57
58 static uint32_t v2_dc_lum_table[512][2]; 58 static uint32_t v2_dc_lum_table[512][2];
59 static uint32_t v2_dc_chroma_table[512][2]; 59 static uint32_t v2_dc_chroma_table[512][2];
60 60
61 #ifdef CONFIG_ENCODERS
62 static inline void msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n); 61 static inline void msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n);
63 #endif //CONFIG_ENCODERS
64 static inline int msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block, 62 static inline int msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
65 int n, int coded, const uint8_t *scantable); 63 int n, int coded, const uint8_t *scantable);
66 static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr); 64 static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr);
67 static int msmpeg4_decode_motion(MpegEncContext * s, 65 static int msmpeg4_decode_motion(MpegEncContext * s,
68 int *mx_ptr, int *my_ptr); 66 int *mx_ptr, int *my_ptr);
69 #ifdef CONFIG_ENCODERS
70 static void msmpeg4v2_encode_motion(MpegEncContext * s, int val); 67 static void msmpeg4v2_encode_motion(MpegEncContext * s, int val);
71 #endif //CONFIG_ENCODERS
72 static void init_h263_dc_for_msmpeg4(void); 68 static void init_h263_dc_for_msmpeg4(void);
73 static inline void msmpeg4_memsetw(short *tab, int val, int n); 69 static inline void msmpeg4_memsetw(short *tab, int val, int n);
74 #ifdef CONFIG_ENCODERS 70 #ifdef CONFIG_ENCODERS
75 static int get_size_of_code(MpegEncContext * s, RLTable *rl, int last, int run, int level, int intra); 71 static int get_size_of_code(MpegEncContext * s, RLTable *rl, int last, int run, int level, int intra);
76 #endif //CONFIG_ENCODERS 72 #endif //CONFIG_ENCODERS
84 int frame_count = 0; 80 int frame_count = 0;
85 #endif 81 #endif
86 82
87 #include "msmpeg4data.h" 83 #include "msmpeg4data.h"
88 84
85 #ifdef CONFIG_ENCODERS //strangely gcc includes this even if its not references
89 static uint8_t rl_length[NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2]; 86 static uint8_t rl_length[NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2];
87 #endif //CONFIG_ENCODERS
90 88
91 #ifdef STATS 89 #ifdef STATS
92 90
93 const char *st_names[ST_NB] = { 91 const char *st_names[ST_NB] = {
94 "unknown", 92 "unknown",
848 return pred; 846 return pred;
849 } 847 }
850 848
851 #define DC_MAX 119 849 #define DC_MAX 119
852 850
853 #ifdef CONFIG_ENCODERS
854
855 static void msmpeg4_encode_dc(MpegEncContext * s, int level, int n, int *dir_ptr) 851 static void msmpeg4_encode_dc(MpegEncContext * s, int level, int n, int *dir_ptr)
856 { 852 {
857 int sign, code; 853 int sign, code;
858 int pred; 854 int pred;
859 855
1042 last_non_zero = i; 1038 last_non_zero = i;
1043 } 1039 }
1044 } 1040 }
1045 } 1041 }
1046 1042
1047 #endif //CONFIG_ENCODERS
1048
1049 /****************************************/ 1043 /****************************************/
1050 /* decoding stuff */ 1044 /* decoding stuff */
1051 1045
1052 static VLC mb_non_intra_vlc[4]; 1046 static VLC mb_non_intra_vlc[4];
1053 static VLC mb_intra_vlc; 1047 static VLC mb_intra_vlc;
1426 int i; 1420 int i;
1427 for(i=0;i<n;i++) 1421 for(i=0;i<n;i++)
1428 tab[i] = val; 1422 tab[i] = val;
1429 } 1423 }
1430 1424
1431 #ifdef CONFIG_ENCODERS
1432
1433 static void msmpeg4v2_encode_motion(MpegEncContext * s, int val) 1425 static void msmpeg4v2_encode_motion(MpegEncContext * s, int val)
1434 { 1426 {
1435 int range, bit_size, sign, code, bits; 1427 int range, bit_size, sign, code, bits;
1436 1428
1437 if (val == 0) { 1429 if (val == 0) {
1460 if (bit_size > 0) { 1452 if (bit_size > 0) {
1461 put_bits(&s->pb, bit_size, bits); 1453 put_bits(&s->pb, bit_size, bits);
1462 } 1454 }
1463 } 1455 }
1464 } 1456 }
1465
1466 #endif //CONFIG_ENCODERS
1467 1457
1468 /* this is identical to h263 except that its range is multiplied by 2 */ 1458 /* this is identical to h263 except that its range is multiplied by 2 */
1469 static int msmpeg4v2_decode_motion(MpegEncContext * s, int pred, int f_code) 1459 static int msmpeg4v2_decode_motion(MpegEncContext * s, int pred, int f_code)
1470 { 1460 {
1471 int code, val, sign, shift; 1461 int code, val, sign, shift;