Commit c4e2a535 authored by D Richard Felker III's avatar D Richard Felker III

100l to loren. at least this fixes the compile error, but the code is still...

100l to loren. at least this fixes the compile error, but the code is still broken (decoding buggy/crashing)

Originally committed as revision 5276 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 52dc09a5
...@@ -553,11 +553,10 @@ void ff_clean_mpeg4_qscales(MpegEncContext *s){ ...@@ -553,11 +553,10 @@ void ff_clean_mpeg4_qscales(MpegEncContext *s){
#endif //CONFIG_ENCODERS #endif //CONFIG_ENCODERS
#define tab_size (sizeof(s->direct_scale_mv[0])/sizeof(int16_t))
#define tab_bias (tab_size/2)
static void ff_mpeg4_init_direct_mv(MpegEncContext *s){ static void ff_mpeg4_init_direct_mv(MpegEncContext *s){
//FIXME table is stored in MpegEncContext for thread-safety,
// but a static array would be faster
static const int tab_size = sizeof(s->direct_scale_mv[0])/sizeof(int16_t);
static const int tab_bias = (tab_size/2);
int i; int i;
for(i=0; i<tab_size; i++){ for(i=0; i<tab_size; i++){
s->direct_scale_mv[0][i] = (i-tab_bias)*s->pb_time/s->pp_time; s->direct_scale_mv[0][i] = (i-tab_bias)*s->pb_time/s->pp_time;
...@@ -566,8 +565,6 @@ static void ff_mpeg4_init_direct_mv(MpegEncContext *s){ ...@@ -566,8 +565,6 @@ static void ff_mpeg4_init_direct_mv(MpegEncContext *s){
} }
static inline void ff_mpeg4_set_one_direct_mv(MpegEncContext *s, int mx, int my, int i){ static inline void ff_mpeg4_set_one_direct_mv(MpegEncContext *s, int mx, int my, int i){
static const int tab_size = sizeof(s->direct_scale_mv[0])/sizeof(int16_t);
static const int tab_bias = (tab_size/2);
int xy= s->block_index[i]; int xy= s->block_index[i];
uint16_t time_pp= s->pp_time; uint16_t time_pp= s->pp_time;
uint16_t time_pb= s->pb_time; uint16_t time_pb= s->pb_time;
...@@ -595,6 +592,9 @@ static inline void ff_mpeg4_set_one_direct_mv(MpegEncContext *s, int mx, int my, ...@@ -595,6 +592,9 @@ static inline void ff_mpeg4_set_one_direct_mv(MpegEncContext *s, int mx, int my,
} }
} }
#undef tab_size
#undef tab_bias
/** /**
* *
* @return the mb_type * @return the mb_type
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment