search for: flac__max_extra_residual_bps

Displaying 10 results from an estimated 10 matches for "flac__max_extra_residual_bps".

2014 Jun 19
7
[PATCH] stream_encoder : Improve selection of residual accumulator width
...libFLAC/include/private/stream_encoder.h +++ b/src/libFLAC/include/private/stream_encoder.h @@ -37,6 +37,12 @@ #include <config.h> #endif +/* + * This is used to avoid overflow with unusual signals in 32-bit + * accumulator in the *precompute_partition_info_sums_* functions. + */ +#define FLAC__MAX_EXTRA_RESIDUAL_BPS 4 + #if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && defined FLAC__HAS_X86INTRIN #include "private/cpu.h" #include "FLAC/format.h" diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c index e64ece2..8928a39 100644 --- a/src/libFLAC/strea...
2014 Jun 19
1
[PATCH] stream_encoder : Improve selection of residual accumulator width
...l_from_qlp_coefficients_16bit(...); > else > encoder->private_->local_lpc_compute_residual_from_qlp_coefficients(...); > else > encoder->private_->local_lpc_compute_residual_from_qlp_coefficients_64bit(...); Yes, it's the same check. Assuming residual can be at most FLAC__MAX_EXTRA_RESIDUAL_BPS bits wider than subframe_bps, I think it should be: if(subframe_bps + qlp_coeff_precision + FLAC__bitmath_ilog2(order) + FLAC__MAX_EXTRA_RESIDUAL_BPS - 1 <= 32) if(subframe_bps + FLAC__MAX_EXTRA_RESIDUAL_BPS <= 16 && qlp_coeff_precision <= 16) > vs. read_subframe_lpc_(): >...
2014 Jun 20
2
[PATCH] stream_encoder : Improve selection of residual accumulator width
On Fri, Jun 20, 2014 at 01:21:03PM +0400, lvqcl wrote: > Miroslav Lichvar ?????: > > > +/* > > + * This is used to avoid overflow with unusual signals in 32-bit > > + * accumulator in the *precompute_partition_info_sums_* functions. > > + */ > > +#define FLAC__MAX_EXTRA_RESIDUAL_BPS 4 > > > + /* WATCHOUT: "+ bps + FLAC__MAX_EXTRA_RESIDUAL_BPS" is the maximum > > + * assumed size of the average residual magnitude */ > > + if(FLAC__bitmath_ilog2(default_partition_samples) + bps + FLAC__MAX_EXTRA_RESIDUAL_BPS < 32) { > > From FLAC__f...
2014 Jun 29
4
[PATCH] stream_encoder : Improve selection of residual accumulator width
...order, residual[]) function. And indeed, max. possible residual value is 16 times bigger than max. value in data[] array: residual[i] = data[i] - 4*data[i-1] + 6*data[i-2] - 4*data[i-3] + data[i-4] 16 == 2^4, so max. bps value for residual[] is equal to max. bps for data[] + 4. The value of FLAC__MAX_EXTRA_RESIDUAL_BPS == 4 is enough to fix this problem with FLAC__fixed_compute_residual().
2015 May 23
2
A patch for precompute_partition_info_sums_()
...h a preliminary version of a patch for precompute_partition_info_sums_() function that should accelerate encoding of 24-bit input data. 1) SSE2, SSSE3 and AVX2 versions of this function should be updated, too 2) the patch also changes if(FLAC__bitmath_ilog2(default_partition_samples) + bps + FLAC__MAX_EXTRA_RESIDUAL_BPS < 32) into (in effect) if(FLAC__bitmath_ilog2(default_partition_samples) + bps + FLAC__MAX_EXTRA_RESIDUAL_BPS <= 32) So, should the value of FLAC__MAX_EXTRA_RESIDUAL_BPS be increased (to 5? or to 6?) 3) any comments? -------------- next part -------------- A non-text attachment was scr...
2014 Jun 29
0
[PATCH] stream_encoder : Improve selection of residual accumulator width
...; And indeed, max. possible residual value is 16 times bigger than max. value > in data[] array: > > residual[i] = data[i] - 4*data[i-1] + 6*data[i-2] - 4*data[i-3] + data[i-4] > > 16 == 2^4, so max. bps value for residual[] is equal to max. bps for data[] + 4. > The value of FLAC__MAX_EXTRA_RESIDUAL_BPS == 4 is enough to fix this problem > with FLAC__fixed_compute_residual(). On the other hand, it is possible to set FLAC__MAX_EXTRA_RESIDUAL_BPS to 0, and change evaluate_fixed_subframe_() function instead: in the call of find_best_partition_order_() function, replace subframe_bps with subframe...
2015 May 18
1
A condition in precompute_partition_info_sums_()
...31 Mar 2007) adds the following conditional: if(FLAC__bitmath_ilog2(default_partition_samples) + bps < 32) And the commit http://git.xiph.org/?p=flac.git;a=commitdiff;h=f081524c19eeafd08f4db6ee5d52a9634c60f475 has this: if(FLAC__bitmath_ilog2(default_partition_samples) + bps + FLAC__MAX_EXTRA_RESIDUAL_BPS < 32) The question is: why ... < 32, not ... <= 32 ? Basically we want to know the number of bits that is necessary to represent the value of (default_partition_samples * max_value_of_residual) product. Let's assume that the bitness of the residual signal is N. The minimum value is...
2014 Jun 30
2
[PATCH] stream_encoder : Improve selection of residual accumulator width
...sidual value is 16 times bigger than max. value > > in data[] array: > > > > residual[i] = data[i] - 4*data[i-1] + 6*data[i-2] - 4*data[i-3] + data[i-4] > > > > 16 == 2^4, so max. bps value for residual[] is equal to max. bps for data[] + 4. > > The value of FLAC__MAX_EXTRA_RESIDUAL_BPS == 4 is enough to fix this problem > > with FLAC__fixed_compute_residual(). > > > On the other hand, it is possible to set FLAC__MAX_EXTRA_RESIDUAL_BPS > to 0, and change evaluate_fixed_subframe_() function instead: in the call > of find_best_partition_order_() function, repl...
2014 Jun 19
5
[PATCH] stream_encoder : Improve selection of residual accumulator width
On Thu, Jun 19, 2014 at 03:30:22PM +0400, lvqcl wrote: > BTW, what can you say about the following place in stream_decoder.c > in read_subframe_lpc_() function: > > /*@@@@@@ technically not pessimistic enough, should be more like > if( (FLAC__uint64)order * ((((FLAC__uint64)1)<<bps)-1) * ((1<<subframe->qlp_coeff_precision)-1) < (((FLAC__uint64)-1)
2015 Sep 26
9
Supporting 32 bit data
Hi all, I just noticed this: https://sourceforge.net/p/flac/feature-requests/91/ a request for support of 32 bit audio data. The request has been around since 2008. Had two inial impressions: * Would adding this break brackwards compatibility too badly? Obviously decoding of 32 bit encoded data would not work with older versions of flac. * This is nuts. 24 bits has a dynamic range of