[FFmpeg-devel] Patch for High color and High bit-depth support

Debargha Mukherjee debargha at google.com
Tue Apr 7 23:30:34 CEST 2015


Resolutions inline.

On Mon, Apr 6, 2015 at 3:21 PM, James Zern <jzern at google.com> wrote:

> On Fri, Apr 3, 2015 at 6:37 PM, Debargha Mukherjee <debargha at google.com>
> wrote:
>
> >>
> >> You can probably merge profile 1 like 2/3 to cut down on the
> duplication.
> >> You
> >> might want to set bitdepth to 8 by default reducing the ifdefs here too.
> >>
> >
> > done.
> >
>
> > +#ifdef VPX_IMG_FMT_HIGHBITDEPTH
> > +    case AV_PIX_FMT_YUV420P10LE:
> > +    case AV_PIX_FMT_YUV420P12LE:
> > +        if (codec_caps & VPX_CODEC_CAP_HIGHBITDEPTH) {
> > +            enccfg->g_bit_depth = enccfg->g_input_bit_depth =
> > +                avctx->pix_fmt == AV_PIX_FMT_YUV420P10LE ? 10 : 12;
> > +            enccfg->g_profile = 2;
> > +            *img_fmt = VPX_IMG_FMT_I42016;
> > +            *flags |= VPX_CODEC_USE_HIGHBITDEPTH;
> > +            return 0;
> > +        } else {
> > +            break;
> > +        }
> >
>
> just drop the else, you return from the other block.
>

Done.


>
> >
> >>
> >> > +#if CONFIG_LIBVPX_VP9_ENCODER
> >> > +    if (avctx->codec_id == AV_CODEC_ID_VP9) {
> >> > +        if (set_pix_fmt(avctx, codec_caps, &enccfg, &flags,
> &img_fmt))
> >> > +            return AVERROR(EINVAL);
> >> > +        av_log(avctx, AV_LOG_INFO, "Bit-depth: %d\n",
> >> enccfg.g_bit_depth);
> >> >
> >>
> >> Won't build with a non-high-bitdepth build.
> >>
> >
> > done.
> >
>
> This should get output in dump_enc_cfg(), no? I think the log can be
> dropped.
>

Done.


>
> >
> >>
> >> > -    .pix_fmts       = (const enum AVPixelFormat[]){
> AV_PIX_FMT_YUV420P,
> >> AV_PIX_FMT_NONE },
> >> > +    .pix_fmts       = (const enum AVPixelFormat[]){
> AV_PIX_FMT_YUV420P,
> >> > +
> AV_PIX_FMT_YUV422P,
> >> > +
> AV_PIX_FMT_YUV444P,
> >> > +#ifdef VPX_IMG_FMT_HIGHBITDEPTH
> >> > +
> >> AV_PIX_FMT_YUV420P10LE,
> >> > +
> >> AV_PIX_FMT_YUV422P10LE,
> >> > +
> >> AV_PIX_FMT_YUV444P10LE,
> >> > +
> >> AV_PIX_FMT_YUV420P12LE,
> >> > +
> >> AV_PIX_FMT_YUV422P12LE,
> >> > +
> >> AV_PIX_FMT_YUV444P12LE,
> >> > +#endif
> >>
> >
> > done using ff_vp9_init_static().
> >
> > diff --git a/libavcodec/libvpx.c b/libavcodec/libvpx.c
> > index 5d29893..5111eed 100644
> > --- a/libavcodec/libvpx.c
> > +++ b/libavcodec/libvpx.c
> > @@ -19,12 +19,47 @@
> >   */
> >
> >  #include <vpx/vpx_codec.h>
> > -
> > +#include <vpx/vpx_encoder.h>
> > +#include <vpx/vp8cx.h>
> >
>
> You need to make sure the encoder is available. Keep the break between
> local
> and system headers.
>

Kept the break.


>
> >      if (    vpx_codec_version_major() < 1
> >          || (vpx_codec_version_major() == 1 && vpx_codec_version_minor()
> < 3))
> >          codec->capabilities |= CODEC_CAP_EXPERIMENTAL;
> > +    if (    vpx_codec_version_major() == 1 && vpx_codec_version_minor()
> >= 3) {
> >
>
> 1.4.0 would be better for all high bitdepth since it wasn't working at
> 1.3.0
> and identifying anything in between would need a configure change. Also
> check
> for major > 1.
>

Done.


> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>



-- 
Debargha Mukherjee, Ph.D.
Staff Software Engineer,
Google, Inc.
Email: debargha at google.com
Phone: 408-234-5956 (cell)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Support-for-VP9-high-color-high-bit-depth-encoding.patch
Type: text/x-patch
Size: 8326 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150407/e53a2991/attachment.bin>


More information about the ffmpeg-devel mailing list