static uint32_t v2_dc_lum_table[512][2];
static uint32_t v2_dc_chroma_table[512][2];
-#ifdef CONFIG_ENCODERS
static inline void msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n);
-#endif //CONFIG_ENCODERS
static inline int msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
int n, int coded, const uint8_t *scantable);
static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr);
static int msmpeg4_decode_motion(MpegEncContext * s,
int *mx_ptr, int *my_ptr);
-#ifdef CONFIG_ENCODERS
static void msmpeg4v2_encode_motion(MpegEncContext * s, int val);
-#endif //CONFIG_ENCODERS
static void init_h263_dc_for_msmpeg4(void);
static inline void msmpeg4_memsetw(short *tab, int val, int n);
#ifdef CONFIG_ENCODERS
static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64]);
static int wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64]);
-extern uint32_t inverse[256];
-
#ifdef DEBUG
int intra_count = 0;
#include "msmpeg4data.h"
+#ifdef CONFIG_ENCODERS //strangely gcc includes this even if its not references
static uint8_t rl_length[NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2];
+#endif //CONFIG_ENCODERS
#ifdef STATS
if(s->msmpeg4_version>=4){
- ff_init_scantable(s, &s->intra_scantable , wmv1_scantable[1]);
- ff_init_scantable(s, &s->intra_h_scantable, wmv1_scantable[2]);
- ff_init_scantable(s, &s->intra_v_scantable, wmv1_scantable[3]);
- ff_init_scantable(s, &s->inter_scantable , wmv1_scantable[0]);
+ ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable , wmv1_scantable[1]);
+ ff_init_scantable(s->dsp.idct_permutation, &s->intra_h_scantable, wmv1_scantable[2]);
+ ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, wmv1_scantable[3]);
+ ff_init_scantable(s->dsp.idct_permutation, &s->inter_scantable , wmv1_scantable[0]);
}
//Note the default tables are set in common_init in mpegvideo.c
put_bits(&s->pb, 1, 1);
s->last_bits++;
s->misc_bits++;
+ s->skip_count++;
return;
}
msmpeg4_encode_block(s, block[i], i);
}
s->i_tex_bits += get_bits_diff(s);
+ s->i_count++;
}
}
sum+=src[x + y*stride];
}
}
- return (sum + (scale>>1))/scale;
+ return FASTDIV((sum + (scale>>1)), scale);
}
/* dir = 0: left, dir = 1: top prediction */
b = (b + (8 >> 1)) / 8;
c = (c + (8 >> 1)) / 8;
} else {
- a = (a + (scale >> 1)) / scale;
- b = (b + (scale >> 1)) / scale;
- c = (c + (scale >> 1)) / scale;
+ a = FASTDIV((a + (scale >> 1)), scale);
+ b = FASTDIV((b + (scale >> 1)), scale);
+ c = FASTDIV((c + (scale >> 1)), scale);
}
#endif
/* XXX: WARNING: they did not choose the same test as MPEG4. This
#define DC_MAX 119
-#ifdef CONFIG_ENCODERS
-
static void msmpeg4_encode_dc(MpegEncContext * s, int level, int n, int *dir_ptr)
{
int sign, code;
}
}
-#endif //CONFIG_ENCODERS
-
/****************************************/
/* decoding stuff */
tab[i] = val;
}
-#ifdef CONFIG_ENCODERS
-
static void msmpeg4v2_encode_motion(MpegEncContext * s, int val)
{
int range, bit_size, sign, code, bits;
}
}
-#endif //CONFIG_ENCODERS
-
/* this is identical to h263 except that its range is multiplied by 2 */
static int msmpeg4v2_decode_motion(MpegEncContext * s, int pred, int f_code)
{
return pred;
sign = get_bits1(&s->gb);
shift = f_code - 1;
- val = (code - 1) << shift;
- if (shift > 0)
+ val = code;
+ if (shift) {
+ val = (val - 1) << shift;
val |= get_bits(&s->gb, shift);
- val++;
+ val++;
+ }
if (sign)
val = -val;