[FFmpeg-cvslog] r14484 - in trunk/libavcodec: audioconvert.c audioconvert.h

Benjamin Larsson banan
Thu Jul 31 14:58:13 CEST 2008


pross wrote:
> Author: pross
> Date: Thu Jul 31 14:55:06 2008
> New Revision: 14484
>
> Log:
> Add sample format support functions: avcodec_get_sample_fmt_name(), avcodec_get_sample_fmt(), avcodec_sample_fmt_string()
>
>
> Added:
>    trunk/libavcodec/audioconvert.h
> Modified:
>    trunk/libavcodec/audioconvert.c
>
> Modified: trunk/libavcodec/audioconvert.c
> ==============================================================================
> --- trunk/libavcodec/audioconvert.c	(original)
> +++ trunk/libavcodec/audioconvert.c	Thu Jul 31 14:55:06 2008
> @@ -25,7 +25,49 @@
>   * @author Michael Niedermayer <michaelni at gmx.at>
>   */
>  
> -#include "avcodec.h"
> +#include "audioconvert.h"
> +
> +typedef struct SampleFmtInfo {
> +    const char *name;
> +    int bits;
> +} SampleFmtInfo;
> +
> +/** this table gives more information about formats */
> +static const SampleFmtInfo sample_fmt_info[SAMPLE_FMT_NB] = {
> +    [SAMPLE_FMT_U8]  = { .name = "u8",  .bits = 8 },
> +    [SAMPLE_FMT_S16] = { .name = "s16", .bits = 16 },
> +    [SAMPLE_FMT_S24] = { .name = "s24", .bits = 24 },
> +    [SAMPLE_FMT_S32] = { .name = "s32", .bits = 32 },
> +    [SAMPLE_FMT_FLT] = { .name = "flt", .bits = 32 }
> +};
>   

We need a scaled biased float format also. SAMPLE_FMT_SBF = { .name = 
"sbf", .bits = 32 }might be ok.

MvH
Benjamin Larsson






More information about the ffmpeg-cvslog mailing list