--- trunk/xvidcore/src/utils/mbtransquant.c 2004/04/15 12:05:19 1431 +++ trunk/xvidcore/src/utils/mbtransquant.c 2004/04/15 19:44:06 1432 @@ -21,7 +21,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: mbtransquant.c,v 1.23 2004-03-22 22:36:24 edgomez Exp $ + * $Id: mbtransquant.c,v 1.24 2004-04-15 19:44:06 edgomez Exp $ * ****************************************************************************/ @@ -183,7 +183,8 @@ int Q, const uint16_t * const Zigzag, const uint16_t * const QuantMatrix, - int Non_Zero); + int Non_Zero, + int Sum); /* Quantize all blocks -- Inter mode */ static __inline uint8_t @@ -234,7 +235,8 @@ sum = dct_quantize_trellis_c(&qcoeff[i*64], &data[i*64], pMB->quant, &scan_tables[0][0], matrix, - 63); + 63, + sum); } stop_quant_timer(); @@ -781,17 +783,6 @@ return -1; } -static int __inline -Compute_Sum(const int16_t *C, int last) -{ - int sum = 0; - - while(last--) - sum += abs(C[last]); - - return(sum); -} - /* this routine has been strippen of all debug code */ static int dct_quantize_trellis_c(int16_t *const Out, @@ -799,7 +790,8 @@ int Q, const uint16_t * const Zigzag, const uint16_t * const QuantMatrix, - int Non_Zero) + int Non_Zero, + int Sum) { /* Note: We should search last non-zero coeffs on *real* DCT input coeffs @@ -822,7 +814,7 @@ int Last_Node = -1; uint32_t Last_Cost = 0; - int i, j, sum; + int i, j; /* source (w/ CBP penalty) */ Run_Costs[-1] = 2<=0) { Out[Zigzag[i]] = Nodes[i].Level; - sum += abs(Nodes[i].Level); + Sum += abs(Nodes[i].Level); i -= Nodes[i].Run; } - return sum; + return Sum; } /* original version including heavy debugging info */