[CFL] Add cfl_update_cost function

Encapsulates the logic to update the rate of each CfL codeword.
The if statements are removed from the loop and the arrays are
stored in CFL_CTX instead of being declared every time.

Change-Id: I0cb208b14e6c6a888210dd33c5e8fe8d74dd87f4
2 files changed