Commit Graph

464 Commits

Author SHA1 Message Date
Thomas Fach-Pedersen
25ed22d192 KINGDOM: Make audio track selectable in MVE decoder 2020-06-07 00:02:29 +02:00
Thomas Fach-Pedersen
03c2a973e4 KINGDOM: Fix MVE video format 6 decoding 2020-06-07 00:02:29 +02:00
Thomas Fach-Pedersen
e091dab0ae KINGDOM: Frames can span multiple chunks 2020-06-07 00:02:29 +02:00
Thomas Fach-Pedersen
7c07260ab8 KINGDOM: Replace uint16_t with uint16 in MVE decoder 2020-06-07 00:02:29 +02:00
Thomas Fach-Pedersen
aff19ae96b KINGDOM: Implement preliminary MVE decoder.
Implements decoding for formats 0x6 and 0x10. Not bug free.
2020-06-07 00:02:29 +02:00
Eugene Sandulenko
637493cc85 VIDEO: Stub for MVE decoder 2020-06-07 00:02:29 +02:00
Matthew Duggan
818e681746 IMAGE: Add support for Crusader: No Remorse movie decoding
The movies for Crusader: No Remorse have a unique decoder which is not too hard
to implement.  Unfortunately, they don't properly implement the "compression"
FourCC, and instead put their ID in the "Stream Handler".  Since supporting
them requires a change to the existing Image API, I thought I should make a
pull request for comments.

With this change, the movies in Crusader can all be played nicely.
2020-05-11 07:54:24 +02:00
Eugene Sandulenko
8b0ff834d0 VIDEO: Fix typo which could lead to crash in mpeg decoder 2020-04-28 10:38:37 +02:00
D G Turner
b7b66c5049 VIDEO: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-11-30 19:47:06 +00:00
Dmitry Blau
cf179868c8 VIDEO: Fix embedded subtitles in VMD videos
This fixes the subtitles in Woodruff - bug 10960
2019-09-13 11:27:24 +03:00
Bastien Bouclet
0f57aea2df COMMON: Use a prefix table to speed up the Huffman decoder
Symbols for codes shorter than the prefix table index width are stored
in the table. All the entries in the table with an index starting with
the code are set to the symbol value. That way, when decoding it is
possible to get the number of bits corresponding to the table width from
the bitstream and directly find the symbol value. Longer code still need
to be searched for in the codes list.
2019-04-13 16:24:25 +03:00
Bastien Bouclet
43e04d19c4 VIDEO: Fix Bink clearing color comment
YUV 000 is a green, not black. Thanks DrMcCoy for noticing and fixing
the issue.
2019-04-01 20:49:51 +02:00
Bastien Bouclet
195b4cbd20 VIDEO: Fix an integer overflow when dequantizing the DCT coeffs
See 2968bedf12
2019-04-01 20:49:45 +02:00
Torbjörn Andersson
9785d5007a ZVISION: Boost volume for MPEG cutscenes
The high-resolution videos play back at much lower volume than the
original ones. This adds hard-coded values for how much to amplify
each cutscene. It's all done by ear, and it does introduce some
clipping, but I think it should be acceptable.

Of course, it could also be a problem with the audio decoder, so
this may be the wrong approach entirely.
2019-02-10 16:32:02 +02:00
Bastien Bouclet
f72f71a6cc VIDEO: Keep track of the duration of ignored edits
Fixes inconsistent videos playing in Caldoria in the DVD version of JMP
Pegasus Prime.
2019-02-02 13:30:44 +01:00
Torbjörn Andersson
7c58534f4f VIDEO: Add buffering demuxer to MPEG-PS decoder
In all my attempts to get the audio and video to sync up in the
ZGI videos, there have always been 9-10 frames of video before the
audio even starts, even though the audio is timestamped to start
before. This attempts to fix that by prioritizing sending audio
packets to the decoder in a timely fashion.

I do not know if this is the correct way of doing this, and there
are still some things that need to be fixed. But pragmatically, it
does procude significantly better sync, so...
2018-11-04 22:33:22 +01:00
Torbjörn Andersson
a5b5b68a1a VIDEO: Use all video PTS's
Sometimes (only at the very start of a movie?) there will be a
video packet that has a PTS but no frame to display. Save that PTS
and use it for the next frame. This doesn't actually improve
anything, as far as I can tell, but feels right.
2018-11-04 22:33:22 +01:00
Torbjörn Andersson
1255e8de4d VIDEO: Removed _psmESType
We weren't doing anything with it anyway. And I'm not sure it's
even available in the ZGI videos.
2018-11-04 22:33:22 +01:00
Torbjörn Andersson
1d69564876 VIDEO: Moved MPEGStream creation out of readNextPacket()
I think it makes things easier to read, and I have some ideas
that I want to try which should be easier this way...
2018-11-04 22:33:22 +01:00
Torbjörn Andersson
ac40828ed2 VIDEO: Make the video pts sync easier to understand 2018-11-04 22:33:22 +01:00
Torbjörn Andersson
b672a694b9 VIDEO: Synchronize video to pts timestamps
This is another attempts at improving the audio/video sync in the
MPEG-PS decoder. Unfortunately, the audio probably also needs to
be synced to its pts timestamps...
2018-11-04 22:33:22 +01:00
Torbjörn Andersson
43b29a93d7 VIDEO: Use the standalone AC-3 decoder in the MPEG-PS code
This code comes from clone2727's now defunct (?) ac3 branch, with
some minor compile fixes. This represents the latest version of
the stalled AC-3 decoder work for Zork: Grand Inquisitor. Note,
however, that I have not yet asked for clone2727's permission to
use this. I'm just experimenting.
2018-11-04 22:33:22 +01:00
Torbjörn Andersson
ef70af5e99 VIDEO: Some minor cleanups to the AC-3 decoder 2018-11-04 22:33:22 +01:00
Torbjörn Andersson
e6abe39752 VIDEO: Skip DVD code. The sound plays, but audio/video sync is off
Like most things that make this branch actually work, this comes
from clone2727.
2018-11-04 22:33:22 +01:00
Torbjörn Andersson
89ec9766a1 VIDEO: After figuring out sample rate, rewind the AC-3 stream 2018-11-04 22:33:22 +01:00
Torbjörn Andersson
ad41dfb7ff VIDEO: Committed fixes from clone2727
This collects the whole frame before trying to decode it. It's
still now working right, but it's way better than it was before.
2018-11-04 22:33:22 +01:00
Torbjörn Andersson
fc7fa1de3a VIDEO: Use liba52 to decode audio. This is still laughably broken
At the moment, this produces nothing but misery in the form of
Valgrind warnings and horrible noise.
2018-11-04 22:33:22 +01:00
Cameron Cawley
06446d36f5 VIDEO: More fixes when building with Theora and Tremor 2018-08-18 13:33:43 +02:00
Cameron Cawley
5cf3b75deb VIDEO: Fix Theora playback when building with Tremor 2018-08-03 14:52:09 +02:00
Bastien Bouclet
b8abe40085 VIDEO: QT: Make sure all the edits are in the media bounds
In the Spanish version of Riven, the last edit of the video ogk.mov
ends one frame after the end of the media causing the playback to fail
without this check.

Fixes Trac#10633.
2018-07-21 08:02:40 +02:00
Eric Fry
2d836d4ec0 VIDEO: Warn instead of error when unhandled TXTS stream found in AVI 2018-07-20 06:43:33 +00:00
Andrei Prykhodko
7703b3617e VIDEO: fix seeking to first/second frame if it exceeds uint16 2018-06-29 13:41:44 +03:00
Bastien Bouclet
c76c052259 VIDEO: Fix seeking the the last frame of QT videos while playing backwards
Fixes Trac#10590.
2018-06-29 07:20:28 +02:00
whiterandrek
abf17aaa59 VIDEO: fix rewinding of FLIC files 2018-06-15 00:25:57 +02:00
Adrian Frühwirth
fa6a9280b2 VIDEO: Add PRINCE to list of engines using the FLIC decoder 2018-05-17 19:52:15 +02:00
whiterandrek
ff1b7ff89d VIDEO: FLIC: Fix decoding of BYTE_RUN/FLI_BRUN chunks
Our decoder currently only supports the standard FLC format which
does not rely on the stored packet count (which is part of the FLI
format and limited to 255 packets per line).
Instead, the image width should be used as criterion when decoding
a frame which allows for more than 255 packets per line.

See also https://www.compuphase.com/flic.htm
2018-05-17 19:45:16 +02:00
Adrian Frühwirth
9bee9e1ba6 JANITORIAL: Fix whitespace 2018-04-19 12:08:31 +02:00
Bastien Bouclet
9b9600a50f VIDEO: Express VideoDecoder::endOfVideo using easier to understand logic 2017-11-02 19:49:43 +01:00
Bastien Bouclet
6e6fab5b83 VIDEO: BINK: Fix plane data clobbering caused by incorrect pitch value
When decoding blocks, the YUV planes' pitches were computed using the
target video surface size instead of the block based size, resulting in
decoded plane data being overwritten for some video sizes.

Affected videos are LEOS-11102.bik and LEOS-11152.bik from Myst III.
2017-10-08 08:54:40 +02:00
Bastien Bouclet
8547c89b86 VIDEO: Change QT edit list to a Common::Array
And fix an out of bounds acces when seeking to the end of a video.
Skipping samples is needed even when seeking through silent edits
because a silent stream is queued for those.

Fixes #10219.
2017-09-21 13:06:18 +02:00
Torbjörn Andersson
59f8e62adf JANITORIAL: Silence GCC 7 warnings
These fall throughs have to be deliberate, or they wouldn't have to
check if mode equals 2 in the mode == 2 cases.
2017-09-11 06:48:34 +02:00
Paul Gilbert
be208264dd VIDEO: Fix reverse playback right to the very start of the video 2017-09-04 12:03:34 -04:00
Paul Gilbert
e72a1d7c46 VIDEO: Simplify AVIDecoder reverse playback special handling 2017-09-03 19:52:48 -04:00
Paul Gilbert
22e24d7c0b VIDEO: Fix reverse playback in AVIDecoder 2017-09-03 17:29:09 -04:00
Willem Jan Palenstijn
47539e1939 VIDEO: Use new BitStreamMemory class for PSXStreamDecoder 2017-08-24 19:46:59 +02:00
Willem Jan Palenstijn
e72f681ceb VIDEO: Use new BitStreamMemory class for SmackerDecoder 2017-08-24 19:46:59 +02:00
Willem Jan Palenstijn
dde259f068 COMMON: Remove BitStream base class to allow inlining calls
All users of BitStream were in fact using a specific, hardcoded variant,
so we can hardcode that variant, removing the need for virtual calls,
and enabling inlining.
2017-08-24 19:46:59 +02:00
Colin Snover
4ba87013a9 VIDEO: Support old-style stereo in VMDs
This format is used by the stereo audio VMDs in Lighthouse.
2017-08-20 11:36:26 -05:00
Bastien Bouclet
ec49730711 VIDEO: Allow setting the mixer sound type used to play audio tracks 2017-07-27 06:40:07 +02:00
Paul Gilbert
371a594b8d VIDEO: Fix AVIDecoder skipping alternate frames in reverse playback 2017-07-22 21:02:26 -04:00
Paul Gilbert
2838776c4b VIDEO: Refactor AVIDecoder for better handling of transparency track
A lot of the standard VideoDecoder methods were still treating the
transparency track as part of the video, so methods like getFrameCount
would return double the amount it should be. This refactoring properly
separates the transparency track into a separate field entirely.
2017-06-30 21:31:17 -04:00
Paul Gilbert
a897ad9e72 VIDEO: Add method to VideoDecoder to erase a track 2017-06-30 20:34:28 -04:00
Paul Gilbert
680b668614 VIDEO: Fix transparency track seeking in AVIDecoder 2017-06-25 20:48:12 -04:00
Colin Snover
0d63d2a7ad VIDEO: Wrap out-of-range VMD audio samples instead of clipping
The 16-bit DPCM decompressors in SSCI and Urban Runner use a 16-bit
register to store sample data, without any special handling of
overflow. As such, out-of-range samples simply wrap around, rather
than getting clipped.

It is not totally clear if the wrapping behaviour was intentionally
exploited to handle extreme transients, but in any case, videos
like GK2 5280.VMD that generate samples outside the signed 16-bit
range cause a loud pop when using clipping, but play back correctly
when wrapping.
2017-06-17 13:09:27 -05:00
Colin Snover
53fb26550d VIDEO: Unexpose audio sync API in AdvancedVMDDecoder
This change was inadvertently added in commit
44dd029cb1 but is not actually used.
2017-04-29 14:30:09 -05:00
Colin Snover
7b90f0693a IMAGE: Return correct pixel format for Indeo3
This gives Indeo3 the same behavior as other codecs when
encapsulated in a container that provides bit depth information
(e.g. AVI).

Closes #888.
2017-01-11 10:59:55 -06:00
D G Turner
cff454d5e7 VIDEO: Fix Two Further Signed vs. Unsigned Compiler Warnings. 2017-01-10 03:23:31 +00:00
Paul Gilbert
cc4ede6509 VIDEO: Further work on 2-track AVI videos
It turns out that at least one video in Starship Titanic, for the
Lift Indicator, has only a single transparency frame in track 2.
The added code, therefore, when it doesn't find an index entry
for the desired frame number, works backwards until it finds a valid
frame (likely frame 0), and then scans forward. If it hits the end
of the video, then it simply uses whatever last frame it last decoded.
2016-12-29 22:23:16 -05:00
Paul Gilbert
2e8c80cf58 VIDEO: Add support for AVI 2-track videos with missing track 2 indexes 2016-12-29 16:54:13 -05:00
Paul Gilbert
0c200e833e VIDEO: Add reverse playback support to AviDecoder 2016-12-05 23:15:44 -05:00
Bastien Bouclet
1d349e8244 VIDEO: Fix an off-by-one check in VideoDecoder::getTrack 2016-10-18 13:13:00 +02:00
Eugene Sandulenko
af2027ddd1 Merge pull request #838 from bluegr/chewy
Chewy: Esc from F5. New WIP engine.
2016-10-15 13:51:00 +02:00
Paul Gilbert
a333f3c44c VIDEO: Support rewind on AVI files with multiple video tracks 2016-10-12 20:09:36 -04:00
Paul Gilbert
c45b11f849 VIDEO: Fix video playback for zvision AVI videos 2016-10-11 21:05:58 -04:00
Paul Gilbert
83188eace9 VIDEO: Expose the bitCount of AVIVideoTrack bitmap headers 2016-10-06 20:32:25 -04:00
Paul Gilbert
293147345f VIDEO: Simplify AVIDecoder index handling for second video track 2016-10-03 07:41:44 -04:00
Paul Gilbert
c676ecb258 VIDEO: Implement seeking for AVI videos with a transparency video track 2016-10-02 20:22:53 -04:00
Filippos Karapetis
7331bdc6b1 VIDEO: Allow parts of the FLIC decoder to be overriden by child classes
This is needed by the specialized FLIC video decoder used in the chewy
engine
2016-10-03 00:33:49 +03:00
Paul Gilbert
3d25e260f7 TITANIC: Fix AVIDecoder to properly handle transparency video tracks 2016-10-02 14:24:40 -04:00
Paul Gilbert
28b2609b92 TITANIC: Remove track select logic from AVIDecoder 2016-10-02 08:20:10 -04:00
Colin Snover
44dd029cb1 SCI32: Implement kSetHotRectangles
Used only by chapter 7 of Phant1.
2016-09-29 19:39:16 -05:00
Paul Gilbert
bd010bc79f COMMON: Converted Common::BitStream to use DisposeAfterUse 2016-09-10 11:16:07 -04:00
Eugene Sandulenko
fab199d37e JANITORIAL: Make GPL headers uniform 2016-09-03 12:46:38 +02:00
Eugene Sandulenko
9d3a2c1c7f Merge pull request #786 from dreammaster/titanic
TITANIC: Starship Titanic engine
2016-08-01 00:27:28 +03:00
Eugene Sandulenko
7b7b1cf0d6 VIDEO: Hid verbose debug output deeper 2016-07-25 23:24:42 +03:00
Paul Gilbert
789760295d VIDEO: Add titanic to list of engines using AVIDecoder 2016-07-17 13:10:07 -04:00
Paul Gilbert
bb2d290dca VIDEO: Handle STRN chunks in AVI file streams to set stream name 2016-07-17 13:09:20 -04:00
Paul Gilbert
fa6e12aaab VIDEO: Add support for a track filtering callback function
This is needed for Starship Titanic, where videos can have a secondary
video track. It was simpler to use the callback as a means to select
one video track each across two decoders than trying to make VideoDecoder
and/or AVIDecoder support decoding from multiple video tracks simultaneously
2016-07-17 13:08:31 -04:00
Paul Gilbert
62f2763bf7 VIDEO: Respect RIFF filesize field when decoding AVI files
Starship Titanic in particular needs this, since some of the videos
have extra junk at the end of the file, such as ycursors.avi,
and parsing fails if we don't respect the filesize field
2016-07-15 19:27:42 -04:00
Colin Snover
28d4f5b0e4 VIDEO: Expose API for providing a memory location to draw VMDs
In SSCI, VMD is drawn by a standard CelObjMem wrapped by a
ScreenItem, giving the location of the bitmap memory to the
decoder. The decoder already supports this, but the API was
previously hidden behind the AdvancedVMDDecoder wrapper
(which is more convenient to use than the VMDDecoder class).
2016-07-10 09:35:24 -05:00
Ori Avtalion
3564032330 JANITORIAL: Reduce audio header dependencies 2016-04-14 16:10:21 +03:00
Bastien Bouclet
6d8eebbf7b VIDEO: Stay on the first edit when playing QT videos backwards
We don't support playing videos with multiple edits backwards. Taking the code
path to move to the next edit when playing backwards sets the current edit index
to an invalid value with the video still trying to play. Which results in out of
bounds reads, and ultimately a crash.

This fixes multiple crashes in Myst. Using the key without the chest on
Stoneship, resetting the clock tower puzzle, and using the switch in the trees
in Channelwood.

This was a regression introduced in a59f5db505.
2016-02-13 17:54:07 +01:00
Matthew Hoops
561d1a1d62 VIDEO: Switch to all packetized streams for AVI
ZVision does not currently, but that's OK
2015-08-30 21:01:39 -04:00
Matthew Hoops
de2f4e6982 VIDEO: Add support for MP3 in AVI 2015-08-30 19:53:53 -04:00
Matthew Hoops
14e57ca76f VIDEO: Switch MPEG-PS audio code to use the packetized MP3 code 2015-08-30 19:53:53 -04:00
Matthew Hoops
49885d686e VIDEO: Implement fallback dithering for QuickTime videos
Used for any codec without direct dithering support
2015-04-12 20:12:38 -04:00
Matthew Hoops
b170b08822 VIDEO: Add support for dithering in QuickTime videos 2015-04-11 14:37:04 -04:00
Matthew Hoops
f342d63431 IMAGE: Allow for choosing dither type 2015-04-11 14:36:37 -04:00
Matthew Hoops
cfc64157a0 VIDEO: Allow AVI tracks to be dithered via the Codec
Video for Windows made the Codec do the dithering work
2015-04-11 14:36:26 -04:00
Matthew Hoops
f6d7c5e176 IMAGE: Add functions to allow for videos to be dithered 2015-04-11 14:36:18 -04:00
Matthew Hoops
cb25b7b5ee VIDEO: Make the QuickTime code error out again if the frame data can't be found
The case shouldn't actually ever happen; the off-by-one bug when seeking to the last frame of the media (in an edit) caused this originally
2015-01-20 20:10:59 -05:00
Matthew Hoops
7d1ee5563a VIDEO: Remove the "-1" edit hack
With the previous commits' fixes, it's no longer needed
2015-01-20 20:10:59 -05:00
Matthew Hoops
1a0f104acf VIDEO: Fix potential off-by-one frame time after seek
If seeking to the final frame of an edit, _nextFrameStartTime wouldn't be adjust properly and would wrongly say that it's at the end of the edit. This never affected anything because of the edit "-1" hack.
2015-01-20 20:10:59 -05:00
Matthew Hoops
8e2a438dd9 VIDEO: Fix edit frame calculation
An edit that seeks to the last frame of the media would not show
2015-01-20 20:10:59 -05:00
Matthew Hoops
aaf4d38a56 VIDEO: Round the edit time offset instead of truncating it
Allows for the KQ6 Mac intro to play without the edit "-1" hack
2015-01-20 20:10:58 -05:00
Matthew Hoops
a59f5db505 VIDEO: Fix timing with frames going past the edit boundary 2015-01-20 20:10:58 -05:00
Eugene Sandulenko
8e0d7d7255 Merge pull request #559 from fedor4ever/master
VIDEO: Add Theora support to systems which use libtremor
2015-01-11 21:12:01 +01:00
Matthew Hoops
7054bcd9c5 VIDEO: Add MPEG-PS demuxer
For use with ZVision and later MADE
2015-01-08 00:45:13 -05:00
Fedor Strizhnev
7225101e62 Add Theora support to systems which use libtremor 2015-01-05 16:53:35 +03:00
Matthew Hoops
bed532587b VIDEO: Fix check to see if the frame rate is a whole number
Thanks to Marisa-Chan for spotting
2014-12-24 10:38:28 -05:00