Skip to content

Instantly share code, notes, and snippets.

View n9Mtq4's full-sized avatar

Will Bresnahan n9Mtq4

  • Massachusetts
View GitHub Profile
/**
* Performs a greedy algorithm on the chunk vmaf data to produce a list of cq values that maximizes the average vmaf of
* the entire encode without going over the [SIZE_LIMIT].
*
* This is a variation of the 0-1 knapsack problem. Due to the extra constraint of needing one of each chunk, the
* pseudo-polynomial algorithm cannot be applied. Instead, we make the following assumptions to reach a good local
* maximum.
*
* For any chunk c and cq value q,
* - vmaf(c, q - 1) > vmaf(c, q) and