Andreas Rheinhardt
b263415ab7
avcodec/mpegvideo: Don't set unrestricted_mv for decoders
...
It is write-only for them.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
2022-01-13 08:29:44 +01:00
Andreas Rheinhardt
6739bb5a0e
avcodec/h263: Move functions only used once to their caller
...
In this case it means moving ff_h263_pred_dc() resp. ff_h263_pred_acdc()
to ituh263enc.c resp. ituh263dec.c.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
2022-01-09 09:28:37 +01:00
Andreas Rheinhardt
9c489a0f3a
avcodec/mpegvideo: Move startcodes to mpeg12.h
...
And remove the MPEG-4-specific SLICE_START_CODE, which duplicates
SLICE_STARTCODE.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com >
2021-09-20 00:10:35 +02:00
Andreas Rheinhardt
61fe481586
avcodec/h263data, ituh263*: Make initializing RL inter table thread-safe
...
Up until now, ff_h263_rl_inter was initialized by both ituh263dec and
ituh263enc; this is an obstacle in making the codecs that use this code
init-threadsafe.
This obstacle is eliminated by only initializing this RLTable from
a single place that is guarded by a dedicated AVOnce.
Reviewed-by: Anton Khirnov <anton@khirnov.net >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com >
2021-01-25 14:52:58 +01:00
Andreas Rheinhardt
1ea13f949a
avcodec/ituh263dec: Don't initialize unused parts of RLTable
...
The RLTable ff_rl_intra_aic is only used by ituh263dec and ituh263enc;
the former only uses the RLTable's VLC, the latter only index_run,
max_level and max_run. Yet ituh263dec also initializes the latter.
This commit stops doing so.
Reviewed-by: Anton Khirnov <anton@khirnov.net >
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com >
2021-01-25 14:52:52 +01:00
Andreas Rheinhardt
27eea249cc
avcodec/msmpeg4dec: Reuse identical MV VLC
...
msmpeg4dec and ituh263dec both create VLCs with identical parameters out
of ff_mvtab. Given that ff_msmpeg4_decode_init() always (indirectly) calls
ff_h263_decode_init_vlc(), the VLC initialized by the latter can be
directly used by msmpeg4dec. Doing so saves a bit more than 2KB from the
.bss segment as well as the code to initialize a VLC.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com >
2021-01-25 14:51:53 +01:00
Andreas Rheinhardt
a3831e81ff
avcodec/ituh263dec: Don't initialize unused RL VLCs
...
The ff_rl_intra_aic RLTable is only used by ituh263dec and ituh263enc;
the former is the only user of its RL VLC tables. It uses only the very
first one of these VLC tables, but up until now all 32 are initialized,
wasting 68696B from the .bss segment (or that amount of memory if this
decoder has actually been used). This commit changes this.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com >
2021-01-25 14:51:53 +01:00
Anton Khirnov
c8c2dfbc37
lavu: move LOCAL_ALIGNED from internal.h to mem_internal.h
...
That is a more appropriate place for it.
2021-01-01 14:11:01 +01:00
Andreas Rheinhardt
daf8b10eeb
avcodec/rv10: Use symbol table more effectively
...
The RealVideo 1.0 decoder uses VLCs to parse DC coefficients. But the
values returned from get_vlc2() are not directly used; instead
-(val - 128) (which is in the range -127..128) is. This transformation
is unnecessary as it can effectively be done when initializing the VLC
by modifying the symbols table used. There is just one minor
complication: The chroma table is incomplete and in order to distinguish
an error from get_vlc2() (due to an invalid code) the ordinary return
range is modified to 0..255. This is possible because the only caller of
this function is (on success) only interested in the return value modulo
256.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com >
2020-12-08 17:51:45 +01:00
Michael Niedermayer
7f0498ed46
avcodec/ituh263dec: Check input for minimal frame size
...
Fixes: Timeout (28sec -> 3sec)
Fixes: 17559/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H263_fuzzer-5681050776240128
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2019-10-08 16:24:58 +02:00
Michael Niedermayer
8335ba8ae9
avcodec/ituh263dec: Make the condition for the studio slice start code match between ff_h263_resync() and ff_mpeg4_decode_studio_slice_header()
...
If they mismatch an infinite loop can occur
Fixes: Timeout (infinite loop)
Fixes: 17043/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5695051748868096
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2019-09-28 18:35:27 +02:00
Andreas Rheinhardt
324487b596
avcodec/ituh263dec: Fix undefined left shift of negative number
...
Fixes ticket #8160 .
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2019-09-28 17:24:32 +02:00
Kieran Kunhya
f9d3841ae6
mpeg4video: Add support for MPEG-4 Simple Studio Profile.
...
This is a profile supporting > 8-bit video and has a higher quality DCT
2018-04-02 13:06:23 +01:00
Martin Vignali
cbbec68847
libavcodec/blockdsp : add AVX version
...
Also modify the required alignment, to 32 instead of 16
for several codecs
Signed-off-by: James Almer <jamrial@gmail.com >
2017-10-03 19:47:37 -03:00
Michael Niedermayer
12c3e120fe
avcodec/ituh263dec: Use 0xffff as error code in h263p_decode_umotion()
...
This matches ff_h263_decode_motion() both functions error codes are interpreted by the same common code
Fixes: 690/clusterfuzz-testcase-4744944981901312
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2017-03-02 03:16:12 +01:00
Michael Niedermayer
0716bcce5b
avcodec/ituh263dec: Check for the bitstream end in ff_h263_decode_mb()
...
Fixes invalid shift
Fixes: 670/clusterfuzz-testcase-4852021066727424
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com >
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2017-02-26 17:16:22 +01:00
Michael Niedermayer
0d85c7bb5a
avcodec/ituh263dec: Fix runtime error: left shift of 1342177279 by 1 places cannot be represented in type 'int'
...
Fixes: 659/clusterfuzz-testcase-5866673603084288
Huge DMV could be created by an encoder ignoring the spec
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2017-02-24 00:38:45 +01:00
Michael Niedermayer
631f748491
avcodec/ituh263dec: Fix runtime error: left shift of negative value -22
...
Fixes: 639/clusterfuzz-testcase-5143866241974272
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2017-02-21 19:05:04 +01:00
Michael Niedermayer
b7d9b4a1f1
avcodec/ituh263dec: Check cbpy in ff_h263_decode_mb()
...
Fixes: 618/clusterfuzz-testcase-6594990333493248
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2017-02-20 00:49:44 +01:00
Michael Niedermayer
39afd0482f
avcodec/ituh263dec: Implement U263s interpretation of H.263 B frames
...
Fixes Ticket1536
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2017-02-03 03:33:37 +01:00
Michael Niedermayer
0126cd95cc
avcodec/ituh263dec: Correct timestamp recovery for B frames
...
Improves u263_b-frames_5.avi
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2017-02-01 22:01:34 +01:00
Michael Niedermayer
901c625494
avcodec/ituh263dec: Use correct error codes in ff_h263_decode_mb()
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2017-02-01 19:09:27 +01:00
Michael Niedermayer
e00c516d1e
avcodec/ituh263dec: Correct indention
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2017-02-01 19:09:27 +01:00
Michael Niedermayer
b28ae1e09b
avcodec/ituh263dec: Implement B frame support with UMV
...
Fixes: u263_b-frames_1.avi
Fixes part of Ticket1536
return -1 is used here as it is used in similar code in this function, I intend
to replace it by proper error codes in the whole function.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2017-02-01 17:35:54 +01:00
Michael Niedermayer
2baf36caed
avcodec/ituh263dec: Avoid spending a long time in slice sync
...
Fixes: 177/fuzz-3-ffmpeg_VIDEO_AV_CODEC_ID_FLV1_fuzzer
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2016-11-15 18:27:31 +01:00
Clément Bœsch
6c98398b0b
lavc/get_bits: add a logging context to check_marker()
...
Based on d338abb664
2016-06-22 20:07:49 +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
Vittorio Giovara
41ed7ab45f
cosmetics: Fix spelling mistakes
...
Signed-off-by: Diego Biurrun <diego@biurrun.de >
2016-05-04 18:16:21 +02:00
Lou Logan
06eef96b69
fix some a/an typos
...
Signed-off-by: Lou Logan <lou@lrcd.com >
2016-03-28 14:13:17 -08:00
Michael Niedermayer
2a227fe879
Merge commit '0a49a62f998747cfa564d98d36a459fe70d3299b'
...
* commit '0a49a62f998747cfa564d98d36a459fe70d3299b':
h263: Always check both dimensions
Conflicts:
libavcodec/ituh263dec.c
See: 62006b539d
Merged-by: Michael Niedermayer <michaelni@gmx.at >
2015-06-30 22:14:25 +02:00
Michael Niedermayer
5585da7c5e
Merge commit '6f4cd33efb5a9ec75db1677d5f7846c60337129f'
...
* commit '6f4cd33efb5a9ec75db1677d5f7846c60337129f':
cosmetic: Reformat ff_h263_decode_mba
Merged-by: Michael Niedermayer <michaelni@gmx.at >
2015-06-30 22:01:32 +02:00
Luca Barbato
0a49a62f99
h263: Always check both dimensions
...
CC: libav-stable@libav.org
Found-By: ago@gentoo.org
2015-06-30 15:34:38 +02:00
Luca Barbato
6f4cd33efb
cosmetic: Reformat ff_h263_decode_mba
2015-06-30 15:34:38 +02:00
Michael Niedermayer
b5c71fba59
Merge commit 'e7af52a68dde9144b273a9598b60bf0f56e1323b'
...
* commit 'e7af52a68dde9144b273a9598b60bf0f56e1323b':
mpegvideo: rv10: Move function declaration to a separate header
Merged-by: Michael Niedermayer <michaelni@gmx.at >
2015-06-12 21:05:57 +02:00
Michael Niedermayer
218f58a16a
Merge commit 'e3d0f49abb20a551bf6d885f75c354d6d0bbeb9d'
...
* commit 'e3d0f49abb20a551bf6d885f75c354d6d0bbeb9d':
mpegvideo: h263: Move all tables to a single file
Conflicts:
libavcodec/h263.h
libavcodec/h263data.h
Merged-by: Michael Niedermayer <michaelni@gmx.at >
2015-06-12 20:57:37 +02:00
Vittorio Giovara
e7af52a68d
mpegvideo: rv10: Move function declaration to a separate header
2015-06-12 12:26:54 +01:00
Vittorio Giovara
e3d0f49abb
mpegvideo: h263: Move all tables to a single file
2015-06-12 12:26:04 +01:00
Michael Niedermayer
fd116b8dfa
Merge commit '378a00087fdadcc9b34165c05cd10a1a15f3fe61'
...
* commit '378a00087fdadcc9b34165c05cd10a1a15f3fe61':
mpegvideo: Move tables to a separate file
Merged-by: Michael Niedermayer <michaelni@gmx.at >
2015-06-01 01:26:36 +02:00
Vittorio Giovara
378a00087f
mpegvideo: Move tables to a separate file
2015-05-31 13:06:19 +02:00
Michael Niedermayer
75647622b5
Merge commit '6f57375d707de40dcec28d3cef886c364e032c21'
...
* commit '6f57375d707de40dcec28d3cef886c364e032c21':
rl: Rename ff_*_rl() to ff_rl_*()
Conflicts:
libavcodec/mpeg4videodec.c
libavcodec/rl.c
libavcodec/rl.h
Merged-by: Michael Niedermayer <michaelni@gmx.at >
2015-05-28 21:48:49 +02:00
Anton Khirnov
6f57375d70
rl: Rename ff_*_rl() to ff_rl_*()
2015-05-28 15:38:43 +01:00
Michael Niedermayer
d5227ceff1
Merge commit '9c1db92ad372d4cd69e0490e691c56e4097cb193'
...
* commit '9c1db92ad372d4cd69e0490e691c56e4097cb193':
mpegvideo: Drop err_recognition
Conflicts:
libavcodec/h263dec.c
libavcodec/ituh263dec.c
libavcodec/mpeg4video.h
libavcodec/mpeg4videodec.c
libavcodec/msmpeg4dec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at >
2015-05-22 20:38:42 +02:00
Vittorio Giovara
9c1db92ad3
mpegvideo: Drop err_recognition
...
It is just a duplicate of an AVCodecContext member so use it instead.
2015-05-22 15:34:39 +01:00
Michael Niedermayer
7b94a2f4b1
avcodec/ituh263dec: Use ff_tlog() for block level information
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2015-04-26 01:00:05 +02:00
Michael Niedermayer
8f7b022c8c
Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'
...
* commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25':
lavc: Replace av_dlog and tprintf with internal macros
Conflicts:
libavcodec/aacdec.c
libavcodec/audio_frame_queue.c
libavcodec/bitstream.c
libavcodec/dcadec.c
libavcodec/dnxhddec.c
libavcodec/dvbsubdec.c
libavcodec/dvdec.c
libavcodec/dvdsubdec.c
libavcodec/get_bits.h
libavcodec/gifdec.c
libavcodec/h264.h
libavcodec/h264_cabac.c
libavcodec/h264_cavlc.c
libavcodec/h264_loopfilter.c
libavcodec/h264_refs.c
libavcodec/imc.c
libavcodec/interplayvideo.c
libavcodec/jpeglsdec.c
libavcodec/libopencore-amr.c
libavcodec/mjpegdec.c
libavcodec/mpeg12dec.c
libavcodec/mpegvideo_enc.c
libavcodec/mpegvideo_parser.c
libavcodec/pngdec.c
libavcodec/ratecontrol.c
libavcodec/rv10.c
libavcodec/svq1dec.c
libavcodec/vqavideo.c
libavcodec/wmadec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at >
2015-04-20 04:10:10 +02:00
Vittorio Giovara
6a85dfc830
lavc: Replace av_dlog and tprintf with internal macros
2015-04-19 12:41:59 +01:00
Michael Niedermayer
fbdaebb298
avcodec/ituh263dec: Use check_marker()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2015-04-15 03:22:27 +02:00
Michael Niedermayer
c16896f525
Merge commit 'c01ccccbb13f464e74bb8498a8c573a66c430ca0'
...
* commit 'c01ccccbb13f464e74bb8498a8c573a66c430ca0':
ituh263dec: use macro instead of #if
Merged-by: Michael Niedermayer <michaelni@gmx.at >
2015-01-29 22:02:22 +01:00
Vittorio Giovara
c01ccccbb1
ituh263dec: use macro instead of #if
2015-01-29 17:33:34 +00:00
Michael Niedermayer
17085a0251
Merge commit '7ea1b3472a61de4aa4d41b571e99418e4997ad41'
...
* commit '7ea1b3472a61de4aa4d41b571e99418e4997ad41':
lavc: deprecate the use of AVCodecContext.time_base for decoding
Conflicts:
libavcodec/avcodec.h
libavcodec/h264.c
libavcodec/mpegvideo_parser.c
libavcodec/utils.c
libavcodec/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at >
2014-10-15 15:49:31 +02:00