[x265] [PATCH] stats: remove --cu-stats option

Steve Borho steve at borho.org
Sat May 30 19:43:16 CEST 2015


On 05/29, Deepthi Nandakumar wrote:
> So, the general roadmap for stats collection is this:
> 
> x265 will keep all console outputs as-is, but disable cu-stats option. The
> cu-stats will be replaced by a more powerful per-frame CU stats in
> log-level 5. Now, the proposed log-levels will look like:
> 
> log-level 0(error)   : only errors
> log-level 1(warning) : only errors and warnings
> log-level 2(summary) : errors, warnings, summary
> log-level 3(info)    : full x265 info, and above             - default
> log-level 4(frame)   : Basic frame-level info and above
> log-level 5(full)    : Full frame-level info, lots of additional
> statistics. This option is available only if csv is also enabled. Without
> csv, this will  default to log-level 4 outputs in console.

I feel that conflating the log level and CSV operations was a bad design
choice on my part. --log-level should only affect x265_log() calls and
each log-level should be associated with an X265_LOG_* level macro.

If I was starting from scratch I would implement them this way:

1) make sure everything written into the non-framewise CSV is available
   in x265_stats
2) make everything that is written into the framewise CSV available in a
   new x265_frame_stats struct
3) remove CSV filename from x265_param, and remove all CSV file writing
   from libx265
4) change --csv into a CLI-only option that queries x265_stats at the
   end of the encode and appends stats to a file (write header if new).
5) make a new --frame-csv CLI-only option that requests x265_frame_stats
   from the encoder and does framewise file writes (and the summary at
   the end). --frame-csv <> and --csv <> could be used together
6) remove X265_LOG_FRAME, and always generate CU stats if log level is
   >= LOG_LEVEL_INFO

This way libx265 is no longer responsible for the CSV string
manipulations or CSV file I/O, and now all these encoder statistics are
available to external monitoring systems.

The only downside to this approach is that CSV files would not be
possible if you're not using our CLI unless other applications copied
the file write logic.

-- 
Steve Borho


More information about the x265-devel mailing list