[FFmpeg-devel] deduplicated [PATCH] Cinepak: speed up decoding several-fold, depending on the scenario, by supporting multiple output pixel formats.

u-9iep at aetey.se u-9iep at aetey.se
Mon Feb 13 19:51:39 EET 2017


On Mon, Feb 13, 2017 at 02:23:47PM +0100, Paul B Mahol wrote:
> >> @@ -488,4 +1026,6 @@ AVCodec ff_cinepak_decoder = {
> >>      .close          = cinepak_decode_end,
> >>      .decode         = cinepak_decode_frame,
> >>      .capabilities   = AV_CODEC_CAP_DR1,
> >> +    .pix_fmts       = pixfmt_list,

> > [...]

> Is this new mini swscale?

Generality of swscaler is traded away to be able to fuse the conversion
with the decoder. In this special case this is remarkably fruitful,
while definitely not applicable "en masse".

If there were at least another practical codec with similar properties,
it might be nice to refactor such "codebook-targeting format conversion"
to make it reusable. It would still be much smaller in scope than swscaler
and hence could be optimized more specifically.

I would like to find a rival to Cinepak and would happily do such a
refactoring (if applicable) for the sake of another fast-decodable codec,
but nothing I know of comes near enough to be practical.

Well, while we are at it, "general purpose" vs "game" codec aside,

RoQ decoding could be possibly made faster by building a full second
level codebook in advance and avoiding the double indirection later.
(This looks like what the "dreamroq" decoder does btw.)

While I do not expect that RoQ can be made faster than Cinepak (it
is more complex at decoding), it can be optimized against pixel format
conversions in the same way so it may be worth to give this a try.

Then abstracting a "mini-swscale" could become justifiable.

Regards,
Rune



More information about the ffmpeg-devel mailing list