34 #define HIST_SIZE (3*256) 
   49 #define OFFSET(x) offsetof(ThumbContext, x) 
   50 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM 
   66                "Allocation failure, try to lower the number of frames\n");
 
   82     double err, sum_sq_err = 0;
 
   85         err = median[i] - (double)hist[i];
 
   86         sum_sq_err += err*err;
 
   95     int i, j, best_frame_idx = 0;
 
   96     int nb_frames = thumb->
n;
 
   97     double avg_hist[
HIST_SIZE] = {0}, sq_err, min_sq_err = -1;
 
  101         for (i = 0; i < nb_frames; i++)
 
  103         avg_hist[j] /= nb_frames;
 
  107     for (i = 0; i < nb_frames; i++) {
 
  109         if (i == 0 || sq_err < min_sq_err)
 
  110             best_frame_idx = i, min_sq_err = sq_err;
 
  114     for (i = 0; i < nb_frames; i++) {
 
  116         if (i != best_frame_idx)
 
  122     picref = thumb->
frames[best_frame_idx].
buf;
 
  124            "from a set of %d images\n", best_frame_idx,
 
  126     thumb->
frames[best_frame_idx].
buf = NULL;
 
  144     for (j = 0; j < inlink->
h; j++) {
 
  145         for (i = 0; i < inlink->
w; i++) {
 
  146             hist[0*256 + p[i*3    ]]++;
 
  147             hist[1*256 + p[i*3 + 1]]++;
 
  148             hist[2*256 + p[i*3 + 2]]++;
 
  231     .description   = 
NULL_IF_CONFIG_SMALL(
"Select the most representative frame in a given sequence of consecutive frames."),
 
  236     .
inputs        = thumbnail_inputs,
 
  238     .priv_class    = &thumbnail_class,