[FFmpeg-devel] [PATCH] webp: fix transforms after a palette with pixel packing.

James Zern jzern at google.com
Sun Sep 26 01:36:03 EEST 2021


On Mon, Sep 20, 2021 at 5:44 PM James Zern <jzern at google.com> wrote:
>
> On Wed, Sep 8, 2021 at 6:46 PM James Zern <jzern at google.com> wrote:
> >
> > On Mon, Aug 30, 2021 at 5:11 AM Maryla <maryla-at-google.com at ffmpeg.org> wrote:
> > >
> > > When a color indexing transform with 16 or fewer colors is used,
> > > WebP uses "pixel packing", i.e. storing several pixels in one byte,
> > > which virtually reduces the width of the image (see WebPContext's
> > > reduced_width field). This reduced_width should always be used when
> > > reading and applying subsequent transforms.
> > >
> > > Updated patch with added fate test.
> > > The source image dual_transform.webp can be downloaded by cloning
> > > https://chromium.googlesource.com/webm/libwebp-test-data/
> > >
> > > Fixes: 9368
> > > ---
> > >  libavcodec/webp.c                             | 34 ++++++++++---------
> > >  tests/fate/image.mak                          |  3 ++
> > >  .../fate/webp-rgb-lossless-palette-predictor  |  6 ++++
> > >  3 files changed, 27 insertions(+), 16 deletions(-)
> > >  create mode 100644 tests/ref/fate/webp-rgb-lossless-palette-predictor
> > >
> >
> > This works locally and matches the output from libwebp. I sent a
> > request to samples-request@ to add the file. This should have a micro
> > version bump for libavcodec/version.h; I've added that locally.
> >
>
> The sample addition is still pending. I've verified the pam output of
> this file and lossless* from the webp test set match libwebp. I'll
> submit this soon with the fate test disabled if there aren't any
> comments.
>

Applied with the test disabled. Thanks for the patch.


More information about the ffmpeg-devel mailing list