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

Paul B Mahol onemda at gmail.com
Mon Aug 5 15:30:24 EEST 2019


On Mon, Aug 5, 2019 at 2:05 PM Lynne <dev at lynne.ee> wrote:

> Aug 5, 2019, 9:39 AM by onemda at gmail.com:
>
> > Hi,
> >
> > Patch attached.
> >
>
> > int run = FFMIN(255, copy);
>
> Just replace all FFMIN(255 with av_clip_uint8, should be faster, in
> theory, on some platforms.
>
>
> > +        switch (s->pixel_size) {> +        case 3:> +
> bytestream2_put_le24(&s->pb, AV_RL24(src));> +            break;> +
> case 1:> +            bytestream2_put_byte(&s->pb, src[0]);> +
> break;> +        }
>
> Just replace all those switches with something line:
> if (s->pixel_size == 3)
>     bytestream2_put_le24(&s->pb, AV_RL24(src));
> else
>     bytestream2_put_byte(&s->pb, src[0]);
>
> 4 vs 8 lines.
>
>
> Also, how do you signal that compression was worse than encoding the frame
> directly? In the code you just jump to memcpying the frame to the packet.
> Does the decoder just assume if the packet size is the max packet size its
> uncompressed?
> If so you should check that the compressed stream isn't that same size by
> some chance, unless its impossible (e.g. compressed stream is always an odd
> amount of bytes or something).
>

It is that way handled in decoder. Also output of encoder works under WMP
if you use custom tag: 0x0001


>
> Rest looks fine.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list