Re: [FFmpeg-devel] [PATCH 3/4] avcodec/sanm: Check w, h for subversion < 2

2025-07-03 Thread Manuel Lauss
Servus Michael, On Thu, Jun 19, 2025 at 5:05 AM Michael Niedermayer wrote: > > Fixes: > 410609432/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SANM_fuzzer-4935159201988608 > Fixes: out of array access > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master

Re: [FFmpeg-devel] [PATCH 4/4] avcodec/sanm: Check thet left/top is within the w/h

2025-07-03 Thread Manuel Lauss
On Thu, Jun 19, 2025 at 5:05 AM Michael Niedermayer wrote: > > Fixes: > 423673969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SANM_fuzzer-5466731806261248 > Fixes: out of array access > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/sanm: avoid using k in left pxoff check

2025-06-04 Thread Manuel Lauss
Servus Michael, On Wed, Jun 4, 2025 at 1:00 PM Michael Niedermayer wrote: > > On Tue, Jun 03, 2025 at 12:30:40PM +0200, Manuel Lauss wrote: > > Servus Michael, > > > > On Sat, May 31, 2025 at 12:51 AM Michael Niedermayer > > wrote: > > > > > &g

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/sanm: avoid using k in left pxoff check

2025-06-03 Thread Manuel Lauss
Servus Michael, On Sat, May 31, 2025 at 12:51 AM Michael Niedermayer wrote: > > > > /* smooth top and left block borders with neighbours */ > > > > -if (((pxoff - p + k) < 0) || ((pxoff - p + k) >= maxpxo) > > > > +if (((pxoff - p + 0) < 0) || ((pxoff - p + k

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/sanm: avoid using k in left pxoff check

2025-05-30 Thread Manuel Lauss
Hi Michael, On Fri, May 30, 2025 at 9:52 PM Michael Niedermayer wrote: > > Hi Manual > > On Wed, May 14, 2025 at 03:39:53AM +0200, Michael Niedermayer wrote: > > k is always 4 here and it seems this is not what was intended > > replacing it with 0 works but it may be wrong > > > > This needs revi

[FFmpeg-devel] [PATCH 0/2] avcodec/sanm: SEGA-CD codecs support

2025-05-30 Thread Manuel Lauss
2 patches to fix video playback of Rebel Assault 1 SEGA-CD Version. The code for this was reversed from the latest DOS EXE and tested with content from the SEGA-CD release. See https://ibb.co/QvsbpWY9 for before/after screenshots. Manuel Lauss (2): avcodec/sanm: fix codec33/34 tile generator

[FFmpeg-devel] [PATCH 2/2] avcodec/sanm: codec31/32 (SEGA-CD) support

2025-05-30 Thread Manuel Lauss
codec31/32 are like codec1/3 (RLE coding) but with 2 4-bit pixels per byte. --- libavcodec/sanm.c | 59 +++ 1 file changed, 59 insertions(+) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 46cad3c703..975f33992f 100644 --- a/libavcodec/sanm.c +

[FFmpeg-devel] [PATCH 1/2] avcodec/sanm: fix codec33/34 tile generator

2025-05-30 Thread Manuel Lauss
tested with LVL11/L11PLAY.ANM from Rebel Assault Sega-CD release. --- libavcodec/sanm.c | 33 +++-- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 00bfef00fe..46cad3c703 100644 --- a/libavcodec/sanm.c +++ b/li

Re: [FFmpeg-devel] [PATCH v2 0/3] avcodec/sanm: Fixes for "StarWars - Making Magic"

2025-05-07 Thread Manuel Lauss
Hi, If there are no objections, I will commit this with whitespace fixes in 2-3 days. I see no regressions with existing sanm video support. Manuel On Tue, May 6, 2025 at 5:41 PM Manuel Lauss wrote: > > This patchset extends the SANM codec handler to support video of > the 1996 CD-

[FFmpeg-devel] [PATCH v2 3/3] avcodec/sanm: support "StarWars - Making Magic" video

2025-05-06 Thread Manuel Lauss
c37/47/48 need their 2/3 buffers to be private to themselves. The decoded result is then copied to the fbuf, honoring the left/top offsets if required. Signed-off-by: Manuel Lauss --- v2: reworded description, left/top need to be non-negative to consider the image to be copied to front buffe

[FFmpeg-devel] [PATCH v2 2/3] avcodec/sanm: recognize common FOBJ sizes

2025-05-06 Thread Manuel Lauss
Change the size detection a bit to recognize common video sizes, as the FOBJ codecs>=37 cannot always be trusted, since they can be embedded in a larger frame. Signed-off-by: Manuel Lauss --- v2: reworded description. libavcodec/sanm.c | 34 +++--- 1 file chan

[FFmpeg-devel] [PATCH v1 1/3] avcodec/sanm: ignore codec48 compression type 6

2025-05-06 Thread Manuel Lauss
Some videos of "StarWars - Making Magic" have this subcompression type: data just consists of the 16 byte codec48 header; the DOS player and the c48 decoder in the Myteries of the Sith game engine ignore it. Signed-off-by: Manuel Lauss --- v2: reworded description libavcodec/sanm.c

[FFmpeg-devel] [PATCH v2 0/3] avcodec/sanm: Fixes for "StarWars - Making Magic"

2025-05-06 Thread Manuel Lauss
7), MotS (c48) See https://ibb.co/73Pt803 for post/pre fix screenshots. Manuel Lauss (3): avcodec/sanm: ignore codec48 compression type 6 avcodec/sanm: add a whitelist for known FOBJ sizes avcodec/sanm: support "StarWars - Making Magic&qu

[FFmpeg-devel] [PATCH 3/3] avcodec/sanm: support "StarWars - Making Magic" video

2025-05-01 Thread Manuel Lauss
r buffers need to be private to themselves. The decoded result is then copied to the fbuf, honoring the x/y offsets if required. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 63 +++ 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a

[FFmpeg-devel] [PATCH 2/3] avcodec/sanm: add a whitelist for known FOBJ sizes

2025-05-01 Thread Manuel Lauss
Change the size detection a bit to recognize common video sizes, as the FOBJ codecs>=37 cannot always be trusted. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 34 +++--- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/libavcodec/sanm.

[FFmpeg-devel] [PATCH 1/3] avcodec/sanm: ignore codec48 compression type 6

2025-05-01 Thread Manuel Lauss
Some videos of "StarWars - Making Magic" have this subcompression type: data just consists of the 16 byte codec48 header; the DOS player simply treats it like nothing to do. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) di

[FFmpeg-devel] [PATCH 0/3] avcodec/sanm: Fixes for "StarWars - Making Magic"

2025-05-01 Thread Manuel Lauss
ic, the codec48 dimensions can no longer be blindly trusted. #3: support video of Making Magic. This patch also brings the fobj handling more in line with what the game engines actually do. Tested with RA1, RA2 (c37), Outlaws (c47), MotS (c48) See https://ibb.co/73Pt803 for post/pre fix scree

[FFmpeg-devel] [PATCH v3 07/14] avcodec/sanm: codec23 decoder

2025-03-17 Thread Manuel Lauss
This codec alternatingly skips and changes existing pixels. A second 16bit parameter in the FOBJ header indicates how to do the pixel changes: either by specifying a LUT in the codec datastream or by adding a constant value to the pixel. Signed-off-by: Manuel Lauss --- v2, v3: no changes

[FFmpeg-devel] [PATCH v3 11/14] avcodec/sanm: implement STOR/FTCH for ANIMv1

2025-03-17 Thread Manuel Lauss
Assault 1 for e.g. backgrounds and the cockpit overlay. For ANIMv2 keep the current system to store the decoded image, as replaying a FOBJ would not work with codecs37/47/48 due to sequence violations. Signed-off-by: Manuel Lauss --- v3: removed the check for dimensions-set-in-stone before queueing a

[FFmpeg-devel] [PATCH v3 06/14] avcodec/sanm: codec2 decoder

2025-03-17 Thread Manuel Lauss
this codec consists of 4 byte packets: 2bytes delta-x, 1 byte delta-y and 1 byte color to put at that spot. Used in Rebel Assault 1 only. Signed-off-by: Manuel Lauss --- v2, v3: no changes. libavcodec/sanm.c | 20 1 file changed, 20 insertions(+) diff --git a/libavcodec

[FFmpeg-devel] [PATCH v3 03/14] avcodec/sanm: better frame size detection for old codecs

2025-03-17 Thread Manuel Lauss
me to the determined dimensions. Tested with RA1, RA2, Full Throttle, Dig, Outlaws, SotE and MotS videos. Signed-off-by: Manuel Lauss --- v2, v3: no changes libavcodec/sanm.c | 63 --- 1 file changed, 49 insertions(+), 14 deletions(-) diff --

[FFmpeg-devel] [PATCH v3 10/14] avcodec/sanm: codec37: reimplement comp4

2025-03-17 Thread Manuel Lauss
Compression 4 code 0 means copy from delta buffer without mv, AND start of a skip run. This gets rid of the extra case and column index manipulation and implements this as it is implemented in the original game exe, i.e. as a special case for after mv copy. Signed-off-by: Manuel Lauss --- v3

[FFmpeg-devel] [PATCH v3 09/14] avcodec/sanm: codec4/5/33/34 decoder

2025-03-17 Thread Manuel Lauss
This codec works on 4x4 pixel tiles, which can be generated and read from the datastream. They're both identical, codec5 misses a tile index to skip the current tile. Codecs33/34 are the same as 4/5 but with a different tileset generator. Used only in Rebel Assault 1. Signed-off-by: Manuel

[FFmpeg-devel] [PATCH v3 08/14] avcodec/sanm: codec21 decoder

2025-03-17 Thread Manuel Lauss
similar to codec23, this one alternatingly skips and writes bytes. Signed-off-by: Manuel Lauss --- v2,v3: no changes libavcodec/sanm.c | 45 + 1 file changed, 45 insertions(+) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 6302c62f43

[FFmpeg-devel] [PATCH v3 13/14] avcodec/sanm: codec20 decoder

2025-03-17 Thread Manuel Lauss
codec20 is raw uncompressed image data. It is used internally in Rebel Assault 1 as a special format for STOR (when parameter for STOR is set to 3), and is used again in the "Full Throttle Remaster" from 2017. Signed-off-by: Manuel Lauss --- v3: newly added libavcodec/s

[FFmpeg-devel] [PATCH v3 14/14] MAINTAINERS: add Manuel Lauss as sanm.c/smush.c Maintainer

2025-03-17 Thread Manuel Lauss
As requested by Michael Niedermayer. Signed-off-by: Manuel Lauss --- v3: no changes v2: newly added MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 9714581c6b..917eca458e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -244,6 +244,7 @@ Codecs

[FFmpeg-devel] [PATCH v3 12/14] avcodec/sanm: ignore codec45

2025-03-17 Thread Manuel Lauss
leads me to believe this codec never worked as intended. Signed-off-by: Manuel Lauss --- v3: no changes v2: newly added libavcodec/sanm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 54d578ae4b..730ec14b98 100644 --- a/libavcodec/sanm.c

[FFmpeg-devel] [PATCH v3 05/14] avcodec/sanm: fix codec3

2025-03-17 Thread Manuel Lauss
codec3 is codec1 which writes zero values instead of skipping them. This fixes a lot of RA1 videos. Signed-off-by: Manuel Lauss --- v2, v3: no changes libavcodec/sanm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index

[FFmpeg-devel] [PATCH v3 04/14] avcodec/sanm: better ANIMv1 engine support

2025-03-17 Thread Manuel Lauss
in a generic way. Signed-off-by: Manuel Lauss --- v3: no changes v2: added handling of unaligned objects libavcodec/sanm.c | 49 ++- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 38cdb

[FFmpeg-devel] [PATCH v3 02/14] avcodec/sanm: FOBJ left/top are signed values

2025-03-17 Thread Manuel Lauss
The left/top parameters of a FOBJ are signed values. Adjust codec1 code accordingly to not draw outside the buffer area. Rebel Assault 1 makes heavy use of this. Signed-off-by: Manuel Lauss --- v2, v3: no changes libavcodec/sanm.c | 33 ++--- 1 file changed, 18

[FFmpeg-devel] [PATCH v3 01/14] avcodec/sanm: disable left/top for fullscreen codecs

2025-03-17 Thread Manuel Lauss
The block-based codecs 37/47/48 work on the full frame, and there's no existing LucasArts game video that uses left/top offsets for these, as it doesn't make sense. Ignore the left/top parameters for these codecs. Signed-off-by: Manuel Lauss --- v2, v3: no changes libavcodec/s

[FFmpeg-devel] [PATCH v3 00/14] avcodec/sanm: various improvements

2025-03-17 Thread Manuel Lauss
e seems to be all-black until the first NPAL (=new palette) chunk is encountered, although every ANM and SAN file have a full palette in their header. Manuel Lauss (14): avcodec/sanm: disable left/top for fullscreen codecs avcodec/sanm: FOBJ left/top are signed values avcodec/sanm: better

[FFmpeg-devel] [PATCH v2 04/13] avcodec/sanm: better ANIMv1 engine support

2025-03-15 Thread Manuel Lauss
in a generic way. Signed-off-by: Manuel Lauss --- v2: added handling of unaligned objects libavcodec/sanm.c | 49 ++- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 38cdb533eb..069bc0400a 100644

[FFmpeg-devel] [PATCH v2 01/13] avcodec/sanm: disable left/top for fullscreen codecs

2025-03-15 Thread Manuel Lauss
The block-based codecs 37/47/48 work on the full frame, and there's no existing LucasArts game video that uses left/top offsets for these, as it doesn't make sense. Ignore the left/top parameters for these codecs. Signed-off-by: Manuel Lauss --- libavcodec/s

[FFmpeg-devel] [PATCH v2 08/13] avcodec/sanm: codec21 decoder

2025-03-15 Thread Manuel Lauss
similar to codec23, this one alternatingly skips and writes bytes. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 45 + 1 file changed, 45 insertions(+) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index aca5bf49ec..6080144235 100644 --- a

[FFmpeg-devel] [PATCH v2 12/13] avcodec/sanm: ignore codec45

2025-03-15 Thread Manuel Lauss
leads me to believe this codec never worked as intended. Signed-off-by: Manuel Lauss --- v2: newly added. libavcodec/sanm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index b86f67c3bf..7e39c5eeb0 100644 --- a/libavcodec/sanm.c +++ b/libavcodec/s

[FFmpeg-devel] [PATCH v2 02/13] avcodec/sanm: FOBJ left/top are signed values

2025-03-15 Thread Manuel Lauss
The left/top parameters of a FOBJ are signed values. Adjust codec1 code accordingly to not draw outside the buffer area. Rebel Assault 1 makes heavy use of this. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 33 ++--- 1 file changed, 18 insertions(+), 15

[FFmpeg-devel] [PATCH v2 10/13] avcodec/sanm: codec37: reimplement comp4

2025-03-15 Thread Manuel Lauss
Compression 4 code 0 means copy from delta buffer without mv, AND start of a skip run. This gets rid of the extra case and column index manipulation and implements this as it is implemented in the original game exe, i.e. as a special case for after mv copy. Signed-off-by: Manuel Lauss

[FFmpeg-devel] [PATCH v2 11/13] avcodec/sanm: implement STOR/FTCH for ANIMv1

2025-03-15 Thread Manuel Lauss
Assault 1 for e.g. backgrounds and the cockpit overlay. For ANIMv2 keep the current system to store the decoded image, as replaying a FOBJ would not work with codecs37/47/48 due to sequence violations. Signed-off-by: Manuel Lauss --- v2: reimplemented by giving the RA1 codecs an explicit GetByteContext

[FFmpeg-devel] [PATCH v2 13/13] MAINTAINERS: add Manuel Lauss as sanm.c/smush.c Maintainer

2025-03-15 Thread Manuel Lauss
As requested by Michael Niedermayer. Signed-off-by: Manuel Lauss --- v2: newly added. MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 9714581c6b..917eca458e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -244,6 +244,7 @@ Codecs: rpza.c

[FFmpeg-devel] [PATCH v2 09/13] avcodec/sanm: codec4/5/33/34 decoder

2025-03-15 Thread Manuel Lauss
This codec works on 4x4 pixel tiles, which can be generated and also read from the datastream. Codec5 does not recognize the "skip-block" command; codecs33/34 are the same as 4/5 but with a different tileset generator. Signed-off-by: Manuel Lauss --- v2: had left+top swapped resulte

[FFmpeg-devel] [PATCH v2 07/13] avcodec/sanm: codec23 decoder

2025-03-15 Thread Manuel Lauss
This codec alternatingly skips and changes existing pixels. A second 16bit parameter in the FOBJ header indicates how to do the pixel changes: either by specifying a LUT in the codec datastream or by adding a constant value to the pixel. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 66

[FFmpeg-devel] [PATCH v2 06/13] avcodec/sanm: codec2 decoder

2025-03-15 Thread Manuel Lauss
this codec consists of 4 byte packets: 2bytes delta-x, 1 byte delta-y and 1 byte color to put at that spot. Used in Rebel Assault 1 only. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 20 1 file changed, 20 insertions(+) diff --git a/libavcodec/sanm.c b/libavcodec

[FFmpeg-devel] [PATCH v2 05/13] avcodec/sanm: fix codec3

2025-03-15 Thread Manuel Lauss
codec3 is codec1 which writes zero values instead of skipping them. This fixes a lot of RA1 videos. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 069bc0400a..0c8ca73508

[FFmpeg-devel] [PATCH v2 03/13] avcodec/sanm: better frame size detection for old codecs

2025-03-15 Thread Manuel Lauss
clamp the large frame to the determined dimensions. Tested with RA1, RA2, Full Throttle, Dig, Outlaws, SotE and MotS videos. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 63 --- 1 file changed, 49 insertions(+), 14 deletions(-) diff --

[FFmpeg-devel] [PATCH v2 00/13] avcodec/sanm: various improvements

2025-03-15 Thread Manuel Lauss
palette issues in RA1: when the first FRME does not contain any video data, the palette seems to be all-black until the first NPAL (=new palette) chunk is encountered, although every ANM and SAN file have a full palette in their header. Manuel Lauss (13): avcodec/sanm: disable left/top for

Re: [FFmpeg-devel] [PATCH 11/12] avcodec/sanm: change GetByteContext member to pointer

2025-03-14 Thread Manuel Lauss
Michael On Fri, Mar 14, 2025 at 9:31 PM Michael Niedermayer wrote: > > Hi Manuel > > On Thu, Mar 13, 2025 at 12:15:04PM +0100, Manuel Lauss wrote: > > In order do properly support the ANIM STOR/FTCH system, the FTCH > > must replay a stored FOBJ and change the SANMC

Re: [FFmpeg-devel] [PATCH 09/12] avcodec/sanm: codec4/5/33/34 decoder

2025-03-14 Thread Manuel Lauss
Servus Andreas, On Fri, Mar 14, 2025 at 1:08 AM Andreas Rheinhardt wrote: > > +static int old_codec4(SANMVideoContext *ctx, int left, int top, int w, int > > h, > > + uint8_t param, uint16_t param2, int codec) > > +{ > > +const uint16_t p = ctx->pitch; > > +const ui

Re: [FFmpeg-devel] [PATCH 00/12] avcodec/sanm: various improvements

2025-03-14 Thread Manuel Lauss
Hi Michael, On Fri, Mar 14, 2025 at 1:06 AM Michael Niedermayer wrote: > > Hi Manuel > > please add yourself to the MAINTAINER file for sanm with a patch > you are already maintaining sanm, its just not written in the file Fine, I'll add a patch for this in a v2 patchset. Manuel ___

[FFmpeg-devel] [PATCH 11/12] avcodec/sanm: change GetByteContext member to pointer

2025-03-13 Thread Manuel Lauss
In order do properly support the ANIM STOR/FTCH system, the FTCH must replay a stored FOBJ and change the SANMContext's "GetByteContext" member temporarily. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 394 +++--- 1 file changed,

[FFmpeg-devel] [PATCH 12/12] avcodec/sanm: properly implement STOR/FTCH for ANIMv1

2025-03-13 Thread Manuel Lauss
in the stack. For ANIMv2 keep the current system to store the decoded image, as replaying a FOBJ would not work with codecs37/47/48 due to sequence violations. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 84 --- 1 file changed, 80 insertions

[FFmpeg-devel] [PATCH 06/12] avcodec/sanm: codec2 support

2025-03-13 Thread Manuel Lauss
this codec consists of 4 byte packets: 2bytes delta-x, 1 byte delta-y and 1 byte color to put at that spot. Used in Rebel Assault 1 only. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 20 1 file changed, 20 insertions(+) diff --git a/libavcodec/sanm.c b/libavcodec

[FFmpeg-devel] [PATCH 10/12] avcodec/sanm: codec37: reimplement comp4

2025-03-13 Thread Manuel Lauss
Compression 4 code 0 means copy from delta buffer without mv, AND start of a skip run. This gets rid of the extra case and column index manipulation and implements this as it is implemented in the original game exe, i.e. as a special case for after mv copy. Signed-off-by: Manuel Lauss

[FFmpeg-devel] [PATCH 02/12] avcodec/sanm: disable left/top for fullscreen codecs

2025-03-13 Thread Manuel Lauss
The block-based codecs 37/47/48 work on the full frame, and there's no existing LucasArts game video that uses left/top offsets for these, as it doesn't make sense. Ignore the left/top parameters for these codecs. Signed-off-by: Manuel Lauss --- libavcodec/s

[FFmpeg-devel] [PATCH 04/12] avcodec/sanm: misc fixes

2025-03-13 Thread Manuel Lauss
all zeroes. This fixes a lot of stray colors in e.g L1HANGAR.ANM, L2INTRO.ANM, space scenes. - Esp in RA1, there are a lot of FRME objects which don't contain any video data (prebuffering some audio only). Account for that. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c

[FFmpeg-devel] [PATCH 09/12] avcodec/sanm: codec4/5/33/34 decoder

2025-03-13 Thread Manuel Lauss
This codec works on 4x4 pixel tiles, which can be generated and read from the datastream. They're both identical, codec5 misses a tile index to skip the current tile. Codecs33/34 are the same as 4/5 but with a different tileset generator. Used only in Rebel Assault 1. Signed-off-by: Manuel

[FFmpeg-devel] [PATCH 08/12] avcodec/sanm: codec21 decoder

2025-03-13 Thread Manuel Lauss
similar to codec23, this one alternatingly skips and writes bytes. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 45 + 1 file changed, 45 insertions(+) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 67963bb5d3..bf2ec40df4 100644 --- a

[FFmpeg-devel] [PATCH 07/12] avcodec/sanm: codec23 decoder

2025-03-13 Thread Manuel Lauss
This codec alternatingly skips and changes existing pixels. A second 16bit parameter in the FOBJ header indicates how to do the pixel changes: either by specifying a LUT in the codec datastream or by adding a constant value to the pixel. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 66

[FFmpeg-devel] [PATCH 05/12] avcodec/sanm: fix codec3

2025-03-13 Thread Manuel Lauss
codec3 is codec1 which writes zero values instead of skipping them. This fixes a lot of RA1 videos. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index fbb6e7231a..d4a84febc7

[FFmpeg-devel] [PATCH 03/12] avcodec/sanm: FOBJ left/top are signed values

2025-03-13 Thread Manuel Lauss
The left/top parameters of a FOBJ are signed values. Adjust codec1 code accordingly to not draw outside the buffer area. Rebel Assault 1 makes heavy use of this. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 33 ++--- 1 file changed, 18 insertions(+), 15

[FFmpeg-devel] [PATCH 00/12] avcodec/sanm: various improvements

2025-03-13 Thread Manuel Lauss
the existing scheme breaks the visuals here. This patchset makes almost all RA1 videos now playable with generally correct content, although some hiccups remain. Manuel Lauss (12): avcodec/sanm: better frame size detection for old codecs avcodec/sanm: disable left/top for fullscreen codecs

[FFmpeg-devel] [PATCH 01/12] avcodec/sanm: better frame size detection for old codecs

2025-03-13 Thread Manuel Lauss
ottle, Dig, Outlaws, SotE and MotS videos. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 63 --- 1 file changed, 49 insertions(+), 14 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index a4f0a28c7c..0795d664fa 100644 --- a/libav

[FFmpeg-devel] [PATCH 9/9] avcodec/sanm: codec21 decoder

2025-03-11 Thread Manuel Lauss
similar to codec23, this one alternatingly skips and writes bytes. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 45 + 1 file changed, 45 insertions(+) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index dbd78de0bc..edce76c7f4 100644 --- a

[FFmpeg-devel] [PATCH 8/9] avcodec/sanm: codec23 decoder

2025-03-11 Thread Manuel Lauss
This codec alternatingly skips and changes existing pixels. A second 16bit parameter in the FOBJ header indicates how to do the pixel changes: either by specifying a LUT in the codec datastream or by adding a constant value to the pixel. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 66

[FFmpeg-devel] [PATCH 7/9] avcodec/sanm: codec2 decoder

2025-03-11 Thread Manuel Lauss
this codec consists of 4 byte packets: 2bytes delta-x, 1 byte delta-y and 1 byte color to put at that spot. Used in Rebel Assault 1 only. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 20 1 file changed, 20 insertions(+) diff --git a/libavcodec/sanm.c b/libavcodec

[FFmpeg-devel] [PATCH 6/9] avcodec/sanm: misc fixes

2025-03-11 Thread Manuel Lauss
all zeroes. This fixes a lot of unwanted colors in e.g L1HANGAR.ANM, L2INTRO.ANM, a space scenes. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 8 1 file changed, 8 insertions(+) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 310b1a429b..efed31b70c 100644 --- a

[FFmpeg-devel] [PATCH 5/9] avcodec/sanm: FOBJ left/top are signed values

2025-03-11 Thread Manuel Lauss
The left/top parameters of a FOBJ are signed values. Adjust codec1 code accordingly to not draw outside the buffer area. Rebel Assault 1 makes heavy use of this. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 32 +--- 1 file changed, 17 insertions(+), 15

[FFmpeg-devel] [PATCH 4/9] avcodec/sanm: fix codec3

2025-03-11 Thread Manuel Lauss
codec3 is codec1 which writes zero values instead of skipping them. This fixes a lot of RA1 videos. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index b2923515b1..a512810987

[FFmpeg-devel] [PATCH 1/9] avcodec/sanm: codec37: reimplement comp4

2025-03-11 Thread Manuel Lauss
Compression 4 code 0 means copy from delta buffer without mv, AND start of a skip run. This change gets rid of the extra case and column index manipulation and implements this the same way it is implemented in the original game exe, i.e. as a special case after mv copy. Signed-off-by: Manuel

[FFmpeg-devel] [PATCH 3/9] avcodec/sanm: disable left/top for fullscreen codecs

2025-03-11 Thread Manuel Lauss
The block-based codecs 37/47/48 work on the full frame, and there's no existing LucasArts game video that uses left/top offsets for these, as it doesn't make sense. Ignore the left/top parameters for these codecs. Signed-off-by: Manuel Lauss --- Well, except for SotE, which uses &qu

[FFmpeg-devel] [PATCH 2/9] avcodec/sanm: better frame size detection for old codecs

2025-03-11 Thread Manuel Lauss
Js, rather clamp the large frame to the determined dimensions (The Dig's sq1.san). Tested with RA1, RA2, Full Throttle, Dig, Outlaws, SotE and MotS videos. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 59 --- 1 file changed, 45 insertions(+

Re: [FFmpeg-devel] [PATCH v4 2/3] avcodec/sanm: fobj left/top are signed

2025-03-11 Thread Manuel Lauss
Servus Michael, On Mon, Mar 10, 2025 at 9:32 PM Michael Niedermayer wrote: > > Hi > > On Sun, Mar 09, 2025 at 04:52:25PM +0100, Manuel Lauss wrote: > > Hi Michael, > > > > On Sat, Mar 8, 2025 at 8:11 PM Michael Niedermayer > > wrote: > > > > >

Re: [FFmpeg-devel] [PATCH v4 2/3] avcodec/sanm: fobj left/top are signed

2025-03-09 Thread Manuel Lauss
Hi Michael, On Sat, Mar 8, 2025 at 8:11 PM Michael Niedermayer wrote: > > Hi Manuel > > On Tue, Mar 04, 2025 at 06:07:18PM +0100, Manuel Lauss wrote: > > The left and top parameters of an FOBJ are signed values. > > > > Signed-off-by: Manuel Lauss > > ---

[FFmpeg-devel] [PATCH v4 2/3] avcodec/sanm: fobj left/top are signed

2025-03-04 Thread Manuel Lauss
The left and top parameters of an FOBJ are signed values. Signed-off-by: Manuel Lauss --- v4: revert v3, it arose due to a misunderstanding v3: change the bytestream accessor to signed too v2: no changes libavcodec/sanm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[FFmpeg-devel] [PATCH v4 3/3] avcodec/sanm: add smush codec23 decoder

2025-03-04 Thread Manuel Lauss
used as a constant offset to add to the existing pixel value. Signed-off-by: Manuel Lauss --- v4: also support c23 on ANIMv0/1 (Rebel Assault 1, e.g LVL11/L11PLAY.ANM water) v3: updates due to changes in patch 2 v2: no changes. Videos showing the before/after state (Rebel Assault II LEV09/09PLAY.SAN

[FFmpeg-devel] [PATCH v4 1/3] avcodec/sanm: ignore unknown codecs in FOBJs

2025-03-04 Thread Manuel Lauss
Don't error out, just ignore unknown codec numbers and pretend decode succeeded. This is useful for older LucasArts titles which stack a lot of different FOBJs with different codecs into a single frame. Signed-off-by: Manuel Lauss --- v4: no changes v3: no changes v2: Mark frame as co

[FFmpeg-devel] [PATCH v3 3/3] avcodec/sanm: add smush codec23 decoder

2025-02-17 Thread Manuel Lauss
This codec alternatingly skips and changes existing pixels. A second 16bit parameter in the FOBJ header indicates how to do the pixel changes: either by specifying a LUT in the codec datastream or by adding a constant value to the pixel. Signed-off-by: Manuel Lauss --- v3: updates due to changes

[FFmpeg-devel] [PATCH v3 2/3] avcodec/sanm: fobj left/top are signed

2025-02-17 Thread Manuel Lauss
The left and top parameters of an FOBJ are signed values. Signed-off-by: Manuel Lauss --- v3: change the bytestream accessor to signed too v2: no changes libavcodec/sanm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index

[FFmpeg-devel] [PATCH v3 1/3] avcodec/sanm: ignore unknown codecs in FOBJs

2025-02-17 Thread Manuel Lauss
Don't error out, just ignore unknown codec numbers and pretend decode succeeded. This is useful for older LucasArts titles which stack a lot of different FOBJs with different codecs into a single frame. Signed-off-by: Manuel Lauss --- v3: no changes v2: Mark frame as corrupt, suggest

[FFmpeg-devel] [PATCH v2 3/3] avcodec/sanm: add smush codec23 decoder

2025-02-10 Thread Manuel Lauss
This codec alternatingly skips and changes existing pixels. A second 16bit parameter in the FOBJ header indicates how to do the pixel changes: either by specifying a LUT in the codec datastream or by adding a constant value to the pixel. Signed-off-by: Manuel Lauss --- v2: no changes. Videos

[FFmpeg-devel] [PATCH v2 2/3] avcodec/sanm: fobj left/top are signed

2025-02-10 Thread Manuel Lauss
The left and top parameters of an FOBJ are signed values. Signed-off-by: Manuel Lauss --- v2: no changes. libavcodec/sanm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index a4f0a28c7c..71dbac4320 100644 --- a/libavcodec/sanm.c

[FFmpeg-devel] [PATCH v2 1/3] avcodec/sanm: ignore unknown codecs in FOBJs

2025-02-10 Thread Manuel Lauss
s supposed to be visible. Signed-off-by: Manuel Lauss --- v2: Mark frame as corrupt, suggested by Marton Balint libavcodec/sanm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index c30095ed32..a4f0a28c7c 100644 --- a/libavcodec/sa

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/sanm: ignore unknown codecs in FOBJs

2025-02-10 Thread Manuel Lauss
Hi Marton! Marton Balint schrieb am Mo., 10. Feb. 2025, 20:42: > > > On Mon, 10 Feb 2025, Manuel Lauss wrote: > > > Don't error out, just ignore unknown codec numbers and pretend > > decode succeeded. This is useful for older LucasArts titles > > which

[FFmpeg-devel] [PATCH 3/3] avcodec/sanm: add smush codec23 decoder

2025-02-10 Thread Manuel Lauss
This codec alternatingly skips and changes existing pixels. A second 16bit parameter in the FOBJ header indicates how to do the pixel changes: either by specifying a LUT in the codec datastream or by adding a constant value to the pixel. Signed-off-by: Manuel Lauss --- Videos showing the before

[FFmpeg-devel] [PATCH 1/3] avcodec/sanm: ignore unknown codecs in FOBJs

2025-02-10 Thread Manuel Lauss
Don't error out, just ignore unknown codec numbers and pretend decode succeeded. This is useful for older LucasArts titles which stack a lot of different FOBJs with different codecs into a single frame. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 2 +- 1 file changed, 1 insertion(

[FFmpeg-devel] [PATCH 2/3] avcodec/sanm: fobj left/top are signed

2025-02-10 Thread Manuel Lauss
The left and top parameters of an FOBJ are signed values. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 37d2c915d4..0e7cd292d0 100644 --- a/libavcodec/sanm.c +++ b/libavcodec

Re: [FFmpeg-devel] [PATCH v2 3/2] avcodec/sanm: codec37 buffers are private

2025-01-24 Thread Manuel Lauss
, 2025 at 05:40:25PM +0100, Manuel Lauss wrote: > > Ping? > > I see you are quite active on the sanm code, maybe you want to > send a patch to add yourself to MAINTAINERS for sanm ? > > This would give you git write access and simplify your work with sanm > > thx > &g

Re: [FFmpeg-devel] [PATCH v2 3/2] avcodec/sanm: codec37 buffers are private

2025-01-21 Thread Manuel Lauss
Ping? Manuel Lauss schrieb am Mo., 13. Jan. 2025, 22:00: > codec37 operates on 2 buffers, which must be considered private to > the codec and must therefore not be changed by subsequent FOBJs. > > Let codec37 therefore operate on frm1/2 instead of frm0/2, but copy > the decode

Re: [FFmpeg-devel] [PATCH v2 1/2] avcodec/sanm: implement codec37 subcodec1

2025-01-16 Thread Manuel Lauss
Servus Michael, On Fri, Jan 17, 2025 at 2:32 AM Michael Niedermayer wrote: > > Hi > > On Wed, Jan 15, 2025 at 06:24:44PM +0100, Manuel Lauss wrote: > > Ping? > > > > > Incidentally this also closes trac ticket #5753; while commit > > will apply with that

Re: [FFmpeg-devel] [PATCH v2 1/2] avcodec/sanm: implement codec37 subcodec1

2025-01-15 Thread Manuel Lauss
Ping? Incidentally this also closes trac ticket #5753; while commit b22ce90d ("avcodec/sanm: SMUSH codec48 decoder") fixes #5746. Thanks! Manuel On Thu, Jan 9, 2025 at 9:03 AM Manuel Lauss wrote: > > RLE-compressed stream of motion vector indices and a special opcode &

[FFmpeg-devel] [PATCH v2 3/2] avcodec/sanm: codec37 buffers are private

2025-01-13 Thread Manuel Lauss
Throttle "dazed.san" and also in a lot of Rebel Assault II gameplay videos: these videos consist of frames with an initial codec37 FOBJ image to set the stage, and optional codec1-23 FOBJs overlaid on top of that image. Signed-off-by: Manuel Lauss --- v2: use FFSWAP() to swap the 2 buffers

[FFmpeg-devel] [PATCH 3/2] avcodec/sanm: codec37 buffers are private

2025-01-13 Thread Manuel Lauss
Throttle "dazed.san" and also in a lot of Rebel Assault II gameplay videos: these videos consist of frames with an initial codec37 FOBJ image to set the stage, and optional codec1-23 FOBJs overlaid on top of that image. Signed-off-by: Manuel Lauss --- Applies on top of my previous patch &qu

[FFmpeg-devel] [PATCH v2 2/2] avcodec/sanm: simplify codec37 subcodec 3/4 path

2025-01-09 Thread Manuel Lauss
according to the flag. Signed-off-by: Manuel Lauss --- v2: fixed up because of changes to 1/2 libavcodec/sanm.c | 114 +++--- 1 file changed, 37 insertions(+), 77 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 0d04b09c8d..51b8a2f54c

[FFmpeg-devel] [PATCH v2 1/2] avcodec/sanm: implement codec37 subcodec1

2025-01-09 Thread Manuel Lauss
RLE-compressed stream of motion vector indices and a special opcode to fill a block with data from the source stream. It is used in the LucasArts "Full Throttle" blink*.san animations. Signed-off-by: Manuel Lauss --- v2: move variable declarations to top of functions. libavcodec/s

Re: [FFmpeg-devel] [PATCH] libavcodec/sanm: implement codec37 subcodec1

2025-01-08 Thread Manuel Lauss
Interesting, which compiler do you use? I see no such errors with gcc-15. I'll redo the patch, thanks for testing! Manuel On Thu, Jan 9, 2025 at 4:02 AM Michael Niedermayer wrote: > > Hi > > On Tue, Jan 07, 2025 at 03:46:09PM +0100, Manuel Lauss wrote: > > RLE-comp

[FFmpeg-devel] [PATCH] libavcodec/sanm: simplify codec37 subcodec 3/4 path

2025-01-07 Thread Manuel Lauss
to the flag. Signed-off-by: Manuel Lauss --- Applies on top of my other patch "libavcodec/sanm: implement codec37 subcodec1" libavcodec/sanm.c | 118 +++--- 1 file changed, 39 insertions(+), 79 deletions(-) diff --git a/libavcodec/sanm.c b/

[FFmpeg-devel] [PATCH] libavcodec/sanm: implement codec37 subcodec1

2025-01-07 Thread Manuel Lauss
RLE-compressed stream of motion vector indices and a special opcode to fill a block with data from the source stream. It is used in the LucasArts "Full Throttle" blink*.san animations. Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 64

Re: [FFmpeg-devel] [PATCH] libavcodec/sanm: SMUSH codec48 decoder

2025-01-02 Thread Manuel Lauss
Hello, Ping? With this patch the 2 sample files at http://samples.mplayerhq.hu/game-formats/la-san/jediknight-sith/ play just fine. Thanks, Manuel On Mon, Dec 16, 2024 at 5:08 PM Manuel Lauss wrote: > > Adds a decoder for the SMUSH codec48 video encoding, as is used by > the

[FFmpeg-devel] [PATCH] libavcodec/sanm: SMUSH codec48 decoder

2024-12-16 Thread Manuel Lauss
Adds a decoder for the SMUSH codec48 video encoding, as is used by the LucasArts game "Mysteries of the Sith". Signed-off-by: Manuel Lauss --- libavcodec/sanm.c | 223 ++ 1 file changed, 223 insertions(+) diff --git a/libavcodec/sanm.c b/

Re: [FFmpeg-devel] How to support audio data placed within video data

2024-11-30 Thread Manuel Lauss
On Sat, Nov 30, 2024 at 9:50 AM Anton Khirnov wrote: > > Quoting Manuel Lauss (2024-11-28 21:58:09) > > On Thu, Nov 28, 2024 at 3:19 PM Anton Khirnov wrote: > > > > > > Quoting Manuel Lauss (2024-11-26 15:25:30) > > > > Hello, > > > >

  1   2   >