<div dir="ltr"><div>Sagar,<br><br>Good job investigating this. I see that you're trying to avoid the wrong (padded) width and height from being passed into dither. <br><br></div><div>However, the padding is done only on Encoder::m_param and not the param given by the user. <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 29, 2015 at 2:14 PM, <span dir="ltr"><<a href="mailto:sagar@multicorewareinc.com" target="_blank">sagar@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Sagar Kotecha <<a href="mailto:sagar@multicorewareinc.com">sagar@multicorewareinc.com</a>><br>
# Date 1443516264 -19800<br>
# Tue Sep 29 14:14:24 2015 +0530<br>
# Node ID b0a32288a2ab20cd9fd9773ee11476673c9e6bf0<br>
# Parent f4c267f28487161fa78c43cabb30dc4f4f82570c<br>
Fix: Provide width and height of input file to dither, param may have padded that.<br>
<br>
Fixes Issue #195<br>
<br>
diff -r f4c267f28487 -r b0a32288a2ab source/input/input.h<br>
--- a/source/input/input.h Mon Sep 28 13:38:33 2015 +0530<br>
+++ b/source/input/input.h Tue Sep 29 14:14:24 2015 +0530<br>
@@ -79,6 +79,10 @@<br>
virtual bool isFail() = 0;<br>
<br>
virtual const char *getName() const = 0;<br>
+<br>
+ virtual int getWidth() const = 0;<br>
+<br>
+ virtual int getHeight() const = 0;<br>
};<br>
}<br>
<br>
diff -r f4c267f28487 -r b0a32288a2ab source/input/y4m.h<br>
--- a/source/input/y4m.h Mon Sep 28 13:38:33 2015 +0530<br>
+++ b/source/input/y4m.h Tue Sep 29 14:14:24 2015 +0530<br>
@@ -88,6 +88,10 @@<br>
bool readPicture(x265_picture&);<br>
<br>
const char *getName() const { return "y4m"; }<br>
+<br>
+ int getWidth() const { return width; }<br>
+<br>
+ int getHeight() const { return height; }<br>
};<br>
}<br>
<br>
diff -r f4c267f28487 -r b0a32288a2ab source/input/yuv.h<br>
--- a/source/input/yuv.h Mon Sep 28 13:38:33 2015 +0530<br>
+++ b/source/input/yuv.h Tue Sep 29 14:14:24 2015 +0530<br>
@@ -80,6 +80,10 @@<br>
bool readPicture(x265_picture&);<br>
<br>
const char *getName() const { return "yuv"; }<br>
+<br>
+ int getWidth() const { return width; }<br>
+<br>
+ int getHeight() const { return height; }<br>
};<br>
}<br>
<br>
diff -r f4c267f28487 -r b0a32288a2ab source/x265.cpp<br>
--- a/source/x265.cpp Mon Sep 28 13:38:33 2015 +0530<br>
+++ b/source/x265.cpp Tue Sep 29 14:14:24 2015 +0530<br>
@@ -632,7 +632,7 @@<br>
{<br>
if (pic_in->bitDepth > param->internalBitDepth && cliopt.bDither)<br>
{<br>
- x265_dither_image(*api, *pic_in, param->sourceWidth, param->sourceHeight, errorBuf, param->internalBitDepth);<br>
+ x265_dither_image(*api, *pic_in, cliopt.input->getWidth(), cliopt.input->getHeight(), errorBuf, param->internalBitDepth);<br>
pic_in->bitDepth = param->internalBitDepth;<br>
}<br>
/* Overwrite PTS */<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br></div>