Example #1
0
/**
 * Apply the Scale2x effect on a group of rows. Used internally.
 */
static inline void stage_scale2x(void* dst0, void* dst1, const void* src0, const void* src1, const void* src2, unsigned pixel, unsigned pixel_per_row)
{
    switch (pixel) {
#if defined(__GNUC__) && defined(__i386__)
    case 1 :
        scale2x_8_mmx(dst0, dst1, src0, src1, src2, pixel_per_row);
        break;
    case 2 :
        scale2x_16_mmx(dst0, dst1, src0, src1, src2, pixel_per_row);
        break;
    case 4 :
        scale2x_32_mmx(dst0, dst1, src0, src1, src2, pixel_per_row);
        break;
#else
    case 1 :
        scale2x_8_def(dst0, dst1, src0, src1, src2, pixel_per_row);
        break;
    case 2 :
        scale2x_16_def(dst0, dst1, src0, src1, src2, pixel_per_row);
        break;
    case 4 :
        scale2x_32_def(dst0, dst1, src0, src1, src2, pixel_per_row);
        break;
#endif
    }
}
Example #2
0
/**
 * Scale by a factor of 2 a row of pixels of 16 bits.
 * This function operates like scale2x_8_mmx() but for 16 bits pixels.
 * \param src0 Pointer at the first pixel of the previous row.
 * \param src1 Pointer at the first pixel of the current row.
 * \param src2 Pointer at the first pixel of the next row.
 * \param count Length in pixels of the src0, src1 and src2 rows. It must
 * be at least 8 and a multiple of 4.
 * \param dst0 First destination row, double length in pixels.
 * \param dst1 Second destination row, double length in pixels.
 */
void scale2x_16_mmx(scale2x_uint16* dst0, scale2x_uint16* dst1, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count)
{
	if (count % 4 != 0 || count < 8) {
		scale2x_16_def(dst0, dst1, src0, src1, src2, count);
	} else {
		scale2x_16_mmx_border(dst0, src0, src1, src2, count);
		scale2x_16_mmx_border(dst1, src2, src1, src0, count);
	}
}
Example #3
0
/**
 * Apply the Scale2x effect on a group of rows. Used internally.
 */
static inline void stage_scale2x(void* dst0, void* dst1, const void* src0, const void* src1, const void* src2, unsigned pixel, unsigned pixel_per_row)
{
	switch (pixel) {
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
		case 1 : scale2x_8_mmx(SSDST(8,0), SSDST(8,1), SSSRC(8,0), SSSRC(8,1), SSSRC(8,2), pixel_per_row); break;
		case 2 : scale2x_16_mmx(SSDST(16,0), SSDST(16,1), SSSRC(16,0), SSSRC(16,1), SSSRC(16,2), pixel_per_row); break;
		case 4 : scale2x_32_mmx(SSDST(32,0), SSDST(32,1), SSSRC(32,0), SSSRC(32,1), SSSRC(32,2), pixel_per_row); break;
#else
		case 1 : scale2x_8_def(SSDST(8,0), SSDST(8,1), SSSRC(8,0), SSSRC(8,1), SSSRC(8,2), pixel_per_row); break;
		case 2 : scale2x_16_def(SSDST(16,0), SSDST(16,1), SSSRC(16,0), SSSRC(16,1), SSSRC(16,2), pixel_per_row); break;
		case 4 : scale2x_32_def(SSDST(32,0), SSDST(32,1), SSSRC(32,0), SSSRC(32,1), SSSRC(32,2), pixel_per_row); break;
#endif
	}
}
Example #4
0
/**
 * Apply the Scale2x effect on a group of rows. Used internally.
 */
static inline void stage_scale2x(void* dst0, void* dst1,
				 const void* src0, const void* src1, const void* src2,
				 unsigned int pixel, unsigned int pixel_per_row)
{
	switch (pixel)
	{
		case 2:
			scale2x_16_def(SSDST(16,0), SSDST(16,1),
				       SSSRC(16,0), SSSRC(16,1), SSSRC(16,2),
				       pixel_per_row);
			break;
		
		case 4:
			scale2x_32_def(SSDST(32,0), SSDST(32,1),
				       SSSRC(32,0), SSSRC(32,1), SSSRC(32,2),
				       pixel_per_row);
			break;
	}
}