1
0
Fork 0
Commit Graph

78 Commits

Author SHA1 Message Date
Andreas Rheinhardt 6106fb2b4c avcodec/hevcdsp: Offset ff_hevc_.pel_filters to simplify addressing
Besides simplifying address computations (it saves 432B of .text
in hevcdsp.o alone here) it also fixes undefined behaviour that
occurs if mx or my are 0 (happens when the filters are unused)
because they lead to an array index of -1 in the old code.
This happens in the checkasm-hevc_pel FATE-test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-13 20:25:49 -03:00
Wu Jianhua 04c2e246a3 avcodec/hevcdsp_template: reuse put/put_luma/put_chroma from h2656_inter_template
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2024-02-01 19:54:28 +08:00
Nuo Mi ae0a83477b hevcdec: move deblock template to h26x/h2656_deblock_template.c 2024-01-11 22:53:05 +08:00
Nuo Mi d2fe23b835 hevcdec: move sao template to h26x/h2656_sao_template.c 2024-01-11 22:53:05 +08:00
Andreas Rheinhardt b3bbbb14d0 avcodec/hevcdsp: Constify src pointers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 02:54:04 +02:00
Michael Niedermayer 9c5250a561 avcodec/hevcdsp_template: stay within tables in sao_band_filter()
Fixes: out of array read
Fixes: 47875/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5719393113341952

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-07-12 21:55:22 +02:00
Michael Niedermayer d135f3c514 avcodec/hevcdsp_template: Fix Invalid shifts in put_hevc_qpel_bi_w_h() and put_hevc_qpel_bi_w_w()
Fixes: left shift of negative value -1
Fixes: 4690/clusterfuzz-testcase-minimized-6117482428366848

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-28 20:13:59 +01:00
Michael Niedermayer 0c9ab5ef9c avcodec/hevcdsp_template.c: Fix undefined shift in FUNC(dequant)
Fixes: runtime error: left shift of negative value -180
Fixes: 4626/clusterfuzz-testcase-minimized-5647837887987712

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-26 18:05:10 +01:00
Michael Niedermayer 439fbb9c8b avcodec/hevcdsp_template: Fix undefined shift in put_hevc_qpel_bi_w_hv()
Fixes: runtime error: left shift of negative value -3
Fixes: 4524/clusterfuzz-testcase-minimized-6055590120914944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-17 02:09:31 +01:00
Michael Niedermayer 0409d33311 avcodec/hevcdsp_template: Fix undefined shift in put_hevc_epel_bi_w_h()
Fixes: runtime error: left shift of negative value -127
Fixes: 4397/clusterfuzz-testcase-minimized-4779061080489984

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-01 23:12:07 +01:00
Michael Niedermayer 7d88586e47 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>
2017-11-20 21:29:00 +01:00
Michael Niedermayer fbdab6eca7 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>
2017-10-03 20:34:35 +02:00
Michael Niedermayer c225da68cf 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>
2017-09-11 12:23:58 +02:00
Clément Bœsch 038e6aef7a Merge commit '4abe3b049d987420eb891f74a35af2cebbf52144'
* commit '4abe3b049d987420eb891f74a35af2cebbf52144':
  hevc: rename hevc.[ch] to hevcdec.[ch]

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-23 16:48:41 +01:00
James Almer 1e18548826 Merge commit 'ba479f3daafc7e4359ec1212164569ebe59f0bb7'
* commit 'ba479f3daafc7e4359ec1212164569ebe59f0bb7':
  hevc: Change type of array stride parameters to ptrdiff_t

Merged-by: James Almer <jamrial@gmail.com>
2017-03-21 15:49:09 -03:00
Clément Bœsch 7c300a8ed4 lavc/hevc: remove a few random spaces to reduce diff with libav 2017-01-31 17:02:24 +01:00
Clément Bœsch 05018c2cda Merge commit 'cc16da75c2f99d92f7a6461100f041352deb6d88'
* 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-31 16:05:06 +01:00
Clément Bœsch a604115f72 Merge commit 'a92fd8a06256e71a0be87b03751ec3c2a4a8aa21'
* commit 'a92fd8a06256e71a0be87b03751ec3c2a4a8aa21':
  hevc: Add DC IDCT

Noop, only spacing adjusted.

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-01-31 15:55:44 +01:00
Clément Bœsch 2456efcc0f Merge commit '4f247de3b797cdc9d243d26534412f81c306e5b5'
* commit '4f247de3b797cdc9d243d26534412f81c306e5b5':
  hevcdsp_template: Templatize IDCT

This commit is a noop as we already have that code from a previous
commits (see 92cccb7bcd).

Spacing is adjusted to reduce the diff.

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-01-31 15:49:12 +01:00
Clément Bœsch d0e132bab6 Merge commit '1bd890ad173d79e7906c5e1d06bf0a06cca4519d'
* 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>
2017-01-31 15:31:34 +01:00
Clément Bœsch 3a3554871a lavc/hevcdsp: fix pretty printing mistake
"Issue" introduced in 83976e40e8.
2017-01-30 12:03:30 +01:00
Anton Khirnov 4abe3b049d hevc: rename hevc.[ch] to hevcdec.[ch]
This is more consistent with the rest of libav and frees up the hevc.h
name for decoder-independent shared declarations.
2016-10-16 20:26:17 +02:00
Diego Biurrun ba479f3daa hevc: Change type of array stride parameters to ptrdiff_t
ptrdiff_t is the correct type for array strides and similar.
2016-09-29 17:54:23 +02:00
Mickaël Raulet cc16da75c2 hevc: Add coefficient limiting to speed up IDCT
Integrated to libav by Josh de Kock <josh@itanimul.li>.

Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
2016-07-18 15:27:13 +02:00
Mickaël Raulet a92fd8a062 hevc: Add DC IDCT
Integrated to Libav by Josh de Kock <josh@itanimul.li>.

Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
2016-07-18 15:27:13 +02:00
Mickaël Raulet 4f247de3b7 hevcdsp_template: Templatize IDCT
Integrated to Libav by Josh de Kock <josh@itanimul.li>.

Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
2016-07-18 15:27:13 +02:00
Alexandra Hájková 1bd890ad17 hevc: Separate adding residual to prediction from IDCT
Based on patch 250430bf28
by Mickaël Raulet <mraulet@insa-rennes.fr>, integrated
to Libav by Josh de Kock <josh@itanimul.li>.

Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
2016-07-18 15:27:13 +02:00
Anton Khirnov e7078e842d hevcdsp: add x86 SIMD for MC 2015-12-05 21:11:52 +01:00
Anton Khirnov a853388d2f hevc: change the stride of the MC buffer to be in bytes instead of elements
Currently, the frame stride is passed in bytes, while the MC buffer size
is in int16_t elements, This can be confusing, so pass both strides in
bytes.
2015-12-05 21:11:12 +01:00
Anton Khirnov 688417399c hevcdsp: split the pred functions by width
This should allow for more efficient SIMD.
2015-12-05 21:10:41 +01:00
Anton Khirnov 818bfe7f0a hevcdsp: split the epel functions by width
This should allow for more efficient SIMD.
2015-12-05 21:09:57 +01:00
Anton Khirnov 1f821750f0 hevcdsp: split the qpel functions by width instead of by the subpixel fraction
This should allow for more efficient SIMD.

Keep the C versions as they are now, to allow the compiler to inline the
interpolation coefficients.
2015-12-05 21:08:04 +01:00
Anton Khirnov d8ebb6157d hevcdsp: fix a function name
put_weighted_pred_avg should be put_unweighted_pred_avg, there is no
weighting there.
2015-08-21 08:46:05 +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