[FFmpeg-devel] [PATCH] libvpx: deadline & profile support

Michael Niedermayer michaelni
Sun Jul 11 14:58:37 CEST 2010


On Mon, Jun 14, 2010 at 04:20:20PM -0400, James Zern wrote:
> The attached makes a pass at mapping the libvpx deadline, cpuused,
> error resilience and profile parameters.
> The first three are combined into level with deadline in the hundred's
> place and cpuused from 0-32, with a negative level setting error
> resilience. This results in only mapping the pre-defined deadline
> values (encode takes a microsecond value) and does combine slightly
> unrelated parameters, so suggestions for a better setup are more than
> welcome.
> 
> * Error resilient mode indicates to the encoder that it should take
> * measures appropriate for streaming over lossy or noisy links, if
> * possible. Set to 1 to enable this feature, 0 to disable it.
> g_error_resilient;
> 
> Description of cpuused in relation to deadline [1].
> 
> [1]: http://www.webmproject.org/tools/encoder-parameters/#2_encode_quality_vs_speed

>  libvpxenc.c |   24 +++++++++++++++++++++++-
>  1 file changed, 23 insertions(+), 1 deletion(-)
> 723c6fa604e36133854e290461f06bb4907a826e  libvpx-deadline_mapping.diff
> Index: libavcodec/libvpxenc.c
> ===================================================================
> --- libavcodec/libvpxenc.c	(revision 23607)
> +++ libavcodec/libvpxenc.c	(working copy)
> @@ -276,7 +276,29 @@ static av_cold int vp8_init(AVCodecConte
>          enccfg.rc_twopass_stats_in = ctx->twopass_stats;
>      }
>  
> -    ctx->deadline = VPX_DL_GOOD_QUALITY;

> +    /* 0-3: For non-zero values the encoder increasingly optimizes for reduced
> +       complexity playback on low powered devices at the expense of encode
> +       quality. */
> +    if (avctx->profile != FF_PROFILE_UNKNOWN)
> +        enccfg.g_profile = avctx->profile;

ok


> +    switch (FFABS(avctx->level) / 100) {
> +    case 1:
> +        ctx->deadline = VPX_DL_BEST_QUALITY;
> +        break;
> +    case 2:
> +    default:
> +        ctx->deadline = VPX_DL_GOOD_QUALITY;
> +        break;
> +    case 3:
> +        ctx->deadline = VPX_DL_REALTIME;
> +        break;
> +    }
> +    av_log(avctx, AV_LOG_DEBUG, "Using deadline: %lu\n", ctx->deadline);

avctx->level and ctx->deadline seem to differ in semantics, so iam not
in favor of this

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100711/a51acc27/attachment.pgp>



More information about the ffmpeg-devel mailing list