On 12/05/2012 12:52 PM, Kostya Shishkov wrote:
> On Wed, Nov 28, 2012 at 03:00:10PM -0500, Justin Ruggles wrote:
>> ---
>> libavresample/Makefile | 1 +
>> libavresample/audio_convert.c | 33 ++++-
>> libavresample/audio_convert.h | 22 ++-
>> libavresample/avresample.h | 9 +
>> libavresample/dither.c | 392
>> +++++++++++++++++++++++++++++++++++++++++
>> libavresample/dither.h | 60 +++++++
>> libavresample/internal.h | 1 +
>> libavresample/options.c | 6 +
>> libavresample/utils.c | 10 +-
>> 9 files changed, 523 insertions(+), 11 deletions(-)
>> create mode 100644 libavresample/dither.c
>> create mode 100644 libavresample/dither.h
[...]
>> +void ff_audio_convert_free(AudioConvert **ac)
>> +{
>> + if (!*ac)
>> + return;
>> + ff_dither_free(&(*ac)->dc);
>
> does this line do what I hope it does?
I don't know what you hope for, but it does what I want it to do...
[...]
>> +
>> +/* noise shaping coefficients */
>> +
>> +static const float ns_48_coef_b[4] = {
>> + 2.2374f, -0.7339f, -0.1251f, -0.6033f
>> +};
>> +
>> +static const float ns_48_coef_a[4] = {
>> + 0.9030f, 0.0116f, -0.5853f, -0.2571f
>> +};
>> +
>> +static const float ns_44_coef_b[4] = {
>> + 2.2061f, -0.4707f, -0.2534f, -0.6213f
>> +};
>> +
>> +static const float ns_44_coef_a[4] = {
>> + 1.0587f, 0.0676f, -0.6054f, -0.2738f
>> +};
>
> looks like it can be generated for all frequencies if you know DSP theory
> (unlike me), but it's fine too
I also don't know enough about it to come up with a function to generate
coeffs for any frequency.
>> +static inline float lfg_get_flt(AVLFG *lfg)
>> +{
>> + return av_lfg_get(lfg) / (float)UINT32_MAX;
>> +}
>
> Make it generic? I think some codecs use the similar code too.
I couldn't find any. But I guess it could still be useful to have available.
-Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel