summaryrefslogtreecommitdiff
path: root/libavcodec/ppc
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2009-01-06 10:35:06 +0000
committerGuillaume Poirier <gpoirier@mplayerhq.hu>2009-01-06 10:35:06 +0000
commit54b9095833fea1897a00fa08e8b46fd9d4c7b826 (patch)
tree8aac5a4c8ad97c119db4ee46fccbb4d80bc4714a /libavcodec/ppc
parent373745ae62faa02abe6c4a23486d1f6a851043f1 (diff)
offset and weights are signed, fixes some non-bitexact issues.
Patch by David Conrad %lessen42 A gmail P com% Originally committed as revision 16449 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ppc')
-rw-r--r--libavcodec/ppc/h264_altivec.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/ppc/h264_altivec.c b/libavcodec/ppc/h264_altivec.c
index 6a5ed44f54..fb9b9beb74 100644
--- a/libavcodec/ppc/h264_altivec.c
+++ b/libavcodec/ppc/h264_altivec.c
@@ -942,7 +942,8 @@ void biweight_h264_WxH_altivec(uint8_t *dst, uint8_t *src, int stride, int log2_
{
int y, dst_aligned, src_aligned;
vec_u8 vsrc, vdst;
- vec_u16 vtemp, vlog2_denom, vweights, vweightd, voffset, v0, v1, v2, v3;
+ vec_s16 vtemp, vweights, vweightd, voffset, v0, v1, v2, v3;
+ vec_u16 vlog2_denom;
DECLARE_ALIGNED_16(int32_t, temp[4]);
LOAD_ZERO;
@@ -977,16 +978,16 @@ void biweight_h264_WxH_altivec(uint8_t *dst, uint8_t *src, int stride, int log2_
}
if (w == 16 || dst_aligned) {
- v0 = vec_mladd(v0, vweightd, zero_u16v);
- v2 = vec_mladd(v2, vweights, zero_u16v);
+ v0 = vec_mladd(v0, vweightd, zero_s16v);
+ v2 = vec_mladd(v2, vweights, zero_s16v);
v0 = vec_adds(v0, voffset);
v0 = vec_adds(v0, v2);
v0 = vec_sra(v0, vlog2_denom);
}
if (w == 16 || !dst_aligned) {
- v1 = vec_mladd(v1, vweightd, zero_u16v);
- v3 = vec_mladd(v3, vweights, zero_u16v);
+ v1 = vec_mladd(v1, vweightd, zero_s16v);
+ v3 = vec_mladd(v3, vweights, zero_s16v);
v1 = vec_adds(v1, voffset);
v1 = vec_adds(v1, v3);