Commit Graph
100 Commits
Author SHA1 Message Date
Anton Khirnov 51822879e7 h264_mb: constify block_offset
It is read-only in this code.
2015-03-21 11:27:15 +01:00
Anton Khirnov 3bea6409a1 h264_mvpred: constify all uses of H264Context
All the variables modified by this code are either per-MB arrays or have
been moved to the per-slice context
2015-03-21 11:27:15 +01:00
Anton Khirnov 460176aa19 h264.h: constify all uses of H264Context
All the variables modified by this code are either per-MB arrays or have
been moved to the per-slice context
2015-03-21 11:27:15 +01:00
Anton Khirnov d27b8248a6 h264_direct: constify all uses of H264Context
All the variables modified by this code are either per-MB arrays or have
been moved to the per-slice context
2015-03-21 11:27:14 +01:00
Anton Khirnov f42485dbce h264: use a separate GetBitContext for slice data 2015-03-21 11:27:14 +01:00
Anton Khirnov 2ea00e35e4 h264: do not abuse the context as a temporary storage in get_last_needed_nal()
Use a local variable instead.
2015-03-21 11:27:14 +01:00
Anton Khirnov 404a416d4b h264: remove some remnants of data partitioning 2015-03-21 11:27:14 +01:00
Anton Khirnov 7bbc254d64 h264: move resync_mb_{x,y} into the per-slice context 2015-03-21 11:27:14 +01:00
Anton Khirnov d4d9068cdf h264: move mb_{x,y} into the per-slice context 2015-03-21 11:27:14 +01:00
Anton Khirnov 0edbe6faa7 h264: move mb_xy into the per-slice context 2015-03-21 11:27:14 +01:00
Anton Khirnov 07c5ca551b h264: move is_complex into the per-slice context 2015-03-21 11:27:14 +01:00
Anton Khirnov 47a0d39350 h264: move mb_skip_run into the per-slice context 2015-03-21 11:27:14 +01:00
Anton Khirnov 9951907f6f h264: move redundant_pic_count into the per-slice context 2015-03-21 11:27:14 +01:00
Anton Khirnov a9b201cacf h264: move cabac_init_idc into the per-slice context 2015-03-21 11:27:14 +01:00
Anton Khirnov e6c90ce94f h264: move loopfilter parameters into the per-slice context 2015-03-21 11:27:14 +01:00
Anton Khirnov bd3e460b73 h264: move direct_cache into the per-slice context 2015-03-21 11:27:14 +01:00
Anton Khirnov 6479c79f55 h264: move mvd_cache into the per-slice context 2015-03-21 11:27:14 +01:00
Anton Khirnov a67f8ae9a2 h264: move mvd_table into the per-slice context 2015-03-21 11:27:14 +01:00
Anton Khirnov 5c8280c307 h264: move last_qscale_diff into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov e7226984ac h264: move [{top,left}_]cbp into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov 30da98adbd h264: move cabac[_state] into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov bf03a878a7 h264: move mb[_{padding,luma_dc}] into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov b063582e0c h264: move intra_pcm_ptr into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov 95eb35f305 h264: move the ref lists variables into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov 7747726667 h264: move map_col_to_list0[_field] into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov ee0d774dfa h264: move dist_scale_factor[_field] into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov be69f0a800 h264: move col_{parity,fieldoff} into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov 066aafced4 h264: move direct_spatial_mv_pred into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov ed451a08a4 h264: move sub_mb_type into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov 56febc993b h264: move the slice type variables into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov 5f390eef8e h264: move mb_[uv]linesize into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov 99a35d1ccb h264: move neighbor_transform_size into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov e6287f077c h264: move {mv,ref}_cache into the per-slice context 2015-03-21 11:27:13 +01:00
Anton Khirnov f69574cf7a h264: move non_zero_count_cache into the per-slice context 2015-03-21 11:27:12 +01:00
Anton Khirnov 64c81b2cd0 h264: move *_samples_available into the per-slice context 2015-03-21 11:27:12 +01:00
Anton Khirnov 7d8154edd5 h264: move intra4x4_pred_mode[_cache] into the per-slice context 2015-03-21 11:27:12 +01:00
Anton Khirnov 8b00f4df20 h264: move some neighbour information into the per-slice context 2015-03-21 11:27:12 +01:00
Anton Khirnov 4bd5ac200d h264: move {chroma,intra16x16}_pred_mode into the per-slice context 2015-03-21 11:27:12 +01:00
Anton Khirnov 5355ed6b20 h264: move {prev,next}_mb_skipped into the per-slice context 2015-03-21 11:27:12 +01:00
Anton Khirnov 06789ad3b7 h264: move qp_thresh into the per-slice context 2015-03-21 11:27:12 +01:00
Anton Khirnov d231e84b06 h264: move the quantizers into the per-slice context 2015-03-21 11:27:12 +01:00
Anton Khirnov d40ae0e595 h264: do not copy qscale when updating per-thread contexts
It's a per-slice quantity constructed when parsing the slice header.
2015-03-21 11:27:12 +01:00
Anton Khirnov 92c6c2a605 h264: split weighted pred-related vars into per-slice context 2015-03-21 11:27:09 +01:00
Anton Khirnov d8a45d2d49 h264_ps: properly check cropping parameters against overflow
CC: libav-stable@libav.org
2015-03-21 09:35:23 +01:00
Anton Khirnov 5127c00b97 hevc: zero the correct variables on invalid crop parameters
It's the output_window that is applied to the output frame, not
pic_conf_win
2015-03-21 09:35:19 +01:00
Anton Khirnov c929659bdd hevc: make the crop sizes unsigned 2015-03-21 09:35:14 +01:00
Anton Khirnov cf18e777ae movenc: write the display transform matrix 2015-03-19 21:02:59 +01:00
Anton Khirnov 96a06dbaf2 FATE: add support for testing hwaccels 2015-03-10 07:40:11 +01:00
Anton Khirnov dc7536ca3d avconv: do not abort immediately if initializing hwaccel fails
exit_program() will try to free the decoders, which is not a good idea
from within get_format().
Return an error instead.
2015-03-10 07:40:11 +01:00
Anton KhirnovandLuca Barbato ae5e1f3d66 tiff: Check that there is no aliasing in pixel format selection
Fixes possible issues with unexpected bpp/bppcount values.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Bug-Id: CVE-2014-8544
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-03-08 19:14:14 +01:00
Anton Khirnov ad786dd450 h264: remove a now redundant error check
It was only relevant when data partitioning was in use.
2015-03-05 16:10:11 +01:00
Anton Khirnov db5cc75f8b wma.h: #include "avcodec.h"
It's required for at least AVCodecContext.

Fixes make checkheaders.
2015-03-03 20:57:56 +01:00
Anton Khirnov 990e4a6639 Add a QSV decoding example. 2015-02-28 21:51:24 +01:00
Anton Khirnov 71f1ad37d8 lavc: do not compile fmtconvert unconditionally
Only ac3dec and dcadec use it.
2015-02-28 21:51:24 +01:00
Anton Khirnov d74a8cb7e4 fmtconvert: drop unused functions 2015-02-28 21:51:24 +01:00
Anton Khirnov ee964145b5 lavc: remove unused traces of fmtconvert usage
Those decoders have been switched to float output and so do not use
fmtconvert anymore.
2015-02-28 21:51:24 +01:00
Anton Khirnov a06b0b1295 h264: initialize H264Context.avctx in init_thread_copy
This prevents using a wrong (first thread's) AVCodecContext if decoding
a frame in the first pass over all threads fails.
2015-02-21 09:29:48 +01:00
Anton Khirnov 0dea4c77cc h264: only ref cur_pic in update_thread_context if it is initialized
It may be empty if the previous thread's decode call did not contain a
valid frame.
2015-02-21 09:29:27 +01:00
Anton Khirnov 0fbb271318 qsv_api: fix building with libmfx disabled 2015-02-19 17:35:34 +01:00
Anton Khirnov 11c22dfd49 configure: add missing h264_qsv hwaccel deps 2015-02-19 17:32:55 +01:00
Anton Khirnov 4e08c82110 lavc: add an Intel libmfx-based H.264 decoder
Based on the code by Luca Barbato <lu_zero@gentoo.org> and Yukinori
Yamazoe <drocon11@gmail.com>.
2015-02-19 15:08:49 +01:00
Anton Khirnov 31d2039cb4 h264_parser: export video format and dimensions 2015-02-19 15:07:52 +01:00
Anton Khirnov 5b1d9ceec7 pixfmt: add a pixel format for QSV hwaccel 2015-02-19 15:07:21 +01:00
Anton Khirnov e21d853099 FATE: add a test for the SVQ1 header byte swapping 2015-02-15 15:30:29 +01:00
Anton Khirnov d3449ac938 changelog: mention DXVA/HEVC and AAC ELD480 2015-02-15 15:30:21 +01:00
Anton Khirnov faa8ffda2c doc/APIchanges: fill in missing dates and hashes
Also, move a misplaced block to the right position.
2015-02-13 08:35:15 +01:00
Anton Khirnov 1509c018bd mpegts: relax restrictions on matching the packet start in read_header
analyze() is currently called both when probing and from read_header().
It determines the packet start by looking for the sync byte, followed by
unset Transport Error Indicator and valid adaptation_field_control.

This makes sense to do when probing, but once we already know the format
is MPEG-TS, it is counterproductive to be so strict -- e.g. in some
files the TEI might be set and analyze() might get called with a smaller
buffer than the one used for probing, resulting in a failure.
2015-02-10 21:43:44 +01:00
Anton Khirnov 0232ba62a2 frame: clarify buf documentation
Mention explicitly that the array must be filled contiguously.
2015-02-08 21:28:31 +01:00
Anton Khirnov a536a4e4bc lavc: support extracting audio service type from side data 2015-01-27 09:22:33 +01:00
Anton Khirnov 3212578148 mov: export audio service type as side data 2015-01-27 09:21:28 +01:00
Anton Khirnov 4227e4fe74 lavf: add a convenience function for adding side data to a stream 2015-01-27 09:18:32 +01:00
Anton Khirnov 728685f37a Add a side data type for audio service type.
Currently, audio service type is a field in AVCodecContext. However,
side data is more appropriate for this kind of information.
2015-01-27 09:17:48 +01:00
Anton Khirnov 80a11de7dc nutenc: do not use has_b_frames
It is unreliable, especially when the stream codec context is not the
encoding context. Use the codec descriptor properties instead.
2015-01-27 09:15:07 +01:00
Anton Khirnov e44b58924f lavc: deprecate unused AVCodecContext.stream_codec_tag 2015-01-27 09:14:39 +01:00
Anton Khirnov f771b3ab5d avidec: do not export stream_codec_tag
Handle its only existing use case internally.
2015-01-27 09:13:45 +01:00
Anton Khirnov 167e004e1a h264: drop any pretense of support for data partitioning
It does not work correctly and apparently never did. There is no
indication that this (mis)feature is ever used in the wild or even that
any software other than the reference supports it.

Since the code that attempts to support it adds some nontrivial
complexity and has resulted in several bugs in the past, it is better to
just drop it.
2015-01-27 09:10:12 +01:00
Anton Khirnov 58ae8d5957 h264_parser: restore a comment lost in 0268a54 2015-01-27 09:09:56 +01:00
Anton Khirnov ecab21ac47 h264: do not reset the ref lists in flush_change()
They are always constructed anew when needed, so there is no need to
reset them explicitly.
2015-01-27 09:09:29 +01:00
Anton Khirnov 9404a47a2d h264: move parser-only variables to their own context 2015-01-27 09:08:31 +01:00
Anton Khirnov cf1e0786ed error_resilience: move the MECmpContext initialization into ER code
Currently, it needs to be initialized by the ER caller (which is
currently either a mpegvideo decoder or h264dec). However, since none of
those decoders use MECmpContext for anything except ER, it makes more
sense to handle it purely inside ER.
2015-01-27 09:07:59 +01:00
Anton Khirnov 443b71928b hevc: unref the current frame if frame_start() fails
Prevents DPB from filling up with damaged input.
2015-01-27 08:34:56 +01:00
Anton Khirnov 1dd021929f hevc: clear unused refs on failure 2015-01-27 08:34:46 +01:00
Anton Khirnov f9f883af4f h264: simplify code in flush_dpb()
There is no point in clearing reference explicitly, since that will be
done as a part of ff_h264_unref_picture() right below.
2015-01-27 08:34:24 +01:00
Anton KhirnovandVittorio Giovara 54bc15d5eb id3v2: fix reading v2.2 attached pictures
In v2.2, the picture type is not a zero-terminated string, but has a
constant size of 3 bytes.
2015-01-14 17:17:24 +01:00
Anton KhirnovandVittorio Giovara 932788be5a id3v2: add names to the parameters of ID3v2EMFunc.read
Some of them are not immediately obvious.
2015-01-14 17:17:24 +01:00
Anton KhirnovandVittorio Giovara 8809c974a3 id3v2: constify the 'tag' parameter to special metadata parsing callback
Those functions should not ever modify it.
2015-01-14 17:17:24 +01:00
Anton Khirnov 51da7d0274 matroskaenc: refuse to write AAC without valid extradata 2015-01-09 15:51:00 +01:00
Anton Khirnov 7e4e010b80 mpeg4audio: check the init_get_bits() return value
Fixes possible invalid reads.

CC:libav-stable@libav.org
2015-01-09 15:44:31 +01:00
Anton Khirnov 60d4c6ff76 h264: restore a block mistakenly removed in e10fd08a
CC: libav-stable@libav.org
Bug-ID: 781
2014-12-27 10:44:48 +01:00
Anton Khirnov 17ba719d9b mmvideo: check frame dimensions
The frame size must be set by the caller and each dimension must be a
multiple of 2.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8543
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-12-19 08:01:46 +01:00
Anton Khirnov 88626e5af8 jvdec: check frame dimensions
The frame size must be set by the caller and each dimension must be a
multiple of 8.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8542
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-12-19 08:01:46 +01:00
Anton Khirnov 809c3023b6 mjpegdec: check for pixel format changes
Fixes possible invalid memory access.

Based on code by Michael Niedermayer <michaelni@gmx.at>

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8541
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-12-19 08:01:46 +01:00
Anton Khirnov 64f7575fbd mov: avoid a memleak when multiple stss boxes are present
CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-12-19 08:01:46 +01:00
Anton Khirnov e10e6651b5 thread: use "" instead of <> for including the w32pthreads wrapper
Found-by: Dave Yeo <dave.r.yeo@gmail.com>
2014-12-14 18:15:57 +01:00
Anton Khirnov 1973079417 opusdec: make sure all substreams have the same number of coded samples
Fixes invalid writes with invalid multichannel streams.

CC:libav-stable@libav.org
2014-11-27 14:06:03 +01:00
Anton Khirnov 2443e522f0 lavu: add wrappers for the pthreads mutex API
Also add no-op fallbacks when threading is disabled.

This helps keeping the code clean if Libav is compiled for targets
without threading. Since we assume that no threads of any kind are used
in such configurations, doing nothing is ok by definition.

Based on a patch by wm4 <nfxjfg@googlemail.com>.
2014-11-27 13:36:00 +01:00
Anton Khirnov 8b573ddda7 hevc: remove superfluous assignments and checks 2014-11-17 09:26:45 +01:00
Anton Khirnov eac3ac1fe0 hevc: eliminate an unneeded intermediate variable 2014-11-17 09:26:45 +01:00
Anton Khirnov eb335f3c5c hevc: reduce variable scope
Also, collapse the array into a scalar, since only one value is needed
at a time.
2014-11-17 09:26:45 +01:00
Anton Khirnov 84c0ece5fd hevc: further reduce code duplication in hls_prediction_unit() 2014-11-17 09:25:15 +01:00