summaryrefslogtreecommitdiff
path: root/libavcodec/vc1_block.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2014-11-24 00:44:46 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-11-25 02:00:06 +0000
commitb67138598ce158e3083f6295a27b63e2065d5ecb (patch)
tree748b697e78cb4926eb9cc0d9e3abd5d92799ea41 /libavcodec/vc1_block.c
parent62e52b94e684491dfc5a6b7ca688bb86f7cd0f3f (diff)
vc1: Simplify a little setting the intra variables
The code currently set the information in at least 4 places, spare some pointless loops. Make the code in the loop a little uniform to make easier factorize it out later.
Diffstat (limited to 'libavcodec/vc1_block.c')
-rw-r--r--libavcodec/vc1_block.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
index acd5145944..ab7f7a3518 100644
--- a/libavcodec/vc1_block.c
+++ b/libavcodec/vc1_block.c
@@ -1650,8 +1650,6 @@ static int vc1_decode_p_mb_intfr(VC1Context *v)
}
s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA;
s->mb_intra = v->is_intra[s->mb_x] = 1;
- for (i = 0; i < 6; i++)
- v->mb_type[0][s->block_index[i]] = 1;
fieldtx = v->fieldtx_plane[mb_pos] = get_bits1(gb);
mb_has_coeffs = get_bits1(gb);
if (mb_has_coeffs)
@@ -1664,11 +1662,11 @@ static int vc1_decode_p_mb_intfr(VC1Context *v)
s->c_dc_scale = s->c_dc_scale_table[mquant];
dst_idx = 0;
for (i = 0; i < 6; i++) {
- s->dc_val[0][s->block_index[i]] = 0;
+ v->a_avail = v->c_avail = 0;
+ v->mb_type[0][s->block_index[i]] = 1;
+ s->dc_val[0][s->block_index[i]] = 0;
dst_idx += i >> 2;
val = ((cbp >> (5 - i)) & 1);
- v->mb_type[0][s->block_index[i]] = s->mb_intra;
- v->a_avail = v->c_avail = 0;
if (i == 2 || i == 3 || !s->first_slice_line)
v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
if (i == 1 || i == 3 || s->mb_x)
@@ -1833,11 +1831,11 @@ static int vc1_decode_p_mb_intfi(VC1Context *v)
cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_ICBPCY_VLC_BITS, 2);
dst_idx = 0;
for (i = 0; i < 6; i++) {
- s->dc_val[0][s->block_index[i]] = 0;
+ v->a_avail = v->c_avail = 0;
v->mb_type[0][s->block_index[i]] = 1;
+ s->dc_val[0][s->block_index[i]] = 0;
dst_idx += i >> 2;
val = ((cbp >> (5 - i)) & 1);
- v->a_avail = v->c_avail = 0;
if (i == 2 || i == 3 || !s->first_slice_line)
v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
if (i == 1 || i == 3 || s->mb_x)
@@ -2110,11 +2108,11 @@ static void vc1_decode_b_mb_intfi(VC1Context *v)
cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_ICBPCY_VLC_BITS, 2);
dst_idx = 0;
for (i = 0; i < 6; i++) {
- s->dc_val[0][s->block_index[i]] = 0;
+ v->a_avail = v->c_avail = 0;
+ v->mb_type[0][s->block_index[i]] = 1;
+ s->dc_val[0][s->block_index[i]] = 0;
dst_idx += i >> 2;
val = ((cbp >> (5 - i)) & 1);
- v->mb_type[0][s->block_index[i]] = s->mb_intra;
- v->a_avail = v->c_avail = 0;
if (i == 2 || i == 3 || !s->first_slice_line)
v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
if (i == 1 || i == 3 || s->mb_x)
@@ -2315,8 +2313,6 @@ static int vc1_decode_b_mb_intfr(VC1Context *v)
}
s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA;
s->mb_intra = v->is_intra[s->mb_x] = 1;
- for (i = 0; i < 6; i++)
- v->mb_type[0][s->block_index[i]] = 1;
fieldtx = v->fieldtx_plane[mb_pos] = get_bits1(gb);
mb_has_coeffs = get_bits1(gb);
if (mb_has_coeffs)
@@ -2329,11 +2325,11 @@ static int vc1_decode_b_mb_intfr(VC1Context *v)
s->c_dc_scale = s->c_dc_scale_table[mquant];
dst_idx = 0;
for (i = 0; i < 6; i++) {
- s->dc_val[0][s->block_index[i]] = 0;
+ v->a_avail = v->c_avail = 0;
+ v->mb_type[0][s->block_index[i]] = 1;
+ s->dc_val[0][s->block_index[i]] = 0;
dst_idx += i >> 2;
val = ((cbp >> (5 - i)) & 1);
- v->mb_type[0][s->block_index[i]] = s->mb_intra;
- v->a_avail = v->c_avail = 0;
if (i == 2 || i == 3 || !s->first_slice_line)
v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
if (i == 1 || i == 3 || s->mb_x)