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

2021-09-25 Thread James Zern
On Mon, Sep 20, 2021 at 5:44 PM James Zern  wrote:
>
> On Wed, Sep 8, 2021 at 6:46 PM James Zern  wrote:
> >
> > On Mon, Aug 30, 2021 at 5:11 AM Maryla  
> > 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.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] libaom: Dont use aom_codec_av1_dx_algo.

2021-10-20 Thread James Zern
On Wed, Oct 20, 2021 at 9:59 AM Matt Oliver  wrote:
>
> This fixes linking errors where variables cannot be correctly linked in
> from an external shared library such as with msvc (requires dllimport which
> is not used by libaom). Instead just call the function that returns the
> same variable.
> ---
>  libavcodec/libaomdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c
> index 75ecc08970..d6b822fda2 100644
> --- a/libavcodec/libaomdec.c
> +++ b/libavcodec/libaomdec.c
> @@ -241,7 +241,7 @@ static av_cold int aom_free(AVCodecContext *avctx)
>
>  static av_cold int av1_init(AVCodecContext *avctx)
>  {
> -return aom_init(avctx, &aom_codec_av1_dx_algo);
> +return aom_init(avctx, aom_codec_av1_dx());
>  }
>

lgtm.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] libaom: Dont use aom_codec_av1_dx_algo.

2021-11-01 Thread James Zern
On Fri, Oct 29, 2021 at 8:13 PM Matt Oliver  wrote:
>
> >
> > Does this compile and link with libaom 1.0.0? We unfortunately still
> > support that version (despite being unusable speed wise) because distros
> > like Debian still ship it.
> >
>
> Just looked it up and yes version 1.0.0 includes the required
> aom_codec_av1_dx() function (line 37 of aomdx.h for those interested).
>

There's some coverage of supported versions of libvpx and libaom to
help catch compatibility issues here:
https://build.webmproject.org/jenkins/view/libvpx%20nightly/job/libvpx__ffmpeg/
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] libaom: Dont use aom_codec_av1_dx_algo.

2021-11-01 Thread James Zern
On Fri, Oct 29, 2021 at 8:51 PM Matt Oliver  wrote:
>
> On Sat, 30 Oct 2021 at 14:13, Matt Oliver  wrote:
>
> > Does this compile and link with libaom 1.0.0? We unfortunately still
> >> support that version (despite being unusable speed wise) because distros
> >> like Debian still ship it.
> >>
> >
> > Just looked it up and yes version 1.0.0 includes the required
> > aom_codec_av1_dx() function (line 37 of aomdx.h for those interested).
> >
>
> I also noticed that libvpx does the same thing as libaom where it uses the
> direct variable instead of the function returning the variable. libvpx
> doesnt currently support static compilation so it's not an issue that has
> come up but was wondering whether it was worth submitting a patch
> preemptively fixing that issue as well.
>

That would be fine. By static compilation do you mean generating an
import lib for this scenario?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avcodec/libaomdec: use intermediate arrays for plane pointers and strides

2021-11-01 Thread James Zern
On Sat, Oct 30, 2021 at 6:59 AM James Almer  wrote:
>
> Fixes -Wstringop-overflow warnings with libaom >= 2.0.0, where the unused 
> alpha
> plane was removed from aom_image.
>
> Signed-off-by: James Almer 
> ---
>  libavcodec/libaomdec.c | 10 +++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>

lgtm.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] libaom: Dont use aom_codec_av1_dx_algo.

2021-11-02 Thread James Zern
On Mon, Nov 1, 2021 at 6:11 PM Matt Oliver  wrote:
>
> On Tue, 2 Nov 2021 at 04:41, James Zern 
> wrote:
>
> > On Fri, Oct 29, 2021 at 8:51 PM Matt Oliver  wrote:
> > >
> > > On Sat, 30 Oct 2021 at 14:13, Matt Oliver  wrote:
> > >
> > > > Does this compile and link with libaom 1.0.0? We unfortunately still
> > > >> support that version (despite being unusable speed wise) because
> > distros
> > > >> like Debian still ship it.
> > > >>
> > > >
> > > > Just looked it up and yes version 1.0.0 includes the required
> > > > aom_codec_av1_dx() function (line 37 of aomdx.h for those interested).
> > > >
> > >
> > > I also noticed that libvpx does the same thing as libaom where it uses
> > the
> > > direct variable instead of the function returning the variable. libvpx
> > > doesnt currently support static compilation so it's not an issue that has
> > > come up but was wondering whether it was worth submitting a patch
> > > preemptively fixing that issue as well.
> > >
> >
> > That would be fine. By static compilation do you mean generating an
> > import lib for this scenario?
> >
>
> That was actually a typo, I meant libvpx doesnt support 'shared'
> compilation on windows (the configure script only allows it to be specified
> on ELF platforms). I'm not familiar with why libvpx doesnt currently allow
> it but if it did then ffmpeg would have the same issues as with libaom that
> was fixed with this patch.

There's no reason someone couldn't build libvpx this way, but
configure never had support added for it; libaom picked up support
through its transition to cmake.

> Which is why I was wondering if people were fine
> with me preemptively fixing it by patching ffmpeg now instead of waiting
> for it to be a potential issue down the line.
>

That's fine by me.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] libvpxdec: Correct linking against variables.

2021-11-22 Thread James Zern
On Mon, Nov 22, 2021 at 4:35 AM Matt Oliver  wrote:
>
> On Thu, 4 Nov 2021 at 15:44, Matt Oliver  wrote:
>
> > Instead link against the function that returns the correct variable. This
> > fixes linking errors with dlls with msvc.
> > ---
> >  libavcodec/libvpxdec.c | 10 +-
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >

lgtm. Sorry, I missed this when it came through.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 2/2] avcodec/libaomenc: remove the redundant initialization

2021-11-22 Thread James Zern
On Mon, Nov 22, 2021 at 6:47 AM  wrote:
>
> From: Limin Wang 
>
> For dst->have_sse will be assigned by ctx->have_sse soon(code line 23).
>
> Signed-off-by: Limin Wang 
> ---
>  libavcodec/libaomenc.c | 1 -
>  1 file changed, 1 deletion(-)
>

lgtm.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] avcodec/utils, avcodec_open2: close codec on failure

2019-07-09 Thread James Zern
after a successful init if the function fails for another reason close
the codec without requiring FF_CODEC_CAP_INIT_CLEANUP which is meant to
cover init failures themselves. fixes a memory leak in those cases.

BUG=oss-fuzz:15529

Signed-off-by: James Zern 
---
 libavcodec/utils.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 1b1feca38c..9ff9628f7f 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -542,6 +542,7 @@ int attribute_align_arg 
ff_codec_open2_recursive(AVCodecContext *avctx, const AV
 int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec 
*codec, AVDictionary **options)
 {
 int ret = 0;
+int codec_init_ok = 0;
 AVDictionary *tmp = NULL;
 const AVPixFmtDescriptor *pixdesc;
 
@@ -935,6 +936,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 if (ret < 0) {
 goto free_and_end;
 }
+codec_init_ok = 1;
 }
 
 ret=0;
@@ -1023,7 +1025,8 @@ end:
 return ret;
 free_and_end:
 if (avctx->codec &&
-(avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP))
+(codec_init_ok ||
+ (avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP)))
 avctx->codec->close(avctx);
 
 if (codec->priv_class && codec->priv_data_size)
-- 
2.22.0.410.gd8fdbe21b5-goog

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH, v2 3/3] lavc/libvpxenc: add dynamic resolution encode support for libvpx

2019-07-31 Thread James Zern
Hi,

On Tue, Jul 30, 2019 at 10:06 PM Linjie Fu  wrote:
> [...]
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index feb52ea..800ba18 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -1067,6 +1067,15 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
> *pkt,
>  int res, coded_size;
>  vpx_enc_frame_flags_t flags = 0;
>
> +if (frame && (avctx->width != frame->width ||
> +  avctx->height != frame->height)) {
> +avctx->width  = frame->width;
> +avctx->height = frame->height;
> +
> +avctx->codec->close(avctx);

You shouldn't need to destroy the encoder for a resolution change,
unless I'm missing something. Take a look at resize_test.cc [1].

[1] 
https://chromium.googlesource.com/webm/libvpx/+/refs/heads/master/test/resize_test.cc#305
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH V2] avcodec/libvpxenc: add ROI-based encoding support for VP8/VP9 support

2019-08-13 Thread James Zern
Hi,

On Tue, Aug 13, 2019 at 1:18 AM Guo, Yejun  wrote:
>
> example command line to verify it:
> ./ffmpeg -i input.stream -vf addroi=0:0:iw/3:ih/3:-0.8 -c:v libvpx -b:v 2M 
> tmp.webm
>
> Signed-off-by: Guo, Yejun 
> ---
>  configure  |   7 ++
>  libavcodec/libvpxenc.c | 197 
> +
>  2 files changed, 204 insertions(+)
>
> diff --git a/configure b/configure
> index 3fb8f35..e549e26 100755
> --- a/configure
> +++ b/configure
> @@ -6300,6 +6300,13 @@ enabled libvpx&& {
>  check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" 
> "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
>  check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
> "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs 
> $pthreads_extralibs"
>  }
> +enabled libvpx_vp9_encoder && {
> +test_cc < +#include 
> +void foo(void){ int i = VP9E_SET_ROI_MAP; }
> +EOF
> +}
> +

This can be removed after addressing the comment below.

> [...].
> +
> +static int vp9_encode_set_roi(AVCodecContext *avctx, int frame_width, int 
> frame_height, const AVFrameSideData *sd)
> +{
> +int roi_supported = 0;
> +VPxContext *ctx = avctx->priv_data;
> +
> +#ifdef SUPPORT_LIBVPX_VP9_ROI

You can use VPX_CTRL_VP9E_SET_ROI_MAP to check availability. All
controls have a corresponding VPX_CTRL_ define (see the
bottom of vpx/vp8cx.h).
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH, RFC, v2 3/3] lavc/libvpxenc: add dynamic resolution encode support for libvpx

2019-08-13 Thread James Zern
Hi,

On Tue, Aug 13, 2019 at 2:30 AM Linjie Fu  wrote:
>
> According to spec, libvpx should support dynamic resolution changes.
>
> Add dynamic resolution encoding support in libvpx.
>
> Only single pass mode with no look ahead is supported for variable
> resolution encoding without initialization.
>

Do you mean /reinitialization/?

> cmdline:
> ffmpeg -noautoscale -y -i ./reinit-large_420_8-to-small_420_8.h264
>  -pix_fmt yuv420p -c:v libvpx-vp9 lena.ivf
>

Do you have a reference command line for creating the source content?

> Filed an issue in https://bugs.chromium.org/p/webm/issues/detail?id=1642
> to fix some memory problem.
>

It may be worth getting that bug resolved before landing this change
if existing library versions are buggy.

> Signed-off-by: Linjie Fu 
> ---
>  libavcodec/libvpxenc.c | 24 
>  1 file changed, 24 insertions(+)
>
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index feb52ea..3d2295d 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -1067,6 +1067,28 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
> *pkt,
>  int res, coded_size;
>  vpx_enc_frame_flags_t flags = 0;
>
> +if (frame && (avctx->width != frame->width ||
> +  avctx->height != frame->height)) {
> +avctx->width  = frame->width;
> +avctx->height = frame->height;
> +
> +struct vpx_codec_enc_cfg new_cfg = { 0 };
> +memcpy(&new_cfg, ctx->encoder.config.enc,
> +sizeof(struct vpx_codec_enc_cfg));
> +
> +new_cfg.g_w = frame->width;
> +new_cfg.g_h = frame->height;
> +if (new_cfg.g_lag_in_frames > 1 ||
> +new_cfg.g_pass != VPX_RC_ONE_PASS) {
> +av_log(avctx, AV_LOG_WARNING, "Only single pass mode "
> +   "with no look ahead is supported for variable "
> +   "resolution encoding without initialization.\n");

Would it be better to warn and reinitialize as in your earlier patch
rather than changing the settings from the user?

> +new_cfg.g_pass  = VPX_RC_ONE_PASS;
> +new_cfg.g_lag_in_frames = 0;
> +}
> +vpx_codec_enc_config_set(&ctx->encoder, &new_cfg);
> +}
> +
>  if (frame) {
>  rawimg  = &ctx->rawimg;
>  rawimg->planes[VPX_PLANE_Y] = frame->data[0];
> @@ -1075,6 +1097,8 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
> *pkt,
>  rawimg->stride[VPX_PLANE_Y] = frame->linesize[0];
>  rawimg->stride[VPX_PLANE_U] = frame->linesize[1];
>  rawimg->stride[VPX_PLANE_V] = frame->linesize[2];
> +rawimg->d_w = frame->width;
> +rawimg->d_h = frame->height;
>  if (ctx->is_alpha) {
>  uint8_t *u_plane, *v_plane;
>  rawimg_alpha = &ctx->rawimg_alpha;
> --
> 2.7.4
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] Change libaom default to crf=28.

2019-08-14 Thread James Zern
Hi,

On Tue, Aug 13, 2019 at 8:23 PM elliottk
 wrote:
>
> Current default is 256kbps, which produces inconsistent
> results (too high for low-res, too low for hi-res).
> Use CRF instead, which will adapt.
> ---
>  libavcodec/libaomenc.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
>

I think this is OK as it's similar to what is done for x264/5 [1].

> diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
> index 9b4fb3b4eb..a18d11c8aa 100644
> --- a/libavcodec/libaomenc.c
> +++ b/libavcodec/libaomenc.c
> @@ -575,10 +575,10 @@ static av_cold int aom_init(AVCodecContext *avctx,
>  if (enccfg.rc_end_usage == AOM_CQ) {
>  enccfg.rc_target_bitrate = 100;
>  } else {
> -avctx->bit_rate = enccfg.rc_target_bitrate * 1000;
> +enccfg.rc_end_usage = AOM_Q;
> +ctx->crf = 28;
>

Can we take a library default here or does it default to bitrate and
have cq_level cleared?

>  av_log(avctx, AV_LOG_WARNING,
> -   "Neither bitrate nor constrained quality specified, using 
> default bitrate of %dkbit/sec\n",
> -   enccfg.rc_target_bitrate);
> +   "Neither bitrate nor constrained quality specified, using 
> default CRF of 28\n");
>

You may want to use the variable to produce the output in case it changes.

[1] https://bugs.chromium.org/p/aomedia/issues/detail?id=2219#c9
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] Change libaom default to crf=28.

2019-08-16 Thread James Zern
Hi,

On Thu, Aug 15, 2019 at 1:22 PM elliottk
 wrote:
>
> Current default is 256kbps, which produces inconsistent
> results (too high for low-res, too low for hi-res).
> Use CRF instead, which will adapt.
> ---
>  libavcodec/libaomenc.c | 9 +
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
> index 9b4fb3b4eb..621e897672 100644
> --- a/libavcodec/libaomenc.c
> +++ b/libavcodec/libaomenc.c
> @@ -575,10 +575,11 @@ static av_cold int aom_init(AVCodecContext *avctx,
>  if (enccfg.rc_end_usage == AOM_CQ) {
>  enccfg.rc_target_bitrate = 100;
>  } else {
> -avctx->bit_rate = enccfg.rc_target_bitrate * 1000;
> +enccfg.rc_end_usage = AOM_Q;

Unless the docs are out of date this should be AOM_CQ level since crf
is mapped to that control [1].

> +ctx->crf = 28;
>  av_log(avctx, AV_LOG_WARNING,
> -   "Neither bitrate nor constrained quality specified, using 
> default bitrate of %dkbit/sec\n",
> -   enccfg.rc_target_bitrate);
> +   "Neither bitrate nor constrained quality specified, using 
> default CRF of %d\n",
> +   ctx->crf);
>  }
>  }
>

[1] https://aomedia.googlesource.com/aom/+/refs/heads/master/aom/aomcx.h#221
"For this value to be used aom_codec_enc_cfg_t::rc_end_usage must be
set to #AOM_CQ."
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH V3] avcodec/libvpxenc: add ROI-based encoding support for VP8/VP9 support

2019-08-20 Thread James Zern
Hi,

On Tue, Aug 13, 2019 at 8:29 PM Guo, Yejun  wrote:
> example command line to verify it:
> ./ffmpeg -i input.stream -vf addroi=0:0:iw/3:ih/3:-0.8 -c:v libvpx -b:v 2M 
> tmp.webm
>
> Signed-off-by: Guo, Yejun 
> ---
>  libavcodec/libvpxenc.c | 197 
> +
>  1 file changed, 197 insertions(+)
>
> [...]
>
> +
> +memset(roi_map, 0, sizeof(*roi_map));
> +
> +/* segment id 0 in roi_map is reserved for the areas not covered by 
> AVRegionOfInterest.
> + * segment id 0 in roi_map is also for the areas with 
> AVRegionOfInterest.qoffset near 0.
> + * (delta_q of segment id 0 is 0).
> + */
> +segment_mapping[MAX_DELTA_Q] = 1;
> +/* roi_map has memset with zero, just explictly set it again for explict 
> understanding. */

There are some typos in this, but as the comment says, it's redundant.
I think this and
the next line could be removed.

> +roi_map->delta_q[0] = 0;
> +segment_id = 1;
> +
> +roi = (const AVRegionOfInterest*)sd->data;
> +self_size = roi->self_size;
> +if (!self_size || sd->size % self_size != 0) {
> +av_log(avctx, AV_LOG_ERROR, "Invalid 
> AVRegionOfInterest.self_size.\n");
> +return AVERROR(EINVAL);
> +}
> +nb_rois = sd->size / self_size;
> +
> +/* This list must be iterated from zero because regions are
> + * defined in order of decreasing importance. So discard less
> + * important areas if they exceed the segment count.
> + */
> +for (int i = 0; i < nb_rois; i++) {
> +int delta_q;
> +int mapping_index;
> +
> +roi = (const AVRegionOfInterest*)(sd->data + self_size * i);
> +if (roi->qoffset.den == 0) {
> +av_log(avctx, AV_LOG_ERROR, "AVRegionOfInterest.qoffset.den must 
> not be zero.\n");
> +return AVERROR(EINVAL);
> +}
> +
> +delta_q = (int)(roi->qoffset.num * 1.0f / roi->qoffset.den * 
> MAX_DELTA_Q);
> +delta_q = av_clip(delta_q, -MAX_DELTA_Q, MAX_DELTA_Q);
> +

Note that libvpx allows other adjustments (loop filter, block skipping, among
others), but there may not be a way to provide this with AVRegionOfInterest.

> [...]
> +
> +if (ctx->aq_mode > 0 || ctx->cpu_used < 5 || ctx->deadline != 
> VPX_DL_REALTIME) {
> +if (!ctx->roi_warned) {
> +ctx->roi_warned = 1;
> +if (ctx->aq_mode > 0)
> +av_log(avctx, AV_LOG_WARNING, "ROI is disabled when any 
> of AQ mode is on, skipping ROI.\n");
> +else
> +av_log(avctx, AV_LOG_WARNING, "due to libvpx's internal 
> issue (see function apply_roi_map), skipping ROI.\n");

I think this could just mention that ROI is only supported with aq_mode==0,
cpu_used >= 5 and deadline set to realtime rather than having a more specific
statement like this one.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] Change libaom default to crf=28.

2019-08-21 Thread James Zern
On Tue, Aug 20, 2019 at 5:31 PM Elliott Karpilovsky
 wrote:
>
> I believe the documentation is out of date. I added some debug
> statements and verified that variable was being used to pull CRF
> values when AOM_Q mode is set. I have
> https://aomedia-review.googlesource.com/c/aom/+/94104 out to update
> the documentation.
>

Thanks for making the update to the docs. Note that inline replies are
preferred to top-posting on this list.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] Change libaom default to crf=32.

2019-08-21 Thread James Zern
On Wed, Aug 21, 2019 at 12:18 PM Elliott Karpilovsky
 wrote:
>
> From: elliottk 
>
> Current default is 256kbps, which produces inconsistent
> results (too high for low-res, too low for hi-res).
> Use CRF instead, which will adapt.
> ---
>  libavcodec/libaomenc.c | 9 +
>  1 file changed, 5 insertions(+), 4 deletions(-)
>

lgtm. I'll apply this soon if there aren't any other comments. libvpx
could probably use a similar update.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] Change libaom default to crf=32.

2019-08-22 Thread James Zern
Hi,

On Thu, Aug 22, 2019 at 12:25 AM Moritz Barsnick  wrote:
>
> On Wed, Aug 21, 2019 at 18:03:23 -0700, James Zern wrote:
> > > From: elliottk 
> > > Current default is 256kbps, which produces inconsistent
> > > results (too high for low-res, too low for hi-res).
> > > Use CRF instead, which will adapt.
> >
> > lgtm. I'll apply this soon if there aren't any other comments. libvpx
> > could probably use a similar update.
>
> Is this a behavioral change which would justify a bump of libavcodec
> micro?
>

Yes I had that thought and had a bump locally. It is only a setting
change not the introduction of a new option, but I thought increasing
it would be safest.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] Change libaom default to crf=32.

2019-08-23 Thread James Zern
On Wed, Aug 21, 2019 at 6:03 PM James Zern  wrote:
>
> On Wed, Aug 21, 2019 at 12:18 PM Elliott Karpilovsky
>  wrote:
> >
> > From: elliottk 
> >
> > Current default is 256kbps, which produces inconsistent
> > results (too high for low-res, too low for hi-res).
> > Use CRF instead, which will adapt.
> > ---
> >  libavcodec/libaomenc.c | 9 +
> >  1 file changed, 5 insertions(+), 4 deletions(-)
> >
>
> lgtm. I'll apply this soon if there aren't any other comments. libvpx
> could probably use a similar update.

applied, thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH V5] avcodec/libvpxenc: add ROI-based encoding support for VP8/VP9 support

2019-08-26 Thread James Zern
Hi,

On Thu, Aug 22, 2019 at 5:56 PM Guo, Yejun  wrote:
>
> example command line to verify it:
> ./ffmpeg -i input.stream -vf addroi=0:0:iw/3:ih/3:-0.8 -c:v libvpx -b:v 2M 
> tmp.webm
>
> Signed-off-by: Guo, Yejun 
> ---
>  libavcodec/libvpxenc.c | 194 
> +
>  1 file changed, 194 insertions(+)
>

Looks OK overall, just a few minor comments and you should bump the
micro version number for this change.

> [...]
> +
> +segment_mapping[mapping_index] = segment_id + 1;
> +roi_map->delta_q[segment_id] = delta_q;
> +segment_id++;
> +}
> +}
> +
> +

This line can go.

> [...]
> +
> +av_assert0(!roi_supported);
> +if (!ctx->roi_warned) {
> +ctx->roi_warned = 1;
> +av_log(avctx, AV_LOG_WARNING, "ROI is not supported, please upgrade 
> libvpx to version >= 1.8.1, "
> +  "and you might need to build ffmpeg 
> again.\n");

This could be "...to version >= 1.8.1. You may need to rebuild ffmpeg.\n"

> [...]
> +
> +if (sd) {
> +if (avctx->codec_id == AV_CODEC_ID_VP8)
> +vp8_encode_set_roi(avctx, frame->width, frame->height, sd);
> +else if (avctx->codec_id == AV_CODEC_ID_VP9)

This is the only other option, it can just be 'else'. Other checks in
the code assume this already.

> +vp9_encode_set_roi(avctx, frame->width, frame->height, sd);
> +}
>  }
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH V5] avcodec/libvpxenc: add ROI-based encoding support for VP8/VP9 support

2019-08-28 Thread James Zern
Hi,

On Mon, Aug 26, 2019 at 11:30 PM Guo, Yejun  wrote:
>
>
>
> > -Original Message-
> > From: James Zern [mailto:jz...@google.com]
> > Sent: Tuesday, August 27, 2019 12:03 PM
> > To: FFmpeg development discussions and patches 
> > Cc: Guo, Yejun 
> > Subject: Re: [FFmpeg-devel] [PATCH V5] avcodec/libvpxenc: add ROI-based
> > encoding support for VP8/VP9 support
> >
> > Hi,
> >
> > On Thu, Aug 22, 2019 at 5:56 PM Guo, Yejun  wrote:
> > >
> > > example command line to verify it:
> > > ./ffmpeg -i input.stream -vf addroi=0:0:iw/3:ih/3:-0.8 -c:v libvpx -b:v 2M
> > tmp.webm
> > >
> > > Signed-off-by: Guo, Yejun 
> > > ---
> > >  libavcodec/libvpxenc.c | 194
> > +
> > >  1 file changed, 194 insertions(+)
> > >
> >
> > Looks OK overall, just a few minor comments and you should bump the
> > micro version number for this change.
>
> thanks,
> do you mean bump LIBAVCODEC_VERSION_MICRO in file libavcodec/version.h? 
> thanks.
>

Yes.

> >
> > > [...]
> > > +
> > > +segment_mapping[mapping_index] = segment_id + 1;
> > > +roi_map->delta_q[segment_id] = delta_q;
> > > +segment_id++;
> > > +}
> > > +}
> > > +
> > > +
> >
> > This line can go.
>
> do you mean the next line av_assert0 can be removed? thanks.
>

No, I meant the extra blank line, there are 2 of them.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH V5] avcodec/libvpxenc: add ROI-based encoding support for VP8/VP9 support

2019-08-28 Thread James Zern
On Wed, Aug 28, 2019 at 10:20 PM Guo, Yejun  wrote:
>
>
>
> > -Original Message-
> > From: James Zern [mailto:jz...@google.com]
> > Sent: Thursday, August 29, 2019 12:39 PM
> > To: Guo, Yejun 
> > Cc: FFmpeg development discussions and patches 
> > Subject: Re: [FFmpeg-devel] [PATCH V5] avcodec/libvpxenc: add ROI-based
> > encoding support for VP8/VP9 support
> >
> > Hi,
> >
> > On Mon, Aug 26, 2019 at 11:30 PM Guo, Yejun  wrote:
> > >
> > >
> > >
> > > > -Original Message-
> > > > From: James Zern [mailto:jz...@google.com]
> > > > Sent: Tuesday, August 27, 2019 12:03 PM
> > > > To: FFmpeg development discussions and patches
> > 
> > > > Cc: Guo, Yejun 
> > > > Subject: Re: [FFmpeg-devel] [PATCH V5] avcodec/libvpxenc: add ROI-based
> > > > encoding support for VP8/VP9 support
> > > >
> > > > Hi,
> > > >
> > > > On Thu, Aug 22, 2019 at 5:56 PM Guo, Yejun  wrote:
> > > > >
> > > > > example command line to verify it:
> > > > > ./ffmpeg -i input.stream -vf addroi=0:0:iw/3:ih/3:-0.8 -c:v libvpx 
> > > > > -b:v 2M
> > > > tmp.webm
> > > > >
> > > > > Signed-off-by: Guo, Yejun 
> > > > > ---
> > > > >  libavcodec/libvpxenc.c | 194
> > > > +
> > > > >  1 file changed, 194 insertions(+)
> > > > >
> > > >
> > > > Looks OK overall, just a few minor comments and you should bump the
> > > > micro version number for this change.
> > >
> > > thanks,
> > > do you mean bump LIBAVCODEC_VERSION_MICRO in file
> > libavcodec/version.h? thanks.
> > >
> >
> > Yes.
> >
> > > >
> > > > > [...]
> > > > > +
> > > > > +segment_mapping[mapping_index] = segment_id + 1;
> > > > > +roi_map->delta_q[segment_id] = delta_q;
> > > > > +segment_id++;
> > > > > +}
> > > > > +}
> > > > > +
> > > > > +
> > > >
> > > > This line can go.
> > >
> > > do you mean the next line av_assert0 can be removed? thanks.
> > >
> >
> > No, I meant the extra blank line, there are 2 of them.
>
> My intention for the two blank lines was to divide the two logical parts more 
> clear. Anyway, I'll follow to remove.
>

If there's a reason to divide them then a separate function or comment
for the next section could work. Extra blank lines are likely to be
cleaned up by tools or other developers.

> and I've send out v7 for this patch this morning, do you have any other 
> comment? thanks. So I can combine all the comments in v8 patch.
>

I think the last set was all I had, though I could give it more testing.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] lavc/libaomenc: Add -tile-columns/-tile-rows

2018-08-31 Thread James Zern
On Fri, Aug 31, 2018 at 9:40 AM James Almer  wrote:
>
> On 8/31/2018 1:00 PM, Kagami Hiiragi wrote:
> > On 31/08/18 18:18, James Almer wrote:
> >> On 8/31/2018 11:52 AM, Kagami Hiiragi wrote:
> >>> On 31/08/18 02:58, James Almer wrote:
>  On 8/20/2018 2:56 PM, Kagami Hiiragi wrote:
> > These options are required for multithreaded encoding, because they set
> > to zero by default in av1_cx_iface.c.
> >
> > Signed-off-by: Kagami Hiiragi 
> >
> > diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
> > index 9431179886..55cb7ff72e 100644
> > --- a/libavcodec/libaomenc.c
> > +++ b/libavcodec/libaomenc.c
> > @@ -68,6 +68,8 @@ typedef struct AOMEncoderContext {
> >  int static_thresh;
> >  int drop_threshold;
> >  int noise_sensitivity;
> > +int tile_columns;
> > +int tile_rows;
> >  } AOMContext;
> >
> >  static const char *const ctlidstr[] = {
> > @@ -75,6 +77,8 @@ static const char *const ctlidstr[] = {
> >  [AOME_SET_CQ_LEVEL] = "AOME_SET_CQ_LEVEL",
> >  [AOME_SET_ENABLEAUTOALTREF] = "AOME_SET_ENABLEAUTOALTREF",
> >  [AOME_SET_STATIC_THRESHOLD] = "AOME_SET_STATIC_THRESHOLD",
> > +[AV1E_SET_TILE_COLUMNS] = "AV1E_SET_TILE_COLUMNS",
> > +[AV1E_SET_TILE_ROWS]= "AV1E_SET_TILE_ROWS",
> >  [AV1E_SET_COLOR_RANGE]  = "AV1E_SET_COLOR_RANGE",
> >  [AV1E_SET_COLOR_PRIMARIES]  = "AV1E_SET_COLOR_PRIMARIES",
> >  [AV1E_SET_MATRIX_COEFFICIENTS] = "AV1E_SET_MATRIX_COEFFICIENTS",
> > @@ -449,6 +453,11 @@ static av_cold int aom_init(AVCodecContext *avctx,
> >  if (ctx->crf >= 0)
> >  codecctl_int(avctx, AOME_SET_CQ_LEVEL,  ctx->crf);
> >
> > +if (ctx->tile_columns >= 0)
> > +codecctl_int(avctx, AV1E_SET_TILE_COLUMNS, ctx->tile_columns);
> > +if (ctx->tile_rows >= 0)
> > +codecctl_int(avctx, AV1E_SET_TILE_ROWS, ctx->tile_rows);
> > +
> >  codecctl_int(avctx, AV1E_SET_COLOR_PRIMARIES, 
> > avctx->color_primaries);
> >  codecctl_int(avctx, AV1E_SET_MATRIX_COEFFICIENTS, 
> > avctx->colorspace);
> >  codecctl_int(avctx, AV1E_SET_TRANSFER_CHARACTERISTICS, 
> > avctx->color_trc);
> > @@ -746,6 +755,8 @@ static const AVOption options[] = {
> >  { "static-thresh","A change threshold on blocks below which 
> > they will be skipped by the encoder", OFFSET(static_thresh), 
> > AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
> >  { "drop-threshold",   "Frame drop threshold", offsetof(AOMContext, 
> > drop_threshold), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, VE },
> >  { "noise-sensitivity", "Noise sensitivity", 
> > OFFSET(noise_sensitivity), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 4, VE},
> > +{ "tile-columns", "Number of tile columns to use, log2", 
> > OFFSET(tile_columns), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 6, VE},
> 
>  Why 6? The libaom API doesn't mention a limit, just says the argument
>  should be in log2 unit, and that it will be capped based on the image 
>  size.
> >>>
> >>> https://aomedia.googlesource.com/aom/+/1742b043e2269dc1927afe428fbf5a46493e741e/av1/av1_cx_iface.c#298
> >>>
> > +{ "tile-rows", "Number of tile rows to use, log2", 
> > OFFSET(tile_rows), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 6, VE},
> 
>  And for this one it says the range is [0-2].
> >>>
> >>> Who says it? I can pass --tile-rows=6 to aomenc.
> >>
> >> The doxy in the public header:
> >> https://aomedia.googlesource.com/aom/+/master/aom/aomcx.h#312
> >
> > I guess it wasn't fixed after
> > https://aomedia.googlesource.com/aom/+/492c545fad1e1f980d23d79d0372857c60d31458^!/#F1
> >
> > I don't think ffmpeg should deal with libaom documentation issues...
>
> Seeing it's effectively a documentation issue, and that the change you
> quoted was made before libaom 1.0.0 was tagged, then i guess the patch
> is ok.
>
> I reported it to libaom bug tracker as well.

Thanks for filing the bug, I posted a fix. Note AV1 supports
non-uniform tiles now and there's another way to specify absolute
widths and heights (--tile-width/height). This parameter wasn't
descaled to allow the encoder to choose the layout unfortunately [1].

[1] https://bugs.chromium.org/p/aomedia/issues/detail?id=2124
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/vpcc: fix values in VP9 level detection heuristics

2018-09-14 Thread James Zern
On Fri, Sep 14, 2018 at 6:39 PM James Almer  wrote:
>
> On 8/27/2018 10:59 PM, James Almer wrote:
> > The levels are stored as decimal values, not hexadecimal.
> >
> > Signed-off-by: James Almer 
> > ---
> >  libavformat/vpcc.c | 28 ++--
> >  1 file changed, 14 insertions(+), 14 deletions(-)
> >

lgtm. For anyone following, one reference is here:
https://www.webmproject.org/vp9/mp4/#vp-codec-configuration-box

> > diff --git a/libavformat/vpcc.c b/libavformat/vpcc.c
> > index 79514483af..e0b7f288a6 100644
> > --- a/libavformat/vpcc.c
> > +++ b/libavformat/vpcc.c
> > @@ -81,33 +81,33 @@ static int get_vp9_level(AVCodecParameters *par, 
> > AVRational *frame_rate) {
> >  if (picture_size <= 0) {
> >  return 0;
> >  } else if (sample_rate <= 829440 && picture_size <= 36864) {
> > -return 0x10;
> > +return 10;
> >  } else if (sample_rate <= 2764800&& picture_size <= 73728) {
> > -return 0x11;
> > +return 11;
> >  } else if (sample_rate <= 4608000&& picture_size <= 122880) {
> > -return 0x20;
> > +return 20;
> >  } else if (sample_rate <= 9216000&& picture_size <= 245760) {
> > -return 0x21;
> > +return 21;
> >  } else if (sample_rate <= 20736000   && picture_size <= 552960) {
> > -return 0x30;
> > +return 30;
> >  } else if (sample_rate <= 36864000   && picture_size <= 983040) {
> > -return 0x31;
> > +return 31;
> >  } else if (sample_rate <= 83558400   && picture_size <= 2228224) {
> > -return 0x40;
> > +return 40;
> >  } else if (sample_rate <= 160432128  && picture_size <= 2228224) {
> > -return 0x41;
> > +return 41;
> >  } else if (sample_rate <= 311951360  && picture_size <= 8912896) {
> > -return 0x50;
> > +return 50;
> >  } else if (sample_rate <= 588251136  && picture_size <= 8912896) {
> > -return 0x51;
> > +return 51;
> >  } else if (sample_rate <= 1176502272 && picture_size <= 8912896) {
> > -return 0x52;
> > +return 52;
> >  } else if (sample_rate <= 1176502272 && picture_size <= 35651584) {
> > -return 0x60;
> > +return 60;
> >  } else if (sample_rate <= 2353004544 && picture_size <= 35651584) {
> > -return 0x61;
> > +return 61;
> >  } else if (sample_rate <= 4706009088 && picture_size <= 35651584) {
> > -return 0x62;
> > +return 62;
> >  } else {
> >  return 0;
> >  }
>
> Ping.
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avcodec/libvpxdec: fix setting auto threads

2018-10-27 Thread James Zern
a thread count of 0 is treated the same as 1, use av_cpu_count() to get
the correct thread count when auto threads is requested.

this matches the fix in libvpxenc:
27df34bf1f avcodec/libvpxenc: fix setting amount of threads used for encoding

Signed-off-by: James Zern 
---
 libavcodec/libvpxdec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index 04f27d3396..5193ac51c3 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -47,8 +47,7 @@ static av_cold int vpx_init(AVCodecContext *avctx,
 {
 VPxContext *ctx = avctx->priv_data;
 struct vpx_codec_dec_cfg deccfg = {
-/* token partitions+1 would be a decent choice */
-.threads = FFMIN(avctx->thread_count, 16)
+.threads = avctx->thread_count ? avctx->thread_count : av_cpu_count()
 };
 
 av_log(avctx, AV_LOG_INFO, "%s\n", vpx_codec_version_str());
-- 
2.19.1.568.g152ad8e336-goog

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/libvpxdec: fix setting auto threads

2018-10-29 Thread James Zern
On Sat, Oct 27, 2018 at 1:54 PM James Almer  wrote:
>
> On 10/27/2018 5:52 PM, James Zern wrote:
> > a thread count of 0 is treated the same as 1, use av_cpu_count() to get
> > the correct thread count when auto threads is requested.
> >
> > this matches the fix in libvpxenc:
> > 27df34bf1f avcodec/libvpxenc: fix setting amount of threads used for 
> > encoding
> >
> > Signed-off-by: James Zern 
> > ---
> >  libavcodec/libvpxdec.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
> > index 04f27d3396..5193ac51c3 100644
> > --- a/libavcodec/libvpxdec.c
> > +++ b/libavcodec/libvpxdec.c
> > @@ -47,8 +47,7 @@ static av_cold int vpx_init(AVCodecContext *avctx,
> >  {
> >  VPxContext *ctx = avctx->priv_data;
> >  struct vpx_codec_dec_cfg deccfg = {
> > -/* token partitions+1 would be a decent choice */
> > -.threads = FFMIN(avctx->thread_count, 16)
> > +.threads = avctx->thread_count ? avctx->thread_count : 
> > av_cpu_count()
>
> If the limit of 16 threads is correct and unless libvpx clips it on its
> own, then you shouldn't remove the check.
>

If anything it was a limit put in at one stage of vp8 development, the
comment is certainly vp8 specific. vp8/9 both clip in their own ways
[1][2], but looking at it there may have been some changes to the loop
filter that aren't limiting this number. I'll restore it to be safe.
On the libvpxenc side I don't think there was ever a check in the
wrapper, but the library does put a hard cap on the requested threads
(64) and will fail otherwise.

[1] 
https://chromium.googlesource.com/webm/libvpx/+/v1.7.0/vp8/decoder/threading.c#596
[2] 
https://chromium.googlesource.com/webm/libvpx/+/v1.7.0/vp9/decoder/vp9_decodeframe.c#1542

> LGTM otherwise.
>
> >  };
> >
> >  av_log(avctx, AV_LOG_INFO, "%s\n", vpx_codec_version_str());
> >
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/libvpxdec: fix setting auto threads

2018-10-29 Thread James Zern
On Mon, Oct 29, 2018 at 10:58 PM James Zern  wrote:
>
> On Sat, Oct 27, 2018 at 1:54 PM James Almer  wrote:
> >
> > On 10/27/2018 5:52 PM, James Zern wrote:
> > > a thread count of 0 is treated the same as 1, use av_cpu_count() to get
> > > the correct thread count when auto threads is requested.
> > >
> > > this matches the fix in libvpxenc:
> > > 27df34bf1f avcodec/libvpxenc: fix setting amount of threads used for 
> > > encoding
> > >
> > > Signed-off-by: James Zern 
> > > ---
> > >  libavcodec/libvpxdec.c | 3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > >

Applied with the limit of 16 restored. Thanks for the review.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libvpxenc: extend auto-alt-ref range

2018-11-03 Thread James Zern
vp9 now supports [0, 6]

Signed-off-by: James Zern 
---
 doc/encoders.texi  | 1 +
 libavcodec/libvpxenc.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 899faac49b..3c6f5cd70b 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -1641,6 +1641,7 @@ means unlimited.
 @table @option
 @item auto-alt-ref
 Enable use of alternate reference frames (2-pass only).
+Values greater than 1 enable multi-layer alternate reference frames (VP9 only).
 @item arnr-max-frames
 Set altref noise reduction max frame count.
 @item arnr-type
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 09f7a88452..ad4480b2ae 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -1068,7 +1068,7 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
*pkt,
 
 #define COMMON_OPTIONS \
 { "auto-alt-ref","Enable use of alternate reference " \
- "frames (2-pass only)",   
OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1},  -1,  2,   
VE}, \
+ "frames (2-pass only)",   
OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1},  -1,  6,   
VE}, \
 { "lag-in-frames",   "Number of frames to look ahead for " \
  "alternate reference frame selection",
OFFSET(lag_in_frames),   AV_OPT_TYPE_INT, {.i64 = -1},  -1,  INT_MAX, 
VE}, \
 { "arnr-maxframes",  "altref noise reduction max frame count", 
OFFSET(arnr_max_frames), AV_OPT_TYPE_INT, {.i64 = -1},  -1,  INT_MAX, 
VE}, \
-- 
2.19.1.930.g4563a0d9d0-goog

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libvpxenc,vp9: add enable-tpl option

2018-11-03 Thread James Zern
enables temporal dependency model

Signed-off-by: James Zern 
---
 doc/encoders.texi  |  2 ++
 libavcodec/libvpxenc.c | 11 +++
 2 files changed, 13 insertions(+)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 899faac49b..fced8d7369 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -1692,6 +1692,8 @@ Corpus VBR mode is a variant of standard VBR where the 
complexity distribution
 midpoint is passed in rather than calculated for a specific clip or chunk.
 
 The valid range is [0, 1]. 0 (default) uses standard VBR.
+@item enable-tpl @var{boolean}
+Enable temporal dependency model.
 @end table
 
 @end table
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 09f7a88452..e03dc3539a 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -111,6 +111,7 @@ typedef struct VPxEncoderContext {
 int row_mt;
 int tune_content;
 int corpus_complexity;
+int tpl_model;
 } VPxContext;
 
 /** String mappings for enum vp8e_enc_control_id */
@@ -146,6 +147,9 @@ static const char *const ctlidstr[] = {
 #ifdef VPX_CTRL_VP9E_SET_TUNE_CONTENT
 [VP9E_SET_TUNE_CONTENT]= "VP9E_SET_TUNE_CONTENT",
 #endif
+#ifdef VPX_CTRL_VP9E_SET_TPL
+[VP9E_SET_TPL] = "VP9E_SET_TPL",
+#endif
 #endif
 };
 
@@ -716,6 +720,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
 #ifdef VPX_CTRL_VP9E_SET_TUNE_CONTENT
 if (ctx->tune_content >= 0)
 codecctl_int(avctx, VP9E_SET_TUNE_CONTENT, ctx->tune_content);
+#endif
+#ifdef VPX_CTRL_VP9E_SET_TPL
+if (ctx->tpl_model >= 0)
+codecctl_int(avctx, VP9E_SET_TPL, ctx->tpl_model);
 #endif
 }
 #endif
@@ -1156,6 +1164,9 @@ static const AVOption vp9_options[] = {
 #endif
 #if VPX_ENCODER_ABI_VERSION >= 14
 { "corpus-complexity", "corpus vbr complexity midpoint", 
OFFSET(corpus_complexity), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, VE },
+#endif
+#ifdef VPX_CTRL_VP9E_SET_TPL
+{ "enable-tpl",  "Enable temporal dependency model", 
OFFSET(tpl_model), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE },
 #endif
 LEGACY_OPTIONS
 { NULL }
-- 
2.19.1.930.g4563a0d9d0-goog

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libvpxenc: extend auto-alt-ref range

2018-11-03 Thread James Zern
On Sat, Nov 3, 2018 at 2:02 PM James Zern  wrote:
> [...]
>  #define COMMON_OPTIONS \
>  { "auto-alt-ref","Enable use of alternate reference " \
> - "frames (2-pass only)",   
> OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1},  -1,  2,   
> VE}, \
> + "frames (2-pass only)",   
> OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1},  -1,  6,   
> VE}, \

This was extended earlier [1], but probably should have been made
codec specific. I can do that, but we might want to keep the 0-2 range
for vp8 now for compatibility. Any preferences?

[1] 41da4f8cb3 lavc/libvpxenc: fix -auto-alt-ref option type
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libvpxenc: extend auto-alt-ref range

2018-11-05 Thread James Zern
On Sat, Nov 3, 2018 at 2:31 PM James Almer  wrote:
>
> On 11/3/2018 6:04 PM, James Zern wrote:
> > On Sat, Nov 3, 2018 at 2:02 PM James Zern  wrote:
> >> [...]
> >>  #define COMMON_OPTIONS \
> >>  { "auto-alt-ref","Enable use of alternate reference " \
> >> - "frames (2-pass only)",   
> >> OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1},  -1,  2,
> >>VE}, \
> >> + "frames (2-pass only)",   
> >> OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1},  -1,  6,
> >>VE}, \
> >
> > This was extended earlier [1], but probably should have been made
> > codec specific. I can do that, but we might want to keep the 0-2 range
> > for vp8 now for compatibility. Any preferences?
>
> What happens when you use the higher values while encoding VP8? Does it
> error out or silently clips it to 1 internally?
>
> If it errors out then yes, move it out of COMMON_OPTIONS and into each
> encoder AVOption array.
>

VP8 is clipped in this file currently because the library will error
out with values > 1:
codecctl_int(avctx, VP8E_SET_ENABLEAUTOALTREF,
 avctx->codec_id == AV_CODEC_ID_VP8 ?
!!ctx->auto_alt_ref : ctx->auto_alt_ref);

So moving it from COMMON_OPTIONS at this point will avoid any more
drift in the reported range of '-h encoder=libvpx'.

> >
> > [1] 41da4f8cb3 lavc/libvpxenc: fix -auto-alt-ref option type
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libvpxenc: extend auto-alt-ref range

2018-11-05 Thread James Zern
On Mon, Nov 5, 2018 at 4:45 PM James Zern  wrote:
>
> On Sat, Nov 3, 2018 at 2:31 PM James Almer  wrote:
> >
> > On 11/3/2018 6:04 PM, James Zern wrote:
> > > On Sat, Nov 3, 2018 at 2:02 PM James Zern  wrote:
> > >> [...]
> > >>  #define COMMON_OPTIONS \
> > >>  { "auto-alt-ref","Enable use of alternate reference " \
> > >> - "frames (2-pass only)",   
> > >> OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1},  -1,  2,  
> > >>  VE}, \
> > >> + "frames (2-pass only)",   
> > >> OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1},  -1,  6,  
> > >>  VE}, \
> > >
> > > This was extended earlier [1], but probably should have been made
> > > codec specific. I can do that, but we might want to keep the 0-2 range
> > > for vp8 now for compatibility. Any preferences?
> >
> > What happens when you use the higher values while encoding VP8? Does it
> > error out or silently clips it to 1 internally?
> >
> > If it errors out then yes, move it out of COMMON_OPTIONS and into each
> > encoder AVOption array.
> >
>
> VP8 is clipped in this file currently because the library will error
> out with values > 1:

More precisely the value will fail to be set and the error will be
logged, but encoding will continue and you'll get the library default.

> codecctl_int(avctx, VP8E_SET_ENABLEAUTOALTREF,
>  avctx->codec_id == AV_CODEC_ID_VP8 ?
> !!ctx->auto_alt_ref : ctx->auto_alt_ref);
>
> So moving it from COMMON_OPTIONS at this point will avoid any more
> drift in the reported range of '-h encoder=libvpx'.
>
> > >
> > > [1] 41da4f8cb3 lavc/libvpxenc: fix -auto-alt-ref option type
> > > ___
> > > ffmpeg-devel mailing list
> > > ffmpeg-devel@ffmpeg.org
> > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > >
> >
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libvpxenc: extend auto-alt-ref range

2018-11-05 Thread James Zern
On Mon, Nov 5, 2018 at 5:02 PM James Zern  wrote:
>
> vp9 now supports [0, 6]
>
> Signed-off-by: James Zern 
> ---
>  doc/encoders.texi  | 1 +
>  libavcodec/libvpxenc.c | 6 --
>  2 files changed, 5 insertions(+), 2 deletions(-)
>

This version moves the option from COMMON_OPTIONS for comparison.

> diff --git a/doc/encoders.texi b/doc/encoders.texi
> index 899faac49b..3c6f5cd70b 100644
> --- a/doc/encoders.texi
> +++ b/doc/encoders.texi
> @@ -1641,6 +1641,7 @@ means unlimited.
>  @table @option
>  @item auto-alt-ref
>  Enable use of alternate reference frames (2-pass only).
> +Values greater than 1 enable multi-layer alternate reference frames (VP9 
> only).
>  @item arnr-max-frames
>  Set altref noise reduction max frame count.
>  @item arnr-type
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index 09f7a88452..827df21fa5 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -1067,8 +1067,6 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
> *pkt,
>  #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
>
>  #define COMMON_OPTIONS \
> -{ "auto-alt-ref","Enable use of alternate reference " \
> - "frames (2-pass only)",   
> OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1},  -1,  2,   
> VE}, \
>  { "lag-in-frames",   "Number of frames to look ahead for " \
>   "alternate reference frame selection",
> OFFSET(lag_in_frames),   AV_OPT_TYPE_INT, {.i64 = -1},  -1,  INT_MAX, 
> VE}, \
>  { "arnr-maxframes",  "altref noise reduction max frame count", 
> OFFSET(arnr_max_frames), AV_OPT_TYPE_INT, {.i64 = -1},  -1,  INT_MAX, 
> VE}, \
> @@ -1112,6 +1110,8 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
> *pkt,
>  #if CONFIG_LIBVPX_VP8_ENCODER
>  static const AVOption vp8_options[] = {
>  COMMON_OPTIONS
> +{ "auto-alt-ref","Enable use of alternate reference "
> + "frames (2-pass only)",
> OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1}, -1,  2, VE},
>  { "cpu-used","Quality/Speed ratio modifier",
> OFFSET(cpu_used),AV_OPT_TYPE_INT, {.i64 = 1}, -16, 16, VE},
>  LEGACY_OPTIONS
>  { NULL }
> @@ -1121,6 +1121,8 @@ static const AVOption vp8_options[] = {
>  #if CONFIG_LIBVPX_VP9_ENCODER
>  static const AVOption vp9_options[] = {
>  COMMON_OPTIONS
> +{ "auto-alt-ref","Enable use of alternate reference "
> + "frames (2-pass only)",
> OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1}, -1, 6, VE},
>  { "cpu-used","Quality/Speed ratio modifier",
> OFFSET(cpu_used),AV_OPT_TYPE_INT, {.i64 = 1},  -8, 8, VE},
>  { "lossless","Lossless mode",   
> OFFSET(lossless),AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, VE},
>  { "tile-columns","Number of tile columns to use, log2", 
> OFFSET(tile_columns),AV_OPT_TYPE_INT, {.i64 = -1}, -1, 6, VE},
> --
> 2.19.1.930.g4563a0d9d0-goog
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libvpxenc: extend auto-alt-ref range

2018-11-05 Thread James Zern
vp9 now supports [0, 6]

Signed-off-by: James Zern 
---
 doc/encoders.texi  | 1 +
 libavcodec/libvpxenc.c | 6 --
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 899faac49b..3c6f5cd70b 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -1641,6 +1641,7 @@ means unlimited.
 @table @option
 @item auto-alt-ref
 Enable use of alternate reference frames (2-pass only).
+Values greater than 1 enable multi-layer alternate reference frames (VP9 only).
 @item arnr-max-frames
 Set altref noise reduction max frame count.
 @item arnr-type
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 09f7a88452..827df21fa5 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -1067,8 +1067,6 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
*pkt,
 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 
 #define COMMON_OPTIONS \
-{ "auto-alt-ref","Enable use of alternate reference " \
- "frames (2-pass only)",   
OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1},  -1,  2,   
VE}, \
 { "lag-in-frames",   "Number of frames to look ahead for " \
  "alternate reference frame selection",
OFFSET(lag_in_frames),   AV_OPT_TYPE_INT, {.i64 = -1},  -1,  INT_MAX, 
VE}, \
 { "arnr-maxframes",  "altref noise reduction max frame count", 
OFFSET(arnr_max_frames), AV_OPT_TYPE_INT, {.i64 = -1},  -1,  INT_MAX, 
VE}, \
@@ -1112,6 +1110,8 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
*pkt,
 #if CONFIG_LIBVPX_VP8_ENCODER
 static const AVOption vp8_options[] = {
 COMMON_OPTIONS
+{ "auto-alt-ref","Enable use of alternate reference "
+ "frames (2-pass only)",
OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1}, -1,  2, VE},
 { "cpu-used","Quality/Speed ratio modifier",
OFFSET(cpu_used),AV_OPT_TYPE_INT, {.i64 = 1}, -16, 16, VE},
 LEGACY_OPTIONS
 { NULL }
@@ -1121,6 +1121,8 @@ static const AVOption vp8_options[] = {
 #if CONFIG_LIBVPX_VP9_ENCODER
 static const AVOption vp9_options[] = {
 COMMON_OPTIONS
+{ "auto-alt-ref","Enable use of alternate reference "
+ "frames (2-pass only)",
OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1}, -1, 6, VE},
 { "cpu-used","Quality/Speed ratio modifier",
OFFSET(cpu_used),AV_OPT_TYPE_INT, {.i64 = 1},  -8, 8, VE},
 { "lossless","Lossless mode",   
OFFSET(lossless),AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, VE},
 { "tile-columns","Number of tile columns to use, log2", 
OFFSET(tile_columns),AV_OPT_TYPE_INT, {.i64 = -1}, -1, 6, VE},
-- 
2.19.1.930.g4563a0d9d0-goog

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libvpxenc,vp9: add enable-tpl option

2018-11-08 Thread James Zern
On Sat, Nov 3, 2018 at 2:01 PM James Zern  wrote:
>
> enables temporal dependency model
>
> Signed-off-by: James Zern 
> ---
>  doc/encoders.texi  |  2 ++
>  libavcodec/libvpxenc.c | 11 +++
>  2 files changed, 13 insertions(+)
>

If there aren't any comments I'll submit this one soon.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libvpxenc: extend auto-alt-ref range

2018-11-08 Thread James Zern
On Mon, Nov 5, 2018 at 5:03 PM James Zern  wrote:
>
> On Mon, Nov 5, 2018 at 5:02 PM James Zern  wrote:
> >
> > vp9 now supports [0, 6]
> >
> > Signed-off-by: James Zern 
> > ---
> >  doc/encoders.texi  | 1 +
> >  libavcodec/libvpxenc.c | 6 --
> >  2 files changed, 5 insertions(+), 2 deletions(-)
> >
>
> This version moves the option from COMMON_OPTIONS for comparison.
>

I'll submit this version soon if there aren't any comments. vp8 could
be made a bool in a followup at the cost of compatibility, it's been
in its current state for a couple years.

> > diff --git a/doc/encoders.texi b/doc/encoders.texi
> > index 899faac49b..3c6f5cd70b 100644
> > --- a/doc/encoders.texi
> > +++ b/doc/encoders.texi
> > @@ -1641,6 +1641,7 @@ means unlimited.
> >  @table @option
> >  @item auto-alt-ref
> >  Enable use of alternate reference frames (2-pass only).
> > +Values greater than 1 enable multi-layer alternate reference frames (VP9 
> > only).
> >  @item arnr-max-frames
> >  Set altref noise reduction max frame count.
> >  @item arnr-type
> > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> > index 09f7a88452..827df21fa5 100644
> > --- a/libavcodec/libvpxenc.c
> > +++ b/libavcodec/libvpxenc.c
> > @@ -1067,8 +1067,6 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
> > *pkt,
> >  #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
> >
> >  #define COMMON_OPTIONS \
> > -{ "auto-alt-ref","Enable use of alternate reference " \
> > - "frames (2-pass only)",   
> > OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1},  -1,  2, 
> >   VE}, \
> >  { "lag-in-frames",   "Number of frames to look ahead for " \
> >   "alternate reference frame selection",
> > OFFSET(lag_in_frames),   AV_OPT_TYPE_INT, {.i64 = -1},  -1,  
> > INT_MAX, VE}, \
> >  { "arnr-maxframes",  "altref noise reduction max frame count", 
> > OFFSET(arnr_max_frames), AV_OPT_TYPE_INT, {.i64 = -1},  -1,  
> > INT_MAX, VE}, \
> > @@ -1112,6 +1110,8 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
> > *pkt,
> >  #if CONFIG_LIBVPX_VP8_ENCODER
> >  static const AVOption vp8_options[] = {
> >  COMMON_OPTIONS
> > +{ "auto-alt-ref","Enable use of alternate reference "
> > + "frames (2-pass only)",
> > OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1}, -1,  2, VE},
> >  { "cpu-used","Quality/Speed ratio modifier",
> > OFFSET(cpu_used),AV_OPT_TYPE_INT, {.i64 = 1}, -16, 16, VE},
> >  LEGACY_OPTIONS
> >  { NULL }
> > @@ -1121,6 +1121,8 @@ static const AVOption vp8_options[] = {
> >  #if CONFIG_LIBVPX_VP9_ENCODER
> >  static const AVOption vp9_options[] = {
> >  COMMON_OPTIONS
> > +{ "auto-alt-ref","Enable use of alternate reference "
> > + "frames (2-pass only)",
> > OFFSET(auto_alt_ref),AV_OPT_TYPE_INT, {.i64 = -1}, -1, 6, VE},
> >  { "cpu-used","Quality/Speed ratio modifier",
> > OFFSET(cpu_used),AV_OPT_TYPE_INT, {.i64 = 1},  -8, 8, VE},
> >  { "lossless","Lossless mode",   
> > OFFSET(lossless),AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, VE},
> >  { "tile-columns","Number of tile columns to use, log2", 
> > OFFSET(tile_columns),AV_OPT_TYPE_INT, {.i64 = -1}, -1, 6, VE},
> > --
> > 2.19.1.930.g4563a0d9d0-goog
> >
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libvpxenc,vp9: add enable-tpl option

2018-11-09 Thread James Zern
On Thu, Nov 8, 2018 at 2:46 PM James Zern  wrote:
>
> On Sat, Nov 3, 2018 at 2:01 PM James Zern  wrote:
> >
> > enables temporal dependency model
> >
> > Signed-off-by: James Zern 
> > ---
> >  doc/encoders.texi  |  2 ++
> >  libavcodec/libvpxenc.c | 11 +++
> >  2 files changed, 13 insertions(+)
> >
>
> If there aren't any comments I'll submit this one soon.

applied.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: add VP8 temporal scalability configuration options

2018-11-13 Thread James Zern
On Mon, Nov 12, 2018 at 10:37 AM Ard Oerlemans
 wrote:
>
> Thanks for the suggestion. I have updated the patch.
>

Try to keep the original patch message so it's easier to apply.

> Ard
>
> ---
>  doc/encoders.texi  | 28 +++
>  libavcodec/libvpxenc.c | 79 ++
>  2 files changed, 107 insertions(+)
>

This looks OK, just some minor comments.

> [...]
> +static void vp8_ts_parse_int_array(int* dest, char *value, size_t value_len, 
> int max_entries)

'*' is associated with the variable.

> [...]
> +{
> +int dest_idx = 0;
> +char *value_end = value + value_len;
> +while (value < value_end && dest_idx < max_entries) {
> +dest[dest_idx] = strtoul(value, &value, 10);
> +while (value < value_end && (*value == ',' || av_isspace(*value)))
> +value++;

Could this just be av_strtok?

> [...]
> @@ -1113,6 +1191,7 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
> *pkt,
>  static const AVOption vp8_options[] = {
>  COMMON_OPTIONS
>  { "cpu-used","Quality/Speed ratio modifier",
> OFFSET(cpu_used),AV_OPT_TYPE_INT, {.i64 = 1}, -16, 16, VE},
> +{ "ts-parameters",   "Temporal scaling configuration using a :-separated 
> list of key=value parameters", OFFSET(vp8_ts_parameters), AV_OPT_TYPE_STRING, 
> {.str=NULL},  0,  0, VE},

This doesn't apply.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: add VP8 temporal scalability configuration options

2018-11-16 Thread James Zern
On Wed, Nov 14, 2018 at 12:56 PM Ard Oerlemans
 wrote:
>
> This commit adds configuration options to libvpxenc.c that can be used to
> enable VP8 temporal scalability. It also adds a way to programmatically set 
> the
> per-frame encoding flags which can be used to control usage and updates of
> reference frames while encoding with temporal scalability enabled.
> ---
>  doc/encoders.texi  | 28 +++
>  libavcodec/libvpxenc.c | 81 ++
>  2 files changed, 109 insertions(+)
>

lgtm. I'll submit this soon if there aren't any further comments.

> [...]
> +while (token && dest_idx < max_entries)
> +{

This should be joined with the previous line. I have a fix for it locally.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/libvpxenc: add VP8 temporal scalability configuration options

2018-11-19 Thread James Zern
On Fri, Nov 16, 2018 at 8:59 PM James Zern  wrote:
>
> On Wed, Nov 14, 2018 at 12:56 PM Ard Oerlemans
>  wrote:
> >
> > This commit adds configuration options to libvpxenc.c that can be used to
> > enable VP8 temporal scalability. It also adds a way to programmatically set 
> > the
> > per-frame encoding flags which can be used to control usage and updates of
> > reference frames while encoding with temporal scalability enabled.
> > ---
> >  doc/encoders.texi  | 28 +++
> >  libavcodec/libvpxenc.c | 81 ++
> >  2 files changed, 109 insertions(+)
> >
>
> lgtm. I'll submit this soon if there aren't any further comments.
>

applied, thanks for the patch.

> > [...]
> > +while (token && dest_idx < max_entries)
> > +{
>
> This should be joined with the previous line. I have a fix for it locally.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2 2/2] avcodec/libaomenc.c: Add super-resolution options to libaom wrapper

2020-03-17 Thread James Zern
Hi,

On Thu, Mar 5, 2020 at 6:20 PM Wang Cao  wrote:
>
> Signed-off-by: Wang Cao 
> ---
> The changes are made according to the code review
> - Bump the MICRO version
> - Use enum for Super resolution mode consts. The original enum in libaom
>   is not public so a enum is defined and matched the original enum
>  doc/encoders.texi  | 39 +++
>  libavcodec/libaomenc.c | 47 ++
>  libavcodec/version.h   |  2 +-
>  3 files changed, 87 insertions(+), 1 deletion(-)
>
> diff --git a/doc/encoders.texi b/doc/encoders.texi
> index 0a74ecce9b..04f05e7c9b 100644
> --- a/doc/encoders.texi
> +++ b/doc/encoders.texi
> @@ -1608,6 +1608,45 @@ Enable the use of global motion for block prediction. 
> Default is true.
>  Enable block copy mode for intra block prediction. This mode is
>  useful for screen content. Default is true.
>
> +@item enable-superres (@emph{boolean})
> +Enable super-resolution during the encoding process.
> +

Funny aomenc in libaom doesn't have this option. It must assume the
library defaults will take care of it, seems like a bug.

> +@item superres-mode (@emph{mode})
> +Select super-resultion mode.
> +

resolution
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v2 1/2] avcodec/libaomenc.c: Add a libaom command-line option 'tune'

2020-03-17 Thread James Zern
Hi,

On Thu, Mar 5, 2020 at 6:38 PM Wang Cao  wrote:
>
> Signed-off-by: Wang Cao 
> ---
> Made changes according to the review.
> - Bump the MICRO version of libavcodec.
> - Use enum for 'tune' option consts for better consistency
>
>  doc/encoders.texi  | 11 +++
>  libavcodec/libaomenc.c |  7 +++
>  libavcodec/version.h   |  2 +-
>  3 files changed, 19 insertions(+), 1 deletion(-)
>

Just some cosmetics.

> diff --git a/doc/encoders.texi b/doc/encoders.texi
> index e23b6b32fe..0a74ecce9b 100644
> --- a/doc/encoders.texi
> +++ b/doc/encoders.texi
> @@ -1508,6 +1508,17 @@ Complexity-based.
>  Cyclic refresh.
>  @end table
>
> +@item tune (@emph{tune})
> +Set the distortion metric the encoder is tune with. Default is @code{psnr}.
> +

...the encoder is tuned with...

> +@table @samp
> +@item psnr (@emph{0})
> +PSNR as distortion metric
> +

Given the description above and the name of the options the extra text
may be redundant.

> [...]
> @@ -1096,6 +1100,9 @@ static const AVOption options[] = {
>  { "usage",   "Quality and compression efficiency vs speed 
> tradeof", OFFSET(usage), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, 
> "usage"},
>  { "good","Good quality",  0, AV_OPT_TYPE_CONST, {.i64 = 
> 0 /* AOM_USAGE_GOOD_QUALITY */}, 0, 0, VE, "usage"},
>  { "realtime","Realtime encoding", 0, AV_OPT_TYPE_CONST, {.i64 = 
> 1 /* AOM_USAGE_REALTIME */}, 0, 0, VE, "usage"},
> +{ "tune","The metric that encoder tunes for. Automatically 
> choosen by encoder by default", OFFSET(tune), AV_OPT_TYPE_INT, {.i64 = -1}, 
> -1, AOM_TUNE_SSIM, VE, "tune"},

...that the encoder tunes...chosen by the encoder...

> +{ "psnr","PSNR as distortion metric", 0, 
> AV_OPT_TYPE_CONST, {.i64 = AOM_TUNE_PSNR}, 0, 0, VE, "tune"},
> +{ "ssim","SSIM as distortion metric", 0, 
> AV_OPT_TYPE_CONST, {.i64 = AOM_TUNE_SSIM}, 0, 0, VE, "tune"},

Like in the other table the extra descriptions may be redundant, they
could be NULL.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v2 2/2] avcodec/libaomenc.c: Add super-resolution options to libaom wrapper

2020-04-10 Thread James Zern
On Fri, Apr 3, 2020 at 2:10 PM Wang Cao  wrote:
>
> Signed-off-by: Wang Cao 
> ---
>  doc/encoders.texi  | 39 +++
>  libavcodec/libaomenc.c | 47 ++
>  libavcodec/version.h   |  2 +-
>  3 files changed, 87 insertions(+), 1 deletion(-)
>
> diff --git a/doc/encoders.texi b/doc/encoders.texi
> index 18bfe8f2eb..e32fecdca3 100644
> --- a/doc/encoders.texi
> +++ b/doc/encoders.texi

There is some trailing whitespace in this file. Don't forget to run
tools/patcheck / git diff --check.

> [...]
> +
> +enum AOMSuperresModes {
> +AOM_SUPERRES_MODE_NONE= 0,
> +AOM_SUPERRES_MODE_FIXED   = 1,
> +AOM_SUPERRES_MODE_RANDOM  = 2,
> +AOM_SUPERRES_MODE_QTHRESH = 3,
> +AOM_SUPERRES_MODE_AUTO= 4,
> +AOM_SUPERRES_MODE_NB
>  };
>

This really could be exposed by the library. Just use constants for
the options, it's dangerous to use the AOM_ namespace should libaom
make similar values public.

> [...]
> +{ "enable-superres", "Enable super-resolution mode", 
> OFFSET(enable_superres), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "superres-mode",   "Select super-resultion mode", 
> OFFSET(superres_mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 
> AOM_SUPERRES_MODE_NB-1, VE, "superres_mode"},

resolution.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v2 1/2] avcodec/libaomenc.c: Add a libaom command-line option 'tune'

2020-04-10 Thread James Zern
On Fri, Apr 10, 2020 at 10:50 PM James Zern  wrote:
>
> On Fri, Apr 3, 2020 at 2:07 PM Wang Cao  wrote:
> >
> > Signed-off-by: Wang Cao 
> > ---
> >  doc/encoders.texi  | 9 +
> >  libavcodec/libaomenc.c | 7 +++
> >  libavcodec/version.h   | 2 +-
> >  3 files changed, 17 insertions(+), 1 deletion(-)
> >
>
> lgtm. I'll apply this soon.

I missed that the choosen -> chosen fix was missing. fixed locally.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v2 1/2] avcodec/libaomenc.c: Add a libaom command-line option 'tune'

2020-04-10 Thread James Zern
On Fri, Apr 3, 2020 at 2:07 PM Wang Cao  wrote:
>
> Signed-off-by: Wang Cao 
> ---
>  doc/encoders.texi  | 9 +
>  libavcodec/libaomenc.c | 7 +++
>  libavcodec/version.h   | 2 +-
>  3 files changed, 17 insertions(+), 1 deletion(-)
>

lgtm. I'll apply this soon.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v2 1/2] avcodec/libaomenc.c: Add a libaom command-line option 'tune'

2020-04-11 Thread James Zern
On Fri, Apr 10, 2020 at 11:18 PM James Zern  wrote:
>
> On Fri, Apr 10, 2020 at 10:50 PM James Zern  wrote:
> >
> > On Fri, Apr 3, 2020 at 2:07 PM Wang Cao  wrote:
> > >
> > > Signed-off-by: Wang Cao 
> > > ---
> > >  doc/encoders.texi  | 9 +
> > >  libavcodec/libaomenc.c | 7 +++
> > >  libavcodec/version.h   | 2 +-
> > >  3 files changed, 17 insertions(+), 1 deletion(-)
> > >
> >
> > lgtm. I'll apply this soon.
>
> I missed that the choosen -> chosen fix was missing. fixed locally.

applied. thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v4 1/2] libavcodec/libaomenc.c: Support gray input

2020-04-13 Thread James Zern
Hi,

On Tue, Apr 7, 2020 at 5:14 PM Ryo Hirafuji  wrote:
>
> From: Ryo Hirafuji 
>
> AV1 decoders, libaomdec and libdav1d, both support grayscale image.
> However, libaomenc does not support it yet.
> In this patch, I add a grayscale image support also to libaomenc.
>
> Fixes ticket #7599
> ---
>  libavcodec/libaomenc.c | 40 +---
>  1 file changed, 33 insertions(+), 7 deletions(-)
>

This should bump the micro version number in libavcodec/version.h.

> [...]
> @@ -979,12 +986,27 @@ static int aom_encode(AVCodecContext *avctx, AVPacket 
> *pkt,
>
>  if (frame) {
>  rawimg  = &ctx->rawimg;
> -rawimg->planes[AOM_PLANE_Y] = frame->data[0];
> -rawimg->planes[AOM_PLANE_U] = frame->data[1];
> -rawimg->planes[AOM_PLANE_V] = frame->data[2];
> -rawimg->stride[AOM_PLANE_Y] = frame->linesize[0];
> -rawimg->stride[AOM_PLANE_U] = frame->linesize[1];
> -rawimg->stride[AOM_PLANE_V] = frame->linesize[2];
> +if (frame->format == AV_PIX_FMT_GRAY8 ||
> +frame->format == AV_PIX_FMT_GRAY10 ||
> +frame->format == AV_PIX_FMT_GRAY12) {
> +rawimg->monochrome = 1;
> +// Information of U and V planes are ignored,
> +// but must point some valid pointer to avoid SIGSEGV of libaom.

That's annoying. I filed a bug to track [1]. The monochrome flag
itself seems unnecessary for the library rather than just an image
format, but that's another discussion.
This reads a little strangely to me, maybe something like: U and V
information is ignored, but must point to valid buffers...?

[1] https://crbug.com/aomedia/2639
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v2 2/2] avcodec/libaomenc.c: Add super-resolution options to libaom wrapper

2020-04-13 Thread James Zern
On Tue, Mar 17, 2020 at 7:38 PM James Zern  wrote:
>
> Hi,
>
> On Thu, Mar 5, 2020 at 6:20 PM Wang Cao  wrote:
> >
> > Signed-off-by: Wang Cao 
> > ---
> > The changes are made according to the code review
> > - Bump the MICRO version
> > - Use enum for Super resolution mode consts. The original enum in libaom
> >   is not public so a enum is defined and matched the original enum
> >  doc/encoders.texi  | 39 +++
> >  libavcodec/libaomenc.c | 47 ++
> >  libavcodec/version.h   |  2 +-
> >  3 files changed, 87 insertions(+), 1 deletion(-)
> >
> > diff --git a/doc/encoders.texi b/doc/encoders.texi
> > index 0a74ecce9b..04f05e7c9b 100644
> > --- a/doc/encoders.texi
> > +++ b/doc/encoders.texi
> > @@ -1608,6 +1608,45 @@ Enable the use of global motion for block 
> > prediction. Default is true.
> >  Enable block copy mode for intra block prediction. This mode is
> >  useful for screen content. Default is true.
> >
> > +@item enable-superres (@emph{boolean})
> > +Enable super-resolution during the encoding process.
> > +
>
> Funny aomenc in libaom doesn't have this option. It must assume the
> library defaults will take care of it, seems like a bug.
>

Looking at it a little more closely, there's a 'none' superres-mode,
so that will work on its own.

> > +@item superres-mode (@emph{mode})
> > +Select super-resultion mode.
> > +
>
> resolution
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v4 1/2] libavcodec/libaomenc.c: Support gray input

2020-04-14 Thread James Zern
On Tue, Apr 14, 2020 at 3:57 AM Ryo Hirafuji  wrote:
>
> Thanks for the review!
>
> This should bump the micro version number in libavcodec/version.h.
>
>
> OK, I will bump up the version when the problem below is solved.
>

If we want to go for compatibility with different versions of the
library we could move forward with the patch as is, though it would be
simpler to just treat this as a bug fix in libaom.

>
> > That's annoying. I filed a bug to track [1]. The monochrome flag
> > itself seems unnecessary for the library rather than just an image
> > format, but that's another discussion.
> >
>
>  Thanks for creating the issue.
>
> You might be right.
> I just need this line to set  the monochrome flag to 1 in Sequence Header
> OBU:
> > enccfg->monochrome = 1u;
>
> This reads a little strangely to me, maybe something like: U and V
> > information is ignored, but must point to valid buffers...?
> > [1] https://crbug.com/aomedia/2639
>
>
> I pasted the stack trace when V plane and U plane are NULL and ffmpeg
> crashes:
> https://bugs.chromium.org/p/aomedia/issues/detail?id=2639#c1
> (ryoh@... is also my account)
>

Thanks for adding the detail.

> If we allocate aom_image with aom_img_alloc function, allocated V plane and
> U plane are filled with 0 (not 128, 512 or 2048).
> And I don't have to fill them to 128 to obtain a gray image.
> (I tried it in https://github.com/link-u/cavif )
> So I think these planes are just ignored (but not sure).
>

They should be. From the stack trace it looks like a simple fix when
dealing with border extension, though that may uncover other issues.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v4 2/2] libavcodec/libaomenc.c: Support lossless encoding

2020-04-14 Thread James Zern
On Tue, Apr 7, 2020 at 5:14 PM Ryo Hirafuji  wrote:
>
> From: Ryo Hirafuji 
>
> AV1 support lossless encoding.
> In this patch, I added a command line flag to enable it.
>
> Fixes ticket #7600
> ---
>  libavcodec/libaomenc.c | 14 +++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
>
> [...]
> @@ -574,7 +577,9 @@ static av_cold int aom_init(AVCodecContext *avctx,
>  if (avctx->rc_min_rate == avctx->rc_max_rate &&
>  avctx->rc_min_rate == avctx->bit_rate && avctx->bit_rate) {
>  enccfg.rc_end_usage = AOM_CBR;
> -} else if (ctx->crf >= 0) {
> +} else if (ctx->crf == 0) {
> +enccfg.rc_end_usage = AOM_Q;

I saw the earlier comments around using crf=0 as the trigger for this.
libaom will behave differently with q vs cq mode. This also differs
from the -lossless in libvpxenc where this feature originated; mostly
we've been mapping options one to one with vpx/aomenc. Let me ask
around about the preference for lossless usage in libaom.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v4 1/2] libavcodec/libaomenc.c: Support gray input

2020-04-15 Thread James Zern
On Wed, Apr 15, 2020 at 8:14 AM James Almer  wrote:
>
> On 4/14/2020 9:26 PM, James Zern wrote:
> > On Tue, Apr 14, 2020 at 3:57 AM Ryo Hirafuji  
> > wrote:
> >>
> >> Thanks for the review!
> >>
> >> This should bump the micro version number in libavcodec/version.h.
> >>
> >>
> >> OK, I will bump up the version when the problem below is solved.
> >>
> >
> > If we want to go for compatibility with different versions of the
> > library we could move forward with the patch as is, though it would be
> > simpler to just treat this as a bug fix in libaom.
>
> Once a new version of libaom is tagged (Hopefully soon, since it's been
> almost two years since 1.0.0), we could set it as the minimum
> requirement and forget about 1.0.0, since that version is by now
> essentially unusable.
>

Thanks, that was my hope. I just wasn't sure how long we wanted to
wait before changing the minimum. You're right though, the only tags
are old and were more for bitstream compatibility rather than encoder
functionality. A full release should be coming soon [1] and with more
regular frequency after that.

[1] https://crbug.com/aomedia/2545
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avcodec: add a WebP parser

2020-04-16 Thread James Zern
On Mon, Apr 13, 2020 at 5:58 PM James Almer  wrote:
>
> Based on code from the BMP parser.
>
> Addresses ticket #8574
>
> Signed-off-by: James Almer 
> ---
>  libavcodec/Makefile  |   1 +
>  libavcodec/parsers.c |   1 +
>  libavcodec/webp_parser.c | 112 +++
>  3 files changed, 114 insertions(+)
>  create mode 100644 libavcodec/webp_parser.c
>

lgtm.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v4 2/2] libavcodec/libaomenc.c: Support lossless encoding

2020-04-21 Thread James Zern
On Fri, Apr 17, 2020 at 9:57 AM Ryo Hirafuji  wrote:
>
> I see, Thanks.
> I'm looking forward to the answer.
>

There is some benefit to using cq-level as many of the encoder
decisions are based on this (reference frame structure, speed
features, etc) and so it's better tuned than quality mode. In both
cases the output is lossless so either will work, but given the
structure of the options to the library it might make sense to match
vp9 in libvpxenc.c and use cq-level.

> (If you are OK, please CC to me. I also would like to know about lossless
> mode in libaom, because I also use my software)
>

Sorry, I missed this comment. I don't have any results that would be
visible publicly.

> 2020年4月15日(水) 10:00 James Zern :
>
> > On Tue, Apr 7, 2020 at 5:14 PM Ryo Hirafuji 
> > wrote:
> > >
> > > From: Ryo Hirafuji 
> > >
> > > AV1 support lossless encoding.
> > > In this patch, I added a command line flag to enable it.
> > >
> > > Fixes ticket #7600
> > > ---
> > >  libavcodec/libaomenc.c | 14 +++---
> > >  1 file changed, 11 insertions(+), 3 deletions(-)
> > >
> > > [...]
> > > @@ -574,7 +577,9 @@ static av_cold int aom_init(AVCodecContext *avctx,
> > >  if (avctx->rc_min_rate == avctx->rc_max_rate &&
> > >  avctx->rc_min_rate == avctx->bit_rate && avctx->bit_rate) {
> > >  enccfg.rc_end_usage = AOM_CBR;
> > > -} else if (ctx->crf >= 0) {
> > > +} else if (ctx->crf == 0) {
> > > +enccfg.rc_end_usage = AOM_Q;
> >
> > I saw the earlier comments around using crf=0 as the trigger for this.
> > libaom will behave differently with q vs cq mode. This also differs
> > from the -lossless in libvpxenc where this feature originated; mostly
> > we've been mapping options one to one with vpx/aomenc. Let me ask
> > around about the preference for lossless usage in libaom.
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v1] avcodec/libvpxenc: fix potential memory leak.

2021-02-16 Thread James Zern
Hi,

On Mon, Feb 15, 2021 at 10:37 PM Wonkap Jang
 wrote:
>
> While parsing ref_frame_config, AVdictionary needs to be manually
> deallocated.
> ---
>  libavcodec/libvpxenc.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index 284cb9a108..941c3fdd88 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -1595,6 +1595,7 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
> *pkt,
>  if (en) {
>  if (avctx->codec_id == AV_CODEC_ID_VP9) {
>  AVDictionaryEntry* en2 = NULL;
> +ctx->vpx_ref_frame_config = NULL;
>  av_dict_parse_string(&ctx->vpx_ref_frame_config, 
> en->value, "=", ":", 0);

Is there value in allowing a partial parse of the string? This should
at least issue a warning if the call fails; vpx_ref_frame_config
should be freed in either case.

>
>  while ((en2 = av_dict_get(ctx->vpx_ref_frame_config, "", 
> en2, AV_DICT_IGNORE_SUFFIX))) {
> @@ -1604,6 +1605,8 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
> *pkt,
> en2->key, en2->value);
>  }
>
> +if (ctx->vpx_ref_frame_config)

This check is unnecessary.

> +av_dict_free(&ctx->vpx_ref_frame_config);
>  codecctl_intp(avctx, VP9E_SET_SVC_REF_FRAME_CONFIG, (int 
> *)&ctx->ref_frame_config);
>  } else {
>  av_log(avctx, AV_LOG_WARNING,
> --
> 2.30.0.478.g8a0d178c01-goog
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v1] avcodec/libvpxenc: fix potential memory leak.

2021-02-16 Thread James Zern
On Tue, Feb 16, 2021 at 4:17 PM Wonkap Jang
 wrote:
>
> On Tue, Feb 16, 2021 at 1:02 PM James Zern 
> wrote:
> [...]
> >
> > >
> > >  while ((en2 =
> > av_dict_get(ctx->vpx_ref_frame_config, "", en2, AV_DICT_IGNORE_SUFFIX))) {
> > > @@ -1604,6 +1605,8 @@ static int vpx_encode(AVCodecContext *avctx,
> > AVPacket *pkt,
> > > en2->key, en2->value);
> > >  }
> > >
> > > +if (ctx->vpx_ref_frame_config)
> >
> > This check is unnecessary.
> >
> [WJ] if parsing failed at first try without allocating anything? I saw
> examples checking for it.
>

The call checks the validity of the pointer, though
libavutil/tests/dict.c doesn't look to explicitly test that condition.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v2] avcodec/libvpxenc: fix potential memory leak.

2021-02-16 Thread James Zern
On Tue, Feb 16, 2021 at 2:29 PM Wonkap Jang
 wrote:
>
> While parsing ref_frame_config, AVdictionary needs to be manually
> deallocated.
> ---
>  libavcodec/libvpxenc.c | 20 +---
>  1 file changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index 284cb9a108..e71ae54f34 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -1595,15 +1595,21 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket 
> *pkt,
>  if (en) {
>  if (avctx->codec_id == AV_CODEC_ID_VP9) {
>  AVDictionaryEntry* en2 = NULL;
> -av_dict_parse_string(&ctx->vpx_ref_frame_config, 
> en->value, "=", ":", 0);
> -
> -while ((en2 = av_dict_get(ctx->vpx_ref_frame_config, "", 
> en2, AV_DICT_IGNORE_SUFFIX))) {
> -if (vpx_ref_frame_config_parse(ctx, enccfg, 
> en2->key, en2->value, avctx->codec_id) < 0)
> -av_log(avctx, AV_LOG_WARNING,
> -   "Error parsing option '%s = %s'.\n",
> -   en2->key, en2->value);
> +ctx->vpx_ref_frame_config = NULL;
> +if (av_dict_parse_string(&ctx->vpx_ref_frame_config, 
> en->value, "=", ":", 0) == 0) {

! is preferred to testing 0.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v5] avcodec/libvpxenc: optimize parsing vpx_svc_ref_frame_config

2021-02-18 Thread James Zern
On Thu, Feb 18, 2021 at 11:01 AM Wonkap Jang
 wrote:
>
> Getting rid of unnecessary use of AVDictionary object in parsing
> vpx_svc_ref_frame_config.
> ---
>  libavcodec/libvpxenc.c | 73 +++---
>  1 file changed, 55 insertions(+), 18 deletions(-)
>

lgtm, just a couple of cosmetics I addressed locally. I'll submit this
soon. Thanks for the suggestions Nicolas.

> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index 284cb9a108..dfa0763fff 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -42,6 +42,7 @@
>  #include "libavutil/mathematics.h"
>  #include "libavutil/opt.h"
>  #include "libavutil/pixdesc.h"
> +#include "libavutil/avstring.h"
>

This is already included, in general the includes can be sorted.
Deleted locally.

> [...]
> -av_log(avctx, AV_LOG_WARNING,
> -   "Error parsing option '%s = %s'.\n",
> -   en2->key, en2->value);
> +int ret;
> +ret = vpx_parse_ref_frame_config(&ctx->ref_frame_config,
> +   enccfg->ss_number_layers, 
> en->value);

I joined these two lines locally.

> +if (ret < 0) {
> +av_log(avctx, AV_LOG_WARNING,
> +   "Error parsing ref_frame_config option 
> %s.\n", en->value);
> +return ret;
>  }
>
>  codecctl_intp(avctx, VP9E_SET_SVC_REF_FRAME_CONFIG, (int 
> *)&ctx->ref_frame_config);
>  } else {
>  av_log(avctx, AV_LOG_WARNING,
> -   "Error using option ref-frame-config for a 
> non-VP9 codec\n");
> +   "Using option ref-frame-config for a non-VP9 
> codec\n");

I changed 'Using' to 'Ignoring' locally.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v5] avcodec/libvpxenc: optimize parsing vpx_svc_ref_frame_config

2021-02-19 Thread James Zern
On Thu, Feb 18, 2021 at 1:17 PM James Zern  wrote:
>
> On Thu, Feb 18, 2021 at 11:01 AM Wonkap Jang
>  wrote:
> >
> > Getting rid of unnecessary use of AVDictionary object in parsing
> > vpx_svc_ref_frame_config.
> > ---
> >  libavcodec/libvpxenc.c | 73 +++---
> >  1 file changed, 55 insertions(+), 18 deletions(-)
> >
>
> lgtm, just a couple of cosmetics I addressed locally. I'll submit this
> soon. Thanks for the suggestions Nicolas.
>

applied, thanks.

> > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> > index 284cb9a108..dfa0763fff 100644
> > --- a/libavcodec/libvpxenc.c
> > +++ b/libavcodec/libvpxenc.c
> > @@ -42,6 +42,7 @@
> >  #include "libavutil/mathematics.h"
> >  #include "libavutil/opt.h"
> >  #include "libavutil/pixdesc.h"
> > +#include "libavutil/avstring.h"
> >
>
> This is already included, in general the includes can be sorted.
> Deleted locally.
>
> > [...]
> > -av_log(avctx, AV_LOG_WARNING,
> > -   "Error parsing option '%s = %s'.\n",
> > -   en2->key, en2->value);
> > +int ret;
> > +ret = 
> > vpx_parse_ref_frame_config(&ctx->ref_frame_config,
> > +   
> > enccfg->ss_number_layers, en->value);
>
> I joined these two lines locally.
>
> > +if (ret < 0) {
> > +av_log(avctx, AV_LOG_WARNING,
> > +   "Error parsing ref_frame_config option 
> > %s.\n", en->value);
> > +return ret;
> >  }
> >
> >  codecctl_intp(avctx, VP9E_SET_SVC_REF_FRAME_CONFIG, 
> > (int *)&ctx->ref_frame_config);
> >  } else {
> >  av_log(avctx, AV_LOG_WARNING,
> > -   "Error using option ref-frame-config for a 
> > non-VP9 codec\n");
> > +   "Using option ref-frame-config for a non-VP9 
> > codec\n");
>
> I changed 'Using' to 'Ignoring' locally.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avcodec/libaomenc: remove the experimental flag when using libaom 2.0.0 or newer

2020-05-27 Thread James Zern
On Tue, May 26, 2020 at 6:40 PM James Almer  wrote:
>
> Signed-off-by: James Almer 
> ---
> Alternatively, we could remove support for libaom 1.0.0, since it's pretty 
> much
> unusable. But unfortunately both current Debian Stable and latest Ubuntu LTS
> ship it, so i'm not sure if it would be wise.
>
> Any opinions?
>

Those were based off of the normative branch so I agree with you it's
pretty unusable. For LTS at least if there has been an incompatible
ffmpeg release since their snapshot I don't think a new one with
libaom disabled would get pulled in. That said, I'm ok with leaving
1.0.0 support through another release and when we see 2.0 get picked
up by distros. This patch is lgtm depending on other people's
preferences.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v4 1/2] libavcodec/libaomenc.c: Support gray input

2020-06-08 Thread James Zern
On Mon, Jun 8, 2020 at 2:56 AM Moritz Barsnick  wrote:
>
> On Sun, May 10, 2020 at 00:59:25 +0900, Ryo Hirafuji wrote:
> > I can create and send a new patch without these workaround lines, but of
> > course, it will crash if the ffmpeg will be built with older versions of
> > libaom.
>
> Actually, it depends on the runtime version of the library, not which
> version it was built against. (They can differ.)
>
> You could encapsulate the code into a check of aom_codec_version() >
> (1<<16|0<<8|0). Assuming 1.0.0 is the current, buggy release.
>
> > How should I resolve this backward compatibility issue? or I don't have to
> > consider it?
>
> Having a workaround for a known issue does not hurt, IMO, especially
> since a fixed version is not available yet (or is it?).
>

2.0.0 is out. libaomenc.c just got an update to remove the
experimental flag when it's present:
https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/49d37b4b618b20669bbd7081e6af2aecf9c09745?hp=4bc5eb27a74e3eb1805f21a33d4ef08f8f7026e4
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 2/5] libavcodec/libaomenc: Add command-line options to control the use of partition tools.

2020-06-29 Thread James Zern
On Thu, Jun 25, 2020 at 6:02 PM Wang Cao  wrote:
>
> This patch adds the control for enabling rectangular partitions, 1:4/4:1
> partitions and AB shape partitions.
>
> Signed-off-by: Wang Cao 
> ---
>  doc/encoders.texi  | 10 ++
>  libavcodec/libaomenc.c | 15 +++
>  libavcodec/version.h   |  2 +-
>  3 files changed, 26 insertions(+), 1 deletion(-)
>

lgtm. I'll apply this soon if there aren't any other comments.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 3/5] libavcodec/libaomenc.c: Add command-line options for intra-coding tools

2020-06-29 Thread James Zern
On Thu, Jun 25, 2020 at 5:55 PM Wang Cao  wrote:
>
> Signed-off-by: Wang Cao 
> ---
>  doc/encoders.texi  | 21 +++
>  libavcodec/libaomenc.c | 47 --
>  libavcodec/version.h   |  2 +-
>  3 files changed, 63 insertions(+), 7 deletions(-)
>

lgtm.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 1/5] avcodec/libaomenc.c: Add super-resolution options to libaom wrapper

2020-06-29 Thread James Zern
On Mon, Jun 29, 2020 at 11:05 AM James Zern  wrote:
>
> On Thu, Jun 25, 2020 at 5:55 PM Wang Cao  wrote:
> >
> > From: Wang Cao 
> >
> > Signed-off-by: Wang Cao 
> > ---
> >  doc/encoders.texi  | 39 +++
> >  libavcodec/libaomenc.c | 38 ++
> >  libavcodec/version.h   |  2 +-
> >  3 files changed, 78 insertions(+), 1 deletion(-)
> >
> > [...]
> > @@ -688,6 +713,8 @@ static av_cold int aom_init(AVCodecContext *avctx,
> >  // codec control failures are currently treated only as warnings
> >  av_log(avctx, AV_LOG_DEBUG, "aom_codec_control\n");
> >  codecctl_int(avctx, AOME_SET_CPUUSED, ctx->cpu_used);
> > +if (ctx->enable_superres >= 0)
>
> I think you can just check whether superres_mode has been set to avoid
> this additional option.
>
> > +codecctl_int(avctx, AV1E_SET_ENABLE_SUPERRES, 
> > ctx->enable_superres);
> >  if (ctx->auto_alt_ref >= 0)
> >  codecctl_int(avctx, AOME_SET_ENABLEAUTOALTREF, ctx->auto_alt_ref);
> >  if (ctx->arnr_max_frames >= 0)
> > @@ -1107,6 +1134,17 @@ static const AVOption options[] = {
> >  { "tune","The metric that the encoder tunes for. 
> > Automatically chosen by the encoder by default", OFFSET(tune), 
> > AV_OPT_TYPE_INT, {.i64 = -1}, -1, AOM_TUNE_SSIM, VE, "tune"},
> >  { "psnr",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> > AOM_TUNE_PSNR}, 0, 0, VE, "tune"},
> >  { "ssim",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> > AOM_TUNE_SSIM}, 0, 0, VE, "tune"},
> > +{ "enable-superres", "Enable super-resolution mode", 
> > OFFSET(enable_superres), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> > +{ "superres-mode",   "Select super-resultion mode", 
> > OFFSET(superres_mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1, AOM_SUPERRES_AUTO, 
> > VE, "superres_mode"},
>
> resolution
>
> > +{ "none","No frame superres allowed",  
> > 0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_NONE},0, 0, 
> > VE, "superres_mode"},

The AOM_SUPERRES_* enum values are a recent addition, for
compatibility you can use integer constants. If there was an abi bump
after they were added you can check that and keep the enum values for
current versions of the library.

> > +{ "fixed",   "All frames are coded at the specified scale and 
> > super-resolved", 0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_FIXED},   0, 0, 
> > VE, "superres_mode"},
> > +{ "random",  "All frames are coded at a random scale and 
> > super-resolved.", 0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_RANDOM},  
> > 0, 0, VE, "superres_mode"},
> > +{ "qthresh", "Superres scale for a frame is determined based 
> > on q_index",  0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_QTHRESH}, 0, 
> > 0, VE, "superres_mode"},
> > +{ "auto","Automatically select superres for appropriate 
> > frames",   0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_AUTO},0, 
> > 0, VE, "superres_mode"},
> > +{ "superres-denominator","The denominator for superres to use, 
> > range [8, 16]",   OFFSET(superres_denominator), 
> >AV_OPT_TYPE_INT, {.i64 = 8}, 8, 16, VE},
> > +{ "superres-qthresh","The q level threshold after which 
> > superres is used, range [1, 63]",OFFSET(superres_qthresh),  
> >   AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, VE},
> > +{ "superres-kf-denominator", "The denominator for superres to use on 
> > key frames, range [8, 16]", 
> > OFFSET(superres_kf_denominator), AV_OPT_TYPE_INT, {.i64 = 8}, 8, 16, VE},
> > +{ "superres-kf-qthresh", "The q level threshold after which 
> > superres is used for key frames, range [1, 63]", 
> > OFFSET(superres_kf_qthresh), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, VE},
> >  { NULL },
> >  };
> >
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 4/5] libavcodec/libaomenc.c: Add command-line options for tx tools.

2020-06-29 Thread James Zern
On Thu, Jun 25, 2020 at 5:56 PM Wang Cao  wrote:
>
> Signed-off-by: Wang Cao 
> ---
>  doc/encoders.texi  | 21 +
>  libavcodec/libaomenc.c | 31 +++
>  libavcodec/version.h   |  2 +-
>  3 files changed, 53 insertions(+), 1 deletion(-)
>
> [...]
> +{ "reduced-tx-type-set",   "Use reduced set of transform types. 
> Default is false", OFFSET(reduced_tx_type_set),   AV_OPT_TYPE_BOOL, {.i64 
> = -1}, -1, 1, VE},
> +{ "use-intra-dct-only","Use DCT only for INTRA modes",   
>   OFFSET(use_intra_dct_only),AV_OPT_TYPE_BOOL, {.i64 = 
> -1}, -1, 1, VE},
> +{ "use-inter-dct-only","Use DCT only for INTRA modes",   
>   OFFSET(use_inter_dct_only),AV_OPT_TYPE_BOOL, {.i64 = 
> -1}, -1, 1, VE},

INTER
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 5/5] libavcodec/libaomenc.c: Add command-line options for inter-coding tools

2020-06-29 Thread James Zern
On Thu, Jun 25, 2020 at 5:56 PM Wang Cao  wrote:
>
> Signed-off-by: Wang Cao 
> ---
>  doc/encoders.texi  | 36 +
>  libavcodec/libaomenc.c | 61 ++
>  libavcodec/version.h   |  2 +-
>  3 files changed, 98 insertions(+), 1 deletion(-)
>
> [...]
>  codecctl_int(avctx, AOME_SET_STATIC_THRESHOLD, ctx->static_thresh);
> @@ -1226,6 +1275,18 @@ static const AVOption options[] = {
>  { "use-intra-dct-only","Use DCT only for INTRA modes",   
>   OFFSET(use_intra_dct_only),AV_OPT_TYPE_BOOL, {.i64 = 
> -1}, -1, 1, VE},
>  { "use-inter-dct-only","Use DCT only for INTRA modes",   
>   OFFSET(use_inter_dct_only),AV_OPT_TYPE_BOOL, {.i64 = 
> -1}, -1, 1, VE},
>  { "use-intra-default-tx-only", "Use Default-transform only for INTRA 
> modes",   OFFSET(use_intra_default_tx_only), AV_OPT_TYPE_BOOL, {.i64 
> = -1}, -1, 1, VE},
> +{ "enable-ref-frame-mvs", "Enable temporal mv prediction 
> (default is 1)", 
> OFFSET(enable_ref_frame_mvs), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, 
> VE},
> +{ "enable-reduced-reference-set", "Use reduced set of single and 
> compound references  (0: off (default), 1: on)", 
> OFFSET(enable_reduced_reference_set), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, 
> VE},
> +{ "enable-obmc",  "Enable obmc (0: false, 1: true 
> (default))",OFFSET(enable_obmc),  
> AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-dual-filter",   "Enable dual filter (0: false, 1: true 
> (default))", OFFSET(enable_dual_filter),  
>  AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-diff-wtd-comp", "Enable difference-weighted compound 
> (0: false, 1: true (default))",OFFSET(enable_diff_wtd_comp),  
>AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-dist-wtd-comp", "Enable distance-weighted compound (0: 
> false, 1: true (default))",  OFFSET(enable_dist_wtd_comp),
>  AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-onesided-comp", "Enable one sided compound (0: false, 
> 1: true (default))",  OFFSET(enable_onesided_comp),   
>   AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-interinter-wedge",  "Enable interinter wedge compound (0: 
> false, 1: true (default))",   OFFSET(enable_interinter_wedge),
>   AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-interintra-wedge",  "Enable interintra wedge compound (0: 
> false, 1: true (default))",   OFFSET(enable_interintra_wedge),
>   AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-masked-comp",   "Enable masked compound (0: false, 1: 
> true (default))", OFFSET(enable_masked_comp), 
>   AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-interintra-comp",   "Enable interintra compound (0: false, 
> 1: true (default))", OFFSET(enable_interintra_comp),  
>  AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "enable-smooth-interintra", "Enable smooth interintra mode (0: 
> false, 1: true (default))",  
> OFFSET(enable_smooth_interintra), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, 
> VE},

These show up as booleans in the help output, so '(default true)' is
probably enough. You can have a look at the output with -h
encoder=libaom-av1.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 1/5] avcodec/libaomenc.c: Add super-resolution options to libaom wrapper

2020-06-29 Thread James Zern
On Thu, Jun 25, 2020 at 5:55 PM Wang Cao  wrote:
>
> From: Wang Cao 
>
> Signed-off-by: Wang Cao 
> ---
>  doc/encoders.texi  | 39 +++
>  libavcodec/libaomenc.c | 38 ++
>  libavcodec/version.h   |  2 +-
>  3 files changed, 78 insertions(+), 1 deletion(-)
>
> [...]
> @@ -688,6 +713,8 @@ static av_cold int aom_init(AVCodecContext *avctx,
>  // codec control failures are currently treated only as warnings
>  av_log(avctx, AV_LOG_DEBUG, "aom_codec_control\n");
>  codecctl_int(avctx, AOME_SET_CPUUSED, ctx->cpu_used);
> +if (ctx->enable_superres >= 0)

I think you can just check whether superres_mode has been set to avoid
this additional option.

> +codecctl_int(avctx, AV1E_SET_ENABLE_SUPERRES, ctx->enable_superres);
>  if (ctx->auto_alt_ref >= 0)
>  codecctl_int(avctx, AOME_SET_ENABLEAUTOALTREF, ctx->auto_alt_ref);
>  if (ctx->arnr_max_frames >= 0)
> @@ -1107,6 +1134,17 @@ static const AVOption options[] = {
>  { "tune","The metric that the encoder tunes for. 
> Automatically chosen by the encoder by default", OFFSET(tune), 
> AV_OPT_TYPE_INT, {.i64 = -1}, -1, AOM_TUNE_SSIM, VE, "tune"},
>  { "psnr",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> AOM_TUNE_PSNR}, 0, 0, VE, "tune"},
>  { "ssim",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
> AOM_TUNE_SSIM}, 0, 0, VE, "tune"},
> +{ "enable-superres", "Enable super-resolution mode", 
> OFFSET(enable_superres), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
> +{ "superres-mode",   "Select super-resultion mode", 
> OFFSET(superres_mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1, AOM_SUPERRES_AUTO, 
> VE, "superres_mode"},

resolution

> +{ "none","No frame superres allowed",
>   0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_NONE},0, 0, VE, 
> "superres_mode"},
> +{ "fixed",   "All frames are coded at the specified scale and 
> super-resolved", 0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_FIXED},   0, 0, 
> VE, "superres_mode"},
> +{ "random",  "All frames are coded at a random scale and 
> super-resolved.", 0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_RANDOM},  0, 
> 0, VE, "superres_mode"},
> +{ "qthresh", "Superres scale for a frame is determined based on 
> q_index",  0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_QTHRESH}, 0, 0, VE, 
> "superres_mode"},
> +{ "auto","Automatically select superres for appropriate 
> frames",   0, AV_OPT_TYPE_CONST, {.i64 = AOM_SUPERRES_AUTO},0, 0, 
> VE, "superres_mode"},
> +{ "superres-denominator","The denominator for superres to use, range 
> [8, 16]",   OFFSET(superres_denominator),
> AV_OPT_TYPE_INT, {.i64 = 8}, 8, 16, VE},
> +{ "superres-qthresh","The q level threshold after which superres 
> is used, range [1, 63]",OFFSET(superres_qthresh),
> AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, VE},
> +{ "superres-kf-denominator", "The denominator for superres to use on key 
> frames, range [8, 16]", OFFSET(superres_kf_denominator), 
> AV_OPT_TYPE_INT, {.i64 = 8}, 8, 16, VE},
> +{ "superres-kf-qthresh", "The q level threshold after which superres 
> is used for key frames, range [1, 63]", OFFSET(superres_kf_qthresh), 
> AV_OPT_TYPE_INT, {.i64 = 0}, 0, 63, VE},
>  { NULL },
>  };
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] Change libvpx-vpx default to crf=32.

2019-09-04 Thread James Zern
Hi,

On Wed, Aug 28, 2019 at 2:26 PM Elliott Karpilovsky
 wrote:
>
> Current default is 200kbps, which produces inconsistent
> results (too high for low-res, too low for hi-res). Use
> CRF instead, which will adapt. Affects vp8/vp9. Also
> have VP8 use a default bitrate of 256kbps.
> ---
>  libavcodec/libvpxenc.c | 71 +++---
>  libavcodec/version.h   |  2 +-
>  2 files changed, 61 insertions(+), 12 deletions(-)
>

Some cosmetics, seems to work as expected with tip of tree and v1.4.0.

> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index feb52ea0dd..42504ab95e 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -510,6 +510,63 @@ static void set_color_range(AVCodecContext *avctx)
>  #endif
>  #endif
>
> +/**
> + * Set the target bitrate to VPX library default. Also set CRF to 32 if 
> needed.
> + */
> +static void set_vp8_defaults(AVCodecContext *avctx,
> + struct vpx_codec_enc_cfg *enccfg) {

Indent should be 4 and the brace for a function on a new line [1].

> [...]
> +
> +/**
> + * Called when the bitrate is not set. It sets appropriate default values for
> + * bit-rate and CRF.

'bitrate' is more common in this file.

> [...]
> diff --git a/libavcodec/version.h b/libavcodec/version.h
> index e70ebc0c70..cda6dbae47 100644
> --- a/libavcodec/version.h
> +++ b/libavcodec/version.h
> @@ -29,7 +29,7 @@
>
>  #define LIBAVCODEC_VERSION_MAJOR  58
>  #define LIBAVCODEC_VERSION_MINOR  55
> -#define LIBAVCODEC_VERSION_MICRO 101
> +#define LIBAVCODEC_VERSION_MICRO 102
>

This no longer applies cleanly.

[1] http://ffmpeg.org/developer.html#Code-formatting-conventions
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH V8] avcodec/libvpxenc: add ROI-based encoding support for VP8/VP9

2019-09-11 Thread James Zern
Hi,

On Tue, Sep 10, 2019 at 6:13 PM Guo, Yejun  wrote:
>
> example command line to verify it:
> ./ffmpeg -i input.stream -vf addroi=0:0:iw/3:ih/3:-0.8 -c:v libvpx -b:v 2M 
> tmp.webm
>
> Signed-off-by: Guo, Yejun 
> ---
>  libavcodec/libvpxenc.c | 188 
> +
>  libavcodec/version.h   |   2 +-
>  2 files changed, 189 insertions(+), 1 deletion(-)
>

Thanks for updating the patch. Could you run tools/patcheck on it? I
think the gcc 2.95 comment might be dated [1], so you can ignore that
one.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] Delete unused branch in libaomenc

2019-09-18 Thread James Zern
On Sun, Sep 15, 2019 at 2:03 PM Elliott Karpilovsky
 wrote:
>
> ---
>  libavcodec/libaomenc.c | 14 +-
>  1 file changed, 5 insertions(+), 9 deletions(-)
>

lgtm. This is leftover from libvpxenc, only vp8 can hit the path there.

> diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
> index 7f47707a09..0b369d50a7 100644
> --- a/libavcodec/libaomenc.c
> +++ b/libavcodec/libaomenc.c
> @@ -572,15 +572,11 @@ static av_cold int aom_init(AVCodecContext *avctx,
>  enccfg.rc_target_bitrate = av_rescale_rnd(avctx->bit_rate, 1, 1000,
>AV_ROUND_NEAR_INF);
>  } else if (enccfg.rc_end_usage != AOM_Q) {
> -if (enccfg.rc_end_usage == AOM_CQ) {
> -enccfg.rc_target_bitrate = 100;
> -} else {
> -enccfg.rc_end_usage = AOM_Q;
> -ctx->crf = 32;
> -av_log(avctx, AV_LOG_WARNING,
> -   "Neither bitrate nor constrained quality specified, using 
> default CRF of %d\n",
> -   ctx->crf);
> -}
> +  enccfg.rc_end_usage = AOM_Q;
> +  ctx->crf = 32;
> +  av_log(avctx, AV_LOG_WARNING,
> + "Neither bitrate nor constrained quality specified, using 
> default CRF of %d\n",
> + ctx->crf);

Indent is off, I can fix this locally.

>  }
>
>  if (avctx->qmin >= 0)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] Delete unused branch in libaomenc

2019-09-18 Thread James Zern
On Wed, Sep 18, 2019 at 11:42 AM James Zern  wrote:
>
> On Sun, Sep 15, 2019 at 2:03 PM Elliott Karpilovsky
>  wrote:
> >
> > ---
> >  libavcodec/libaomenc.c | 14 +-
> >  1 file changed, 5 insertions(+), 9 deletions(-)
> >
>
> lgtm. This is leftover from libvpxenc, only vp8 can hit the path there.
>
> > diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
> > index 7f47707a09..0b369d50a7 100644
> > --- a/libavcodec/libaomenc.c
> > +++ b/libavcodec/libaomenc.c
> > @@ -572,15 +572,11 @@ static av_cold int aom_init(AVCodecContext *avctx,
> >  enccfg.rc_target_bitrate = av_rescale_rnd(avctx->bit_rate, 1, 1000,
> >AV_ROUND_NEAR_INF);
> >  } else if (enccfg.rc_end_usage != AOM_Q) {

Looks like this check might be unnecessary given the other checks in
the block above, but reorganizing that can be done in another patch.

> > -if (enccfg.rc_end_usage == AOM_CQ) {
> > -enccfg.rc_target_bitrate = 100;
> > -} else {
> > -enccfg.rc_end_usage = AOM_Q;
> > -ctx->crf = 32;
> > -av_log(avctx, AV_LOG_WARNING,
> > -   "Neither bitrate nor constrained quality specified, 
> > using default CRF of %d\n",
> > -   ctx->crf);
> > -}
> > +  enccfg.rc_end_usage = AOM_Q;
> > +  ctx->crf = 32;
> > +  av_log(avctx, AV_LOG_WARNING,
> > + "Neither bitrate nor constrained quality specified, using 
> > default CRF of %d\n",
> > + ctx->crf);
>
> Indent is off, I can fix this locally.
>
> >  }
> >
> >  if (avctx->qmin >= 0)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH V9] avcodec/libvpxenc: add ROI-based encoding support for VP8/VP9

2019-09-18 Thread James Zern
On Wed, Sep 18, 2019 at 7:54 AM Guo, Yejun  wrote:
>
>
>
> > -Original Message-
> > From: Guo, Yejun
> > Sent: Thursday, September 12, 2019 6:25 PM
> > To: ffmpeg-devel@ffmpeg.org
> > Cc: Guo, Yejun 
> > Subject: [PATCH V9] avcodec/libvpxenc: add ROI-based encoding support for
> > VP8/VP9
> >
> > example command line to verify it:
> > ./ffmpeg -i input.stream -vf addroi=0:0:iw/3:ih/3:-0.8 -c:v libvpx -b:v 2M
> > tmp.webm
> >
> > Signed-off-by: Guo, Yejun 
> > ---
> >  libavcodec/libvpxenc.c | 193
> > +
> >  libavcodec/version.h   |   2 +-
> >  2 files changed, 194 insertions(+), 1 deletion(-)
>
> ping for review, thanks.
>
> btw, the version number in libavcodec/version.h has been changed again,
> and I have to again rebase this patch. I hope to get comments if any and
> so I can put all needed changes in a new V10 patch.
>

lgtm. I can bump the version locally before pushing if there aren't
any more comments.

>
> >
> > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> > index feb52ea..95100b5 100644
> > --- a/libavcodec/libvpxenc.c
> > +++ b/libavcodec/libvpxenc.c
> > @@ -116,6 +116,11 @@ typedef struct VPxEncoderContext {
> >  int tune_content;
> >  int corpus_complexity;
> >  int tpl_model;
> > +/**
> > + * If the driver does not support ROI then warn the first time we
> > + * encounter a frame with ROI side data.
> > + */
> > +int roi_warned;
> >  } VPxContext;
> >
> >  /** String mappings for enum vp8e_enc_control_id */
> > @@ -1057,6 +1062,185 @@ static int queue_frames(AVCodecContext *avctx,
> > AVPacket *pkt_out)
> >  return size;
> >  }
> >
> > +static int set_roi_map(AVCodecContext *avctx, const AVFrameSideData *sd,
> > int frame_width, int frame_height,
> > +   vpx_roi_map_t *roi_map, int block_size, int
> > segment_cnt)
> > +{
> > +/**
> > + * range of vpx_roi_map_t.delta_q[i] is [-63, 63]
> > + */
> > +#define MAX_DELTA_Q 63
> > +
> > +const AVRegionOfInterest *roi = NULL;
> > +int nb_rois;
> > +uint32_t self_size;
> > +int segment_id;
> > +
> > +/* record the mapping from delta_q to "segment id + 1" in
> > segment_mapping[].
> > + * the range of delta_q is [-MAX_DELTA_Q, MAX_DELTA_Q],
> > + * and its corresponding array index is [0, 2 * MAX_DELTA_Q],
> > + * and so the length of the mapping array is 2 * MAX_DELTA_Q + 1.
> > + * "segment id + 1", so we can say there's no mapping if the value of
> > array element is zero.
> > + */
> > +int segment_mapping[2 * MAX_DELTA_Q + 1] = { 0 };
> > +
> > +memset(roi_map, 0, sizeof(*roi_map));
> > +
> > +/* segment id 0 in roi_map is reserved for the areas not covered by
> > AVRegionOfInterest.
> > + * segment id 0 in roi_map is also for the areas with
> > AVRegionOfInterest.qoffset near 0.
> > + * (delta_q of segment id 0 is 0).
> > + */
> > +segment_mapping[MAX_DELTA_Q] = 1;
> > +segment_id = 1;
> > +
> > +roi = (const AVRegionOfInterest*)sd->data;
> > +self_size = roi->self_size;
> > +if (!self_size || sd->size % self_size) {
> > +av_log(avctx, AV_LOG_ERROR, "Invalid
> > AVRegionOfInterest.self_size.\n");
> > +return AVERROR(EINVAL);
> > +}
> > +nb_rois = sd->size / self_size;
> > +
> > +/* This list must be iterated from zero because regions are
> > + * defined in order of decreasing importance. So discard less
> > + * important areas if they exceed the segment count.
> > + */
> > +for (int i = 0; i < nb_rois; i++) {
> > +int delta_q;
> > +int mapping_index;
> > +
> > +roi = (const AVRegionOfInterest*)(sd->data + self_size * i);
> > +if (!roi->qoffset.den) {
> > +av_log(avctx, AV_LOG_ERROR,
> > "AVRegionOfInterest.qoffset.den must not be zero.\n");
> > +return AVERROR(EINVAL);
> > +}
> > +
> > +delta_q = (int)(roi->qoffset.num * 1.0f / roi->qoffset.den *
> > MAX_DELTA_Q);
> > +delta_q = av_clip(delta_q, -MAX_DELTA_Q, MAX_DELTA_Q);
> > +
> > +mapping_index = delta_q + MAX_DELTA_Q;
> > +if (!segment_mapping[mapping_index]) {
> > +if (segment_id == segment_cnt) {
> > +av_log(avctx, AV_LOG_WARNING,
> > +   "ROI only supports %d segments (and segment 0
> > is reserved for non-ROIs), skipping the left ones.\n",
> > +   segment_cnt);
> > +break;
> > +}
> > +
> > +segment_mapping[mapping_index] = segment_id + 1;
> > +roi_map->delta_q[segment_id] = delta_q;
> > +segment_id++;
> > +}
> > +}
> > +
> > +roi_map->rows = (frame_height + block_size - 1) / block_size;
> > +roi_map->cols = (frame_width  + block_size - 1) / block_size;
> > +roi_map->roi_map = av_mallocz_array(roi_map->rows * roi_map->cols,
> > sizeof(*roi_map->roi_map));
> > +if (!roi_map->

Re: [FFmpeg-devel] [PATCH V9] avcodec/libvpxenc: add ROI-based encoding support for VP8/VP9

2019-09-20 Thread James Zern
On Wed, Sep 18, 2019 at 12:03 PM James Zern  wrote:
>
> On Wed, Sep 18, 2019 at 7:54 AM Guo, Yejun  wrote:
> >
> >
> >
> > > -Original Message-
> > > From: Guo, Yejun
> > > Sent: Thursday, September 12, 2019 6:25 PM
> > > To: ffmpeg-devel@ffmpeg.org
> > > Cc: Guo, Yejun 
> > > Subject: [PATCH V9] avcodec/libvpxenc: add ROI-based encoding support for
> > > VP8/VP9
> > >
> > > example command line to verify it:
> > > ./ffmpeg -i input.stream -vf addroi=0:0:iw/3:ih/3:-0.8 -c:v libvpx -b:v 2M
> > > tmp.webm
> > >
> > > Signed-off-by: Guo, Yejun 
> > > ---
> > >  libavcodec/libvpxenc.c | 193
> > > +
> > >  libavcodec/version.h   |   2 +-
> > >  2 files changed, 194 insertions(+), 1 deletion(-)
> >
> > ping for review, thanks.
> >
> > btw, the version number in libavcodec/version.h has been changed again,
> > and I have to again rebase this patch. I hope to get comments if any and
> > so I can put all needed changes in a new V10 patch.
> >
>
> lgtm. I can bump the version locally before pushing if there aren't
> any more comments.
>

applied, thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] Delete unused branch in libaomenc

2019-09-20 Thread James Zern
On Wed, Sep 18, 2019 at 11:42 AM James Zern  wrote:
>
> On Sun, Sep 15, 2019 at 2:03 PM Elliott Karpilovsky
>  wrote:
> >
> > ---
> >  libavcodec/libaomenc.c | 14 +-
> >  1 file changed, 5 insertions(+), 9 deletions(-)
> >
>
> lgtm. This is leftover from libvpxenc, only vp8 can hit the path there.
>

applied, thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] tools/patcheck: remove gcc-2.95 compat check

2019-09-20 Thread James Zern
this conflicts with the current contributing guidance:
http://ffmpeg.org/developer.html#Contributing
FFmpeg is programmed in the ISO C90 language with a few additional
features from ISO C99, namely:
...
for loops with variable definition (‘for (int i = 0; i < 8; i++)’);

Signed-off-by: James Zern 
---
 tools/patcheck | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/patcheck b/tools/patcheck
index 101a542ff3..fe52938f29 100755
--- a/tools/patcheck
+++ b/tools/patcheck
@@ -50,7 +50,6 @@ hiegrep ';;'  'double ;' $*
 hiegrep2 '\b_[a-zA-Z0-9_]{1,}' '__(asm|attribute)([^a-zA-Z0-9]|$)' 'reserved 
identifer' $*
 hiegrep '//[-/<\* ]*$''empty comment' $*
 hiegrep '/\*[-<\* ]*\*/'  'empty comment' $*
-hiegrep 'for *\( *'"$ERE_PRITYP"' '  'not gcc 2.95 compatible' $*
 hiegrep '(static|inline|const) *\1[^_a-zA-Z]'  'duplicate word' $*
 hiegrep 'INIT_VLC_USE_STATIC' 'forbidden ancient vlc type' $*
 hiegrep '=[-+\*\&] ' 'looks like compound assignment' $*
-- 
2.23.0.351.gc4317032e6-goog

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] tools/patcheck: remove gcc-2.95 compat check

2019-09-21 Thread James Zern
On Fri, Sep 20, 2019 at 12:38 AM Paul B Mahol  wrote:
>
> LGTM
>
> On 9/20/19, James Zern  wrote:
> > this conflicts with the current contributing guidance:
> > http://ffmpeg.org/developer.html#Contributing
> > FFmpeg is programmed in the ISO C90 language with a few additional
> > features from ISO C99, namely:
> > ...
> > for loops with variable definition (‘for (int i = 0; i < 8; i++)’);
> >
> > Signed-off-by: James Zern 
> > ---
> >  tools/patcheck | 1 -
> >  1 file changed, 1 deletion(-)
> >

applied.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] Change libvpxenc default to crf=32.

2019-10-05 Thread James Zern
On Tue, Sep 24, 2019 at 4:31 PM Elliott Karpilovsky
 wrote:
>
> Current default is 200kbps, which produces inconsistent
> results (too high for low-res, too low for hi-res). Use
> CRF instead, which will adapt. Affects VP9. Also have
> VP8 use a default bitrate of 256kbps.
> ---
>  libavcodec/libvpxenc.c | 74 +++---
>  libavcodec/version.h   |  2 +-
>  2 files changed, 64 insertions(+), 12 deletions(-)
>

lgtm. I'll apply this soon.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] Change libvpxenc default to crf=32.

2019-10-07 Thread James Zern
On Sat, Oct 5, 2019 at 1:23 PM James Zern  wrote:
>
> On Tue, Sep 24, 2019 at 4:31 PM Elliott Karpilovsky
>  wrote:
> >
> > Current default is 200kbps, which produces inconsistent
> > results (too high for low-res, too low for hi-res). Use
> > CRF instead, which will adapt. Affects VP9. Also have
> > VP8 use a default bitrate of 256kbps.
> > ---
> >  libavcodec/libvpxenc.c | 74 +++---
> >  libavcodec/version.h   |  2 +-
> >  2 files changed, 64 insertions(+), 12 deletions(-)
> >
>
> lgtm. I'll apply this soon.

applied. thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 2/6] avcodec/libvpxenc: only allocate U/V planes once for the alpha encoder instance

2019-11-01 Thread James Zern
On Sun, Oct 27, 2019 at 10:11 AM Marton Balint  wrote:
>
> Signed-off-by: Marton Balint 
> ---
>  libavcodec/libvpxenc.c | 44 +++-
>  1 file changed, 23 insertions(+), 21 deletions(-)
>

The encoder can handle frame size changes. This seems to assume the
size will be constant when using alpha or we'll get a reinit.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 1/6] avcodec/libvpxenc: fix alpha stride

2019-11-01 Thread James Zern
On Sun, Oct 27, 2019 at 10:10 AM Marton Balint  wrote:
>
> Signed-off-by: Marton Balint 
> ---
>  libavcodec/libvpxenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

lgtm.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 4/6] avcodec/libvpxdec: pass decoder instances to vpx_init directly

2019-11-01 Thread James Zern
On Sun, Oct 27, 2019 at 10:11 AM Marton Balint  wrote:
>
> If the alpha decoder init failed we presented the error message from the 
> normal
> decoder. This change should prevent such mistakes.
>
> Signed-off-by: Marton Balint 
> ---
>  libavcodec/libvpxdec.c | 26 +-
>  1 file changed, 13 insertions(+), 13 deletions(-)
>

lgtm.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 3/6] avcodec/libvpxdec: make sure BlockAdditional side data size >= 8

2019-11-01 Thread James Zern
On Sun, Oct 27, 2019 at 10:11 AM Marton Balint  wrote:
>
> Signed-off-by: Marton Balint 
> ---
>  libavcodec/libvpxdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

lgtm. good catch.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 5/6] avcodec/libvpxdec: decode to custom framebuffers for vp9

2019-11-01 Thread James Zern
On Sun, Oct 27, 2019 at 10:11 AM Marton Balint  wrote:
>
> This avoids copying the full frame after decoding.
>
> Signed-off-by: Marton Balint 
> ---
>  libavcodec/libvpxdec.c | 73 
> ++
>  1 file changed, 68 insertions(+), 5 deletions(-)
>

lgtm.

> diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
> index 5c72be5439..fdd5d458d3 100644
> [...]
> +if (min_size > ctx->pool_size) {
> +av_buffer_pool_uninit(&ctx->pool);
> +/* According to the libvpx docs the buffer must be zeroed out. */

I think this is stale and may have been only when using msan and
related tools at one point. We can start with this to cover older
versions, but for reference, Chrome doesn't 0 the buffers.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 6/6] avcodec/libvpxdec: reject video and alpha dimension mismatches

2019-11-01 Thread James Zern
On Sun, Oct 27, 2019 at 10:11 AM Marton Balint  wrote:
>
> Signed-off-by: Marton Balint 
> ---
>  libavcodec/libvpxdec.c | 11 +++
>  1 file changed, 11 insertions(+)
>

lgtm.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCHv2 2/6] avcodec/libvpxenc: only allocate alpha U/V planes on size changes

2019-11-04 Thread James Zern
On Sat, Nov 2, 2019 at 9:20 AM Marton Balint  wrote:
>
> Signed-off-by: Marton Balint 
> ---
>  libavcodec/libvpxenc.c | 60 
> ++
>  1 file changed, 36 insertions(+), 24 deletions(-)
>

lgtm. I'll apply this set of patches soon if there aren't any further comments.

> [...]
> +static int realloc_alpha_uv(AVCodecContext *avctx, int width, int height)
> +{
> +VPxContext *ctx = avctx->priv_data;
> +struct vpx_image *rawimg_alpha = &ctx->rawimg_alpha;
> +unsigned char **planes = rawimg_alpha->planes;
> +int *stride = rawimg_alpha->stride;
> +
> +if (!planes[VPX_PLANE_U] ||
> +!planes[VPX_PLANE_V] ||
> +width  != (int)rawimg_alpha->d_w ||
> +height != (int)rawimg_alpha->d_h)
> +{

This should be joined with the previous line, I've updated it locally.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCHv2 2/6] avcodec/libvpxenc: only allocate alpha U/V planes on size changes

2019-11-05 Thread James Zern
On Mon, Nov 4, 2019 at 4:55 PM James Zern  wrote:
>
> On Sat, Nov 2, 2019 at 9:20 AM Marton Balint  wrote:
> >
> > Signed-off-by: Marton Balint 
> > ---
> >  libavcodec/libvpxenc.c | 60 
> > ++
> >  1 file changed, 36 insertions(+), 24 deletions(-)
> >
>
> lgtm. I'll apply this set of patches soon if there aren't any further 
> comments.
>

applied, thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 5/6] avcodec/libvpxdec: decode to custom framebuffers for vp9

2019-11-05 Thread James Zern
On Fri, Nov 1, 2019 at 1:01 PM James Zern  wrote:
>
> On Sun, Oct 27, 2019 at 10:11 AM Marton Balint  wrote:
> >
> > This avoids copying the full frame after decoding.
> >
> > Signed-off-by: Marton Balint 
> > ---
> >  libavcodec/libvpxdec.c | 73 
> > ++
> >  1 file changed, 68 insertions(+), 5 deletions(-)
> >
>
> lgtm.
>

applied, thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 4/6] avcodec/libvpxdec: pass decoder instances to vpx_init directly

2019-11-05 Thread James Zern
On Fri, Nov 1, 2019 at 11:55 AM James Zern  wrote:
>
> On Sun, Oct 27, 2019 at 10:11 AM Marton Balint  wrote:
> >
> > If the alpha decoder init failed we presented the error message from the 
> > normal
> > decoder. This change should prevent such mistakes.
> >
> > Signed-off-by: Marton Balint 
> > ---
> >  libavcodec/libvpxdec.c | 26 +-
> >  1 file changed, 13 insertions(+), 13 deletions(-)
> >
>
> lgtm.

applied, thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 6/6] avcodec/libvpxdec: reject video and alpha dimension mismatches

2019-11-05 Thread James Zern
On Fri, Nov 1, 2019 at 1:01 PM James Zern  wrote:
>
> On Sun, Oct 27, 2019 at 10:11 AM Marton Balint  wrote:
> >
> > Signed-off-by: Marton Balint 
> > ---
> >  libavcodec/libvpxdec.c | 11 +++
> >  1 file changed, 11 insertions(+)
> >
>
> lgtm.

applied, thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 1/6] avcodec/libvpxenc: fix alpha stride

2019-11-05 Thread James Zern
On Fri, Nov 1, 2019 at 11:47 AM James Zern  wrote:
>
> On Sun, Oct 27, 2019 at 10:10 AM Marton Balint  wrote:
> >
> > Signed-off-by: Marton Balint 
> > ---
> >  libavcodec/libvpxenc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
>
> lgtm.

applied, thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 3/6] avcodec/libvpxdec: make sure BlockAdditional side data size >= 8

2019-11-05 Thread James Zern
On Fri, Nov 1, 2019 at 11:52 AM James Zern  wrote:
>
> On Sun, Oct 27, 2019 at 10:11 AM Marton Balint  wrote:
> >
> > Signed-off-by: Marton Balint 
> > ---
> >  libavcodec/libvpxdec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
>
> lgtm. good catch.

applied, thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [FFmpeg-cvslog] avcodec/libvpxdec: reject video and alpha dimension mismatches

2019-11-06 Thread James Zern
On Wed, Nov 6, 2019 at 2:21 AM Carl Eugen Hoyos  wrote:
>
> Am Mi., 6. Nov. 2019 um 08:28 Uhr schrieb Marton Balint :
> > [...]
> > +if (ctx->has_alpha_channel &&
> > +(img->d_w != img_alpha->d_w ||
> > + img->d_h != img_alpha->d_h ||
> > + img->bit_depth != img_alpha->bit_depth)) {
> > +av_log(avctx, AV_LOG_ERROR,
> > +   "Video dimensions %dx%d@%dbpp differ from alpha 
> > dimensions %dx%d@%dbpp\n",
> > +   img->d_w, img->d_h, img->bit_depth,
> > +   img_alpha->d_w, img_alpha->d_h, img_alpha->bit_depth);
> > +return AVERROR_INVALIDDATA;
>
> Shouldn't this be "bpc" instead of "bpp"?
>

I tend to use them interchangeably, but bpc may be more precise here.
I sent a patch.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avcodec/libvpxdec.c,cosmetics: bpp -> bpc

2019-11-06 Thread James Zern
Signed-off-by: James Zern 
---
 libavcodec/libvpxdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index 1ae2361167..1063c546b0 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -288,7 +288,7 @@ static int vpx_decode(AVCodecContext *avctx,
  img->d_h != img_alpha->d_h ||
  img->bit_depth != img_alpha->bit_depth)) {
 av_log(avctx, AV_LOG_ERROR,
-   "Video dimensions %dx%d@%dbpp differ from alpha dimensions 
%dx%d@%dbpp\n",
+   "Video dimensions %dx%d@%dbpc differ from alpha dimensions 
%dx%d@%dbpc\n",
img->d_w, img->d_h, img->bit_depth,
img_alpha->d_w, img_alpha->d_h, img_alpha->bit_depth);
 return AVERROR_INVALIDDATA;
-- 
2.24.0.432.g9d3f5f5b63-goog

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] doc/encoders: add VP9 temporal scalability encoding option

2019-12-17 Thread James Zern
Hi,

On Mon, Dec 16, 2019 at 2:21 PM Wonkap Jang
 wrote:
>
> Documentation change for adding support for encoding
> with temporal scalability in VP9.
> ---

This part sounds related to the other patches you're sending. The
documentation can be added with the code change for vp9.

>  doc/encoders.texi | 23 ++-
>  1 file changed, 18 insertions(+), 5 deletions(-)
>
> diff --git a/doc/encoders.texi b/doc/encoders.texi
> index 4ee518a124..7efc446a6c 100644
> --- a/doc/encoders.texi
> +++ b/doc/encoders.texi
> [...]
>  ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
> -ts_target_bitrate=25,50,100:ts_rate_decimator=4,2,1:\
> -ts_periodicity=4:ts_layer_id=0,2,1,2 OUTPUT
> +ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\
> +ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT
>  @end example
>  Below is a brief explanation of each of the parameters, please
>  refer to @code{struct vpx_codec_enc_cfg} in @code{vpx/vpx_encoder.h} for more
> @@ -1903,13 +1901,28 @@ details.
>  @item ts_number_layers
>  Number of temporal coding layers.
>  @item ts_target_bitrate
> -Target bitrate for each temporal layer.
> +Target bitrate for each temporal layer in kbps.
> +(bitrate should be inclusive of the lower temporal layer).

This portion is a bug fix for the existing docs (bps -> kbps). Can you
split this out to its own patch?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] doc/encoders: add VP9 temporal scalability encoding option

2019-12-18 Thread James Zern
Hi,

On Wed, Dec 18, 2019 at 10:16 AM Wonkap Jang  wrote:
>
> Hi James,
>
> Some of the changes are on lines right next to each other, and will cause
> conflict... I could make it a separate commit...
> Would that work?
> So, I would make docs into two separate commits and the code already has
> two commits... so overall 4 commits in succession.
>

The doc fix should land quickly, so the other could be rebased after that.

> Would this work?
>
> Thank you,
>
> Wonkap
>
>
> On Tue, Dec 17, 2019 at 5:59 PM James Zern 
> wrote:
>
> > Hi,
> >
> > On Mon, Dec 16, 2019 at 2:21 PM Wonkap Jang
> >  wrote:
> > >
> > > Documentation change for adding support for encoding
> > > with temporal scalability in VP9.
> > > ---
> >
> > This part sounds related to the other patches you're sending. The
> > documentation can be added with the code change for vp9.
> >
> > >  doc/encoders.texi | 23 ++-
> > >  1 file changed, 18 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/doc/encoders.texi b/doc/encoders.texi
> > > index 4ee518a124..7efc446a6c 100644
> > > --- a/doc/encoders.texi
> > > +++ b/doc/encoders.texi
> > > [...]
> > >  ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
> > > -ts_target_bitrate=25,50,100:ts_rate_decimator=4,2,1:\
> > > -ts_periodicity=4:ts_layer_id=0,2,1,2 OUTPUT
> > > +ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\
> > > +ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT
> > >  @end example
> > >  Below is a brief explanation of each of the parameters, please
> > >  refer to @code{struct vpx_codec_enc_cfg} in @code{vpx/vpx_encoder.h}
> > for more
> > > @@ -1903,13 +1901,28 @@ details.
> > >  @item ts_number_layers
> > >  Number of temporal coding layers.
> > >  @item ts_target_bitrate
> > > -Target bitrate for each temporal layer.
> > > +Target bitrate for each temporal layer in kbps.
> > > +(bitrate should be inclusive of the lower temporal layer).
> >
> > This portion is a bug fix for the existing docs (bps -> kbps). Can you
> > split this out to its own patch?
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] doc/encoders: correct the description for ts_target_bitrate

2019-12-18 Thread James Zern
Hi,

On Wed, Dec 18, 2019 at 1:17 PM Wonkap Jang
 wrote:
>
> ts_target_bitrate is in kbps, not bps. This commit clarifies the unit
> and modifies the example to match the description.
> ---
>  doc/encoders.texi | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>

lgtm if you can verify that with the libvpx implementation and update
the docs [1].

[1] 
https://chromium.googlesource.com/webm/libvpx/+/refs/heads/master/vpx/vpx_encoder.h#646
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] doc/encoders: correct the description for ts_target_bitrate

2019-12-19 Thread James Zern
Hi,

On Wed, Dec 18, 2019 at 2:00 PM Wonkap Jang
 wrote:
>
> Hi James,
>
> I have updated the libvpx.
> https://chromium-review.googlesource.com/c/webm/libvpx/+/1974899
>

Thanks for posting the patch. Remember top-posting isn't preferred on
this mailing list [1].

[1] http://ffmpeg.org/contact.html#MailingLists

> Thank you,
>
> Wonkap
>
> On Wed, Dec 18, 2019 at 1:39 PM James Zern 
> wrote:
>
> > Hi,
> >
> > On Wed, Dec 18, 2019 at 1:17 PM Wonkap Jang
> >  wrote:
> > >
> > > ts_target_bitrate is in kbps, not bps. This commit clarifies the unit
> > > and modifies the example to match the description.
> > > ---
> > >  doc/encoders.texi | 5 +++--
> > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > >
> >
> > lgtm if you can verify that with the libvpx implementation and update
> > the docs [1].
> >
> > [1]
> > https://chromium.googlesource.com/webm/libvpx/+/refs/heads/master/vpx/vpx_encoder.h#646
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] Add a commandline option to control loop restoration for libaom

2019-12-20 Thread James Zern
On Wed, Dec 18, 2019 at 7:25 PM Wang Cao  wrote:
>
> Signed-off-by: Wang Cao 
> ---
>  libavcodec/libaomenc.c | 6 ++

Can you update doc/encoders.texi with this detail please?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] doc/encoders: correct the description for ts_target_bitrate

2019-12-20 Thread James Zern
On Wed, Dec 18, 2019 at 4:17 PM Wonkap Jang
 wrote:
>
> ts_target_bitrate is in kbps, not bps. This commit clarifies the unit
> and modifies the example to match the description.
> ---
>  doc/encoders.texi | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>

applied, thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH V1 04/12] lavc/libvpxenc: fix memory leak after av_dict_parse_string fail

2020-01-03 Thread James Zern
Hi,

On Tue, Dec 31, 2019 at 9:21 PM Jun Zhao  wrote:
>
> From: Jun Zhao 
>
> In case of failure, all the successfully set entries are stored in
> *pm. We need to manually free the created dictionary to avoid
> memory leak.
>
> Signed-off-by: Jun Zhao 
> ---
>  libavcodec/libvpxenc.c |3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>

I think this is unnecessary after:
9ac1066dc6 avcodec/libvpxenc: use AV_OPT_TYPE_DICT for ts-parameters
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avcodec/libvpxenc, cosmetics: prefer sizeof(var)

2020-01-03 Thread James Zern
Signed-off-by: James Zern 
---
 libavcodec/libvpxenc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 3f659b4b67..0b8a070304 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -1041,8 +1041,7 @@ static int queue_frames(AVCodecContext *avctx, AVPacket 
*pkt_out)
 if (size < 0)
 return size;
 } else {
-struct FrameListData *cx_frame =
-av_malloc(sizeof(struct FrameListData));
+struct FrameListData *cx_frame = av_malloc(sizeof(*cx_frame));
 
 if (!cx_frame) {
 av_log(avctx, AV_LOG_ERROR,
-- 
2.24.1.735.g03f4e72817-goog

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

  1   2   3   4   5   >