[FFmpeg-devel] [PATCH v3 2/3] avfilter/af_volumedetect.c: Add 32bit float audio support

Andrew Sayers ffmpeg-devel at pileofstuff.org
Tue May 28 18:23:34 EEST 2024


On Mon, May 20, 2024 at 11:16:05PM +0300, Yigithan Yigit wrote:
> ---
>  libavfilter/af_volumedetect.c | 159 ++++++++++++++++++++++++++++------
>  1 file changed, 133 insertions(+), 26 deletions(-)
> 
> diff --git a/libavfilter/af_volumedetect.c b/libavfilter/af_volumedetect.c
> index 327801a7f9..dbbcd037a5 100644
> --- a/libavfilter/af_volumedetect.c
> +++ b/libavfilter/af_volumedetect.c
> @@ -20,27 +20,51 @@
>  
>  #include "libavutil/channel_layout.h"
>  #include "libavutil/avassert.h"
> +#include "libavutil/mem.h"
>  #include "audio.h"
>  #include "avfilter.h"
>  #include "internal.h"
>  
> +#define MAX_DB_FLT 1024
>  #define MAX_DB 91
> +#define HISTOGRAM_SIZE 0x10000
> +#define HISTOGRAM_SIZE_FLT (MAX_DB_FLT*2)
>  
>  typedef struct VolDetectContext {
> -    /**
> -     * Number of samples at each PCM value.
> -     * histogram[0x8000 + i] is the number of samples at value i.
> -     * The extra element is there for symmetry.
> -     */
> -    uint64_t histogram[0x10001];
> +    uint64_t* histogram; ///< for integer number of samples at each PCM value, for float number of samples at each dB

Nitpick (from an in-progress review bot): s/\* / \*/


More information about the ffmpeg-devel mailing list