int rd_thresh_mult[MAX_MODES];
int rd_threshes[MAX_MODES];
+ unsigned int mbs_tested_so_far;
+ unsigned int mode_test_hit_counts[MAX_MODES];
void (*short_fdct4x4)(short *input, short *output, int pitch);
mb->prediction_error = 0;
mb->intra_error = 0;
vp8_zero(mb->count_mb_ref_frame_usage);
-
+ mb->mbs_tested_so_far = 0;
}
}
for (i = 0; i < MAX_MODES; i ++)
{
cpi->mode_check_freq[i] = 0;
- cpi->mode_test_hit_counts[i] = 0;
cpi->mode_chosen_counts[i] = 0;
}
- cpi->mbs_tested_so_far = 0;
+ cpi->mb.mbs_tested_so_far = 0;
/* best quality defaults */
sf->RD = 1;
int ambient_err;
unsigned int mode_check_freq[MAX_MODES];
- unsigned int mode_test_hit_counts[MAX_MODES];
unsigned int mode_chosen_counts[MAX_MODES];
- unsigned int mbs_tested_so_far;
int rd_baseline_thresh[MAX_MODES];
get_predictor_pointers(cpi, plane, recon_yoffset, recon_uvoffset);
/* Count of the number of MBs tested so far this frame */
- cpi->mbs_tested_so_far++;
+ x->mbs_tested_so_far++;
*returnintra = INT_MAX;
x->skip = 0;
/* Check to see if the testing frequency for this mode is at its max
* If so then prevent it from being tested and increase the threshold
* for its testing */
- if (cpi->mode_test_hit_counts[mode_index] &&
+ if (x->mode_test_hit_counts[mode_index] &&
(cpi->mode_check_freq[mode_index] > 1))
{
- if (cpi->mbs_tested_so_far <= (cpi->mode_check_freq[mode_index] *
- cpi->mode_test_hit_counts[mode_index]))
+ if (x->mbs_tested_so_far <= (cpi->mode_check_freq[mode_index] *
+ x->mode_test_hit_counts[mode_index]))
{
/* Increase the threshold for coding this mode to make it less
* likely to be chosen */
/* We have now reached the point where we are going to test the current
* mode so increment the counter for the number of times it has been
* tested */
- cpi->mode_test_hit_counts[mode_index] ++;
+ x->mode_test_hit_counts[mode_index] ++;
rate2 = 0;
distortion2 = 0;
vp8_set_speed_features(cpi);
+ for (i = 0; i < MAX_MODES; i++)
+ {
+ x->mode_test_hit_counts[i] = 0;
+ }
+
q = (int)pow(Qvalue, 1.25);
if (q < 8)
*returnintra = INT_MAX;
/* Count of the number of MBs tested so far this frame */
- cpi->mbs_tested_so_far++;
+ x->mbs_tested_so_far++;
x->skip = 0;
* max If so then prevent it from being tested and increase the
* threshold for its testing
*/
- if (cpi->mode_test_hit_counts[mode_index] && (cpi->mode_check_freq[mode_index] > 1))
+ if (x->mode_test_hit_counts[mode_index] && (cpi->mode_check_freq[mode_index] > 1))
{
- if (cpi->mbs_tested_so_far <= cpi->mode_check_freq[mode_index] * cpi->mode_test_hit_counts[mode_index])
+ if (x->mbs_tested_so_far <= cpi->mode_check_freq[mode_index] * x->mode_test_hit_counts[mode_index])
{
/* Increase the threshold for coding this mode to make it
* less likely to be chosen
* current mode so increment the counter for the number of times
* it has been tested
*/
- cpi->mode_test_hit_counts[mode_index] ++;
+ x->mode_test_hit_counts[mode_index] ++;
/* Experimental code. Special case for gf and arf zeromv modes.
* Increase zbin size to supress noise