[FFmpeg-devel] [PATCH] avcodec: add msrle encoder

Tomas Härdin tjoppen at acc.umu.se
Mon Aug 5 13:22:02 EEST 2019


mån 2019-08-05 klockan 10:39 +0200 skrev Paul B Mahol:
> Hi,
> 
> Patch attached.

> +static av_cold int msrle_encode_init(AVCodecContext *avctx)
> +{
> +    MsrleEncContext *s = avctx->priv_data;
> +
> +    if (av_image_check_size(avctx->width, avctx->height, 0, avctx) < 0)
> +        return AVERROR(EINVAL);

Maybe this check should be further up in lavc? It's done for quite a
few codecs. Doesn't need to hold this patch up tho

> +    if (avctx->gop_size == 0 || (avctx->frame_number % avctx->gop_size) == 0) {
> +        /* I-Frame */
> +        s->key_frame = 1;
> +    } else {
> +        /* P-Frame */
> +        s->key_frame = 0;
> +    }

Explicitly comparing I vs P would yield a better encoder

Patch looks OK enough, but that's mostly based on the quick glance I
gave the msrle spec on Mike's site

/Tomas




More information about the ffmpeg-devel mailing list