Commit ef098530 authored by ramiro's avatar ramiro

Make 16bit YUV formats compatible with NE avcodec_get_pix_fmt().

Patch by Lars Täuber <lars <dot> taeuber <at> gmx <dot> net>.

git-svn-id: file:///var/local/repositories/mplayer/trunk/libswscale@29650 b3059339-0415-0410-9bf9-f77b7e298cf2
parent 2ebc18df
......@@ -136,12 +136,12 @@ unsigned swscale_version(void)
|| (x)==PIX_FMT_YUV440P \
|| (x)==PIX_FMT_MONOWHITE \
|| (x)==PIX_FMT_MONOBLACK \
|| (x)==PIX_FMT_YUV420PLE \
|| (x)==PIX_FMT_YUV422PLE \
|| (x)==PIX_FMT_YUV444PLE \
|| (x)==PIX_FMT_YUV420PBE \
|| (x)==PIX_FMT_YUV422PBE \
|| (x)==PIX_FMT_YUV444PBE \
|| (x)==PIX_FMT_YUV420P16LE \
|| (x)==PIX_FMT_YUV422P16LE \
|| (x)==PIX_FMT_YUV444P16LE \
|| (x)==PIX_FMT_YUV420P16BE \
|| (x)==PIX_FMT_YUV422P16BE \
|| (x)==PIX_FMT_YUV444P16BE \
)
#define isSupportedOut(x) ( \
(x)==PIX_FMT_YUV420P \
......@@ -160,12 +160,12 @@ unsigned swscale_version(void)
|| (x)==PIX_FMT_GRAY8 \
|| (x)==PIX_FMT_YUV410P \
|| (x)==PIX_FMT_YUV440P \
|| (x)==PIX_FMT_YUV420PLE \
|| (x)==PIX_FMT_YUV422PLE \
|| (x)==PIX_FMT_YUV444PLE \
|| (x)==PIX_FMT_YUV420PBE \
|| (x)==PIX_FMT_YUV422PBE \
|| (x)==PIX_FMT_YUV444PBE \
|| (x)==PIX_FMT_YUV420P16LE \
|| (x)==PIX_FMT_YUV422P16LE \
|| (x)==PIX_FMT_YUV444P16LE \
|| (x)==PIX_FMT_YUV420P16BE \
|| (x)==PIX_FMT_YUV422P16BE \
|| (x)==PIX_FMT_YUV444P16BE \
)
#define isPacked(x) ( \
(x)==PIX_FMT_PAL8 \
......@@ -459,18 +459,18 @@ const char *sws_format_name(enum PixelFormat format)
return "vdpau_wmv3";
case PIX_FMT_VDPAU_VC1:
return "vdpau_vc1";
case PIX_FMT_YUV420PLE:
return "yuv420ple";
case PIX_FMT_YUV422PLE:
return "yuv422ple";
case PIX_FMT_YUV444PLE:
return "yuv444ple";
case PIX_FMT_YUV420PBE:
return "yuv420pbe";
case PIX_FMT_YUV422PBE:
return "yuv422pbe";
case PIX_FMT_YUV444PBE:
return "yuv444pbe";
case PIX_FMT_YUV420P16LE:
return "yuv420p16le";
case PIX_FMT_YUV422P16LE:
return "yuv422p16le";
case PIX_FMT_YUV444P16LE:
return "yuv444p16le";
case PIX_FMT_YUV420P16BE:
return "yuv420p16be";
case PIX_FMT_YUV422P16BE:
return "yuv422p16be";
case PIX_FMT_YUV444P16BE:
return "yuv444p16be";
default:
return "Unknown format";
}
......@@ -2371,8 +2371,8 @@ static void getSubSampleFactors(int *h, int *v, int format)
*v=0;
break;
case PIX_FMT_YUV420P:
case PIX_FMT_YUV420PLE:
case PIX_FMT_YUV420PBE:
case PIX_FMT_YUV420P16LE:
case PIX_FMT_YUV420P16BE:
case PIX_FMT_YUVA420P:
case PIX_FMT_GRAY16BE:
case PIX_FMT_GRAY16LE:
......@@ -2391,14 +2391,14 @@ static void getSubSampleFactors(int *h, int *v, int format)
*v=2;
break;
case PIX_FMT_YUV444P:
case PIX_FMT_YUV444PLE:
case PIX_FMT_YUV444PBE:
case PIX_FMT_YUV444P16LE:
case PIX_FMT_YUV444P16BE:
*h=0;
*v=0;
break;
case PIX_FMT_YUV422P:
case PIX_FMT_YUV422PLE:
case PIX_FMT_YUV422PBE:
case PIX_FMT_YUV422P16LE:
case PIX_FMT_YUV422P16BE:
*h=1;
*v=0;
break;
......
......@@ -302,12 +302,12 @@ const char *sws_format_name(enum PixelFormat format);
|| (x)==PIX_FMT_GRAY16LE \
|| (x)==PIX_FMT_RGB48BE \
|| (x)==PIX_FMT_RGB48LE \
|| (x)==PIX_FMT_YUV420PLE \
|| (x)==PIX_FMT_YUV422PLE \
|| (x)==PIX_FMT_YUV444PLE \
|| (x)==PIX_FMT_YUV420PBE \
|| (x)==PIX_FMT_YUV422PBE \
|| (x)==PIX_FMT_YUV444PBE \
|| (x)==PIX_FMT_YUV420P16LE \
|| (x)==PIX_FMT_YUV422P16LE \
|| (x)==PIX_FMT_YUV444P16LE \
|| (x)==PIX_FMT_YUV420P16BE \
|| (x)==PIX_FMT_YUV422P16BE \
|| (x)==PIX_FMT_YUV444P16BE \
)
#define isBE(x) ((x)&1)
#define isPlanar8YUV(x) ( \
......@@ -323,12 +323,12 @@ const char *sws_format_name(enum PixelFormat format);
)
#define isPlanarYUV(x) ( \
isPlanar8YUV(x) \
|| (x)==PIX_FMT_YUV420PLE \
|| (x)==PIX_FMT_YUV422PLE \
|| (x)==PIX_FMT_YUV444PLE \
|| (x)==PIX_FMT_YUV420PBE \
|| (x)==PIX_FMT_YUV422PBE \
|| (x)==PIX_FMT_YUV444PBE \
|| (x)==PIX_FMT_YUV420P16LE \
|| (x)==PIX_FMT_YUV422P16LE \
|| (x)==PIX_FMT_YUV444P16LE \
|| (x)==PIX_FMT_YUV420P16BE \
|| (x)==PIX_FMT_YUV422P16BE \
|| (x)==PIX_FMT_YUV444P16BE \
)
#define isYUV(x) ( \
(x)==PIX_FMT_UYVY422 \
......
......@@ -2914,12 +2914,12 @@ static void RENAME(sws_init_swScale)(SwsContext *c)
case PIX_FMT_PAL8 :
case PIX_FMT_BGR4_BYTE:
case PIX_FMT_RGB4_BYTE: c->hcscale_internal = palToUV; break;
case PIX_FMT_YUV420PBE:
case PIX_FMT_YUV422PBE:
case PIX_FMT_YUV444PBE: c->hcscale_internal = RENAME(BEToUV); break;
case PIX_FMT_YUV420PLE:
case PIX_FMT_YUV422PLE:
case PIX_FMT_YUV444PLE: c->hcscale_internal = RENAME(LEToUV); break;
case PIX_FMT_YUV420P16BE:
case PIX_FMT_YUV422P16BE:
case PIX_FMT_YUV444P16BE: c->hcscale_internal = RENAME(BEToUV); break;
case PIX_FMT_YUV420P16LE:
case PIX_FMT_YUV422P16LE:
case PIX_FMT_YUV444P16LE: c->hcscale_internal = RENAME(LEToUV); break;
}
if (c->chrSrcHSubSample) {
switch(srcFormat) {
......@@ -2957,14 +2957,14 @@ static void RENAME(sws_init_swScale)(SwsContext *c)
c->hascale_internal = NULL;
switch (srcFormat) {
case PIX_FMT_YUYV422 :
case PIX_FMT_YUV420PBE:
case PIX_FMT_YUV422PBE:
case PIX_FMT_YUV444PBE:
case PIX_FMT_YUV420P16BE:
case PIX_FMT_YUV422P16BE:
case PIX_FMT_YUV444P16BE:
case PIX_FMT_GRAY16BE : c->hyscale_internal = RENAME(yuy2ToY); break;
case PIX_FMT_UYVY422 :
case PIX_FMT_YUV420PLE:
case PIX_FMT_YUV422PLE:
case PIX_FMT_YUV444PLE:
case PIX_FMT_YUV420P16LE:
case PIX_FMT_YUV422P16LE:
case PIX_FMT_YUV444P16LE:
case PIX_FMT_GRAY16LE : c->hyscale_internal = RENAME(uyvyToY); break;
case PIX_FMT_BGR24 : c->hyscale_internal = RENAME(bgr24ToY); break;
case PIX_FMT_BGR565 : c->hyscale_internal = bgr16ToY; break;
......
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