[x265] [PATCH] Fix: Provide width and height of input file to dither, param may have padded that

Sagar Kotecha sagar at multicorewareinc.com
Tue Sep 29 11:14:43 CEST 2015


User param are getting updated with encoder param by
api->encoder_parameters(encoder, param) call.

​Thanks,
Sagar​

On Tue, Sep 29, 2015 at 2:32 PM, Deepthi Nandakumar <
deepthi at multicorewareinc.com> wrote:

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


More information about the x265-devel mailing list