[FFmpeg-devel] [PATCH v2] avcodec/libvpxenc: Apply codec options to alpha codec context

James Zern jzern at google.com
Thu Sep 9 05:05:54 EEST 2021


On Fri, Sep 3, 2021 at 5:02 PM James Zern <jzern at google.com> wrote:
>
> On Fri, Sep 3, 2021 at 1:33 AM Adam Chelminski
> <chelminski.adam at gmail.com> wrote:
> >
> > When encoding yuva420 (alpha) frames, the vpx encoder uses a second
> > vpx_codec_ctx to encode the alpha stream. However, codec options were
> > only being applied to the primary encoder. This patch updates
> > codecctl_int and codecctl_intp to also apply codec options to the alpha
> > codec context when encoding frames with alpha.
> >
> > This is necessary to take advantage of libvpx speed optimizations
> > such as 'row-mt' and 'cpu-used' when encoding videos with alpha.
> > Without this patch, the speed optimizations are only applied to the
> > primary stream encoding, and the overall encoding is just as slow
> > as it would be without the options specified.
> >
> > Signed-off-by: Adam Chelminski <chelminski.adam at gmail.com>
> > ---
> >  doc/APIchanges         |  4 ++++
> >  libavcodec/libvpxenc.c | 26 ++++++++++++++++++++++++--
> >  libavcodec/version.h   |  2 +-
> >  3 files changed, 29 insertions(+), 3 deletions(-)
> >
>
> lgtm. One could argue that the alpha encoder should have its own set
> of options to allow for a higher quality alpha plane, but I think
> aligning the configurations makes sense given the current state of the
> code. I'll submit this next week if there aren't any comments.
>

Applied. Thanks for the patch.


More information about the ffmpeg-devel mailing list