Commit Graph

32 Commits

Author SHA1 Message Date
Michael Niedermayer c94326c1fc avcodec/hevcpred_template: Fix left shift of negative value
Fixes: runtime error: left shift of negative value -1
Fixes: 2250/clusterfuzz-testcase-minimized-5693382112313344

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-17 22:36:54 +02:00
Michael Niedermayer d5fcca83b9 Merge commit 'b11acd57326db6c2cc1475dd0bea2a06fbc85aa2'
* 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-12 22:28:54 +02:00
Anton Khirnov b11acd5732 hevc: remove HEVCContext usage from hevc_ps
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-07-12 18:15:39 +02:00
James Almer ba625dd8a1 avcodec: use av_mod_uintp2() where useful
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-04-21 22:41:20 -03: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
gcocherel ba70563d55 hevc/pps: optimized size of min_tb_addr_zs
reduce computation too
(cherry picked from commit 39c4d45c7788081c45c7fae51b7c5d0bcbaece9d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-24 13:11:40 +02:00
Michael Niedermayer 3791741cf9 Merge commit 'c9f8809ee4c576d5833865039bc1c85754448f67'
* commit 'c9f8809ee4c576d5833865039bc1c85754448f67':
  hevc/intra_pred: simplify neighboring sample derivation

Conflicts:
	libavcodec/hevcpred_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-19 15:03:42 +02:00
Michael Niedermayer 454920187f Merge commit '4c390b1ba98e6aec787aa0e7ea57ed7cb38283b7'
* commit '4c390b1ba98e6aec787aa0e7ea57ed7cb38283b7':
  hevc/intra_pred: optimize EXTEND_()*

Conflicts:
	libavcodec/hevcpred_template.c

See: 053fdacde7
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-19 14:28:49 +02:00
Michael Niedermayer 8447658550 Merge commit 'a1c2b48018b09d2613f075ec0748c95bd520ac00'
* commit 'a1c2b48018b09d2613f075ec0748c95bd520ac00':
  hevc: templatize intra_pred

Conflicts:
	libavcodec/hevc.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-19 14:10:13 +02:00
Michael Niedermayer 93318983c3 Merge commit '04db5794cd97e4b33ec2f963ef7f967722a456eb'
* commit '04db5794cd97e4b33ec2f963ef7f967722a456eb':
  hevc: templatize pred_planar

Conflicts:
	libavcodec/hevcpred_template.c

See: 053fdacde7
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-19 13:56:56 +02:00
Anton Khirnov c9f8809ee4 hevc/intra_pred: simplify neighboring sample derivation 2014-05-19 07:12:55 +02:00
Mickaël Raulet 25bb7eaf9e hevc/intra_pred: drop unnecessary conditions in loops
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-05-19 07:12:47 +02:00
Mickaël Raulet 4c390b1ba9 hevc/intra_pred: optimize EXTEND_()*
Process 4 pixels at once.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-05-19 07:10:43 +02:00
Anton Khirnov a1c2b48018 hevc: templatize intra_pred 2014-05-19 07:10:03 +02:00
Mickaël Raulet 04db5794cd hevc: templatize pred_planar
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-05-19 07:09:30 +02:00
Mickaël Raulet bb9e5116fe hevc: fixing code indenting in hevcpred(cherry picked from commit 28a5916845928de2951013b5398465573b181925)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-13 14:29:50 +02:00
Mickaël Raulet 38df49a068 hevc/intrapred: fix indent(cherry picked from commit ab167f3158cf37bd679bda28566170e2c3691686)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-13 14:14:14 +02:00
Mickaël Raulet 053fdacde7 hevc: a much faster implementation of intra prediction (up to 1s on
haswell 2.6GHz on basket ball drive all intra qp 27)(cherry picked from commit 5de9739176f0eb4c205e80a91628a0196c9924b2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-13 14:14:05 +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 dfefc9097e avcodec/hevcpred_template: also initialize top[-1] for constrained intra prediction
Fixes out of array read
Fixes: 387713a12dc5cfa27fcb4178084ce1ea-asan_stack-oob_131176a_1182_cov_3861068719_CAINIT_C_SHARP_3.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-02 21:23:40 +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 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 ce7f1c76bd avcodec/hevc: more whitespaces to reduce difference to 064698d381
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-02 12:33:54 +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 3c3ece24ea hevc : cosmetic changes(cherry picked from commit 7308c0ccf13f18cebe4851e6dcd6b5c0b09be1dd)
Decreases the difference to Anton Khirnovs patch v5

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-27 23:45:34 +01:00
Michael Niedermayer 09ef98f1ae avcodec/hevcpred_template: Fix integer overflows
signed integer overflow is undefined in C

Fixes the following gcc warnings:
In file included from libavcodec/hevcpred.c:27:0:
libavcodec/hevcpred_template.c: In function ‘intra_pred_8’:
libavcodec/hevcpred_template.c:302:9: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]
In file included from libavcodec/hevcpred.c:31:0:
libavcodec/hevcpred_template.c: In function ‘intra_pred_9’:
libavcodec/hevcpred_template.c:302:9: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]
In file included from libavcodec/hevcpred.c:35:0:
libavcodec/hevcpred_template.c: In function ‘intra_pred_10’:
libavcodec/hevcpred_template.c:302:9: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-27 11:54:53 +01:00
Mickaël Raulet 0c8aba3842 hevc: add wavefront parallel processing
cherry picked from commit b971f2c8fdc60f8bab605a6e8060492eb548a53a
cherry picked from commit e57b0a2c915ce6b8a9d57b8292f6581f0680842e

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-22 20:20:40 +02:00
Mickaël Raulet c841d02c05 hevc: fix PPS_A_qualcomm_7(cherry picked from commit 2af177a8761c88eb477a658eebcf4264068aa773)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-20 11:08:32 +02:00
gcocherel cf49d0156d valgrind cleanup(cherry picked from commit 0d5efa40b94c0de92a1fe5091b21e0e2d36bae3d)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-16 00:17:28 +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