diff options
author | Jason Garrett-Glaser <darkshikari@gmail.com> | 2009-06-17 05:54:42 +0000 |
---|---|---|
committer | Jason Garrett-Glaser <darkshikari@gmail.com> | 2009-06-17 05:54:42 +0000 |
commit | 351653a51eb35e2706d8d868bf64d96d2d6c8f55 (patch) | |
tree | c693ac23f0ce7529d0873c5a7b9fcc653b72869f /libavcodec/vc1dec.c | |
parent | 0b389aee4d224a9c1805338fd72dacdcb45e9a82 (diff) | |
download | ffmpeg-351653a51eb35e2706d8d868bf64d96d2d6c8f55.tar.gz |
VC-1/WMV: Remove redundant ff_init_block_index() calls.
These are only supposed to be called once per row, not once per macroblock.
~1.5% faster according to oprofile.
Originally committed as revision 19213 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r-- | libavcodec/vc1dec.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 8cea7c9fc3..7aa104a213 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -2617,8 +2617,9 @@ static void vc1_decode_i_blocks(VC1Context *v) s->mb_intra = 1; s->first_slice_line = 1; for(s->mb_y = 0; s->mb_y < s->mb_height; s->mb_y++) { - for(s->mb_x = 0; s->mb_x < s->mb_width; s->mb_x++) { - ff_init_block_index(s); + s->mb_x = 0; + ff_init_block_index(s); + for(; s->mb_x < s->mb_width; s->mb_x++) { ff_update_block_index(s); s->dsp.clear_blocks(s->block[0]); mb_pos = s->mb_x + s->mb_y * s->mb_width; @@ -2730,8 +2731,9 @@ static void vc1_decode_i_blocks_adv(VC1Context *v) s->mb_intra = 1; s->first_slice_line = 1; for(s->mb_y = 0; s->mb_y < s->mb_height; s->mb_y++) { - for(s->mb_x = 0; s->mb_x < s->mb_width; s->mb_x++) { - ff_init_block_index(s); + s->mb_x = 0; + ff_init_block_index(s); + for(;s->mb_x < s->mb_width; s->mb_x++) { ff_update_block_index(s); s->dsp.clear_blocks(s->block[0]); mb_pos = s->mb_x + s->mb_y * s->mb_stride; @@ -2849,8 +2851,9 @@ static void vc1_decode_p_blocks(VC1Context *v) s->first_slice_line = 1; memset(v->cbp_base, 0, sizeof(v->cbp_base[0])*2*s->mb_stride); for(s->mb_y = 0; s->mb_y < s->mb_height; s->mb_y++) { - for(s->mb_x = 0; s->mb_x < s->mb_width; s->mb_x++) { - ff_init_block_index(s); + s->mb_x = 0; + ff_init_block_index(s); + for(; s->mb_x < s->mb_width; s->mb_x++) { ff_update_block_index(s); vc1_decode_p_mb(v); @@ -2898,8 +2901,9 @@ static void vc1_decode_b_blocks(VC1Context *v) s->first_slice_line = 1; for(s->mb_y = 0; s->mb_y < s->mb_height; s->mb_y++) { - for(s->mb_x = 0; s->mb_x < s->mb_width; s->mb_x++) { - ff_init_block_index(s); + s->mb_x = 0; + ff_init_block_index(s); + for(; s->mb_x < s->mb_width; s->mb_x++) { ff_update_block_index(s); vc1_decode_b_mb(v); |