diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-26 19:50:28 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-26 20:40:44 +0100 |
commit | 02001a372de6e07a51d1772accc7c7b27f2af7ae (patch) | |
tree | d5558d83d669189aa2c8e9fdcdb18cf261562182 /libswscale | |
parent | 3c2ecfcc24761adc67e49888cce08f8a6fddfbb4 (diff) |
sws: add planar RGB formats to isAnyRGB
We have to make some symetric changes elsewhere as this increases
the precission with which samples are stored.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/input.c | 6 | ||||
-rw-r--r-- | libswscale/swscale_internal.h | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/libswscale/input.c b/libswscale/input.c index d3aeb22151..2def2de6c8 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -729,7 +729,7 @@ static av_always_inline void planar_rgb16_to_y(uint8_t *_dst, const uint8_t *_sr int b = rdpx(src[1] + i); int r = rdpx(src[2] + i); - dst[i] = ((RY * r + GY * g + BY * b + (33 << (RGB2YUV_SHIFT + bpc - 9))) >> RGB2YUV_SHIFT); + dst[i] = ((RY * r + GY * g + BY * b + (33 << (RGB2YUV_SHIFT + bpc - 9))) >> (RGB2YUV_SHIFT + bpc - 14)); } } @@ -796,8 +796,8 @@ static av_always_inline void planar_rgb16_to_uv(uint8_t *_dstU, uint8_t *_dstV, int b = rdpx(src[1] + i); int r = rdpx(src[2] + i); - dstU[i] = (RU * r + GU * g + BU * b + (257 << (RGB2YUV_SHIFT + bpc - 9))) >> RGB2YUV_SHIFT; - dstV[i] = (RV * r + GV * g + BV * b + (257 << (RGB2YUV_SHIFT + bpc - 9))) >> RGB2YUV_SHIFT; + dstU[i] = (RU * r + GU * g + BU * b + (257 << (RGB2YUV_SHIFT + bpc - 9))) >> (RGB2YUV_SHIFT + bpc - 14); + dstV[i] = (RV * r + GV * g + BV * b + (257 << (RGB2YUV_SHIFT + bpc - 9))) >> (RGB2YUV_SHIFT + bpc - 14); } } #undef rdpx diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 9f9cc4a790..5f10a6022e 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -716,6 +716,14 @@ static av_always_inline int isRGB(enum AVPixelFormat pix_fmt) ( \ isRGBinInt(x) || \ isBGRinInt(x) || \ + (x)==AV_PIX_FMT_GBRP9LE || \ + (x)==AV_PIX_FMT_GBRP9BE || \ + (x)==AV_PIX_FMT_GBRP10LE || \ + (x)==AV_PIX_FMT_GBRP10BE || \ + (x)==AV_PIX_FMT_GBRP12LE || \ + (x)==AV_PIX_FMT_GBRP12BE || \ + (x)==AV_PIX_FMT_GBRP14LE || \ + (x)==AV_PIX_FMT_GBRP14BE || \ (x)==AV_PIX_FMT_GBR24P \ ) |