-
+#if 0
/* compute variance of 8x8 block */
static double var_sblk(p, lx)
unsigned char *p;
int lx;
{
int j;
- register unsigned int v, s, s2;
+ unsigned int v, s, s2;
s = s2 = 0;
return (double)s2 / 64.0 - ((double)s / 64.0) * ((double)s / 64.0);
}
-
+#endif
static double calc_actj(pict_data_s *picture)
{
*/
- for( l = 0; l < 6; ++l )
- actsum +=
- (*pquant_weight_coeff_sum)
+ if( cur_picture.mbinfo[k].dctblocks )
+ for( l = 0; l < 6; ++l )
+ actsum += (*pquant_weight_coeff_sum)
( cur_picture.mbinfo[k].dctblocks[l], i_q_mat ) ;
actj = (double)actsum / (double)COEFFSUM_SCALE;
if( actj < 12.0 )
of DCT coefficients) and actual quantisation weighted activty.
We use this to try to predict the activity of each frame.
*/
-
+ avg_K = 1;
ratectl->actsum = calc_actj(picture );
ratectl->avg_act = (double)ratectl->actsum/(double)(mb_per_pict);
ratectl->sum_avg_act += ratectl->avg_act;