swscale: Add input support for gbrap10 pixel format

Signed-off-by: Paul B Mahol <onemda@gmail.com>
pull/272/head
Paul B Mahol 9 years ago committed by Luca Barbato
parent 030c8be7a2
commit f6a9c20a52
  1. 16
      libswscale/input.c
  2. 3
      libswscale/utils.c

@ -699,11 +699,21 @@ static void planar_rgb10le_to_y(uint8_t *dst, const uint8_t *src[4], int w)
planar_rgb16_to_y(dst, src, w, 10, 0);
}
static void planar_rgb10le_to_a(uint8_t *dst, const uint8_t *src[4], int w)
{
planar_rgb16_to_a(dst, src, w, 10, 0);
}
static void planar_rgb10be_to_y(uint8_t *dst, const uint8_t *src[4], int w)
{
planar_rgb16_to_y(dst, src, w, 10, 1);
}
static void planar_rgb10be_to_a(uint8_t *dst, const uint8_t *src[4], int w)
{
planar_rgb16_to_a(dst, src, w, 10, 1);
}
static void planar_rgb12le_to_y(uint8_t *dst, const uint8_t *src[4], int w)
{
planar_rgb16_to_y(dst, src, w, 12, 0);
@ -842,6 +852,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_GBRP9LE:
c->readChrPlanar = planar_rgb9le_to_uv;
break;
case AV_PIX_FMT_GBRAP10LE:
case AV_PIX_FMT_GBRP10LE:
c->readChrPlanar = planar_rgb10le_to_uv;
break;
@ -856,6 +867,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_GBRP9BE:
c->readChrPlanar = planar_rgb9be_to_uv;
break;
case AV_PIX_FMT_GBRAP10BE:
case AV_PIX_FMT_GBRP10BE:
c->readChrPlanar = planar_rgb10be_to_uv;
break;
@ -1073,6 +1085,8 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_GBRP9LE:
c->readLumPlanar = planar_rgb9le_to_y;
break;
case AV_PIX_FMT_GBRAP10LE:
c->readAlpPlanar = planar_rgb10le_to_a;
case AV_PIX_FMT_GBRP10LE:
c->readLumPlanar = planar_rgb10le_to_y;
break;
@ -1089,6 +1103,8 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_GBRP9BE:
c->readLumPlanar = planar_rgb9be_to_y;
break;
case AV_PIX_FMT_GBRAP10BE:
c->readAlpPlanar = planar_rgb10be_to_a;
case AV_PIX_FMT_GBRP10BE:
c->readLumPlanar = planar_rgb10be_to_y;
break;

@ -191,6 +191,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
[AV_PIX_FMT_GBRP16LE] = { 1, 0 },
[AV_PIX_FMT_GBRP16BE] = { 1, 0 },
[AV_PIX_FMT_GBRAP] = { 1, 1 },
[AV_PIX_FMT_GBRAP10LE] = { 1, 0 },
[AV_PIX_FMT_GBRAP10BE] = { 1, 0 },
[AV_PIX_FMT_GBRAP12LE] = { 1, 1 },
[AV_PIX_FMT_GBRAP12BE] = { 1, 1 },
[AV_PIX_FMT_GBRAP16LE] = { 1, 0 },
@ -1021,6 +1023,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
srcFormat != AV_PIX_FMT_RGB4_BYTE && srcFormat != AV_PIX_FMT_BGR4_BYTE &&
srcFormat != AV_PIX_FMT_GBRP9BE && srcFormat != AV_PIX_FMT_GBRP9LE &&
srcFormat != AV_PIX_FMT_GBRP10BE && srcFormat != AV_PIX_FMT_GBRP10LE &&
srcFormat != AV_PIX_FMT_GBRAP10BE && srcFormat != AV_PIX_FMT_GBRAP10LE &&
srcFormat != AV_PIX_FMT_GBRP12BE && srcFormat != AV_PIX_FMT_GBRP12LE &&
srcFormat != AV_PIX_FMT_GBRP16BE && srcFormat != AV_PIX_FMT_GBRP16LE &&
((dstW >> c->chrDstHSubSample) <= (srcW >> 1) ||

Loading…
Cancel
Save