Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-07-26avcodec/hevcdec: Avoid allocation of common CABAC stateAndreas Rheinhardt
It used to be allocated separately, so that the pointer to it is copied to all HEVCContexts, so that all slice-threads use the same. This is completely unnecessary now that there is only one HEVCContext any more. There is just one minor complication left: The slice-threads only get a pointer to const HEVCContext, but they need to modify the common CABAC state. Fix this by adding a pointer to the common CABAC state to HEVCLocalContext and document why it exists. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-26avcodec/hevc_cabac: Pass HEVCLocalContext when slice-threadingAndreas Rheinhardt
The HEVC decoder has both HEVCContext and HEVCLocalContext structures. The latter is supposed to be the structure containing the per-slicethread state. Yet that is not how it is handled in practice: Each HEVCLocalContext has a unique HEVCContext allocated for it and each of these coincides except in exactly one field: The corresponding HEVCLocalContext. This makes it possible to pass the HEVCContext everywhere where logically a HEVCLocalContext should be used. This commit stops doing this for lavc/hevc_cabac.c; it also constifies everything that is possible in order to ensure that no slice thread accidentally modifies the main HEVCContext state. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-26avcodec/hevcdec: Add stat_coeffs to HEVCABACStateAndreas Rheinhardt
The HEVC decoder has both HEVCContext and HEVCLocalContext structures. The latter is supposed to be the structure containing the per-slicethread state. Yet that is not how it is handled in practice: Each HEVCLocalContext has a unique HEVCContext allocated for it and each of these coincides with the main HEVCContext except in exactly one field: The corresponding HEVCLocalContext. This makes it possible to pass the HEVCContext everywhere where logically a HEVCLocalContext should be used. This led to confusion in the first version of what eventually became commit c8bc0f66a875bc3708d8dc11b757f2198606ffd7: Before said commit, the initialization of the Rice parameter derivation state was incorrect; the fix for single-threaded as well as frame-threaded decoding was to add backup stats to HEVCContext that are used when the cabac state is updated*, see https://ffmpeg.org/pipermail/ffmpeg-devel/2020-August/268861.html Yet due to what has been said above, this does not work for slice-threading, because the each HEVCLocalContext has its own HEVCContext, so the Rice parameter state would not be transferred between threads. This is fixed in c8bc0f66a875bc3708d8dc11b757f2198606ffd7 by a hack: It rederives what the previous thread was and accesses the corresponding HEVCContext. Fix this by treating the Rice parameter state the same way the ordinary CABAC parameters are shared between threads: Make them part of the same struct that is shared between slice threads. This does not cause races, because the parts of the code that access these Rice parameters are a subset of the parts of code that access the CABAC parameters. *: And if the persistent_rice_adaptation_enabled_flag is set. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-09avcodec/hevc_cabac: Don't cast const away unnecessarilyAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-01-04avcodec/hevcdec: fix stat_coeff save/load for ↵Xu Guangxin
persistent_rice_adaptation_enabled_flag It's required by the 9.3.1 TableStatCoeff* section. Following clips have this feature: WPP_HIGH_TP_444_8BIT_RExt_Apple_2.bit Bitdepth_A_RExt_Sony_1.bin Bitdepth_B_RExt_Sony_1.bin EXTPREC_HIGHTHROUGHPUT_444_16_INTRA_10BIT_RExt_Sony_1.bit EXTPREC_HIGHTHROUGHPUT_444_16_INTRA_12BIT_RExt_Sony_1.bit EXTPREC_HIGHTHROUGHPUT_444_16_INTRA_8BIT_RExt_Sony_1.bit EXTPREC_MAIN_444_16_INTRA_10BIT_RExt_Sony_1.bit EXTPREC_MAIN_444_16_INTRA_12BIT_RExt_Sony_1.bit EXTPREC_MAIN_444_16_INTRA_8BIT_RExt_Sony_1.bit WPP_AND_TILE_10Bit422Test_HIGH_TP_444_10BIT_RExt_Apple_2.bit WPP_AND_TILE_AND_CABAC_BYPASS_ALIGN_0_HIGH_TP_444_14BIT_RExt_Apple_2.bit WPP_AND_TILE_AND_CABAC_BYPASS_ALIGN_1_HIGH_TP_444_14BIT_RExt_Apple_2.bit WPP_AND_TILE_HIGH_TP_444_8BIT_RExt_Apple_2.bit you can download them from: https://www.itu.int/wftp3/av-arch/jctvc-site/bitstream_exchange/draft_conformance/RExt/ Signed-off-by: Xu Guangxin <oddstone@gmail.com> Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
2020-11-29avcodec/hevc_cabac: Limit value in coeff_abs_level_remaining_decode() tighterMichael Niedermayer
The max depth is 16bps, the max allowed coefficient depth is depth+6 Fixes: signed integer overflow: 1074266112 + 1073725439 cannot be represented in type 'int' Fixes: 26493/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5657763331702784 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-17lavc/hevc_cabac: fix cbf_cb and cbf_cr for transform depth 4Linjie Fu
The max transform depth is 5(from 0 to 4), so we need 5 cabac states for cbf_cb and cbf_cr. See Table 9-4 for details. Signed-off-by: Xu Guangxin <guangxin.xu@intel.com> Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-28avcodec/hevc_cabac: Tighten the limit on k in ff_hevc_cu_qp_delta_abs()Michael Niedermayer
Values larger would fail subsequent tests. Fixes: signed integer overflow: 5 + 2147483646 cannot be represented in type 'int' Fixes: 16966/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5695709549953024 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-27avcodec/hevc_cabac: Check prefix so as to avoid invalid shifts in ↵Michael Niedermayer
coeff_abs_level_remaining_decode() I suspect that this can be limited tighter, but i failed to find anything in the spec that would confirm that. Fixes: 4833/clusterfuzz-testcase-minimized-5302840101699584 Fixes: runtime error: left shift of 134217730 by 4 places cannot be represented in type 'int' Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-23avcodec/hevc_cabac: Move prefix check in coeff_abs_level_remaining_decode() downMichael Niedermayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-17avcodec/hevc_cabac: Fix integer overflow in ff_hevc_cu_qp_delta_abs()Michael Niedermayer
Fixes: signed integer overflow: 2147483647 + 1073741824 cannot be represented in type 'int' Fixes: 4555/clusterfuzz-testcase-minimized-4505532481142784 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-03avcodec/hevc_cabac: Check for ff_init_cabac_decoder() failure in cabac_reinit()Michael Niedermayer
Fixes: runtime error: left shift of negative value -967831544 Fixes: 2815/clusterfuzz-testcase-minimized-6062914471460864 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-06-24avcodec/hevcdec: check ff_init_cabac_decoder() for failureMichael Niedermayer
Fixes: runtime error: left shift of 1965559808 by 4 places cannot be represented in type 'int' Fixes: 2333/clusterfuzz-testcase-minimized-5223935677300736 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-08Merge commit '5c89022542ce8521d89ef58858342a7bc1c3cd0d'Clément Bœsch
* commit '5c89022542ce8521d89ef58858342a7bc1c3cd0d': hevc: Drop pointless av_unused attribute Merged-by: Clément Bœsch <u@pkh.me>
2017-03-24Merge commit '0bfdcce4d42a6e654c00ea5f9237dc987626457f'James Almer
* commit '0bfdcce4d42a6e654c00ea5f9237dc987626457f': hevc: move the SliceType enum to hevc.h Merged-by: James Almer <jamrial@gmail.com>
2017-03-23Merge commit '150c896a9e46b23b97debb0a5f66fbaeaa32f153'James Almer
* commit '150c896a9e46b23b97debb0a5f66fbaeaa32f153': hevcdec: split ff_hevc_diag_scan* declarations into a separate header Merged-by: James Almer <jamrial@gmail.com>
2017-03-23Merge commit '4abe3b049d987420eb891f74a35af2cebbf52144'Clément Bœsch
* commit '4abe3b049d987420eb891f74a35af2cebbf52144': hevc: rename hevc.[ch] to hevcdec.[ch] Merged-by: Clément Bœsch <u@pkh.me>
2017-01-31Merge commit 'cc16da75c2f99d92f7a6461100f041352deb6d88'Clément Bœsch
* commit 'cc16da75c2f99d92f7a6461100f041352deb6d88': hevc: Add coefficient limiting to speed up IDCT Noop again as we have these changes already, only random spacing changes. Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-01-31Merge commit '1bd890ad173d79e7906c5e1d06bf0a06cca4519d'Clément Bœsch
* commit '1bd890ad173d79e7906c5e1d06bf0a06cca4519d': hevc: Separate adding residual to prediction from IDCT This commit should be a noop but isn't because of the following renames: - transform_add → add_residual - transform_skip → dequant - idct_4x4_luma → transform_4x4_luma Merged-by: Clément Bœsch <cboesch@gopro.com>
2016-11-30hevc: Drop pointless av_unused attributeDiego Biurrun
2016-10-21hevc: move the SliceType enum to hevc.hAnton Khirnov
Those values are decoder-independent and are also use by the VA-API encoder.
2016-10-16hevc: rename hevc.[ch] to hevcdec.[ch]Anton Khirnov
This is more consistent with the rest of libav and frees up the hevc.h name for decoder-independent shared declarations.
2016-06-21Merge commit '5afb94c817abffad030c6b94d7003dca8aace3d5'Clément Bœsch
* commit '5afb94c817abffad030c6b94d7003dca8aace3d5': Mark read-only tables as static Merged-by: Clément Bœsch <u@pkh.me>
2015-11-28avcodec/hevc_cabac: Fix multiple integer overflowsMichael Niedermayer
Fixes: 04ec80eefa77aecd7a49a442cc02baea/asan_heap-oob_19544fa_3303_1905796cd9d8e15f86d664332caabc00.bit Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-13Merge commit 'a062a55d37720abc8c704aa0e8682efd3cdc9c9b'Michael Niedermayer
* commit 'a062a55d37720abc8c704aa0e8682efd3cdc9c9b': hevc_parser: fix standalone build with the hevc decoder disabled Conflicts: libavcodec/Makefile libavcodec/hevc.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-12Merge commit 'b11acd57326db6c2cc1475dd0bea2a06fbc85aa2'Michael Niedermayer
* commit 'b11acd57326db6c2cc1475dd0bea2a06fbc85aa2': hevc: remove HEVCContext usage from hevc_ps Conflicts: libavcodec/hevc.c libavcodec/hevc_cabac.c libavcodec/hevc_filter.c libavcodec/hevc_mvs.c libavcodec/hevc_ps.c libavcodec/hevc_refs.c libavcodec/hevcpred_template.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-12hevc: remove HEVCContext usage from hevc_psAnton Khirnov
Factor out the parameter sets into a separate struct and use it instead. This will allow us to reuse this code in the parser.
2015-05-18avcodec/hevc_cabac: Rename ff_hevc_transform_skip_flag_decode() to ↵Michael Niedermayer
hevc_transform_skip_flag_decode() The function is static and used once in the file its defined in Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-22avcodec: use av_mod_uintp2() where usefulJames Almer
Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
2015-02-13hevc: Use generic av_clip function, not C implementationPeter Meerwald
hevc seems to be the only place where the C implementation of the av_clip function is explicitly selected, precluding platform-specific optimizations Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-11hevc_cabac: decrease CABAC_MAX_BINMichael Niedermayer
Prevents shifts with undefined behavior, as no syntax element has a valid value greater than 1 << 31. Bug-Id: CID 1206635
2014-10-01hevc: reuse edge emu buffer for coefficientsChristophe Gisquet
Kind of hackish but... Reviewed-by: Mickael Raulet <Mickael.Raulet@insa-rennes.fr> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-27hevc: remove CodingTreeChristophe Gisquet
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-22hevc/rext: fixing rdpcm and scaling list for Range ExtensionMickaël Raulet
-new rext bitstreams: PERSIST_RPARAM_A_RExt_Sony_1.bit ok = QMATRIX_A_RExt_Sony_1.bit ok = SAO_A_RExt_MediaTek_1.bit ok = (cherry picked from commit cdea029d452c521f8e5bcbe589f44b13a4011604) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-15hevc/rext: add support for Range extension toolsMickaël Raulet
SPS features/flags: - transform_skip_rotation_enabled_flag - transform_skip_context_enabled_flag - implicit_rdpcm_enabled_flag - explicit_rdpcm_enabled_flag - intra_smoothing_disabled_flag - persistent_rice_adaptation_enabled_flag PPS features/flags: - log2_max_transform_skip_block_size - cross_component_prediction_enabled_flag - chroma_qp_offset_list_enabled_flag - diff_cu_chroma_qp_offset_depth - chroma_qp_offset_list_len_minus1 - cb_qp_offset_list - cr_qp_offset_list - log2_sao_offset_scale_luma - log2_sao_offset_scale_chroma (cherry picked from commit 005294c5b939a23099871c6130c8a7cc331f73ee) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-15hevc/rext: basic infrastructure for supporting range extensionMickaël Raulet
- support for 4:2:2 and 4:4:4 up to 12 bits - add a new profile for range extension (cherry picked from commit d3c067fa65bbc871758d28aa07f54123430ca346) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-15hevc: separate residu and prediction (needed for Range Extension)Mickaël Raulet
(cherry picked from commit 6b3856ef57d66f2e59ee61fd2eb5f83b6d0d7d4a) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-15hevc/cabac: add new context for new syntax elements related to Rext(cherry ↵Mickaël Raulet
picked from commit 6d71e2394f52679cfc8b86fb5880f89e6bd311d4) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-15hevc: cleaning up, remove unused constants(cherry picked from commit ↵Mickaël Raulet
7eed32d076c57aa03011d65a64903e8bdb633978) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-19Merge commit '869fc416f7c78ed4e397e0208acd1545771c0502'Michael Niedermayer
* commit '869fc416f7c78ed4e397e0208acd1545771c0502': hevc: Mark num_bins_in_se as unused Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-19hevc: Mark num_bins_in_se as unusedLuca Barbato
Only its size is actually used. Silence a clang warning.
2014-06-17avcodec/hevc: new idct + asmplepere
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-06hevc: C code update for new motion compensationMickaël Raulet
pretty print C Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-28avcodec/hevc_cabac: decrease CABAC_MAX_BINMichael Niedermayer
Prevents shifts with undefined behavior Fixes CID1206634 Fixes CID1206635 Fixed CID1206636 Reviewed-by: smarter Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-02libavcodec/hevc: reduce bracket differences to ↵Michael Niedermayer
064698d381e1e7790f21b0199a8930ea04e2e942 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-02avcodec/hevc: more whitespaces to reduce difference to ↵Michael Niedermayer
064698d381e1e7790f21b0199a8930ea04e2e942 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-02avcodec/hevc: Adjust white-spaces to reduce difference to ↵Michael Niedermayer
064698d381e1e7790f21b0199a8930ea04e2e942 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-01Merge commit '064698d381e1e7790f21b0199a8930ea04e2e942'Michael Niedermayer
* commit '064698d381e1e7790f21b0199a8930ea04e2e942': Add HEVC decoder Conflicts: Changelog libavcodec/Makefile libavcodec/allcodecs.c libavcodec/hevc.c libavcodec/hevc.h libavcodec/hevc_cabac.c libavcodec/hevc_filter.c libavcodec/hevc_mvs.c libavcodec/hevc_parser.c libavcodec/hevc_ps.c libavcodec/hevc_refs.c libavcodec/hevc_sei.c libavcodec/hevcdsp.c libavcodec/hevcdsp_template.c libavcodec/hevcpred.c libavcodec/hevcpred_template.c libavcodec/version.h cosmetics from hevc.h & hevc_ps.c mostly merged, other files left as they where in ffmpeg. Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-31Add HEVC decoderGuillaume Martres
Initially written by Guillaume Martres <smarter@ubuntu.com> as a GSoC project. Further contributions by the OpenHEVC project and other developers, namely: Mickaël Raulet <mraulet@insa-rennes.fr> Seppo Tomperi <seppo.tomperi@vtt.fi> Gildas Cocherel <gildas.cocherel@laposte.net> Khaled Jerbi <khaled_jerbi@yahoo.fr> Wassim Hamidouche <wassim.hamidouche@insa-rennes.fr> Vittorio Giovara <vittorio.giovara@gmail.com> Jan Ekström <jeebjp@gmail.com> Anton Khirnov <anton@khirnov.net> Martin Storsjö <martin@martin.st> Luca Barbato <lu_zero@gentoo.org> Yusuke Nakamura <muken.the.vfrmaniac@gmail.com> Reimar Döffinger <Reimar.Doeffinger@gmx.de> Diego Biurrun <diego@biurrun.de> Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-10-28hevc: more cosmetic(cherry picked from commit ↵Mickaël Raulet
9697abe41daa234602915f85bf6b1c0ca0252cff) Decreases the difference to Anton Khirnovs patch v5 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>