[FFmpeg-cvslog] swscale: Force full horizontal chroma internally when the output has a odd size.
Michael Niedermayer
git at videolan.org
Wed Jan 11 22:06:49 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jan 8 22:48:58 2012 +0100| [ba6e36f906c9ff8a4debd44288792579495bafc3] | committer: Michael Niedermayer
swscale: Force full horizontal chroma internally when the output has a odd size.
This fixes a gray line on the right side due to 1 column of pixels being skiped.
Fixes Ticket891
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ba6e36f906c9ff8a4debd44288792579495bafc3
---
libswscale/utils.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 1bbe58e..13eb075 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -850,7 +850,14 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
getSubSampleFactors(&c->chrDstHSubSample, &c->chrDstVSubSample, dstFormat);
// reuse chroma for 2 pixels RGB/BGR unless user wants full chroma interpolation
- if (isAnyRGB(dstFormat) && !(flags&SWS_FULL_CHR_H_INT)) c->chrDstHSubSample=1;
+ if (isAnyRGB(dstFormat) && !(flags&SWS_FULL_CHR_H_INT)) {
+ if (dstW&1) {
+ av_log(c, AV_LOG_DEBUG, "Forcing full internal H chroma due to odd output size\n");
+ flags |= SWS_FULL_CHR_H_INT;
+ c->flags = flags;
+ } else
+ c->chrDstHSubSample = 1;
+ }
// drop some chroma lines if the user wants it
c->vChrDrop= (flags&SWS_SRC_V_CHR_DROP_MASK)>>SWS_SRC_V_CHR_DROP_SHIFT;
More information about the ffmpeg-cvslog
mailing list