Move qp_to_lambda so it is defined before use. Change some tabs to spaces
@@ -637,6 +637,20 @@ static double get_ctu_bits(encoder_state_t * const state, vector2d_t pos) {
return avg_bits;
}
+static double qp_to_lambda(encoder_state_t* const state, int qp)
+{
+ const int shift_qp = 12;
+ double lambda = 0.57 * pow(2.0, (qp - shift_qp) / 3.0);
+
+ // NOTE: HM adjusts lambda for inter according to Hadamard usage in ME.
+ // SATD is currently always enabled for ME, so this has no effect.
+ // bool hadamard_me = true;
+ // if (!hadamard_me && state->frame->slicetype != KVZ_SLICE_I) {
+ // lambda *= 0.95;
+ // }
+
+ return lambda;
+}
void kvz_set_ctu_qp_lambda(encoder_state_t * const state, vector2d_t pos) {
double bits = get_ctu_bits(state, pos);
@@ -915,22 +929,6 @@ void kvz_update_after_picture(encoder_state_t * const state) {
}
}
-
-static double qp_to_lambda(encoder_state_t * const state, int qp)
-{
- const int shift_qp = 12;
- double lambda = 0.57 * pow(2.0, (qp - shift_qp) / 3.0);
-
- // NOTE: HM adjusts lambda for inter according to Hadamard usage in ME.
- // SATD is currently always enabled for ME, so this has no effect.
- // bool hadamard_me = true;
- // if (!hadamard_me && state->frame->slicetype != KVZ_SLICE_I) {
- // lambda *= 0.95;
- // }
-
- return lambda;
-}
-
/**
* \brief Allocate bits and set lambda and QP for the current picture.
* \param state the main encoder state
