On Sat, Jun 25, 2016 at 8:39 AM, Luca Barbato <[email protected]> wrote:
> The encoder produces bitstream compatible with the current specification
> and version 2 is set as reserved (non-standardizable).

How about "Version 2 has not been standardized and the value has been
set as reserved"

> ---
>
> Now with updated samples and version 3 non-experimental.
>
>  libavcodec/ffv1enc.c          | 72 
> +++++++++++++++++++++----------------------
>  tests/ref/seek/vsynth2-ffv1   | 40 ++++++++++++------------
>  tests/ref/vsynth/vsynth1-ffv1 |  4 +--
>  tests/ref/vsynth/vsynth2-ffv1 |  4 +--
>  4 files changed, 59 insertions(+), 61 deletions(-)
>
> diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
> index 7995376..342367c 100644
> --- a/libavcodec/ffv1enc.c
> +++ b/libavcodec/ffv1enc.c
> @@ -566,27 +547,44 @@ static av_cold int ffv1_encode_init(AVCodecContext 
> *avctx)
>
>      s->version = 0;
>
> -    if ((avctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) ||
> -        avctx->slices > 1)
> -        s->version = FFMAX(s->version, 2);
> -
> -    if (avctx->level == 3) {
> -        s->version = 3;
> +    switch (avctx->level) {
> +    case 3:
> +        break;
> +    case 2:
> +        av_log(avctx, AV_LOG_ERROR,
> +               "Version 2 had been deemed non-standard and deprecated "
> +               "the support for it had been removed\n");
> +        return AVERROR(ENOSYS);
> +    case 1:
> +    case 0:
> +        if (avctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) {
> +            av_log(avctx, AV_LOG_ERROR,
> +                   "Multiple pass encoding requires version 3.\n");
> +            return AVERROR(ENOSYS);
> +        }
> +        if (avctx->slices > 1) {
> +            av_log(avctx, AV_LOG_ERROR,
> +                   "Multiple slices support requires version 3.\n");
> +            return AVERROR(ENOSYS);
> +        }
> +        break;
> +    case -99:

use FF_PROFILE_UNKNOWN

> +        if ((avctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) ||
> +            avctx->slices > 1)
> +            s->version = 3;
> +        else
> +            s->version = 0;
> +        break;
> +    default:
> +        av_log(avctx, AV_LOG_ERROR, "Version %d not supported\n",
> +               avctx->level);
> +        return AVERROR(ENOSYS);

Why are you keeping version 0? isn't it going to trigger the assert below?

imho just drop anything below 3 and initialize some sane defaults.

>      }
>
>      if (s->ec < 0) {
>          s->ec = (s->version >= 3);
>      }
>
> -    if (s->version >= 2 &&
> -        avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
> -        av_log(avctx, AV_LOG_ERROR,
> -               "Version %d requested, please set -strict experimental in "
> -               "order to enable it\n",
> -               s->version);
> -        return AVERROR(ENOSYS);
> -    }
> -
>  #if FF_API_CODER_TYPE
>  FF_DISABLE_DEPRECATION_WARNINGS
>      if (avctx->coder_type != -1)
> @@ -754,7 +752,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
>          int gob_count = 0;
>          char *next;
>
> -        av_assert0(s->version >= 2);
> +        av_assert0(s->version > 2);
>
>          for (;; ) {
>              for (j = 0; j < 256; j++)


-- 
Vittorio
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to