44void dct_unquantize_h263_altivec(int16_t *
block,
int nb_coeffs,
int qadd,
int qmul)
46 register const vector
signed short vczero = (
const vector
signed short)vec_splat_s16(0);
49 register vector
signed short blockv, qmulv, qaddv, nqaddv, temp1;
50 register vector
bool short blockv_null, blockv_neg;
52 qmulv = vec_splat((
vec_s16)vec_lde(0, &qmul8), 0);
53 qaddv = vec_splat((
vec_s16)vec_lde(0, &qadd8), 0);
54 nqaddv = vec_sub(vczero, qaddv);
58 for (
register int j = 0; j <= nb_coeffs; j += 8) {
59 blockv = vec_ld(j << 1,
block);
60 blockv_neg = vec_cmplt(blockv, vczero);
61 blockv_null = vec_cmpeq(blockv, vczero);
63 temp1 = vec_sel(qaddv, nqaddv, blockv_neg);
65 temp1 = vec_mladd(blockv, qmulv, temp1);
67 blockv = vec_sel(temp1, blockv, blockv_null);
68 vec_st(blockv, j << 1,
block);
72static void dct_unquantize_h263_intra_altivec(
const MPVContext *
s,
73 int16_t *
block,
int n,
int qscale)
75 int qadd = (qscale - 1) | 1;
76 int qmul = qscale << 1;
77 int block0 =
block[0];
79 block0 *= n < 4 ?
s->y_dc_scale :
s->c_dc_scale;
82 int nb_coeffs =
s->ac_pred ? 63 :
s->intra_scantable.raster_end[
s->block_last_index[n]];
84 dct_unquantize_h263_altivec(
block, nb_coeffs, qadd, qmul);
90static void dct_unquantize_h263_inter_altivec(
const MPVContext *
s,
91 int16_t *
block,
int n,
int qscale)
93 int qadd = (qscale - 1) | 1;
94 int qmul = qscale << 1;
96 int nb_coeffs =
s->inter_scantable.raster_end[
s->block_last_index[n]];
98 dct_unquantize_h263_altivec(
block, nb_coeffs, qadd, qmul);
108 s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_altivec;
109 s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_altivec;
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
Macro definitions for various function/variable attributes.
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
#define PPC_ALTIVEC(flags)
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
av_cold void ff_mpv_unquantize_init_ppc(MPVUnquantDSPContext *s, int bitexact)
Contains misc utility macros and inline functions.