20 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
21 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 |
* |
* |
23 |
* $Id: estimation_rd_based.c,v 1.12 2004-12-18 12:06:43 syskin Exp $ |
* $Id: estimation_rd_based.c,v 1.14 2005-12-09 04:45:35 syskin Exp $ |
24 |
* |
* |
25 |
****************************************************************************/ |
****************************************************************************/ |
26 |
|
|
64 |
int bits; |
int bits; |
65 |
int distortion = 0; |
int distortion = 0; |
66 |
|
|
67 |
fdct(data); |
fdct((short * const)data); |
68 |
|
|
69 |
if (quant_type) sum = quant_h263_inter(coeff, data, quant, mpeg_quant_matrices); |
if (quant_type) sum = quant_h263_inter(coeff, data, quant, mpeg_quant_matrices); |
70 |
else sum = quant_mpeg_inter(coeff, data, quant, mpeg_quant_matrices); |
else sum = quant_mpeg_inter(coeff, data, quant, mpeg_quant_matrices); |
121 |
unsigned int distortion = 0; |
unsigned int distortion = 0; |
122 |
const uint32_t iDcScaler = get_dc_scaler(quant, block < 4); |
const uint32_t iDcScaler = get_dc_scaler(quant, block < 4); |
123 |
|
|
124 |
fdct(coeff); |
fdct((short * const)coeff); |
125 |
|
|
126 |
if (quant_type) { |
if (quant_type) { |
127 |
quant_h263_intra(qcoeff, coeff, quant, iDcScaler, mpeg_quant_matrices); |
quant_h263_intra(qcoeff, coeff, quant, iDcScaler, mpeg_quant_matrices); |
135 |
quant, iDcScaler, predictors, 0); |
quant, iDcScaler, predictors, 0); |
136 |
|
|
137 |
direction = pMB->acpred_directions[block]; |
direction = pMB->acpred_directions[block]; |
138 |
pCurrent = pMB->pred_values[block]; |
pCurrent = (int16_t*)pMB->pred_values[block]; |
139 |
|
|
140 |
/* store current coeffs to pred_values[] for future prediction */ |
/* store current coeffs to pred_values[] for future prediction */ |
141 |
pCurrent[0] = qcoeff[0] * iDcScaler; |
pCurrent[0] = qcoeff[0] * iDcScaler; |
655 |
} |
} |
656 |
|
|
657 |
for (i = 0; i < 6; i++) { |
for (i = 0; i < 6; i++) { |
658 |
/* HVS models, anyone ? */ |
Data->lambda[i] = (LAMBDA*pMB->lambda[i])>>LAMBDA_EXP; |
|
Data->lambda[i] = LAMBDA; |
|
659 |
} |
} |
660 |
|
|
661 |
min_rd = findRD_inter(Data, x, y, pParam, MotionFlags); |
min_rd = findRD_inter(Data, x, y, pParam, MotionFlags); |
761 |
Data->quant_sq = iQuant*iQuant; |
Data->quant_sq = iQuant*iQuant; |
762 |
|
|
763 |
for (i = 0; i < 6; i++) { |
for (i = 0; i < 6; i++) { |
764 |
/* HVS models, anyone ? */ |
Data->lambda[i] = (LAMBDA*pMB->lambda[i])>>LAMBDA_EXP; |
|
Data->lambda[i] = LAMBDA; |
|
765 |
} |
} |
766 |
|
|
767 |
/* INTER <-> INTER4V decision */ |
/* INTER <-> INTER4V decision */ |