Revision c7997007 libavcodec/simple_idct.c

View differences:

libavcodec/simple_idct.c
104 104
}
105 105

  
106 106
#ifdef ARCH_ALPHA
107
/* 0: all entries 0, 1: only first entry nonzero, 2: otherwise  */
107 108
static int inline idctRowCondDC(int16_t *row)
108 109
{
109 110
	int_fast32_t a0, a1, a2, a3, b0, b1, b2, b3;
......
201 202
	row[6] = (a1 - b1) >> ROW_SHIFT;
202 203
	row[7] = (a0 - b0) >> ROW_SHIFT;
203 204

  
204
	return 1;
205
	return 2;
205 206
}
206 207
#else  /* not ARCH_ALPHA */
207 208
static int inline idctRowCondDC (int16_t * row)
......
547 548
			idctSparse2Col(block + i);
548 549
	}
549 550
#elif defined(ARCH_ALPHA)
550
	int shortcut = 1;
551
        int rowsZero = 1;       /* all rows except row 0 zero */
552
        int rowsConstant = 1;	/* all rows consist of a constant value */
551 553

  
552 554
	for (i = 0; i < 8; i++) {
553
		int anynonzero = idctRowCondDC(block + 8 * i);
554
		if (i > 0 && anynonzero)
555
			shortcut = 0;
555
		int sparseness = idctRowCondDC(block + 8 * i);
556

  
557
		if (i > 0 && sparseness > 0)
558
                        rowsZero = 0;
559
                if (sparseness == 2)
560
                        rowsConstant = 0;
556 561
	}
557 562

  
558
	if (shortcut) {
559
		idctCol2(block);
563
        if (rowsZero) {
564
                idctCol2(block);
565
        } else if (rowsConstant) {
566
		uint64_t *lblock = (uint64_t *) block;
567

  
568
		idctSparseCol(block);
569
		for (i = 0; i < 8; i++) {
570
			uint64_t v = (uint16_t) block[i * 8];
571

  
572
			v += v << 16;
573
			v += v << 32;
574
			lblock[0] = v;
575
			lblock[1] = v;
576
			lblock += 2;
577
		}
560 578
	} else {
561 579
		for (i = 0; i < 8; i++)
562 580
			idctSparseCol(block + i);

Also available in: Unified diff