Derek Buitenhuis
52a44d50be
h264_picture: Actually return error during alloc failure
...
Fixes NULL dereference during alloc failure.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-11-26 13:37:02 +00:00
James Almer
b773a8d8c1
Merge commit 'dd343fd986459f467a2d1d70c26101dff1d47d68'
...
* commit 'dd343fd986459f467a2d1d70c26101dff1d47d68':
lavu: Drop deprecated VDPAU pixel formats
Merged-by: James Almer <jamrial@gmail.com>
2017-10-23 18:15:49 -03:00
James Almer
c68a3ab96e
Merge commit '7b917041184874e7d7cba4450813de7e0bb28a33'
...
* commit '7b917041184874e7d7cba4450813de7e0bb28a33':
lavc: Drop deprecated VDPAU codec capability
Merged-by: James Almer <jamrial@gmail.com>
2017-10-21 23:40:03 -03:00
James Almer
07596e45c5
avcodec/h264dec: export cropping information instead of handling it internally
...
This merges commit c3e84820d6
from libav,
originally written by Anton Khirnov and skipped in
fc63d5ceb3
.
libavcodec/h264_picture.c | 3 ---
libavcodec/h264_ps.c | 9 ---------
libavcodec/h264_slice.c | 25 +++++++++++++++++++------
libavcodec/h264dec.c | 13 +------------
libavcodec/h264dec.h | 9 +++++----
5 files changed, 25 insertions(+), 34 deletions(-)
2017-05-26 11:15:45 -03:00
Ronald S. Bultje
e72690b18d
h264: don't sync pic_id between threads.
...
This is how the ref list manager links bitstream IDs to H264Picture/Ref
objects, and is local to the producer thread. There is no need for the
consumer thread to know the bitstream IDs of its references in their
respective producer threads.
In practice, this fixes tsan warnings when running fate-h264:
WARNING: ThreadSanitizer: data race (pid=19295)
Read of size 4 at 0x7dbc0000e614 by main thread (mutexes: write M1914):
#0 ff_h264_ref_picture src/libavcodec/h264_picture.c:112 (ffmpeg+0x0000013b3709)
[..]
Previous write of size 4 at 0x7dbc0000e614 by thread T2 (mutexes: write M1917):
#0 build_def_list src/libavcodec/h264_refs.c:91 (ffmpeg+0x0000013b46cf)
2017-04-03 09:27:04 -04:00
Ronald S. Bultje
b5300c8ad8
h264: don't write to source picture object in ff_h264_ref_picture().
...
Doing so is analogous to writing to source data in memcpy(), and causes
(harmless) tsan warnings in fate-h264.
2017-03-31 08:26:24 -04:00
Anton Khirnov
45286a625c
h264dec: make sure to only end a field if it has been started
...
Calling ff_h264_field_end() when the per-field state is not properly
initialized leads to all kinds of undefined behaviour.
CC: libav-stable@libav.org
Bug-Id: 977 978 992
2016-12-19 08:15:58 +01:00
Clément Bœsch
15b26e88cb
Merge commit '9df889a5f116c1ee78c2f239e0ba599c492431aa'
...
* commit '9df889a5f116c1ee78c2f239e0ba599c492431aa':
h264: rename h264.[ch] to h264dec.[ch]
Merged-by: Clément Bœsch <u@pkh.me>
2016-07-29 11:01:36 +02:00
Clément Bœsch
f48aea66dd
Merge commit 'bec993381cfec72051b0d9f12ac9d9bb9c750983'
...
* commit 'bec993381cfec72051b0d9f12ac9d9bb9c750983':
h264: postpone generating the implicit MMCOs
Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-30 10:24:03 +02:00
Clément Bœsch
57d30fde9e
Merge commit '39ab2ea53121b9976a619cd545fbd3464b908696'
...
* commit '39ab2ea53121b9976a619cd545fbd3464b908696':
h264: rename mmco_index to nb_mmco
Merged-by: Clément Bœsch <u@pkh.me>
2016-06-29 20:07:52 +02:00
Clément Bœsch
bef74ef367
Merge commit '4f81f8dba735c212efae077c4fec8ad4fe53b352'
...
* commit '4f81f8dba735c212efae077c4fec8ad4fe53b352':
Drop unnecessary golomb.h #includes
Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-29 11:54:54 +02:00
Clément Bœsch
8ef57a0d61
Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'
...
* commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb':
cosmetics: Fix spelling mistakes
Merged-by: Clément Bœsch <u@pkh.me>
2016-06-21 21:55:34 +02:00
Anton Khirnov
9df889a5f1
h264: rename h264.[ch] to h264dec.[ch]
...
This is more consistent with the naming of other decoders.
2016-06-21 11:11:26 +02:00
Anton Khirnov
bec993381c
h264: postpone generating the implicit MMCOs
...
Do it right before the MMCOs are applied to the DPB. This will allow
moving the frame_start() call out of the slice header parsing, since
generating the implicit MMCOs needs to be done after frame_start().
2016-06-12 20:27:53 +02:00
Anton Khirnov
39ab2ea531
h264: rename mmco_index to nb_mmco
...
The variable stores the number of mmco entries, so the current name is
misleading.
2016-06-12 20:27:53 +02:00
Clément Bœsch
bd3fd467fe
Merge commit 'c8dcff0cdb17d0aa03ac729eba12d1a20f1f59c8'
...
* commit 'c8dcff0cdb17d0aa03ac729eba12d1a20f1f59c8':
h264: factor out calculating the POC count into a separate file
Merged-by: Clément Bœsch <u@pkh.me>
2016-06-12 19:01:43 +02:00
Diego Biurrun
4f81f8dba7
Drop unnecessary golomb.h #includes
2016-06-08 18:51:57 +02:00
Vittorio Giovara
41ed7ab45f
cosmetics: Fix spelling mistakes
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-04 18:16:21 +02:00
Anton Khirnov
c8dcff0cdb
h264: factor out calculating the POC count into a separate file
...
This will allow decoupling the parser from the decoder.
2016-04-24 10:06:24 +02:00
Michael Niedermayer
98a0053d0f
avcodec/h264: Execute error concealment before marking the frame as done.
...
Fixes race condition causing artifacts
Fixes Ticket4122
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-19 01:31:16 +01:00
Ronald S. Bultje
030b5a4f77
lavc: put remaining bits of vdpau-in-decoder under FF_API_CAP_VDPAU.
2015-08-18 15:57:19 -04:00
wm4
94c0df79c7
lavc: propagate hwaccel errors
...
At least the new videotoolbox decoder does not actually set a frame if
end_frame fails. This causes the API to return success and signals that
a picture was decoded, even though AVFrame->data[0] is NULL.
Fix this by propagating end_frame errors.
2015-08-06 11:05:02 +02:00
Michael Niedermayer
444e9874a7
Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'
...
* commit 'def97856de6021965db86c25a732d78689bd6bb0':
lavc: AV-prefix all codec capabilities
Conflicts:
cmdutils.c
ffmpeg.c
ffplay.c
libavcodec/8svx.c
libavcodec/aacenc.c
libavcodec/ac3dec.c
libavcodec/adpcm.c
libavcodec/alac.c
libavcodec/atrac3plusdec.c
libavcodec/bink.c
libavcodec/dnxhddec.c
libavcodec/dvdec.c
libavcodec/dvenc.c
libavcodec/ffv1dec.c
libavcodec/ffv1enc.c
libavcodec/fic.c
libavcodec/flacdec.c
libavcodec/flacenc.c
libavcodec/flvdec.c
libavcodec/fraps.c
libavcodec/frwu.c
libavcodec/gifdec.c
libavcodec/h261dec.c
libavcodec/hevc.c
libavcodec/iff.c
libavcodec/imc.c
libavcodec/libopenjpegdec.c
libavcodec/libvo-aacenc.c
libavcodec/libvorbisenc.c
libavcodec/libvpxdec.c
libavcodec/libvpxenc.c
libavcodec/libx264.c
libavcodec/mjpegbdec.c
libavcodec/mjpegdec.c
libavcodec/mpegaudiodec_float.c
libavcodec/msmpeg4dec.c
libavcodec/mxpegdec.c
libavcodec/nvenc_h264.c
libavcodec/nvenc_hevc.c
libavcodec/pngdec.c
libavcodec/qpeg.c
libavcodec/ra288.c
libavcodec/rv10.c
libavcodec/s302m.c
libavcodec/sp5xdec.c
libavcodec/takdec.c
libavcodec/tiff.c
libavcodec/tta.c
libavcodec/utils.c
libavcodec/v210dec.c
libavcodec/vp6.c
libavcodec/vp9.c
libavcodec/wavpack.c
libavcodec/yop.c
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27 22:50:18 +02:00
Philip Langdale
9ae766d1c6
avcodec/vdpau: Re-factor pre-hwaccel helper functions into separate header
...
h264.h and hevc.h are mutually exclusive due to defining some of the same
names. As such, we need to avoid forcing h264.h to be included if we want
hevc decode acceleration to be possible.
However, some of the pre-hwaccel helper functions need h264.h. To avoid
messy collisions, let's move the declaration of all those helpers to
a separate header which we will exclude for the hevc support (which will
be hwaccel-only).
Signed-off-by: Philip Langdale <philipl@overt.org>
2015-05-25 19:50:41 -07:00
Michael Niedermayer
36f862e04c
Merge commit 'a0f2946068c62e18cb05ac25c0df3d86077251a6'
...
* commit 'a0f2946068c62e18cb05ac25c0df3d86077251a6':
h264: use properly allocated AVFrames
Conflicts:
libavcodec/h264.c
libavcodec/h264.h
libavcodec/h264_refs.c
libavcodec/h264_slice.c
libavcodec/svq3.c
libavcodec/vda_h264.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-29 16:35:24 +02:00
Michael Niedermayer
e8a460672f
Merge commit '9d33bab583a82cf12286c65258a29c6888e1ff98'
...
* commit '9d33bab583a82cf12286c65258a29c6888e1ff98':
h264: drop H264Context.ouputed_poc
Conflicts:
libavcodec/h264.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-29 11:38:42 +02:00
Michael Niedermayer
0d5e615c10
Merge commit '27b0e6ebfd47b0c11156c18b90fa8c571f0f60c3'
...
* commit '27b0e6ebfd47b0c11156c18b90fa8c571f0f60c3':
h264: drop needs_realloc
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-29 11:28:28 +02:00
Anton Khirnov
a0f2946068
h264: use properly allocated AVFrames
2015-04-29 05:52:58 +02:00
Anton Khirnov
9d33bab583
h264: drop H264Context.ouputed_poc
...
It is only set, but never used for anything.
2015-04-29 05:52:57 +02:00
Anton Khirnov
27b0e6ebfd
h264: drop needs_realloc
...
It is not needed anymore since switching to refcounted frames.
2015-04-29 05:52:57 +02:00
Michael Niedermayer
7be2d2a70c
avcodec/h264: Use only one ERContext
...
This fixes slice threads with error concealment
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-09 17:42:04 +02:00
Michael Niedermayer
6da7625cc3
Merge commit 'a4d34e218f548d381e09c483e8dc6ad18a8d571c'
...
* commit 'a4d34e218f548d381e09c483e8dc6ad18a8d571c':
h264: disable ER by default
Conflicts:
libavcodec/h264.c
libavcodec/h264_picture.c
libavcodec/h264_slice.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-04 00:52:54 +02:00
Anton Khirnov
a4d34e218f
h264: disable ER by default
...
The way it is currently designed is fundamentally unsafe and cannot be
reasonably fixed without completely rewriting it.
2015-04-03 13:14:43 +02:00
Michael Niedermayer
d8151a7e94
Merge commit 'a12d3188cbec15e22070e139fa5cc541da07e2c3'
...
* commit 'a12d3188cbec15e22070e139fa5cc541da07e2c3':
h264: use a smaller struct for the ref lists
Conflicts:
libavcodec/h264_direct.c
libavcodec/h264_mb.c
libavcodec/h264_picture.c
libavcodec/h264_refs.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 23:05:34 +01:00
Michael Niedermayer
830e548b9e
Merge commit '582683b6ac798ed2a004a4e2121b7bd47892bbfd'
...
* commit '582683b6ac798ed2a004a4e2121b7bd47892bbfd':
h264: move remaining ER stuff into the per-slice context
Conflicts:
libavcodec/h264.h
libavcodec/h264_picture.c
libavcodec/h264_slice.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 20:00:34 +01:00
Michael Niedermayer
cc2cfdc497
Merge commit '95eb35f30513e335990ad0d5dca6ddc318477291'
...
* commit '95eb35f30513e335990ad0d5dca6ddc318477291':
h264: move the ref lists variables into the per-slice context
Conflicts:
libavcodec/h264.c
libavcodec/h264.h
libavcodec/h264_cabac.c
libavcodec/h264_cavlc.c
libavcodec/h264_direct.c
libavcodec/h264_mb.c
libavcodec/h264_picture.c
libavcodec/h264_refs.c
libavcodec/h264_slice.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 15:18:10 +01:00
Anton Khirnov
a12d3188cb
h264: use a smaller struct for the ref lists
...
There is no need to store a whole H264Picture, with a full AVFrame
embedded in it. This should allow getting rid of the embedded AVFrame
later.
2015-03-21 11:27:16 +01:00
Anton Khirnov
582683b6ac
h264: move remaining ER stuff into the per-slice context
2015-03-21 11:27:15 +01:00
Anton Khirnov
95eb35f305
h264: move the ref lists variables into the per-slice context
2015-03-21 11:27:13 +01:00
Michael Niedermayer
de6df46120
avcodec/h264: Setup decoder to have matching reference to the EC code
...
Also move EC ref initialization to where the EC code is called.
Fixes out of array read
Fixes: asan_heap-uaf_143f420_142_20110805_112659_ch0.mkv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-08 02:27:27 +01:00
Michael Niedermayer
4667116c39
Merge commit 'ca1e36a8e4cd416142487071dbca734567bdaddf'
...
* commit 'ca1e36a8e4cd416142487071dbca734567bdaddf':
h264: fix build when error resilience is disabled
Conflicts:
libavcodec/h264_picture.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-20 23:18:45 +02:00
Vittorio Giovara
ca1e36a8e4
h264: fix build when error resilience is disabled
2014-06-20 12:48:06 -04:00
Michael Niedermayer
43c57dbe14
Merge commit '888dcd86755d37e55fd74166f6d38ad66d41db58'
...
* commit '888dcd86755d37e55fd74166f6d38ad66d41db58':
h264_picture: Remove pointless dsputil.h #include
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-27 22:34:16 +02:00
Diego Biurrun
888dcd8675
h264_picture: Remove pointless dsputil.h #include
2014-05-27 03:12:17 -07:00
Michael Niedermayer
be656c362d
avcodec/h264_picture: Fix build without error resilience
...
Found-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-20 21:31:40 +02:00
Michael Niedermayer
7ef01a7878
avcodec/h264: mark recovery_cnt==0 frames as keyframes
...
Fixes Ticket3063
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-03 16:01:45 +02:00
Michael Niedermayer
ffd77f94a2
Merge remote-tracking branch 'qatar/master'
...
* qatar/master:
h264: Split h264 slice decoding from nal decoding
Conflicts:
libavcodec/Makefile
libavcodec/h264.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-24 01:33:02 +01:00
Luca Barbato
f51d0f39c0
h264: Split h264 slice decoding from nal decoding
2014-03-23 22:41:12 +01:00