aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2007-08-13 05:23:38 +0000
committerDavid Conrad <lessen42@gmail.com>2007-08-13 05:23:38 +0000
commit42c71907cb394f1b35627631fbc1778f338942d2 (patch)
tree0b8b72856c6e13c4a102b9671d9775928dd8c6c7 /libavcodec/utils.c
parent99e8b22dc56f5d850ac4142388dce029f7761ff3 (diff)
downloadffmpeg-42c71907cb394f1b35627631fbc1778f338942d2.tar.gz
Add av_get_bits_per_sample_format()
Originally committed as revision 10099 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 5f10ffbe86..c381f03f20 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1322,6 +1322,22 @@ int av_get_bits_per_sample(enum CodecID codec_id){
}
}
+int av_get_bits_per_sample_format(enum SampleFormat sample_fmt) {
+ switch (sample_fmt) {
+ case SAMPLE_FMT_U8:
+ return 8;
+ case SAMPLE_FMT_S16:
+ return 16;
+ case SAMPLE_FMT_S24:
+ return 24;
+ case SAMPLE_FMT_S32:
+ case SAMPLE_FMT_FLT:
+ return 32;
+ default:
+ return 0;
+ }
+}
+
#if !defined(HAVE_THREADS)
int avcodec_thread_init(AVCodecContext *s, int thread_count){
return -1;