Mercurial > libavcodec.hg
comparison vp8.c @ 12230:00a4a6b56c7f libavcodec
Fix stupid bug in VP8 prefetching code
author | darkshikari |
---|---|
date | Thu, 22 Jul 2010 22:15:43 +0000 |
parents | cf675a4d5195 |
children | d3f3897ddb5c |
comparison
equal
deleted
inserted
replaced
12229:cf675a4d5195 | 12230:00a4a6b56c7f |
---|---|
1081 | 1081 |
1082 /* Fetch pixels for estimated mv 4 macroblocks ahead. | 1082 /* Fetch pixels for estimated mv 4 macroblocks ahead. |
1083 * Optimized for 64-byte cache lines. Inspired by ffh264 prefetch_motion. */ | 1083 * Optimized for 64-byte cache lines. Inspired by ffh264 prefetch_motion. */ |
1084 static inline void prefetch_motion(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, int x_off, int y_off, int ref) | 1084 static inline void prefetch_motion(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, int x_off, int y_off, int ref) |
1085 { | 1085 { |
1086 if (mb->ref_frame != VP56_FRAME_CURRENT) { | 1086 int mx = mb->mv.x + x_off + 8; |
1087 int mx = mb->mv.x + x_off + 8; | 1087 int my = mb->mv.y + y_off; |
1088 int my = mb->mv.y + y_off; | 1088 uint8_t **src= s->framep[ref]->data; |
1089 uint8_t **src= s->framep[mb->ref_frame]->data; | 1089 int off= mx + (my + (mb_x&3)*4)*s->linesize + 64; |
1090 int off= mx + (my + (mb_x&3)*4)*s->linesize + 64; | 1090 s->dsp.prefetch(src[0]+off, s->linesize, 4); |
1091 s->dsp.prefetch(src[0]+off, s->linesize, 4); | 1091 off= (mx>>1) + ((my>>1) + (mb_x&7))*s->uvlinesize + 64; |
1092 off= (mx>>1) + ((my>>1) + (mb_x&7))*s->uvlinesize + 64; | 1092 s->dsp.prefetch(src[1]+off, src[2]-src[1], 2); |
1093 s->dsp.prefetch(src[1]+off, src[2]-src[1], 2); | |
1094 } | |
1095 } | 1093 } |
1096 | 1094 |
1097 /** | 1095 /** |
1098 * Apply motion vectors to prediction buffer, chapter 18. | 1096 * Apply motion vectors to prediction buffer, chapter 18. |
1099 */ | 1097 */ |