[FFmpeg-devel] [RFC] av_get_bits_per_sample() questions

Stefano Sabatini stefano.sabatini-lala
Sun Mar 13 21:59:00 CET 2011


Hi,

just discovered that we have:

int av_get_bits_per_sample(enum CodecID codec_id);
and:
int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt);

av_get_bits_per_sample() return per-codec bits per sample, and is only
used in pcm:
./pcm.c:48:    avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
./pcm.c:93:    sample_size = av_get_bits_per_sample(avctx->codec->id)/8;
./pcm.c:232:        avctx->bits_per_raw_sample = av_get_bits_per_sample(avctx->codec->id);
./pcm.c:285:    sample_size = av_get_bits_per_sample(avctx->codec_id)/8;
./pcm.c:287:    /* av_get_bits_per_sample returns 0 for CODEC_ID_PCM_DVD */

Since this is a per-codec property I wonder if it would be a better
idea to put the information in the codec context and drop the
function.

The second one, av_get_bits_per_sample_fmt(), is misnamed (should be
av_get_bits_per_sample()), so we may change the name to
av_get_bits_per_sample2() for avoiding the conflict with the name
already taken.
-- 
FFmpeg = Fabulous Foolish Most Plastic Ecletic Geek



More information about the ffmpeg-devel mailing list