[PATCH 3/8] Optimize / simplify av_get_pix_fmt_name().
Stefano Sabatini
stefano.sabatini-lala
Fri Nov 5 11:28:13 CET 2010
---
libavutil/pixdesc.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index c099d03..65fd259 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -816,10 +816,8 @@ static enum PixelFormat get_pix_fmt_internal(const char *name)
const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt)
{
- if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB)
- return NULL;
- else
- return av_pix_fmt_descriptors[pix_fmt].name;
+ return (unsigned)pix_fmt < PIX_FMT_NB ?
+ av_pix_fmt_descriptors[pix_fmt].name : NULL;
}
#if HAVE_BIGENDIAN
--
1.7.1
--qDbXVdCdHGoSgWSk--
More information about the ffmpeg-devel
mailing list