Michael Niedermayer
0e7444f6e4
avcodec/hevc: Remove current_sps
...
The variable should not be needed anymore
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
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>
10 years ago
Anton Khirnov
7693ba0a0e
hevc: export stream parameters from extradata
...
This allows the callers to have a hint of the probable stream parameters
without actually decoding anything.
10 years ago
Anton Khirnov
1ae7afd256
hevc: split out setting AVCodecContext parameters
...
Additionally always set the software pixel format, so it's available
even if ff_get_format() is not called later. This will be useful for
exporting stream parameters from init().
10 years ago
Rainer Hochecker
786032cad8
hevc: avoid unnecessary calls to get_format
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
12cf61c3b2
avcodec/hevc: Fix undefined shifts
...
Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu <tfoucu@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Rainer Hochecker
31816eae32
hevc: delay ff_thread_finish_setup for hwaccel
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
114a2eb272
avcodec: Use av_clip_uintp2() where possible
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Peter Meerwald
eea769df32
hevc: Use generic av_clip function, not C implementation
...
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>
10 years ago
Michael Niedermayer
43b1fd5bb4
avcodec/hevc: drop redundant ifs()
...
Found-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Christophe Gisquet
9a2f5d825a
hevc: free sao buffers when receiving a new SPS
...
The buffer pointers would be otherwise overwritten, causing a
leak on e.g. PERSIST_RPARAM_A_RExt_Sony_1.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Christophe Gisquet
52f2adc015
avcodec/hevc: Update the USE_SAO_SMALL_BUFFER case for the alignment requirements in FFmpeg
...
Use edge emu buffers
And enable the code unconditionally
Speed difference without USE_SAO_SMALL_BUFFER and with the new code:
Decicycles: 26772->26220 (BO32), 83803->80942 (BO64)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Christophe Gisquet
00fe77855b
avcodec/hevc: Do not zero is_pcm on allocation
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Fabrice Bellard
da81cc38e8
avcodec/hevc: reduce memory for SAO
...
cherry picked from commit 5d9f79edef2c11b915bdac3a025b59a32082f409
SAO edge filter uses pre-SAO pixel data on the left and top of the ctb, so
this data must be kept available. This was done previously by having 2
copies of the frame, one before and one after SAO.
This commit reduces the storage to just that, instead of the previous whole
frame.
Commit message taken from patch by Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Mickaël Raulet
7cf6a67ef9
avcodec/hevc: adding support for monochrome sequences in hevc
...
cherry picked from commit 8e50557707d2ec11ccad657470b2e140f314348e
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Christophe Gisquet
bff7feb328
x86: hevc/sao: aligned source buffers
...
Usefull for at least band filter, for which:
- Band filter call only:
32 64
Before: 16556 54015
After: 16497 52355
- Whole case:
32 64
Before: 37031 103008
After: 32045 93952
10 years ago
Michael Niedermayer
2b215b7f5a
avcodec/hevc: Check for av_malloc failure
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
5008605bf2
avcodec/hevc: Replace more mallocs by av_malloc_array()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Hendrik Leppkes
36962ad233
Add DXVA2 HEVC HWAccel
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Hendrik Leppkes
f8ecffa9b7
hevc: reindent after previous commit
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Hendrik Leppkes
b2e9b0f5d4
hevc: add hwaccel hooks
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Hendrik Leppkes
06894f1a04
hevc: store the short term rps flag and size in the context
...
For future use by hardware accelerators.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Hendrik Leppkes
2af82a1ad9
hevc: store the escaped/raw bitstream in HEVCNAL
...
Hardware Accelerators require access to the escaped bitstream.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Hendrik Leppkes
7e850fa67e
Add DXVA2 HEVC HWAccel
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
10 years ago
Hendrik Leppkes
b82722df9b
hevc: reindent after previous commit
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
10 years ago
Hendrik Leppkes
e72e8c5a1d
hevc: add hwaccel hooks
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
10 years ago
Hendrik Leppkes
4b95e95dba
hevc: store the short term rps flag and size in the context
...
For future use by hardware accelerators.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
10 years ago
Hendrik Leppkes
36779a8405
hevc: store the escaped/raw bitstream in HEVCNAL
...
Hardware Accelerators require access to the escaped bitstream.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
10 years ago
Hendrik Leppkes
b0593a4bca
hevc: pass the full HEVCNAL struct to decode_nal_unit
...
This enables decode_nal_unit to access additional fields added in
subsequent commits.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
10 years ago
Anton Khirnov
443b71928b
hevc: unref the current frame if frame_start() fails
...
Prevents DPB from filling up with damaged input.
10 years ago
Hendrik Leppkes
77140279d3
hevc: pass the full HEVCNAL struct to decode_nal_unit
...
This enables decode_nal_unit to access additional fields added in
subsequent commits.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
e172f5e53a
avcodec/hevc: Fix handling of skipped_bytes() reallocation failures
...
Fixes CID1260704
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
99f8c9e4d1
avcodec/hevc: move qp_block_mask to where its used
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
8aa8d12554
avcodec/hevc: clear filter_slice_edges() on allocation
...
This avoids use of uninitialized memory
Fixes: asan_static-oob_17aa046_582_cov_212287884_DBLK_G_VIXS_1.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
b799ec7e0b
avcodec/hevc: Print an error if luma_log2_weight_denom is out of range
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
b2bece5e9a
hevc: always clip luma_log2_weight_denom
...
Its value shall be between 0 and 7 according to the specifications.
CC: libav-stable@libav.org
Bug-Id: CID 1257502
10 years ago
Michael Niedermayer
ef23bd939d
avcodec/hevc: Silence "warning: ref0/1 may be used uninitialized in this function"
...
Also make code more robust by initializing the pointers to NULL
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Luca Barbato
cd975d5658
hevc: Spin the mv_mpv_mode calls in a stand alone function
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
10 years ago
Anton Khirnov
8b573ddda7
hevc: remove superfluous assignments and checks
10 years ago
Anton Khirnov
eac3ac1fe0
hevc: eliminate an unneeded intermediate variable
10 years ago
Anton Khirnov
eb335f3c5c
hevc: reduce variable scope
...
Also, collapse the array into a scalar, since only one value is needed
at a time.
10 years ago
Anton Khirnov
84c0ece5fd
hevc: further reduce code duplication in hls_prediction_unit()
10 years ago
Anton Khirnov
a7b365ae19
hevc: reduce code duplication in hls_prediction_unit()
10 years ago
Anton Khirnov
16c01fb434
hevc: remove an unused function parameter
10 years ago
Anton Khirnov
84b9463984
hevc: remove a redundant line
...
pred_mode is overwritten a few lines immediately below.
10 years ago
Anton Khirnov
2c6a7f9348
hevc: do not store rqt_root_cbf in the context
...
It does not need to be accessed outside of hls_coding_unit().
10 years ago
Anton Khirnov
920bca3e23
hevc: do not store pcm_flag in the context
...
It does not need to be accessed outside of hls_coding_unit().
10 years ago
Vittorio Giovara
b1b1a7370e
display: fix order of operands
...
CC: libav-stable@libav.org
Bug-Id: CID 1238828 / CID 1238832
10 years ago
Changjiang Wei
6f2068e626
avcodec/hevc.c: for big negative mvy value, should wait line 0 of ref frame due to edge extending
...
Reviewed-by: Mickaël Raulet <mraulet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Anton Khirnov
7ea1b3472a
lavc: deprecate the use of AVCodecContext.time_base for decoding
...
When decoding, this field holds the inverse of the framerate that can be
written in the headers for some codecs. Using a field called 'time_base'
for this is very misleading, as there are no timestamps associated with
it. Furthermore, this field is used for a very different purpose during
encoding.
Add a new field, called 'framerate', to replace the use of time_base for
decoding.
10 years ago