A method of quantizing coefficients of a video block for a video coding process that supports context-based adaptive binary arithmetic coding, CABAC, the method comprising: generating a plurality of sets of quantized coefficients for the video block, wherein each of the sets of quantized coefficients is defined based on an assumption that a particular one of the coefficients of the video block corresponds to a last non-zero coefficient of the video block; for each respective set of quantized coefficients in the plurality of sets of quantized coefficients, estimating a cost associated with coding the video block via CABAC, wherein the estimated cost for the respective set of quantized coefficients is based on the respective set of quantized coefficients, wherein estimating the cost for the respective set of quantized coefficients comprises: for each respective coefficient in the respective set of quantized coefficients, calculating a set of at most three Lagrangian costs associated with the respective coefficient for values of the respective quantized coefficient equal to a value of zero, a floor value and a ceiling value, wherein a set of Lagrangian cost functions define the set of Lagrangian costs associated with the respective coefficient, wherein the set of Lagrangian cost functions are associated with a rate-distortion model, and summing the lowest of the Lagrangian costs associated with each coefficient of the respective set of quantized coefficients to determine the estimated cost for the respective set of quantized coefficients; and selecting a given one of the sets of quantized coefficients associated with a lowest one of the estimated costs for the plurality of sets of quantized coefficients. generating a plurality of sets of quantized coefficients for the video block, wherein each of the sets of quantized coefficients is defined based on an assumption that a particular one of the coefficients of the video block corresponds to a last non-zero coefficient of the video block; for each respective set of quantized coefficients in the plurality of sets of quantized coefficients, estimating a cost associated with coding the video block via CABAC, wherein the estimated cost for the respective set of quantized coefficients is based on the respective set of quantized coefficients, wherein estimating the cost for the respective set of quantized coefficients comprises: for each respective coefficient in the respective set of quantized coefficients, calculating a set of at most three Lagrangian costs associated with the respective coefficient for values of the respective quantized coefficient equal to a value of zero, a floor value and a ceiling value, wherein a set of Lagrangian cost functions define the set of Lagrangian costs associated with the respective coefficient, wherein the set of Lagrangian cost functions are associated with a rate-distortion model, and summing the lowest of the Lagrangian costs associated with each coefficient of the respective set of quantized coefficients to determine the estimated cost for the respective set of quantized coefficients; and for each respective coefficient in the respective set of quantized coefficients, calculating a set of at most three Lagrangian costs associated with the respective coefficient for values of the respective quantized coefficient equal to a value of zero, a floor value and a ceiling value, wherein a set of Lagrangian cost functions define the set of Lagrangian costs associated with the respective coefficient, wherein the set of Lagrangian cost functions are associated with a rate-distortion model, and summing the lowest of the Lagrangian costs associated with each coefficient of the respective set of quantized coefficients to determine the estimated cost for the respective set of quantized coefficients; and selecting a given one of the sets of quantized coefficients associated with a lowest one of the estimated costs for the plurality of sets of quantized coefficients.