[FFmpeg-devel] [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
Tue Feb 7 20:44:59 EET 2017

Hello Ronald,

On Tue, Feb 07, 2017 at 10:29:01AM -0500, Ronald S. Bultje wrote:
> So, right now, the decoder outputs pal8 vs. rgb24 depending on the internal
> format of the bitstream, and you're changing it to do conversion so it
> outputs a selectable output format directly, right? (And then there's some
> discussion over how to select the format.)

A very good summary.

The only detail to note is that format conversion has always been done
inside the Cinepak decoder, the change does not "introduce" it in any way.

What is done is basically splitting the format conversion function which
until now did all the three conversions (palettized->pal8; grayscale->rgb24;
"cinepak"->rgb24) into separate functions, as a result each function
becoming simpler, faster and making it easy to produce "any" desired

> My personal opinion is that it's not worth it to do colorspace conversion
> of any sort, including palette resolution, in a decoder. I understand using
> swscale to do the conversion is slower, but cinepak is a fringe codec and a
> new haswell i7 isn't that expensive. (Code maintenance has a cost also.)

Your point about code maintenance cost basically boils down to Cinepak
not being considered worth improvement, because any change incurs a cost
here (among others, the time we spend on this discussion) and because
it is easy somewhere else in a foreign usage case to replace hardware
to more capable. The first part makes sense but the other is hardly solid.

One of the users spent quite a bit of effort on implementing the speedup,
this is at least some kind of indication of the usefulness.


More information about the ffmpeg-devel mailing list