[x264-devel] Re: [PATCH] Altivec optimizations for quant4x4, quant4x4dc, quant8x8, sub8x8_dct8, sub16x16_dct8, pixel_sa8d_8x8
Loren Merritt
lorenm at u.washington.edu
Tue Aug 29 19:53:12 CEST 2006
- Previous message: [x264-devel] Re: [PATCH] Altivec optimizations for quant4x4, quant4x4dc, quant8x8, sub8x8_dct8, sub16x16_dct8, pixel_sa8d_8x8
- Next message: [x264-devel] Re: [PATCH] Altivec optimizations for quant4x4, quant4x4dc, quant8x8, sub8x8_dct8, sub16x16_dct8, pixel_sa8d_8x8
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
On Tue, 29 Aug 2006, Guillaume POIRIER wrote:
> So I imagine the problem lies in the abs+accumulation code, which seems
> quite straightforward, and doesn't look like it could be that
> error-prone... but it's late here, and so I guess I'll just sleep on
it...
>
> If anyone has an idea, please speak-up! :)
> /* accumulation of all elements of the resulting bloc */
> vec_s16_t abs0v = vec_abs(sa8d0v);
> vec_s16_t abs1v = vec_abs(sa8d1v);
> vec_s16_t sum01v = vec_add(abs0v, abs1v);
> vec_s16_t abs2v = vec_abs(sa8d2v);
> vec_s16_t abs3v = vec_abs(sa8d3v);
> vec_s16_t sum23v = vec_add(abs2v, abs3v);
> vec_s32_t sum0123v = vec_sum4s(sum01v, sum23v);
>
> vec_s16_t abs4v = vec_abs(sa8d4v);
> vec_s16_t abs5v = vec_abs(sa8d5v);
> vec_s16_t sum45v = vec_add(abs4v, abs5v);
> vec_s16_t abs6v = vec_abs(sa8d6v);
> vec_s16_t abs7v = vec_abs(sa8d7v);
> vec_s16_t sum67v = vec_add(abs6v, abs7v);
> vec_s16_t sum4567v = vec_sum4s(sum45v, sum67v);
>
> vec_s32_t sumblocv = vec_sums( sum0123v, sum4567v );
> sumblocv = vec_splat(sumblocv, 3);
I'm not fluent in altivec, but the manual says:
vec_sum4s can't take two vec_s16_t, one of the inputs has to be 32bit.
vec_sums only horizontally sums one of the inputs.
so:
sa8d0v = vec_abs(sa8d0v);
sa8d1v = vec_abs(sa8d1v);
sa8d2v = vec_abs(sa8d2v);
sa8d3v = vec_abs(sa8d3v);
sa8d4v = vec_abs(sa8d4v);
sa8d5v = vec_abs(sa8d5v);
sa8d6v = vec_abs(sa8d6v);
sa8d7v = vec_abs(sa8d7v);
sa8d0v = vec_add(sa8d0v, sa8d4v);
sa8d1v = vec_add(sa8d1v, sa8d5v);
sa8d2v = vec_add(sa8d2v, sa8d6v);
sa8d3v = vec_add(sa8d3v, sa8d7v);
sa8d0v = vec_add(sa8d0v, sa8d2v);
sa8d1v = vec_add(sa8d1v, sa8d3v);
sa8d0v = vec_add(sa8d0v, sa8d1v);
vec_s32_t sumblocv = vec_sums(vec_sum4s(sa8d0v, zero), zero)
sumblocv = vec_splat(sumblocv, 3);
--Loren Merritt
--
This is the x264-devel mailing-list
To unsubscribe, go to: http://developers.videolan.org/lists.html
- Previous message: [x264-devel] Re: [PATCH] Altivec optimizations for quant4x4, quant4x4dc, quant8x8, sub8x8_dct8, sub16x16_dct8, pixel_sa8d_8x8
- Next message: [x264-devel] Re: [PATCH] Altivec optimizations for quant4x4, quant4x4dc, quant8x8, sub8x8_dct8, sub16x16_dct8, pixel_sa8d_8x8
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the x264-devel
mailing list