pub fn parse_grain_table(input: &str) -> Result<Vec<GrainTableSegment>, Error>
Expand description

This file has the implementation details of the grain table.

The file format is an ascii representation for readability and editability. Array parameters are separated from the non-array parameters and prefixed with a few characters to make for easy localization with a parameter set. Each entry is prefixed with “E” and the other parameters are only specified if “apply-grain” is non-zero.

filmgrn1
E <start-time> <end-time> <apply-grain> <random-seed> <dynamic-grain>
 p <ar_coeff_lag> <ar_coeff_shift> <grain_scale_shift> ...
 sY <num_y_points> <point_0_x> <point_0_y> ...
 sCb <num_cb_points> <point_0_x> <point_0_y> ...
 sCr <num_cr_points> <point_0_x> <point_0_y> ...
 cY <ar_coeff_y_0> ....
 cCb <ar_coeff_cb_0> ....
 cCr <ar_coeff_cr_0> ....
E <start-time> ...

Errors

  • If the file cannot be opened
  • If the file does not contain a properly formatted film grain table