From b335122213b122c3888f401247abfb793d3162db Mon Sep 17 00:00:00 2001
From: James Zern <[EMAIL REDACTED]>
Date: Mon, 19 Aug 2024 15:28:04 -0700
Subject: [PATCH] rd.c: remove av1_model_rd_surffit()
The last reference to this function was removed in:
2fcd820ec0 Remove unused model_rd functions from rdopt.c
Bug: aomedia:3416
Change-Id: Ic9e6ffee77ef57a41cd5c1233233892564cbd341
---
av1/encoder/rd.c | 108 -----------------------------------------------
av1/encoder/rd.h | 2 -
2 files changed, 110 deletions(-)
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index 403d12ac4..490d6ba0d 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -936,114 +936,6 @@ static int sse_norm_curvfit_model_cat_lookup(double sse_norm) {
return (sse_norm > 16.0);
}
-// Models distortion by sse using a logistic function on
-// l = log2(sse / q^2) as:
-// dbysse = 16 / (1 + k exp(l + c))
-static double get_dbysse_logistic(double l, double c, double k) {
- const double A = 16.0;
- const double dbysse = A / (1 + k * exp(l + c));
- return dbysse;
-}
-
-// Models rate using a clamped linear function on
-// l = log2(sse / q^2) as:
-// rate = max(0, a + b * l)
-static double get_rate_clamplinear(double l, double a, double b) {
- const double rate = a + b * l;
- return (rate < 0 ? 0 : rate);
-}
-
-static const uint8_t bsize_surffit_model_cat_lookup[BLOCK_SIZES_ALL] = {
- 0, 0, 0, 0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 0, 0, 2, 2, 4, 4
-};
-
-static const double surffit_rate_params[9][4] = {
- {
- 638.390212,
- 2.253108,
- 166.585650,
- -3.939401,
- },
- {
- 5.256905,
- 81.997240,
- -1.321771,
- 17.694216,
- },
- {
- -74.193045,
- 72.431868,
- -19.033152,
- 15.407276,
- },
- {
- 416.770113,
- 14.794188,
- 167.686830,
- -6.997756,
- },
- {
- 378.511276,
- 9.558376,
- 154.658843,
- -6.635663,
- },
- {
- 277.818787,
- 4.413180,
- 150.317637,
- -9.893038,
- },
- {
- 142.212132,
- 11.542038,
- 94.393964,
- -5.518517,
- },
- {
- 219.100256,
- 4.007421,
- 108.932852,
- -6.981310,
- },
- {
- 222.261971,
- 3.251049,
- 95.972916,
- -5.609789,
- },
-};
-
-static const double surffit_dist_params[7] = { 1.475844, 4.328362, -5.680233,
- -0.500994, 0.554585, 4.839478,
- -0.695837 };
-
-static void rate_surffit_model_params_lookup(BLOCK_SIZE bsize, double xm,
- double *rpar) {
- const int cat = bsize_surffit_model_cat_lookup[bsize];
- rpar[0] = surffit_rate_params[cat][0] + surffit_rate_params[cat][1] * xm;
- rpar[1] = surffit_rate_params[cat][2] + surffit_rate_params[cat][3] * xm;
-}
-
-static void dist_surffit_model_params_lookup(BLOCK_SIZE bsize, double xm,
- double *dpar) {
- (void)bsize;
- const double *params = surffit_dist_params;
- dpar[0] = params[0] + params[1] / (1 + exp((xm + params[2]) * params[3]));
- dpar[1] = params[4] + params[5] * exp(params[6] * xm);
-}
-
-void av1_model_rd_surffit(BLOCK_SIZE bsize, double sse_norm, double xm,
- double yl, double *rate_f, double *distbysse_f) {
- (void)sse_norm;
- double rpar[2], dpar[2];
- rate_surffit_model_params_lookup(bsize, xm, rpar);
- dist_surffit_model_params_lookup(bsize, xm, dpar);
-
- *rate_f = get_rate_clamplinear(yl, rpar[0], rpar[1]);
- *distbysse_f = get_dbysse_logistic(yl, dpar[0], dpar[1]);
-}
-
static const double interp_rgrid_curv[4][65] = {
{
0.000000, 0.000000, 0.000000, 0.000000, 0.000000,
diff --git a/av1/encoder/rd.h b/av1/encoder/rd.h
index a616e7ece..1d407ca78 100644
--- a/av1/encoder/rd.h
+++ b/av1/encoder/rd.h
@@ -256,8 +256,6 @@ void av1_model_rd_from_var_lapndz(int64_t var, unsigned int n,
void av1_model_rd_curvfit(BLOCK_SIZE bsize, double sse_norm, double xqr,
double *rate_f, double *distbysse_f);
-void av1_model_rd_surffit(BLOCK_SIZE bsize, double sse_norm, double xm,
- double yl, double *rate_f, double *distbysse_f);
int av1_get_switchable_rate(const MACROBLOCK *x, const MACROBLOCKD *xd,
InterpFilter interp_filter, int dual_filter);