Hi,

This patch improves compression a very tiny bit on average, but up to 0.1 percentage point for classical music. I haven't found any tracks that show worsening compression with this patch.
>From baeeba8906efba2e8cffc9008ca54c7cf6c08d77 Mon Sep 17 00:00:00 2001
From: Martijn van Beurden <mva...@gmail.com>
Date: Wed, 3 Dec 2014 14:59:19 +0100
Subject: [PATCH] Improve LPC order guess

The recent compression preset retuning improved upon most material
but it the few tracks that show regression are usually classical
music. This patch improves compression by improving the LPC order
guess, of which classical music benefits most.

Improvement is 0.007% on average but up to 0.1%. I haven't seen
regressions for any of my test samples.
---
 src/libFLAC/lpc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libFLAC/lpc.c b/src/libFLAC/lpc.c
index ca98c5c..f7c643a 100644
--- a/src/libFLAC/lpc.c
+++ b/src/libFLAC/lpc.c
@@ -1308,7 +1308,7 @@ FLAC__double FLAC__lpc_compute_expected_bits_per_residual_sample(FLAC__double lp
 
 	FLAC__ASSERT(total_samples > 0);
 
-	error_scale = 0.5 * M_LN2 * M_LN2 / (FLAC__double)total_samples;
+	error_scale = 0.5 / (FLAC__double)total_samples;
 
 	return FLAC__lpc_compute_expected_bits_per_residual_sample_with_error_scale(lpc_error, error_scale);
 }
@@ -1338,7 +1338,7 @@ unsigned FLAC__lpc_compute_best_order(const FLAC__double lpc_error[], unsigned m
 	FLAC__ASSERT(max_order > 0);
 	FLAC__ASSERT(total_samples > 0);
 
-	error_scale = 0.5 * M_LN2 * M_LN2 / (FLAC__double)total_samples;
+	error_scale = 0.5 / (FLAC__double)total_samples;
 
 	best_index = 0;
 	best_bits = (unsigned)(-1);
-- 
1.9.1

_______________________________________________
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev

Reply via email to