This is more consistent and fixes compilation with clang.
Unified · Split
| @@ -31,7 +31,7 @@ · 30 unmodified lines | |||
| 31 | #include "libavcodec/hevcdsp.h" | 31 | #include "libavcodec/hevcdsp.h" |
| 32 | 32 | ||
| 33 | #if HAVE_ALTIVEC | 33 | #if HAVE_ALTIVEC |
| 34 | static const vector int16_t trans4[4] = { | 34 | static const vec_s16 trans4[4] = { |
| 35 | { 64, 64, 64, 64, 64, 64, 64, 64 }, | 35 | { 64, 64, 64, 64, 64, 64, 64, 64 }, |
| 36 | { 83, 36, 83, 36, 83, 36, 83, 36 }, | 36 | { 83, 36, 83, 36, 83, 36, 83, 36 }, |
| 37 | { 64, -64, 64, -64, 64, -64, 64, -64 }, | 37 | { 64, -64, 64, -64, 64, -64, 64, -64 }, |
| @@ -43,13 +43,13 @@ static const vec_u8 mask[2] = { · 5 unmodified lines | |||
| 43 | { 0x04, 0x05, 0x0C, 0x0D, 0x14, 0x15, 0x1C, 0x1D, 0x06, 0x07, 0x0E, 0x0F, 0x16, 0x17, 0x1E, 0x1F }, | 43 | { 0x04, 0x05, 0x0C, 0x0D, 0x14, 0x15, 0x1C, 0x1D, 0x06, 0x07, 0x0E, 0x0F, 0x16, 0x17, 0x1E, 0x1F }, |
| 44 | }; | 44 | }; |
| 45 | 45 | ||
| 46 | static void transform4x4(vector int16_t src_01, vector int16_t src_23, | 46 | static void transform4x4(vec_s16 src_01, vec_s16 src_23, vec_s32 res[4], |
| 47 | vector int32_t res[4], const int shift, int16_t *coeffs) | 47 | const int shift, int16_t *coeffs) |
| 48 | { | 48 | { |
| 49 | vector int16_t src_02, src_13; | 49 | vec_s16 src_02, src_13; |
| 50 | vector int32_t zero = vec_splat_s32(0); | 50 | vec_s32 zero = vec_splat_s32(0); |
| 51 | vector int32_t e0, o0, e1, o1; | 51 | vec_s32 e0, o0, e1, o1; |
| 52 | vector int32_t add; | 52 | vec_s32 add; |
| 53 | 53 | ||
| 54 | src_13 = vec_mergel(src_01, src_23); | 54 | src_13 = vec_mergel(src_01, src_23); |
| 55 | src_02 = vec_mergeh(src_01, src_23); | 55 | src_02 = vec_mergeh(src_01, src_23); |
| @@ -69,10 +69,10 @@ static void transform4x4(vector int16_t src_01, vector int16_t src_23, · 13 unmodified lines | |||
| 69 | res[3] = vec_sub(e0, o0); | 69 | res[3] = vec_sub(e0, o0); |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | static void scale(vector int32_t res[4], vector int16_t res_packed[2], int shift) | 72 | static void scale(vec_s32 res[4], vec_s16 res_packed[2], int shift) |
| 73 | { | 73 | { |
| 74 | int i; | 74 | int i; |
| 75 | vector unsigned int v_shift = vec_splat_u32(shift); | 75 | vec_u32 v_shift = vec_splat_u32(shift); |
| 76 | 76 | ||
| 77 | for (i = 0; i < 4; i++) | 77 | for (i = 0; i < 4; i++) |
| 78 | res[i] = vec_sra(res[i], v_shift); | 78 | res[i] = vec_sra(res[i], v_shift); |
| @@ -22,9 +22,9 @@ static void FUNC(ff_hevc_idct_4x4, BIT_DEPTH)(int16_t *coeffs, int col_limit) · 21 unmodified lines | |||
| 22 | { | 22 | { |
| 23 | const int shift = 7; | 23 | const int shift = 7; |
| 24 | const int shift2 = 20 - BIT_DEPTH; | 24 | const int shift2 = 20 - BIT_DEPTH; |
| 25 | vector int16_t src_01, src_23; | 25 | vec_s16 src_01, src_23; |
| 26 | vector int32_t res[4]; | 26 | vec_s32 res[4]; |
| 27 | vector int16_t res_packed[2]; | 27 | vec_s16 res_packed[2]; |
| 28 | 28 | ||
| 29 | src_01 = vec_ld(0, coeffs); | 29 | src_01 = vec_ld(0, coeffs); |
| 30 | src_23 = vec_ld(16, coeffs); | 30 | src_23 = vec_ld(16, coeffs); |