1
0
Fork 0
Commit Graph

129 Commits

Author SHA1 Message Date
Andreas Rheinhardt 790f793844 avutil/common: Don't auto-include mem.h
There are lots of files that don't need it: The number of object
files that actually need it went down from 2011 to 884 here.

Keep it for external users in order to not cause breakages.

Also improve the other headers a bit while just at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Andreas Rheinhardt 4a134eb14a avcodec/intrax8: Fix assert
Commit 900ce6f8c3 replaced
IntraX8Context.ac_vlc by IntraX8Context.ac_vlc_table,
but forgot to update an av_assert2()*.
cf7ed01938 then
replaced this with a check for j_ac_vlc[mode],
but this makes no sense as j_ac_vlc is of type
const VLCElem [2][2][8][].

Worse yet, mode can be up to three and then
j_ac_vlc[mode] is undefined behaviour. This happened
during the wmv8-x8intra FATE test.

*: Since 84f16bb5e6
config.h was no longer auto-included in avassert.h
and this disabled av_assert1() and av_assert2()
in files where config.h has not been included before
the inclusion of avassert.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-29 10:30:16 +01:00
Andreas Rheinhardt c95e123e8c avcodec/intrax8: Avoid superfluous VLC structures
Of all these VLCs here, only VLC.table was really used
after init, so use the ff_vlc_init_tables API
to get rid of them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-31 20:47:00 +01:00
Andreas Rheinhardt 9cdf82c2c2 avcodec/vlc: Use proper namespace
Therefore use a proper prefix for this API, e.g.
ff_init_vlc_sparse -> ff_vlc_init_sparse
ff_free_vlc        -> ff_vlc_free
INIT_VLC_LE        -> VLC_INIT_LE
INIT_VLC_USE_NEW_STATIC -> VLC_INIT_USE_STATIC
(The ancient INIT_VLC_USE_STATIC has been removed
in 595324e143, so that
the NEW has been dropped.)
Finally, reorder the flags and change their values
accordingly.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-11 00:27:45 +02:00
Nicolas George cf7ed01938 lavc/intrax8: fix an assert 2023-07-12 15:35:37 +02:00
Andreas Rheinhardt d1d30edf42 avcodec/msmpeg4data: Move data shared between msmpeg4 and VC-1 out
This is in preparation for splitting VC-1 from msmpeg4.
(msmpeg4data.c was originally intended to be just this;
9488b966c7 changed it).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-11-06 17:41:26 +01:00
Andreas Rheinhardt ec2b07db79 avcodec/intrax8: Only keep what is used from ScanTable
Namely ScanTable.permutated.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-24 00:47:07 +02:00
Andreas Rheinhardt fd72d8aea3 avcodec/blockdsp: Remove unused AVCodecContext parameter
Possible since be95df12bb.

Reviewed-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-21 20:24:40 +02:00
Andreas Rheinhardt 900ce6f8c3 avcodec/intrax8: Avoid indirection when accessing VLC table
To do so, store the pointer to the VLC table and not to the VLC.
This is possible, because all the VLCs of the same type use
the same number of bits.
Also use a const VLCElem*, because the target is static and must
therefore not be modified after its initialization.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-03 21:23:35 +02:00
Andreas Rheinhardt eb5c5ae658 avcodec/intrax8: Remove unused IDCTDSPContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-03 21:10:00 +02:00
Andreas Rheinhardt 2d764069be avcodec/vlc: Use structure instead of VLC_TYPE array as VLC element
In C, qualifiers for arrays are broken:
const VLC_TYPE (*foo)[2] is a pointer to an array of two const VLC_TYPE
elements and unfortunately this is not compatible with a pointer
to a const array of two VLC_TYPE, because the latter does not exist
as array types are never qualified (the qualifier applies to the base
type instead). This is the reason why get_vlc2() doesn't accept
a const VLC table despite not modifying the table at all, as
there is no automatic conversion from VLC_TYPE (*)[2] to
const VLC_TYPE (*)[2].

Fix this by using a structure VLCElem for the VLC table.
This also has the advantage of making it clear which
element is which.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-06-17 16:47:29 +02:00
Andreas Rheinhardt abf1a4f05c avcodec/intrax8: Reduce the size of tables used to initialize VLCs
By switching from ff_init_vlc_sparse() to ff_init_vlc_from_lengths() one
can replace an array of codes of type uint16_t with an array of symbols
of type uint8_t, saving space.

Also remove some more code duplication while at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-08 17:51:47 +01:00
Andreas Rheinhardt d1a1f11712 avcodec/intrax8: Avoid code duplication when initializing VLCs
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-08 17:51:47 +01:00
Andreas Rheinhardt ba69ee8801 avcodec/intrax8: Remove VLC offsets table
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-08 17:51:47 +01:00
Andreas Rheinhardt b1af617f51 avcodec/intrax8: Make ff_intrax8_common_init() thread-safe
In particular, don't reinitialize VLCs every time an IntraX8Context is
initialized.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Andreas Rheinhardt 802baf212d avcodec/intrax8: Replace always-false check by assert
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-24 11:35:03 +01:00
Michael Niedermayer 0a9ccc2514 avcodec/intrax8: Check for end of bitstream in ff_intrax8_decode_picture()
Fixes: Timeout (105sec -> 1sec)
Fixes: 20479/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-5769846937878528

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-04-26 18:23:16 +02:00
Clément Bœsch b76dd6a678 Merge commit 'ee59f0540875ab42496af2aacddd942757707683'
* commit 'ee59f0540875ab42496af2aacddd942757707683':
  intrax8: Have function signature match across declaration and definition

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-03-30 10:03:59 +02:00
Clément Bœsch 6eb75e7d59 Merge commit '3281d823cdc7601c4900eb103958c05f59f65555'
* commit '3281d823cdc7601c4900eb103958c05f59f65555':
  intrax8: Change type of array stride parameters to ptrdiff_t

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-21 15:13:36 +01:00
Diego Biurrun ee59f05408 intrax8: Have function signature match across declaration and definition
libavcodec/intrax8.c(776) : warning C4028: formal parameter 1 different from declaration
2016-11-03 15:50:48 +01:00
Diego Biurrun 3281d823cd intrax8: Change type of array stride parameters to ptrdiff_t
ptrdiff_t is the correct type for array strides and similar.

Also rename all such parameters to "stride" for consistency.
2016-09-29 14:48:03 +02:00
Carl Eugen Hoyos db8e8c9731 lavc/intrax8: Use correct printf specifier for size_t on Windows. 2016-07-22 19:23:01 +02:00
Clément Bœsch 8ef57a0d61 Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'
* commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb':
  cosmetics: Fix spelling mistakes

Merged-by: Clément Bœsch <u@pkh.me>
2016-06-21 21:55:34 +02:00
Derek Buitenhuis e811ebcd9c Merge commit 'ca8c7591735c0f80cc29e31e2e92cb10228e14c7'
* commit 'ca8c7591735c0f80cc29e31e2e92cb10228e14c7':
  intrax8: Remove mpegvideo dependency

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-07 21:41:27 +01:00
Derek Buitenhuis f2c7812839 Merge commit '6ebd06a9b2508747a135ee4c880d8f612e08932b'
* commit '6ebd06a9b2508747a135ee4c880d8f612e08932b':
  intrax8: Drop lots of pointless parentheses

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-07 21:40:21 +01:00
Derek Buitenhuis 741960e2f3 Merge commit '9b57995cdd489a4cff51dcc1a1f08ac77ec5a58c'
* commit '9b57995cdd489a4cff51dcc1a1f08ac77ec5a58c':
  intrax8: Drop MB emulation code

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-07 21:40:05 +01:00
Derek Buitenhuis f110c624b1 Merge commit '9fa888c02801fff2e8817c24068f5296bbe60000'
* commit '9fa888c02801fff2e8817c24068f5296bbe60000':
  intrax8: Keep a reference to the decoder blocks

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-07 21:39:44 +01:00
Derek Buitenhuis c59c792470 Merge commit 'c2084ffcbfc11d1b6ed3a4a0df9cafd56fbb896f'
* commit 'c2084ffcbfc11d1b6ed3a4a0df9cafd56fbb896f':
  intrax8: Use the generic horizband function

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-07 21:37:32 +01:00
Derek Buitenhuis 123fef54cc Merge commit 'b1268e0f032a3af3912fe3fb8d3855e12d7ea83b'
* commit 'b1268e0f032a3af3912fe3fb8d3855e12d7ea83b':
  intrax8: Pass macroblock coordinates to ff_intrax8_decode_picture

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-07 21:36:54 +01:00
Derek Buitenhuis 578fb5a27d Merge commit 'd0540fd02171a6233d2016b199d013299debf7e3'
* commit 'd0540fd02171a6233d2016b199d013299debf7e3':
  intrax8: Pass macroblock size to ff_intrax8_common_init

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-07 21:35:20 +01:00
Vittorio Giovara 41ed7ab45f cosmetics: Fix spelling mistakes
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-04 18:16:21 +02:00
Derek Buitenhuis 896fce8509 Merge commit '159323897f545e7405fb9db234e0ba123e174376'
* commit '159323897f545e7405fb9db234e0ba123e174376':
  intrax8: Add a local BlockDSPContext and initialize it

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-24 12:36:23 +01:00
Derek Buitenhuis 52692eed61 Merge commit '1eaae7abb8f208fefb4e8b9e983e61b2499206a3'
* commit '1eaae7abb8f208fefb4e8b9e983e61b2499206a3':
  intrax8: Reference the current AVCodecContext

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-24 12:34:58 +01:00
Derek Buitenhuis 50fa5715bc Merge commit '8072345e9f86d88fbc4a15c17cb03f1e4701c9a5'
* commit '8072345e9f86d88fbc4a15c17cb03f1e4701c9a5':
  intrax8: Keep a reference to the GetBitContext reader

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-24 12:34:16 +01:00
Derek Buitenhuis 93c61c980d Merge commit '65f14128c4bcf8fcd9d3ba1e20b7a22057c9cfb0'
* commit '65f14128c4bcf8fcd9d3ba1e20b7a22057c9cfb0':
  intrax8: Use a constant buffer instead of a ScratchpadContext

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-24 12:33:07 +01:00
Derek Buitenhuis 36dad14693 Merge commit 'eaeba6f241e0de0e797be10f8fda967ef8489e64'
* commit 'eaeba6f241e0de0e797be10f8fda967ef8489e64':
  intrax8: Pass the output frame to the decoding function

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-24 12:32:38 +01:00
Derek Buitenhuis e5c655b098 Merge commit '577393321c389ad2973bec6168a8045c94a9e099'
* commit '577393321c389ad2973bec6168a8045c94a9e099':
  intrax8: Carry over the loopfilter value in ff_intrax8_decode_picture

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-24 12:31:14 +01:00
Derek Buitenhuis 83e0b1b1d7 Merge commit '68127e1bf8037a6e0acd6401cc8c5da950e3fa0a'
* commit '68127e1bf8037a6e0acd6401cc8c5da950e3fa0a':
  intrax8: Keep a reference to the context idctdsp

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-24 12:19:53 +01:00
Derek Buitenhuis 627115b3e4 Merge commit '65127450add50c3bca307edc0517d2e8382717a0'
* commit '65127450add50c3bca307edc0517d2e8382717a0':
  intrax8: Make x8_init_block_index not use mpegvideo fields

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-24 12:16:16 +01:00
Derek Buitenhuis 1a9ffc59d2 Merge commit '922b7e6d86e6197dfa5ebde602dd12cc66fb5f1f'
* commit '922b7e6d86e6197dfa5ebde602dd12cc66fb5f1f':
  intrax8: Use local destination buffers

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-24 12:08:11 +01:00
Michael Niedermayer 76d0209db4 avcodec/intrax8: Remove duplicated chunk from ba5bcf9612
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-18 00:59:18 +02:00
Derek Buitenhuis 9d4799c247 Merge commit '8dead2aaca4aa8b84b77b05745755afb56b7d37a'
* commit '8dead2aaca4aa8b84b77b05745755afb56b7d37a':
  Move const qualifier before type name

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-17 19:35:03 +01:00
Derek Buitenhuis f64b53f2bf Merge commit '0372e73f917e72c40b09270f771046fc142be4a7'
* commit '0372e73f917e72c40b09270f771046fc142be4a7':
  intrax8: Check and propagate errors from ff_intrax8_common_init

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-17 19:31:32 +01:00
Derek Buitenhuis c29ac4abb8 Merge commit 'ad8aa8e6c648b61f01b9f106f27b9d4f3d094345'
* commit 'ad8aa8e6c648b61f01b9f106f27b9d4f3d094345':
  intrax8: Move documentation from implementation to header file

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-17 19:30:01 +01:00
Derek Buitenhuis ba5bcf9612 Merge commit '2ade1cdafb96bf47e77f7ed74731d78a30aae950'
* commit '2ade1cdafb96bf47e77f7ed74731d78a30aae950':
  intrax8: K&R formatting cosmetics

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-17 19:27:53 +01:00
Derek Buitenhuis 7120bff0a3 Merge commit '6f5ff559dbd01fa4ea96bc0a1d2e0c21f2db8d13'
* commit '6f5ff559dbd01fa4ea96bc0a1d2e0c21f2db8d13':
  intrax8: Adjust printf conversion specifier for sizeof expression

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-17 19:13:30 +01:00
Derek Buitenhuis 2c3e38f44f Merge commit '42244ce07a1f4f5108ae86d50fe72db785d483ed'
* commit '42244ce07a1f4f5108ae86d50fe72db785d483ed':
  intrax8: Move a comment to the place it corresponds

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-17 19:11:43 +01:00
Derek Buitenhuis e445b80c74 Merge commit '750562549ceef268b29b94f6a887d9cf331a8c78'
* commit '750562549ceef268b29b94f6a887d9cf331a8c78':
  intrax8: Wrap multiline macros in do{}while(0) clauses

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-17 19:11:17 +01:00
Derek Buitenhuis 909f5e7100 Merge commit '0c6a70873fc6e43194b471d112c30823b6c8d0b4'
* commit '0c6a70873fc6e43194b471d112c30823b6c8d0b4':
  intrax8: Move error resilience out of intrax8

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-17 19:09:12 +01:00
Vittorio Giovara ca8c759173 intrax8: Remove mpegvideo dependency 2016-03-29 13:41:09 +02:00