mbox series

[FFmpeg-devel,0/2] libavcodec/sanm: enhancements

Message ID 20241108085504.351017-1-manuel.lauss@gmail.com
Headers show
Series libavcodec/sanm: enhancements | expand

Message

Manuel Lauss Nov. 8, 2024, 8:55 a.m. UTC
This set of 2 patches adds support for SMUSH codec47 subcodec1 interpolation
table support, and fixes handling of the SMUSH XPAL (delta palette) chunk.

Patch 1 aims to reduce the blockyness of quarter-sized keyframes: the codec
stream provides data to construct a 256x256 table where the values of 2
adjacent pixels can be used as an index into this table to get a new pixel
value to place in between the 2 reference pixels.  The current subcodec1
implementation just creates a 2x2 block of the source pixel.

Patch 2 fixes the intended fadeout of the scene in the LucasArts Outlaws
RAE.SAN (ending) file. Now the there is a proper fadeout and
fade-day-to-night transition instead of a sudden black screen.

See [1] and [2] for a before and after the patch video.


Tested with mpv on all the SAN videos of LucarArts Outlaws and
Curse of Monkey Island games (both use SMUSH codec47).

[1] http://mlau.at/sanm-before.webm  (1,7MB, 40s)
[2] http://mlau.at/sanm-after.webm   (3,2MB, 61s)

Manuel Lauss (2):
  libavcodec/sanm: add codec47 interpolation table support
  libavcodec/sanm: fix XPAL handling

 libavcodec/sanm.c | 136 +++++++++++++++++++++++++++++++++-------------
 1 file changed, 97 insertions(+), 39 deletions(-)