本文整理汇总了C++中pxor_r2r函数的典型用法代码示例。如果您正苦于以下问题:C++ pxor_r2r函数的具体用法?C++ pxor_r2r怎么用?C++ pxor_r2r使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pxor_r2r函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mmx_interp_average_2_U8
static inline void mmx_interp_average_2_U8 (uint8_t * dest,
const uint8_t * src1,
const uint8_t * src2)
{
/* *dest = (*dest + (*src1 + *src2 + 1)/ 2 + 1)/ 2; */
movq_m2r (*dest, mm1); /* load 8 dest bytes */
movq_r2r (mm1, mm2); /* copy 8 dest bytes */
movq_m2r (*src1, mm3); /* load 8 src1 bytes */
movq_r2r (mm3, mm4); /* copy 8 src1 bytes */
movq_m2r (*src2, mm5); /* load 8 src2 bytes */
movq_r2r (mm5, mm6); /* copy 8 src2 bytes */
pxor_r2r (mm3, mm5); /* xor src1 and src2 */
pand_m2r (mask1, mm5); /* mask lower bits */
psrlq_i2r (1, mm5); /* /2 */
por_r2r (mm4, mm6); /* or src1 and src2 */
psubb_r2r (mm5, mm6); /* subtract subresults */
movq_r2r (mm6, mm5); /* copy subresult */
pxor_r2r (mm1, mm5); /* xor srcavg and dest */
pand_m2r (mask1, mm5); /* mask lower bits */
psrlq_i2r (1, mm5); /* /2 */
por_r2r (mm2, mm6); /* or srcavg and dest */
psubb_r2r (mm5, mm6); /* subtract subresults */
movq_r2m (mm6, *dest); /* store result in dest */
}
示例2: MC_avg4_8
static inline void MC_avg4_8 (int height, uint8_t * dest, const uint8_t * ref,
const int stride, const int cpu)
{
do {
movq_m2r (*ref, mm0);
movq_m2r (*(ref+stride+1), mm1);
movq_r2r (mm0, mm7);
movq_m2r (*(ref+1), mm2);
pxor_r2r (mm1, mm7);
movq_m2r (*(ref+stride), mm3);
movq_r2r (mm2, mm6);
pxor_r2r (mm3, mm6);
pavg_r2r (mm1, mm0);
pavg_r2r (mm3, mm2);
por_r2r (mm6, mm7);
movq_r2r (mm0, mm6);
pxor_r2r (mm2, mm6);
pand_r2r (mm6, mm7);
pand_m2r (mask_one, mm7);
pavg_r2r (mm2, mm0);
psubusb_r2r (mm7, mm0);
movq_m2r (*dest, mm1);
pavg_r2r (mm1, mm0);
ref += stride;
movq_r2m (mm0, *dest);
dest += stride;
} while (--height);
}
示例3: main
int main(int ac, char **av)
{
int i, j, k, n;
unsigned char dat0[8] = { 0x01, 0xf2, 0x03, 0x04, 0x05, 0x06, 0xf7, 0x08 };
long long *datp = (long long *)&dat0;
int16_t dat1[8] = { 0x10, 0x20, -0x130, -0x140, 0x50, -0x160, -0x170, 0x80 };
volatile uint8_t *rfp = dat0;
volatile int16_t *bp = dat1;
unsigned char ans1[8], ans2[8];
n = 0;
for( i=-32768; i<32768; ++i ) {
j = 0;
while( j < 256 ) {
for( k=0; k<8; ++k ) {
dat0[k] = i;
dat1[k] = j++;
}
movq_m2r(m_(&rfp[0]),mm1); /* rfp[0..7] */
pxor_r2r(mm3,mm3);
pxor_r2r(mm4,mm4);
movq_m2r(m_(&bp[0]),mm5); /* bp[0..3] */
movq_r2r(mm1,mm2);
movq_m2r(m_(&bp[4]),mm6); /* bp[4..7] */
punpcklbw_r2r(mm3,mm1); /* rfp[0,2,4,6] */
punpckhbw_r2r(mm3,mm2); /* rfp[1,3,5,7] */
paddsw_r2r(mm5,mm1); /* bp[0..3] */
paddsw_r2r(mm6,mm2); /* bp[4..7] */
pcmpgtw_r2r(mm1,mm3);
pcmpgtw_r2r(mm2,mm4);
pandn_r2r(mm1,mm3);
pandn_r2r(mm2,mm4);
packuswb_r2r(mm4,mm3);
movq_r2m(mm3,m_(&ans1[0]));
emms();
ans2[0] = clip(bp[0] + rfp[0]);
ans2[1] = clip(bp[1] + rfp[1]);
ans2[2] = clip(bp[2] + rfp[2]);
ans2[3] = clip(bp[3] + rfp[3]);
ans2[4] = clip(bp[4] + rfp[4]);
ans2[5] = clip(bp[5] + rfp[5]);
ans2[6] = clip(bp[6] + rfp[6]);
ans2[7] = clip(bp[7] + rfp[7]);
if( *(uint64_t *)&ans1[0] != *(uint64_t *)&ans2[0] )
{
printf(" i=%5d %02x %02x %02x %02x %02x %02x %02x %02x\n", i,
ans1[0], ans1[1], ans1[2], ans1[3], ans1[4], ans1[5], ans1[6], ans1[7]);
printf(" j=%5d %02x %02x %02x %02x %02x %02x %02x %02x\n", j,
ans2[0], ans2[1], ans2[2], ans2[3], ans2[4], ans2[5], ans2[6], ans2[7]);
// exit(0);
}
n += 8;
}
}
printf("n=%d\n",n);
return 0;
}
示例4: scale_uint8_x_4_x_generic_mmx
static void scale_uint8_x_4_x_generic_mmx(gavl_video_scale_context_t * ctx, int scanline, uint8_t * dest_start)
{
int i, j;
uint8_t * src, * dst, *src_start;
int32_t * factors;
// mmx_t tmp_mm;
/*
* mm0: Input
* mm1: factor_mask
* mm2: Factor
* mm3: Output
* mm4:
* mm5:
* mm6: 0
* mm7: scratch
*
*/
src_start = ctx->src + scanline * ctx->src_stride;
pxor_r2r(mm6, mm6);
movq_m2r(factor_mask, mm1);
dst = dest_start;
for(i = 0; i < ctx->dst_size; i++)
{
src = src_start + 4*ctx->table_h.pixels[i].index;
factors = ctx->table_h.pixels[i].factor_i;
pxor_r2r(mm3, mm3);
for(j = 0; j < ctx->table_h.factors_per_pixel; j++)
{
/* Load pixels */
movd_m2r(*(src), mm0);
punpcklbw_r2r(mm6, mm0);
psllw_i2r(7, mm0);
/* Load factors */
LOAD_FACTOR_1_4;
/* Multiply */
pmulhw_r2r(mm7, mm0);
paddw_r2r(mm0, mm3);
// DUMP_MM("mm3_2", mm3);
src += 4;
factors++;
}
psraw_i2r(5, mm3);
packuswb_r2r(mm6, mm3);
movd_r2m(mm3, *dst);
dst+=4;
}
ctx->need_emms = 1;
}
示例5: qblock_sad_mmxe
static __inline__ int qblock_sad_mmxe(uint8_t *refblk,
uint32_t h,
uint32_t rowstride)
{
int res;
pxor_r2r (mm4,mm4);
movq_r2r (mm0,mm5); /* First row */
movd_m2r (*refblk, mm6);
pxor_r2r ( mm7, mm7);
refblk += rowstride;
punpcklbw_r2r ( mm7, mm5);
punpcklbw_r2r ( mm7, mm6);
psadbw_r2r ( mm5, mm6);
paddw_r2r ( mm6, mm4 );
movq_r2r (mm1,mm5); /* Second row */
movd_m2r (*refblk, mm6);
refblk += rowstride;
punpcklbw_r2r ( mm7, mm5);
punpcklbw_r2r ( mm7, mm6);
psadbw_r2r ( mm5, mm6);
paddw_r2r ( mm6, mm4 );
if( h == 4 )
{
movq_r2r (mm2,mm5); /* Third row */
movd_m2r (*refblk, mm6);
refblk += rowstride;
punpcklbw_r2r ( mm7, mm5);
punpcklbw_r2r ( mm7, mm6);
psadbw_r2r ( mm5, mm6);
paddw_r2r ( mm6, mm4 );
movq_r2r (mm3,mm5); /* Fourth row */
movd_m2r (*refblk, mm6);
punpcklbw_r2r ( mm7, mm5);
punpcklbw_r2r ( mm7, mm6);
psadbw_r2r ( mm5, mm6);
paddw_r2r ( mm6, mm4 );
}
movd_r2m ( mm4, res );
return res;
}
示例6: mmx_unpack_16rgb
static inline void mmx_unpack_16rgb (uint8_t * image, const int cpu)
{
static mmx_t mmx_bluemask = {0xf8f8f8f8f8f8f8f8LL};
static mmx_t mmx_greenmask = {0xfcfcfcfcfcfcfcfcLL};
static mmx_t mmx_redmask = {0xf8f8f8f8f8f8f8f8LL};
/*
* convert RGB plane to RGB 16 bits
* mm0 -> B, mm1 -> R, mm2 -> G
* mm4 -> GB, mm5 -> AR pixel 4-7
* mm6 -> GB, mm7 -> AR pixel 0-3
*/
pand_m2r (mmx_bluemask, mm0); /* mm0 = b7b6b5b4b3______ */
pand_m2r (mmx_greenmask, mm2); /* mm2 = g7g6g5g4g3g2____ */
pand_m2r (mmx_redmask, mm1); /* mm1 = r7r6r5r4r3______ */
psrlq_i2r (3, mm0); /* mm0 = ______b7b6b5b4b3 */
pxor_r2r (mm4, mm4); /* mm4 = 0 */
movq_r2r (mm0, mm5); /* mm5 = ______b7b6b5b4b3 */
movq_r2r (mm2, mm7); /* mm7 = g7g6g5g4g3g2____ */
punpcklbw_r2r (mm4, mm2);
punpcklbw_r2r (mm1, mm0);
psllq_i2r (3, mm2);
por_r2r (mm2, mm0);
movntq (mm0, *image);
punpckhbw_r2r (mm4, mm7);
punpckhbw_r2r (mm1, mm5);
psllq_i2r (3, mm7);
por_r2r (mm7, mm5);
movntq (mm5, *(image+8));
}
示例7: mmx_end
static inline void mmx_end(uint8_t *src3, uint8_t *src5,
uint8_t *dst, int X)
{
punpcklbw_m2r (mm_cpool[0], mm4);
punpckhbw_m2r (mm_cpool[0], mm5);
psubusw_r2r (mm2, mm0);
psubusw_r2r (mm3, mm1);
movq_m2r (src5[X], mm2);
movq_m2r (src5[X], mm3);
punpcklbw_m2r (mm_cpool[0], mm2);
punpckhbw_m2r (mm_cpool[0], mm3);
psubusw_r2r (mm2, mm0);
psubusw_r2r (mm3, mm1);
psrlw_i2r (3, mm0);
psrlw_i2r (3, mm1);
psubw_r2r (mm6, mm4);
psubw_r2r (mm7, mm5);
packuswb_r2r (mm1,mm0);
movq_r2r (mm4, mm6);
movq_r2r (mm5, mm7);
pcmpgtw_m2r (mm_lthr, mm4);
pcmpgtw_m2r (mm_lthr, mm5);
pcmpgtw_m2r (mm_hthr, mm6);
pcmpgtw_m2r (mm_hthr, mm7);
packsswb_r2r (mm5, mm4);
packsswb_r2r (mm7, mm6);
pxor_r2r (mm6, mm4);
movq_r2r (mm4, mm5);
pandn_r2r (mm0, mm4);
pand_m2r (src3[X], mm5);
por_r2r (mm4, mm5);
movq_r2m (mm5, dst[X]);
}
示例8: frame_i2f_sse
static void frame_i2f_sse(u_char *src,float *dst,int l)
{
int i;
pxor_r2r(mm7,mm7);
for( i=0; i<l; i+=8 ) {
movq_m2r(*src,mm0);
movq_r2r(mm0, mm2);
punpcklbw_r2r(mm7, mm0);
punpckhbw_r2r(mm7, mm2);
movq_r2r(mm0, mm1);
movq_r2r(mm2, mm3);
punpcklwd_r2r(mm7, mm0);
punpckhwd_r2r(mm7, mm1);
punpcklwd_r2r(mm7, mm2);
punpckhwd_r2r(mm7, mm3);
cvtpi2ps_r2r(mm0,xmm0);
cvtpi2ps_r2r(mm1,xmm1);
cvtpi2ps_r2r(mm2,xmm2);
cvtpi2ps_r2r(mm3,xmm3);
movlps_r2m(xmm0,dst[0]);
movlps_r2m(xmm1,dst[2]);
movlps_r2m(xmm2,dst[4]);
movlps_r2m(xmm3,dst[6]);
src+=8;
dst+=8;
}
emms();
}
示例9: scale_uint8_x_1_x_bicubic_noclip_mmx
static void
scale_uint8_x_1_x_bicubic_noclip_mmx(gavl_video_scale_context_t * ctx, int scanline, uint8_t * dest_start)
{
int i;
uint8_t * src, * dst, *src_start;
int32_t * factors;
mmx_t tmp_mm;
// fprintf(stderr, "scale_uint8_x_1_x_bicubic_noclip_mmx\n");
src_start = ctx->src + scanline * ctx->src_stride;
pxor_r2r(mm6, mm6);
dst = dest_start;
for(i = 0; i < ctx->dst_size; i++)
{
src = src_start + ctx->table_h.pixels[i].index;
factors = ctx->table_h.pixels[i].factor_i;
/* Load pixels */
movd_m2r(*(src), mm0);
punpcklbw_r2r(mm6, mm0);
/* Load factors */
movq_m2r(*factors, mm2);
movq_m2r(*(factors+2), mm3);
packssdw_r2r(mm3, mm2);
/* Multiply */
pmaddwd_r2r(mm2, mm0);
psrld_i2r(14, mm0);
MOVQ_R2M(mm0, tmp_mm);
*(dst++) = tmp_mm.d[0] + tmp_mm.d[1];
}
ctx->need_emms = 1;
}
示例10: mmx_unpack_32rgb
static inline void mmx_unpack_32rgb (uint8_t * image, const int cpu)
{
/*
* convert RGB plane to RGB packed format,
* mm0 -> B, mm1 -> R, mm2 -> G, mm3 -> 0,
* mm4 -> GB, mm5 -> AR pixel 4-7,
* mm6 -> GB, mm7 -> AR pixel 0-3
*/
pxor_r2r (mm3, mm3);
movq_r2r (mm0, mm6);
movq_r2r (mm1, mm7);
movq_r2r (mm0, mm4);
movq_r2r (mm1, mm5);
punpcklbw_r2r (mm2, mm6);
punpcklbw_r2r (mm3, mm7);
punpcklwd_r2r (mm7, mm6);
movntq (mm6, *image);
movq_r2r (mm0, mm6);
punpcklbw_r2r (mm2, mm6);
punpckhwd_r2r (mm7, mm6);
movntq (mm6, *(image+8));
punpckhbw_r2r (mm2, mm4);
punpckhbw_r2r (mm3, mm5);
punpcklwd_r2r (mm5, mm4);
movntq (mm4, *(image+16));
movq_r2r (mm0, mm4);
punpckhbw_r2r (mm2, mm4);
punpckhwd_r2r (mm5, mm4);
movntq (mm4, *(image+24));
}
示例11: bsad_0quad_mmxe
/* For a 16*h block, this computes
(((((*pf + *pf2 + 1)>>1) + ((*pb + *pb2 + 1)>>1) + 1)>>1) + *p2 + 1)>>1
*/
static int bsad_0quad_mmxe(uint8_t *pf,uint8_t *pf2,uint8_t *pb,uint8_t *pb2,uint8_t *p2,int lx,int h)
{
int32_t s=0;
pxor_r2r(mm7, mm7);
do {
movq_m2r(pf2[0],mm0);
movq_m2r(pf2[8],mm2);
movq_m2r(pb2[0],mm1);
movq_m2r(pb2[8],mm3);
pavgb_m2r(pf[0],mm0);
pavgb_m2r(pf[8],mm2);
pavgb_m2r(pb[0],mm1);
pavgb_m2r(pb[8],mm3);
pavgb_r2r(mm1,mm0);
pavgb_r2r(mm3,mm2);
psadbw_m2r(p2[0],mm0);
psadbw_m2r(p2[8],mm2);
paddd_r2r(mm0,mm7);
paddd_r2r(mm2,mm7);
pf+=lx;
pf2+=lx;
pb+=lx;
pb2+=lx;
p2+=lx;
h--;
} while (h);
movd_r2g(mm7,s);
emms();
return s;
}
示例12: evas_common_cpu_mmx_test
void
evas_common_cpu_mmx_test(void)
{
#ifdef BUILD_MMX
pxor_r2r(mm4, mm4);
#endif
}
示例13: _op_mul_p_mas_dp_mmx
static void
_op_mul_p_mas_dp_mmx(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) {
DATA32 *e = d + l;
MOV_A2R(ALPHA_255, mm5)
pxor_r2r(mm0, mm0);
while (d < e) {
c = *m;
switch(c)
{
case 0:
break;
case 255:
MOV_P2R(*d, mm1, mm0)
MOV_P2R(*s, mm2, mm0)
MUL4_SYM_R2R(mm2, mm1, mm5)
MOV_R2P(mm1, *d, mm0)
break;
default:
c++;
MOV_A2R(c, mm1)
c = ~(*s);
MOV_P2R(c, mm3, mm0)
MUL4_256_R2R(mm3, mm1)
movq_r2r(mm5, mm4);
psubw_r2r(mm1, mm4);
MOV_P2R(*d, mm1, mm0)
MUL4_SYM_R2R(mm4, mm1, mm5)
MOV_R2P(mm1, *d, mm0)
break;
}
s++; m++; d++;
}
}
示例14: scale_uint8_x_4_x_bilinear_mmx
static void scale_uint8_x_4_x_bilinear_mmx(gavl_video_scale_context_t * ctx, int scanline, uint8_t * dest_start)
{
int i;
uint8_t * src, * dst, *src_start;
int32_t * factors;
// mmx_t tmp_mm;
/*
* mm0: Input1
* mm1: Factor mask
* mm2:
* mm3: Output
* mm4:
* mm5: Input2
* mm6: 0
* mm7: Factor
*
*/
// fprintf(stderr, "scale_uint8_x_4_x_bilinear_mmx\n");
src_start = ctx->src + scanline * ctx->src_stride;
pxor_r2r(mm6, mm6);
movq_m2r(factor_mask, mm1);
dst = dest_start;
for(i = 0; i < ctx->dst_size; i++)
{
src = src_start + 4*ctx->table_h.pixels[i].index;
factors = ctx->table_h.pixels[i].factor_i;
/* Load pixels */
movd_m2r(*(src), mm0);
punpcklbw_r2r(mm6, mm0);
psllw_i2r(6, mm0); /* 14 bit */
/* Load pixels */
movd_m2r(*(src+4), mm5);
punpcklbw_r2r(mm6, mm5);
psllw_i2r(6, mm5); /* 14 bit */
/* Load factors */
LOAD_FACTOR_1_4_NOCLIP; /* 14 bit */
/* Subtract */
psubsw_r2r(mm5, mm0); /* s1(mm0) - s2(mm5) -> mm0 (14 bit) */
pmulhw_r2r(mm7, mm0); /* factor * (s2 - s1) -> mm0 (12 bit) */
psllw_i2r(2, mm0); /* (14 bit) */
paddsw_r2r(mm5, mm0);/* (15 bit) */
psraw_i2r(6, mm0);/* (8 bit) */
packuswb_r2r(mm6, mm0);
movd_r2m(mm0, *dst);
dst+=4;
}
ctx->need_emms = 1;
}
示例15: mean8
static inline void mean8(unsigned char *refpix,unsigned char *pixel,int radius_count,int row_stride,int threshold,int8_t *diff,unsigned char *count)
{
int a,b;
pxor_r2r(mm6,mm6); // mm6 (aka count) = 0
pxor_r2r(mm7,mm7); // mm7 (aka diff) = 0
movq_m2r(*refpix,mm3); // mm3 = refpix[0]
movd_g2r(0x80808080,mm4); // mm4 = 128
punpcklbw_r2r(mm4,mm4);
pxor_r2r(mm4,mm3); // mm3 = refpix[0]-128
movd_g2r(threshold,mm5); // mm5 = threshold
punpcklbw_r2r(mm5,mm5);
punpcklbw_r2r(mm5,mm5);
punpcklbw_r2r(mm5,mm5);
for( b=0; b<radius_count; b++ ) {
for( a=0; a<radius_count; a++ ) {
movq_m2r(*pixel,mm0); // mm0 = pixel[0]
pxor_r2r(mm4,mm0); // mm0 = pixel[0]-128
movq_r2r(mm3,mm2); // mm2 = refpix[0]-128
psubsb_r2r(mm0,mm2); // mm2 = refpix[0]-pixel[0]
psubsb_r2r(mm3,mm0); // mm0 = pixel[0]-refpix[0]
pminub_r2r(mm0,mm2); // mm2 = abs(pixel[0]-refpix[0])
movq_r2r(mm5,mm1); // mm1 = threshold
pcmpgtb_r2r(mm2,mm1); // mm1 = (threshold > abs(pixel[0]-refpix[0])) ? -1 : 0
psubb_r2r(mm1,mm6); // mm6 += (threshold > abs(pixel[0]-refpix[0]))
pand_r2r(mm1,mm0); // mm0 = (threshold > abs(pixel[0]-refpix[0])) ? pixel[0]-refpix[0] : 0
paddb_r2r(mm0,mm7); // mm7 += (threshold > abs(pixel[0]-refpix[0])) ? pixel[0]-refpix[0] : 0
++pixel;
}
pixel += row_stride - radius_count;
}
movq_r2m(mm6,*count);
movq_r2m(mm7,*diff);
emms();
}