Commit 1e3e547a authored by Zhao Zhili's avatar Zhao Zhili Committed by Michael Niedermayer

swscale/utils: remove access of AV_PIX_FMT_NB

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent f1353ce2
...@@ -95,7 +95,7 @@ typedef struct FormatEntry { ...@@ -95,7 +95,7 @@ typedef struct FormatEntry {
uint8_t is_supported_endianness :1; uint8_t is_supported_endianness :1;
} FormatEntry; } FormatEntry;
static const FormatEntry format_entries[AV_PIX_FMT_NB] = { static const FormatEntry format_entries[] = {
[AV_PIX_FMT_YUV420P] = { 1, 1 }, [AV_PIX_FMT_YUV420P] = { 1, 1 },
[AV_PIX_FMT_YUYV422] = { 1, 1 }, [AV_PIX_FMT_YUYV422] = { 1, 1 },
[AV_PIX_FMT_RGB24] = { 1, 1 }, [AV_PIX_FMT_RGB24] = { 1, 1 },
...@@ -270,19 +270,19 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = { ...@@ -270,19 +270,19 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
int sws_isSupportedInput(enum AVPixelFormat pix_fmt) int sws_isSupportedInput(enum AVPixelFormat pix_fmt)
{ {
return (unsigned)pix_fmt < AV_PIX_FMT_NB ? return (unsigned)pix_fmt < FF_ARRAY_ELEMS(format_entries) ?
format_entries[pix_fmt].is_supported_in : 0; format_entries[pix_fmt].is_supported_in : 0;
} }
int sws_isSupportedOutput(enum AVPixelFormat pix_fmt) int sws_isSupportedOutput(enum AVPixelFormat pix_fmt)
{ {
return (unsigned)pix_fmt < AV_PIX_FMT_NB ? return (unsigned)pix_fmt < FF_ARRAY_ELEMS(format_entries) ?
format_entries[pix_fmt].is_supported_out : 0; format_entries[pix_fmt].is_supported_out : 0;
} }
int sws_isSupportedEndiannessConversion(enum AVPixelFormat pix_fmt) int sws_isSupportedEndiannessConversion(enum AVPixelFormat pix_fmt)
{ {
return (unsigned)pix_fmt < AV_PIX_FMT_NB ? return (unsigned)pix_fmt < FF_ARRAY_ELEMS(format_entries) ?
format_entries[pix_fmt].is_supported_endianness : 0; format_entries[pix_fmt].is_supported_endianness : 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment