samplefmt: add av_get_bytes_per_sample()
Deprecate av_get_bits_per_sample_fmt(), which was a misnamed function. For the moment we don't have sample formats with a non-integer number of bytes, in that case we may need to create a new av_get_bits_per_sample() function. In the meanwhile we prefer to adopt this variant, since avoids divisions by 8 all over the place.
This commit is contained in:
committed by
Justin Ruggles
parent
2f37321abc
commit
a6703faa15
@@ -66,8 +66,16 @@ char *av_get_sample_fmt_string (char *buf, int buf_size, enum AVSampleFormat sam
|
||||
return buf;
|
||||
}
|
||||
|
||||
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
|
||||
{
|
||||
return sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB ?
|
||||
0 : sample_fmt_info[sample_fmt].bits >> 3;
|
||||
}
|
||||
|
||||
#if FF_API_GET_BITS_PER_SAMPLE_FMT
|
||||
int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt)
|
||||
{
|
||||
return sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB ?
|
||||
0 : sample_fmt_info[sample_fmt].bits;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user