21 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
22 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 |
* |
* |
24 |
* $Id: mbtransquant.c,v 1.30 2005-12-09 04:45:35 syskin Exp $ |
* $Id: mbtransquant.c,v 1.31 2005-12-10 05:20:35 syskin Exp $ |
25 |
* |
* |
26 |
****************************************************************************/ |
****************************************************************************/ |
27 |
|
|
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); |