[FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

Kieran Kunhya kierank at obe.tv
Mon Apr 11 01:39:57 CEST 2016


On Mon, 11 Apr 2016 at 00:33 Michael Niedermayer <michael at niedermayer.cc>
wrote:

> The bits_per_raw_sample represents the number of bits of precission per
> sample.
>
> The field is added at the logical place, not at the end as the code was
> just
> recently added
>
> This fixes the regression about loosing the audio sample precission
> information
>
> The change in the fate test checksum un-does the change from the merge
>
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libavcodec/avcodec.h |   17 +++++++++++++++++
>  libavcodec/utils.c   |    2 ++
>  tests/ref/lavf/ffm   |    2 +-
>  3 files changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index b3655c5..87739d7 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -3832,9 +3832,26 @@ typedef struct AVCodecParameters {
>       */
>      int64_t bit_rate;
>
> +    /**
> +     * The number of bits per sample in the codedwords.
> +     *
> +     * This is basically the bitrate per sample
> +     *
> +     * This could be for example 4 for ADPCM
> +     * For PCM formats this matches bits_per_raw_sample
> +     * Can be 0
> +     */
>      int bits_per_coded_sample;
>
>      /**
> +     * The number of bits of precission in the samples.
> +     *
> +     * For ADPCM this might be 12 or 16 or similar
> +     * Can be 0
> +     */
> +    int bits_per_raw_sample;
>
>
Precision spelt wrong. Also needs more clarification as to the difference
between the two - I have no idea what the difference is or why one would
use bits_per_coded_sample for anything.

Regards,
Kieran Kunhya


More information about the ffmpeg-devel mailing list