758 |
return -1; |
return -1; |
759 |
} |
} |
760 |
|
|
761 |
|
#define TRELLIS_MIN_EFFORT 3 |
762 |
|
|
763 |
/* this routine has been strippen of all debug code */ |
/* this routine has been strippen of all debug code */ |
764 |
static int |
static int |
765 |
dct_quantize_trellis_c(int16_t *const Out, |
dct_quantize_trellis_c(int16_t *const Out, |
798 |
Run_Costs[-1] = 2<<TL_SHIFT; |
Run_Costs[-1] = 2<<TL_SHIFT; |
799 |
|
|
800 |
Non_Zero = Find_Last(Out, Zigzag, Non_Zero); |
Non_Zero = Find_Last(Out, Zigzag, Non_Zero); |
801 |
if (Non_Zero<0) |
if (Non_Zero < TRELLIS_MIN_EFFORT) |
802 |
return 0; /* Sum is zero if there are only zero coeffs */ |
Non_Zero = TRELLIS_MIN_EFFORT; |
803 |
|
|
804 |
for(i=0; i<=Non_Zero; i++) { |
for(i=0; i<=Non_Zero; i++) { |
805 |
const int q = ((Q*QuantMatrix[Zigzag[i]])>>4); |
const int q = ((Q*QuantMatrix[Zigzag[i]])>>4); |