diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-05-27 12:47:03 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-05-27 13:21:17 +0200 |
commit | 041dbd3c145046e1bfd35079d23c6843a2f703cb (patch) | |
tree | e669e547af4e9dc886db60d7716f65de962e313c /libswscale/swscale_template.c | |
parent | f642982c10dd2257a372e36c00c66b8a57954ae1 (diff) | |
download | ffmpeg-041dbd3c145046e1bfd35079d23c6843a2f703cb.tar.gz |
swscale: dont loose precission on RGB/BGR48 input, that is dont drop half the bits.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/swscale_template.c')
-rw-r--r-- | libswscale/swscale_template.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 8bf38b5946..5a84ceb871 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -886,10 +886,10 @@ static void sws_init_swScale_c(SwsContext *c) } if (c->chrSrcHSubSample) { switch(srcFormat) { - case PIX_FMT_RGB48BE: - case PIX_FMT_RGB48LE: c->chrToYV12 = rgb48ToUV_half; break; - case PIX_FMT_BGR48BE: - case PIX_FMT_BGR48LE: c->chrToYV12 = bgr48ToUV_half; break; + case PIX_FMT_RGB48BE: c->chrToYV12 = rgb48BEToUV_half; break; + case PIX_FMT_RGB48LE: c->chrToYV12 = rgb48LEToUV_half; break; + case PIX_FMT_BGR48BE: c->chrToYV12 = bgr48BEToUV_half; break; + case PIX_FMT_BGR48LE: c->chrToYV12 = bgr48LEToUV_half; break; case PIX_FMT_RGB32 : c->chrToYV12 = bgr32ToUV_half; break; case PIX_FMT_RGB32_1: c->chrToYV12 = bgr321ToUV_half; break; case PIX_FMT_BGR24 : c->chrToYV12 = bgr24ToUV_half_c; break; @@ -903,10 +903,10 @@ static void sws_init_swScale_c(SwsContext *c) } } else { switch(srcFormat) { - case PIX_FMT_RGB48BE: - case PIX_FMT_RGB48LE: c->chrToYV12 = rgb48ToUV; break; - case PIX_FMT_BGR48BE: - case PIX_FMT_BGR48LE: c->chrToYV12 = bgr48ToUV; break; + case PIX_FMT_RGB48BE: c->chrToYV12 = rgb48BEToUV; break; + case PIX_FMT_RGB48LE: c->chrToYV12 = rgb48LEToUV; break; + case PIX_FMT_BGR48BE: c->chrToYV12 = bgr48BEToUV; break; + case PIX_FMT_BGR48LE: c->chrToYV12 = bgr48LEToUV; break; case PIX_FMT_RGB32 : c->chrToYV12 = bgr32ToUV; break; case PIX_FMT_RGB32_1: c->chrToYV12 = bgr321ToUV; break; case PIX_FMT_BGR24 : c->chrToYV12 = bgr24ToUV_c; break; @@ -945,10 +945,10 @@ static void sws_init_swScale_c(SwsContext *c) case PIX_FMT_RGB32_1: c->lumToYV12 = bgr321ToY; break; case PIX_FMT_BGR32 : c->lumToYV12 = rgb32ToY; break; case PIX_FMT_BGR32_1: c->lumToYV12 = rgb321ToY; break; - case PIX_FMT_RGB48BE: - case PIX_FMT_RGB48LE: c->lumToYV12 = rgb48ToY; break; - case PIX_FMT_BGR48BE: - case PIX_FMT_BGR48LE: c->lumToYV12 = bgr48ToY; break; + case PIX_FMT_RGB48BE: c->lumToYV12 = rgb48BEToY; break; + case PIX_FMT_RGB48LE: c->lumToYV12 = rgb48LEToY; break; + case PIX_FMT_BGR48BE: c->lumToYV12 = bgr48BEToY; break; + case PIX_FMT_BGR48LE: c->lumToYV12 = bgr48LEToY; break; } if (c->alpPixBuf) { switch (srcFormat) { @@ -972,12 +972,6 @@ static void sws_init_swScale_c(SwsContext *c) case PIX_FMT_BGR32 : c->alpSrcOffset = 3; break; - case PIX_FMT_RGB48LE: - case PIX_FMT_BGR48LE: - c->lumSrcOffset = 1; - c->chrSrcOffset = 1; - c->alpSrcOffset = 1; - break; } if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) { |