[FFmpeg-cvslog] avcodec/vc1: add Simple and Main profile to vc1_put_signed_blocks_clamped
Jerome Borsboom
git at videolan.org
Sat Jun 16 20:27:02 EEST 2018
ffmpeg | branch: master | Jerome Borsboom <jerome.borsboom at carpalis.nl> | Wed Jun 6 20:47:23 2018 +0200| [2065317db6dc3a219f8ed2de427fe7e19e02eb68] | committer: Carl Eugen Hoyos
avcodec/vc1: add Simple and Main profile to vc1_put_signed_blocks_clamped
Simple and Main profile also need unsigned put_pixels_clamped. Add an argument
to choose between signed and unsigned put_pixels and change function name to
vc1_put_blocks_clamped.
Signed-off-by: Jerome Borsboom <jerome.borsboom at carpalis.nl>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2065317db6dc3a219f8ed2de427fe7e19e02eb68
---
libavcodec/vc1_block.c | 54 ++++++++++++++++++++++++++++++++++----------------
1 file changed, 37 insertions(+), 17 deletions(-)
diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
index 0160095c6c..863f801ef4 100644
--- a/libavcodec/vc1_block.c
+++ b/libavcodec/vc1_block.c
@@ -66,7 +66,7 @@ static inline void init_block_index(VC1Context *v)
/** @} */ //Bitplane group
-static void vc1_put_signed_blocks_clamped(VC1Context *v)
+static void vc1_put_blocks_clamped(VC1Context *v, int put_signed)
{
MpegEncContext *s = &v->s;
uint8_t *dest;
@@ -85,9 +85,14 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v)
if (i > 3 ? v->mb_type[0][s->block_index[i] - s->block_wrap[i] - 1] :
v->mb_type[0][s->block_index[i] - 2 * s->block_wrap[i] - 2]) {
dest = s->dest[0] + ((i & 2) - 4) * 4 * s->linesize + ((i & 1) - 2) * 8;
- s->idsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][i],
- i > 3 ? s->dest[i - 3] - 8 * s->uvlinesize - 8 : dest,
- i > 3 ? s->uvlinesize : s->linesize);
+ if (put_signed)
+ s->idsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][i],
+ i > 3 ? s->dest[i - 3] - 8 * s->uvlinesize - 8 : dest,
+ i > 3 ? s->uvlinesize : s->linesize);
+ else
+ s->idsp.put_pixels_clamped(v->block[v->topleft_blk_idx][i],
+ i > 3 ? s->dest[i - 3] - 8 * s->uvlinesize - 8 : dest,
+ i > 3 ? s->uvlinesize : s->linesize);
}
}
}
@@ -96,9 +101,14 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v)
if (i > 3 ? v->mb_type[0][s->block_index[i] - s->block_wrap[i]] :
v->mb_type[0][s->block_index[i] - 2 * s->block_wrap[i]]) {
dest = s->dest[0] + ((i & 2) - 4) * 4 * s->linesize + (i & 1) * 8;
- s->idsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][i],
- i > 3 ? s->dest[i - 3] - 8 * s->uvlinesize : dest,
- i > 3 ? s->uvlinesize : s->linesize);
+ if (put_signed)
+ s->idsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][i],
+ i > 3 ? s->dest[i - 3] - 8 * s->uvlinesize : dest,
+ i > 3 ? s->uvlinesize : s->linesize);
+ else
+ s->idsp.put_pixels_clamped(v->block[v->top_blk_idx][i],
+ i > 3 ? s->dest[i - 3] - 8 * s->uvlinesize : dest,
+ i > 3 ? s->uvlinesize : s->linesize);
}
}
}
@@ -114,9 +124,14 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v)
dest = s->dest[0] + ((i & 2) >> 1) * s->linesize + ((i & 1) - 2) * 8;
else
dest = s->dest[0] + (i & 2) * 4 * s->linesize + ((i & 1) - 2) * 8;
- s->idsp.put_signed_pixels_clamped(v->block[v->left_blk_idx][i],
- i > 3 ? s->dest[i - 3] - 8 : dest,
- i > 3 ? s->uvlinesize : s->linesize << fieldtx);
+ if (put_signed)
+ s->idsp.put_signed_pixels_clamped(v->block[v->left_blk_idx][i],
+ i > 3 ? s->dest[i - 3] - 8 : dest,
+ i > 3 ? s->uvlinesize : s->linesize << fieldtx);
+ else
+ s->idsp.put_pixels_clamped(v->block[v->left_blk_idx][i],
+ i > 3 ? s->dest[i - 3] - 8 : dest,
+ i > 3 ? s->uvlinesize : s->linesize << fieldtx);
}
}
}
@@ -129,9 +144,14 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v)
dest = s->dest[0] + ((i & 2) >> 1) * s->linesize + (i & 1) * 8;
else
dest = s->dest[0] + (i & 2) * 4 * s->linesize + (i & 1) * 8;
- s->idsp.put_signed_pixels_clamped(v->block[v->cur_blk_idx][i],
- i > 3 ? s->dest[i - 3] : dest,
- i > 3 ? s->uvlinesize : s->linesize << fieldtx);
+ if (put_signed)
+ s->idsp.put_signed_pixels_clamped(v->block[v->cur_blk_idx][i],
+ i > 3 ? s->dest[i - 3] : dest,
+ i > 3 ? s->uvlinesize : s->linesize << fieldtx);
+ else
+ s->idsp.put_pixels_clamped(v->block[v->cur_blk_idx][i],
+ i > 3 ? s->dest[i - 3] : dest,
+ i > 3 ? s->uvlinesize : s->linesize << fieldtx);
}
}
}
@@ -1469,7 +1489,7 @@ static int vc1_decode_p_mb(VC1Context *v)
end:
if (v->overlap && v->pq >= 9)
ff_vc1_p_overlap_filter(v);
- vc1_put_signed_blocks_clamped(v);
+ vc1_put_blocks_clamped(v, 1);
v->cbp[s->mb_x] = block_cbp;
v->ttblk[s->mb_x] = block_tt;
@@ -1680,7 +1700,7 @@ static int vc1_decode_p_mb_intfr(VC1Context *v)
}
if (v->overlap && v->pq >= 9)
ff_vc1_p_overlap_filter(v);
- vc1_put_signed_blocks_clamped(v);
+ vc1_put_blocks_clamped(v, 1);
v->cbp[s->mb_x] = block_cbp;
v->ttblk[s->mb_x] = block_tt;
@@ -1800,7 +1820,7 @@ static int vc1_decode_p_mb_intfi(VC1Context *v)
}
if (v->overlap && v->pq >= 9)
ff_vc1_p_overlap_filter(v);
- vc1_put_signed_blocks_clamped(v);
+ vc1_put_blocks_clamped(v, 1);
v->cbp[s->mb_x] = block_cbp;
v->ttblk[s->mb_x] = block_tt;
@@ -2727,7 +2747,7 @@ static void vc1_decode_i_blocks_adv(VC1Context *v)
if (v->overlap && v->condover != CONDOVER_NONE)
ff_vc1_i_overlap_filter(v);
- vc1_put_signed_blocks_clamped(v);
+ vc1_put_blocks_clamped(v, 1);
if (v->s.loop_filter)
ff_vc1_i_loop_filter(v);
More information about the ffmpeg-cvslog
mailing list