diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2014-11-24 00:44:47 +0100 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-11-25 02:00:06 +0000 |
commit | d25afb579facc83fd3a839f21411124d0b09f0ba (patch) | |
tree | 6a5a2987936e63493bae3557dd5498db157ce1c7 /libavcodec/vc1_block.c | |
parent | b67138598ce158e3083f6295a27b63e2065d5ecb (diff) | |
download | ffmpeg-d25afb579facc83fd3a839f21411124d0b09f0ba.tar.gz |
vc1: Set the is_intra bitfield to all 1 when needed
Keep the code as similar as possible across the codepaths to
ease spotting it for factorization.
Based on a patch from Michael Niedermayer <michaelni@gmx.at>.
Diffstat (limited to 'libavcodec/vc1_block.c')
-rw-r--r-- | libavcodec/vc1_block.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index ab7f7a3518..38de670f46 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -1648,8 +1648,9 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) s->current_picture.motion_val[1][s->block_index[i]][0] = 0; s->current_picture.motion_val[1][s->block_index[i]][1] = 0; } - s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA; - s->mb_intra = v->is_intra[s->mb_x] = 1; + v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. + s->mb_intra = 1; + s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA; fieldtx = v->fieldtx_plane[mb_pos] = get_bits1(gb); mb_has_coeffs = get_bits1(gb); if (mb_has_coeffs) @@ -1816,7 +1817,8 @@ static int vc1_decode_p_mb_intfi(VC1Context *v) idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_IF_MBMODE_VLC_BITS, 2); if (idx_mbmode <= 1) { // intra MB - s->mb_intra = v->is_intra[s->mb_x] = 1; + v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. + s->mb_intra = 1; s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0; s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0; s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; @@ -2093,7 +2095,8 @@ static void vc1_decode_b_mb_intfi(VC1Context *v) idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_IF_MBMODE_VLC_BITS, 2); if (idx_mbmode <= 1) { // intra MB - s->mb_intra = v->is_intra[s->mb_x] = 1; + v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. + s->mb_intra = 1; s->current_picture.motion_val[1][s->block_index[0]][0] = 0; s->current_picture.motion_val[1][s->block_index[0]][1] = 0; s->current_picture.mb_type[mb_pos + v->mb_off] = MB_TYPE_INTRA; @@ -2311,8 +2314,9 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) s->mv[1][i][0] = s->current_picture.motion_val[1][s->block_index[i]][0] = 0; s->mv[1][i][1] = s->current_picture.motion_val[1][s->block_index[i]][1] = 0; } + v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. + s->mb_intra = 1; s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA; - s->mb_intra = v->is_intra[s->mb_x] = 1; fieldtx = v->fieldtx_plane[mb_pos] = get_bits1(gb); mb_has_coeffs = get_bits1(gb); if (mb_has_coeffs) |