Michael Niedermayer
c09c0ce374
avcodec/hevcdsp_template: Fix invalid shift in put_hevc_epel_bi_w_v()
...
Fixes: runtime error: left shift of negative value -255
Fixes: 4037/clusterfuzz-testcase-minimized-5290998163832832
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit 7d88586e47 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2018-01-08 23:19:14 +01:00
Michael Niedermayer
2293e5a78a
avcodec/hevcdsp_template: Fix undefined shift
...
Fixes: runtime error: left shift of negative value -255
Fixes: 3373/clusterfuzz-testcase-minimized-5604083912146944
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit fbdab6eca7 )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2017-10-05 01:27:59 +02:00
Michael Niedermayer
03bf78eba6
avcodec/hevcdsp_template: Fix undefined shift in put_hevc_pel_bi_w_pixels
...
Fixes: runtime error: left shift of negative value -95
Fixes: 3077/clusterfuzz-testcase-minimized-4684917524922368
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
(cherry picked from commit c225da68cf )
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc >
2017-09-17 12:21:32 +02:00
James Almer
7a806c68a6
avcodec/hevcdsp: rename sao_band_filter c functions
...
Signed-off-by: James Almer <jamrial@gmail.com >
2015-08-21 02:24:30 -03:00
Michael Niedermayer
29d147c94d
Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'
...
* commit '059a934806d61f7af9ab3fd9f74994b838ea5eba':
lavc: Consistently prefix input buffer defines
Conflicts:
doc/examples/decoding_encoding.c
libavcodec/4xm.c
libavcodec/aac_adtstoasc_bsf.c
libavcodec/aacdec.c
libavcodec/aacenc.c
libavcodec/ac3dec.h
libavcodec/asvenc.c
libavcodec/avcodec.h
libavcodec/avpacket.c
libavcodec/dvdec.c
libavcodec/ffv1enc.c
libavcodec/g2meet.c
libavcodec/gif.c
libavcodec/h264.c
libavcodec/h264_mp4toannexb_bsf.c
libavcodec/huffyuvdec.c
libavcodec/huffyuvenc.c
libavcodec/jpeglsenc.c
libavcodec/libxvid.c
libavcodec/mdec.c
libavcodec/motionpixels.c
libavcodec/mpeg4videodec.c
libavcodec/mpegvideo.c
libavcodec/noise_bsf.c
libavcodec/nuv.c
libavcodec/nvenc.c
libavcodec/options.c
libavcodec/parser.c
libavcodec/pngenc.c
libavcodec/proresenc_kostya.c
libavcodec/qsvdec.c
libavcodec/svq1enc.c
libavcodec/tiffenc.c
libavcodec/truemotion2.c
libavcodec/utils.c
libavcodec/utvideoenc.c
libavcodec/vc1dec.c
libavcodec/wmalosslessdec.c
libavformat/adxdec.c
libavformat/aiffdec.c
libavformat/apc.c
libavformat/apetag.c
libavformat/avidec.c
libavformat/bink.c
libavformat/cafdec.c
libavformat/flvdec.c
libavformat/id3v2.c
libavformat/isom.c
libavformat/matroskadec.c
libavformat/mov.c
libavformat/mpc.c
libavformat/mpc8.c
libavformat/mpegts.c
libavformat/mvi.c
libavformat/mxfdec.c
libavformat/mxg.c
libavformat/nutdec.c
libavformat/oggdec.c
libavformat/oggparsecelt.c
libavformat/oggparseflac.c
libavformat/oggparseopus.c
libavformat/oggparsespeex.c
libavformat/omadec.c
libavformat/rawdec.c
libavformat/riffdec.c
libavformat/rl2.c
libavformat/rmdec.c
libavformat/rtpdec_latm.c
libavformat/rtpdec_mpeg4.c
libavformat/rtpdec_qdm2.c
libavformat/rtpdec_svq3.c
libavformat/sierravmd.c
libavformat/smacker.c
libavformat/smush.c
libavformat/spdifenc.c
libavformat/takdec.c
libavformat/tta.c
libavformat/utils.c
libavformat/vqf.c
libavformat/westwood_vqa.c
libavformat/xmv.c
libavformat/xwma.c
libavformat/yop.c
Merged-by: Michael Niedermayer <michael@niedermayer.cc >
2015-07-27 23:15:19 +02:00
James Almer
6e3651983c
avcodec/hevcdsp: add missing () to CMP macro
...
Found-by: Clément Bœsch <u@pkh.me >
Signed-off-by: James Almer <jamrial@gmail.com >
2015-02-16 18:56:16 -03:00
James Almer
22596383f3
avcodec/hevcdsp: optimize pixel comparison in sao_edge_filter
...
GCC 4.9.2 on a Core i5-4200U @ 1.60GHz, Linux x86_64
Before
715487 decicycles in sao_edge_filter_8, 262144 runs, 0 skips
After
672104 decicycles in sao_edge_filter_8, 262144 runs, 0 skips
Reviewed-by: Michael Niedermayer <michaelni@gmx.at >
Signed-off-by: James Almer <jamrial@gmail.com >
2015-02-16 17:47:47 -03:00
James Almer
1f1c7c8a57
hevcdsp: remove compilation-time-fixed parameter from sao_edge_filter
...
The stride_src parameter is always 2 * MAX_PB_SIZE + FF_INPUT_BUFFER_PADDING_SIZE.
Signed-off-by: James Almer <jamrial@gmail.com >
2015-02-05 15:02:22 -03:00
James Almer
7457afc64d
hevcdsp: replace the SAOParams struct parameter from sao_edge_filter
...
As with sao_band_filter, pass instead the two variables from the struct needed in the function.
This simplifies writing asm optimized versions.
Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr >
Signed-off-by: James Almer <jamrial@gmail.com >
2015-02-04 17:53:04 -03:00
James Almer
121ccc3365
hevcdsp: further simplify sao_edge_filter
...
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com >
Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr >
Signed-off-by: James Almer <jamrial@gmail.com >
2015-02-04 17:52:59 -03:00
Seppo Tomperi
4386e1fd94
hevcdsp: simplified sao_edge_filter
...
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com >
Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr >
2015-02-04 17:52:54 -03:00
Seppo Tomperi
74d7faf400
hevcdsp: separated sao edge filter and pixel restore funcs
...
Reviewed-by: Michael Niedermayer <michaelni@gmx.at >
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com >
Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr >
2015-02-04 17:52:49 -03:00
James Almer
2929e56006
hevcdsp: replace the SAOParams struct parameter from sao_band_filter
...
Pass instead the two variables from the struct needed in the function.
This simplifies writing asm optimized versions of the function
Signed-off-by: James Almer <jamrial@gmail.com >
2015-02-01 15:45:20 -03:00
James Almer
65e6ab0c5a
hevcdsp: remove unused parameter from sao_band_filter
...
Signed-off-by: James Almer <jamrial@gmail.com >
2015-02-01 15:45:14 -03:00
Michael Niedermayer
30156eab6d
Merge commit 'de1f8ead8993512925a3ee6c7491473414419e55'
...
* commit 'de1f8ead8993512925a3ee6c7491473414419e55':
hevcdsp_template: templatize transquant_bypass
Conflicts:
libavcodec/hevcdsp_template.c
Merged-by: Michael Niedermayer <michaelni@gmx.at >
2014-11-17 11:41:35 +01:00
Anton Khirnov
de1f8ead89
hevcdsp_template: templatize transquant_bypass
2014-11-17 09:25:12 +01:00
Christophe Gisquet
dad7f15567
hevcdsp: remove more instances of compile-time-fixed parameters
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2014-08-22 15:22:42 +02:00
Christophe Gisquet
d4f44b66d3
hevcdsp: remove compilation-time-fixed parameter
...
The dststride parameter is always MAX_PB_SIZE.
Reviewed-by: Mickaël Raulet <mraulet@gmail.com >
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2014-08-22 14:57:37 +02:00
Christophe Gisquet
6786848585
hevc_deblock: change tc type
...
The x86 asm expects int32_t so use that type.
Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr >
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2014-08-06 12:38:26 +02:00
Anton Khirnov
73bb8f61d4
hevcdsp: remove an unneeded variable in the loop filter
...
beta0 and beta1 will always be the same
2014-07-26 15:00:11 +00:00
Christophe Gisquet
ca081217cd
hevcdsp: change types of SAO parameters
...
From openhevc
Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr >
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2014-07-23 20:54:03 +02:00
Anton Khirnov
d7e162d46b
hevcdsp: remove an unneeded variable in the loop filter
...
beta0 and beta1 will always be the same within a CU
Signed-off-by: Mickaël Raulet <mraulet@insa-rennes.fr >
cherry picked from commit 4a23d824741a289c7d2d2f2871d1e2621b63fa1b
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2014-07-22 16:27:26 +02:00
Mickaël Raulet
d249e6828e
hevc/sao: optimze sao implementation
...
- adding one extra pixel all around the frame
- do not copy when SAO is not applied
5% improvement
cherry picked from commit 10fc29fc19a12c4d8168fbe1a954b76386db12d0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2014-07-18 22:46:50 +02:00
Mickaël Raulet
453f8eaee2
hevc/rext: add support for Range extension tools
...
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-15 14:08:20 +02:00
Mickaël Raulet
5a41999d81
hevc/rext: basic infrastructure for supporting range extension
...
- 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-15 13:47:35 +02:00
Mickaël Raulet
250430bf28
hevc: separate residu and prediction (needed for Range Extension)
...
(cherry picked from commit 6b3856ef57d66f2e59ee61fd2eb5f83b6d0d7d4a)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2014-07-15 13:37:27 +02:00
Mickaël Raulet
1241eb8870
hevc: simplify SAO computation, delay from one row its computation
...
(cherry picked from commit f2c5f647cec786df26f442a85e6d685a131a50c9)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2014-07-15 13:11:33 +02:00
plepere
92cccb7bcd
avcodec/hevc: new idct + asm
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2014-06-17 13:23:36 +02:00
Mickaël Raulet
83976e40e8
hevc: C code update for new motion compensation
...
pretty print C
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com >
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2014-05-06 18:22:34 +02:00
Michael Niedermayer
1287b640f0
Merge commit '8eeacf31c5ea37baf6b222dc38d20cf4fd33c455'
...
* commit '8eeacf31c5ea37baf6b222dc38d20cf4fd33c455':
hevc: Do not left shift a negative value in hevc_loop_filter_chroma
Merged-by: Michael Niedermayer <michaelni@gmx.at >
2014-02-23 22:18:09 +01:00
Luca Barbato
8eeacf31c5
hevc: Do not left shift a negative value in hevc_loop_filter_chroma
2014-02-23 14:34:41 +01:00
Guillaume Martres
faf03ecba0
hevc: Remove useless clip
...
The src buffer should only contain values in the interval
[0, (1 << BIT_DEPTH) - 1].
Since shift = (BIT_DEPTH - 5), src[x] >> shift must be in
the interval [0, 31], so no clip is needed.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org >
2014-01-21 11:58:52 +01:00
Guillaume Martres
a246d06fe0
hevc: clip pixels when transquant bypass is used
...
The reconstructed picture should always be clipped (see section 8.6.5),
previously we did not clip coding units where
cu_transquant_bypass_flag == 1.
Sample-Id: 00001325-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org >
2014-01-21 11:58:37 +01:00
Guillaume Martres
b00a8b4d19
hevc: remove useless clip in FUNC(sao_band_filter)()
...
The src buffer should only contain values in the interval
[0, (1 << BIT_DEPTH) - 1]. Since shift = (BIT_DEPTH - 5), src[x] >> shift
must be in the interval [0, 31], so no clip is needed.
This removes the code that was changed in 5856bca360
as the clip that was repositioned in that commit is removed
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2014-01-12 01:03:19 +01:00
Guillaume Martres
c9fe0caf7a
hevc: clip pixels when transquant bypass is used
...
Fixes: asan_stack-oob_eae8e3_7333_WPP_B_ericsson_MAIN10_2.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
This is a more proper fix than 5856bca360
The reconstructed picture should always be clipped (see section 8.6.5),
previously we did not clip coding units where
cu_transquant_bypass_flag == 1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2014-01-12 00:49:11 +01:00
Luca Barbato
5856bca360
hevc: Clip the pixel before shifting
...
Prevent an out of array bound read.
Fixes: asan_stack-oob_eae8e3_7333_WPP_B_ericsson_MAIN10_2.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2014-01-11 20:33:05 +01:00
Guillaume Martres
679a6377e4
hevc: avoid some unnecessary differences with libav
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2013-12-10 16:20:48 +01:00
Michael Niedermayer
35594c48ca
libavcodec/hevc: random cosmetics to reduce diff to 064698d381
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2013-11-02 17:28:44 +01:00
Michael Niedermayer
2c4f573696
libavcodec/hevc: random cosmetics to reduce diff to 064698d381
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2013-11-02 15:32:15 +01:00
Michael Niedermayer
42dbe2d9b1
libavcodec/hevcdsp_template: random cosmetics to reduce diff to 064698d381
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2013-11-02 14:42:57 +01:00
Michael Niedermayer
69b3668b83
libavcodec/hevc: indention related cosmetics to reduce diff to 064698d381
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2013-11-02 14:36:59 +01:00
Michael Niedermayer
6a84d17bd7
libavcodec/hevcdsp_template: cosmetics to reduce diff to 064698d381
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2013-11-02 14:30:22 +01:00
Michael Niedermayer
b23692b3a8
libavcodec/hevc: reduce whitespace differences to 064698d381
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2013-11-02 14:10:21 +01:00
Michael Niedermayer
1a6948fa70
libavcodec/hevc: reduce bracket differences to 064698d381
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2013-11-02 13:09:31 +01:00
Michael Niedermayer
f578e5d937
avcodec/hevc: Adjust white-spaces to reduce difference to 064698d381
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2013-11-02 00:44:54 +01:00
Guillaume Martres
064698d381
Add HEVC decoder
...
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-31 20:19:59 +01:00
Mickaël Raulet
c68faca68e
hevc: fix transform_skip which is only valid for 4x4(cherry picked from commit 740e5a71e5121dbf3fabdc4fec97829c18ecc2d8)
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2013-10-22 08:41:14 +02:00
Guillaume Martres
c8dd048ab8
lavc: add a HEVC decoder.
...
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 >
Signed-off-by: Anton Khirnov <anton@khirnov.net >
Signed-off-by: Michael Niedermayer <michaelni@gmx.at >
2013-10-15 22:13:02 +02:00