Commit Graph

1485 Commits

Author SHA1 Message Date
Michael Niedermayer
fe540ae6b7 Merge commit 'f0259a587ee3419dd894873ea617b4c98eeaca1c'
* commit 'f0259a587ee3419dd894873ea617b4c98eeaca1c':
  h264: check buffer size before accessing it

Conflicts:
	libavcodec/h264.c

See: ea0ac11e52
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-22 11:56:46 +01:00
Anton Khirnov
f0259a587e h264: check buffer size before accessing it
Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2013-11-21 20:54:20 +01:00
Michael Niedermayer
56e122787e Merge commit 'a553c6a347d3d28d7ee44c3df3d5c4ee780dba23'
* commit 'a553c6a347d3d28d7ee44c3df3d5c4ee780dba23':
  lavc: use buf[0] instead of data[0] in checks whether a frame is allocated

Conflicts:
	libavcodec/h264_refs.c
	libavcodec/mpegvideo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-19 03:56:53 +01:00
Anton Khirnov
a553c6a347 lavc: use buf[0] instead of data[0] in checks whether a frame is allocated
data[0] may be NULL for valid frames with hwaccel pixel formats.
2013-11-18 18:09:48 +01:00
Michael Niedermayer
91e00c4a78 Merge commit '458446acfa1441d283dacf9e6e545beb083b8bb0'
* commit '458446acfa1441d283dacf9e6e545beb083b8bb0':
  lavc: Edge emulation with dst/src linesize

Conflicts:
	libavcodec/cavs.c
	libavcodec/h264.c
	libavcodec/hevc.c
	libavcodec/mpegvideo_enc.c
	libavcodec/mpegvideo_motion.c
	libavcodec/rv34.c
	libavcodec/svq3.c
	libavcodec/vc1dec.c
	libavcodec/videodsp.h
	libavcodec/videodsp_template.c
	libavcodec/vp3.c
	libavcodec/vp8.c
	libavcodec/wmv2.c
	libavcodec/x86/videodsp.asm
	libavcodec/x86/videodsp_init.c

Changes to the asm are not merged, they are left for volunteers or
in their absence for later.
The changes this merge introduces are reordering of the function
arguments

See: face578d56
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-15 15:07:10 +01:00
Ronald S. Bultje
458446acfa lavc: Edge emulation with dst/src linesize
Allow supporting files for which the image stride is smaller than
the maximum block size + number of subpel mc taps, e.g. a 64x64 VP9
file or a 16x16 VP8 file with -fflags +emu_edge.
2013-11-15 10:16:27 +01:00
Michael Niedermayer
9244a68092 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  h264: free the tables and uninitialize the context on flush

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-14 21:11:42 +01:00
Anton Khirnov
9eda9d3322 h264: free the tables and uninitialize the context on flush
Prevents referencing empty frames when the first packet after the flush
does not contain a frame.
2013-11-14 19:00:20 +01:00
Michael Niedermayer
9e5ef1c5c3 h264: Do not treat the initial frame special in handling of frame gaps
The not handling of frame gaps has lead to the lack of a dummy reference
frame, which has lead to the failure of decode_slice_header() which has
lead to one SEI recovery message being skiped which had introduced a
slightly suboptimal recovery point for at least 1 h264 file compared to
JM.

Found-by: Carl & BugMaster
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-14 12:16:01 +01:00
Michael Niedermayer
78e150c5e9 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  hwaccel: Simplify ff_find_hwaccel

Conflicts:
	libavcodec/mpeg12dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-10 17:37:51 +01:00
Luca Barbato
08303d7741 hwaccel: Simplify ff_find_hwaccel
It is always called by passing fields from an AVCodecContext.
2013-11-10 13:59:48 +01:00
Michael Niedermayer
4fb1221e66 h264: reduce whitespace differences to libav
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-03 01:16:31 +01:00
Michael Niedermayer
647adc4290 h264: factor "if(h->sei_recovery_frame_cnt >= 0)" out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-02 01:02:21 +01:00
Michael Niedermayer
f62dfed3de h264: simplify frame_recovered code
This is a separate commit to ease future bisecting in case it breaks something.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-01 12:59:40 +01:00
Michael Niedermayer
78265fcfee Merge commit '28096e0a806e57376541e6222d315619906e3c55'
* commit '28096e0a806e57376541e6222d315619906e3c55':
  h264: wait for initial complete frame before outputing frames

Conflicts:
	doc/APIchanges
	libavcodec/h264.c
	libavcodec/mpegvideo.h
	libavutil/frame.h
	libavutil/version.h

See: a64b028aeb (as well as various later commits)
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-01 12:59:08 +01:00
John Stebbins
28096e0a80 h264: wait for initial complete frame before outputing frames
This can be optionally disabled whith the "output_corrupt" flags
option.  When in "output_corrupt" mode, incomplete frames are
signalled through AVFrame.flags FRAME_FLAG_INCOMPLETE_FRAME.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-10-31 20:14:14 +01:00
Derek Buitenhuis
58d13cea30 h264: Check all allocations
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-10-29 14:00:29 +00:00
Derek Buitenhuis
a483aae7d8 h264: Check all allocations
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-10-29 12:00:27 +00:00
Michael Niedermayer
3c9dd93faa h264: make flush_change() set mmco_reset
This ensures that frames do not get mixed on context reinits

Fixes Ticket2836

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-26 01:22:38 +02:00
Michael Niedermayer
29ffeef5e7 avcodec/h264: do not trust last_pic_droppable when marking pictures as done
This simplifies the code and fixes a deadlock

Fixes Ticket2927
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-24 23:15:30 +02:00
Michael Niedermayer
f7f74a37b8 Merge commit '4baba6c813b7a1f27370e20fb1a87b05fcb39208'
* commit '4baba6c813b7a1f27370e20fb1a87b05fcb39208':
  h264_parser: Fix POC parsing for the case where MMCO_RESET is present.

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-16 12:51:26 +02:00
Ronald S. Bultje
93f305473f lavc: Convert some remaining strides to ptrdiff_t 2013-10-15 23:58:20 +02:00
Yusuke Nakamura
4baba6c813 h264_parser: Fix POC parsing for the case where MMCO_RESET is present.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-10-15 20:02:55 +02:00
Michael Niedermayer
65c2fe7159 avcodec/h264: call flush_change() on init
This ensures that all the non zero fields get setup correctly.
Alternatively their initialization could be duplicated.

Fixes Ticket2738

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-10 02:25:51 +02:00
Clément Bœsch
b46f19100b cosmetics: group remaining .name and .long_name.
See b2bed9325.
2013-10-04 13:33:20 +00:00
Michael Niedermayer
ee77140afa Merge commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2'
* commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2':
  cosmetics: Group .name and .long_name together in codec/format declarations

Conflicts:
	libavcodec/8svx.c
	libavcodec/alac.c
	libavcodec/cljr.c
	libavcodec/dnxhddec.c
	libavcodec/dnxhdenc.c
	libavcodec/dpxenc.c
	libavcodec/dvdec.c
	libavcodec/dvdsubdec.c
	libavcodec/dvdsubenc.c
	libavcodec/ffv1dec.c
	libavcodec/flacdec.c
	libavcodec/flvdec.c
	libavcodec/fraps.c
	libavcodec/frwu.c
	libavcodec/g726.c
	libavcodec/gif.c
	libavcodec/gifdec.c
	libavcodec/h261dec.c
	libavcodec/h263dec.c
	libavcodec/iff.c
	libavcodec/imc.c
	libavcodec/libopencore-amr.c
	libavcodec/libopenjpegdec.c
	libavcodec/libopenjpegenc.c
	libavcodec/libspeexenc.c
	libavcodec/libvo-amrwbenc.c
	libavcodec/libvorbisenc.c
	libavcodec/libvpxenc.c
	libavcodec/libx264.c
	libavcodec/libxavs.c
	libavcodec/libxvid.c
	libavcodec/ljpegenc.c
	libavcodec/mjpegbdec.c
	libavcodec/mjpegdec.c
	libavcodec/mpeg12dec.c
	libavcodec/mpeg4videodec.c
	libavcodec/msmpeg4dec.c
	libavcodec/pgssubdec.c
	libavcodec/pngdec.c
	libavcodec/pngenc.c
	libavcodec/proresdec_lgpl.c
	libavcodec/proresenc_kostya.c
	libavcodec/ra144enc.c
	libavcodec/rawdec.c
	libavcodec/rv10.c
	libavcodec/sp5xdec.c
	libavcodec/takdec.c
	libavcodec/tta.c
	libavcodec/v210dec.c
	libavcodec/vp6.c
	libavcodec/wavpack.c
	libavcodec/xbmenc.c
	libavcodec/yop.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-04 12:34:23 +02:00
Diego Biurrun
b2bed9325d cosmetics: Group .name and .long_name together in codec/format declarations 2013-10-03 23:32:01 +02:00
Carl Eugen Hoyos
b5f219c904 Print pix_fmt name on h264 context reinitialisation. 2013-10-03 01:42:23 +02:00
Ronald S. Bultje
face578d56 Rewrite emu_edge functions to have separate src/dst_stride arguments.
This allows supporting files for which the image stride is smaller than
the max. block size + number of subpel mc taps, e.g. a 64x64 VP9 file
or a 16x16 VP8 file with -fflags +emu_edge.
2013-09-28 20:28:08 -04:00
Ronald S. Bultje
c341f734e5 Convert multiplier for MV from int to ptrdiff_t.
This prevents emulated_edge_mc from not undoing mvy*stride-related
integer overflows.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-28 11:28:09 +02:00
Michael Niedermayer
4a89868c5f Merge commit 'cab8c5f8e140c96ba3725ab709d823abfd1e31a5'
* commit 'cab8c5f8e140c96ba3725ab709d823abfd1e31a5':
  h264: do not reinitialize the global cabac tables at each slice header

See: 1e2e2c8095
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-25 10:25:17 +02:00
Anton Khirnov
cab8c5f8e1 h264: do not reinitialize the global cabac tables at each slice header 2013-09-24 17:13:52 +02:00
Michael Niedermayer
d195e6e410 Merge commit '71cabb521ac397db3903011d2de7afd3e0fc7ab6'
* commit '71cabb521ac397db3903011d2de7afd3e0fc7ab6':
  h264: do not discard NAL_SEI when skipping frames

Conflicts:
	libavcodec/h264.c

See: 7d75fb381b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-24 15:38:34 +02:00
Michael Niedermayer
af2bb83dff Merge commit 'edaba18021e4793116f0f266e65077578a5e742e'
* commit 'edaba18021e4793116f0f266e65077578a5e742e':
  h264: log extradata skip only for non-ignored NALs

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-24 15:30:21 +02:00
Rainer Hochecker
71cabb521a h264: do not discard NAL_SEI when skipping frames
Setting AVDISCARD_NONREF (e.g. after flushing) resulted in 100% dropped frames.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-24 13:24:29 +02:00
Vittorio Giovara
edaba18021 h264: log extradata skip only for non-ignored NALs
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-24 13:24:28 +02:00
Vittorio Giovara
1cad7171dd h264: remove an unused static constant
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-20 14:40:10 +03:00
Rainer Hochecker
7d75fb381b h264: do not discard NAL_SEI when skipping frames
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-09 11:42:26 +02:00
Michael Niedermayer
93cf7b0195 avcodec/h264: set er.ref_count earlier
Fixes Ticket2910

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-01 04:02:03 +02:00
Michael Niedermayer
626739ebbb avcodec/h264: Free rbsp_buffer before copying context over it
Fixes memleak
Fixes Ticket1900

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-25 03:30:31 +02:00
Michael Niedermayer
be30e44dd9 avcodec/h264: Zero rbsp_buffer earler to ensure no duplicated pointers can leak
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-25 03:29:52 +02:00
Michael Niedermayer
ecbf838c7d h264: prevent rbsp_buffer values from becoming duplicated
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-25 03:01:19 +02:00
Michael Niedermayer
16466d92b9 Merge commit 'c4e43560fe6677e9d60bfb3cffc41c7324e92a0b'
* commit 'c4e43560fe6677e9d60bfb3cffc41c7324e92a0b':
  h264data: Move some tables to the only place they are used

Conflicts:
	libavcodec/h264data.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-21 12:21:48 +02:00
Michael Niedermayer
58e12732db Merge commit '2a61592573d725956a4377641344afe263382648'
* commit '2a61592573d725956a4377641344afe263382648':
  avcodec: Remove some commented-out debug cruft

Conflicts:
	libavcodec/h264_cabac.c
	libavcodec/h264_cavlc.c
	libavcodec/h264_loopfilter.c
	libavcodec/h264_mvpred.h
	libavcodec/mjpegdec.c
	libavcodec/mjpegenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-21 11:18:43 +02:00
Diego Biurrun
c4e43560fe h264data: Move some tables to the only place they are used 2013-08-20 20:49:37 +02:00
Diego Biurrun
2a61592573 avcodec: Remove some commented-out debug cruft 2013-08-20 19:59:50 +02:00
Michael Niedermayer
a0c6c8e53e Revert "Merge commit of 'vdpau: remove old-style decoders'"
This reverts commit bf36dc50ea, reversing
changes made to b7fc2693c7.

Conflicts:

	libavcodec/h264.c

Keeping support for the old VDPAU API has been requested by our VDPAU maintainer

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-17 22:17:49 +02:00
Michael Niedermayer
921c1d4c95 Merge commit 'c1076d8479a6c0ee2e0c4b0e2151df5b0228438e'
* commit 'c1076d8479a6c0ee2e0c4b0e2151df5b0228438e':
  h264: check one context_init() allocation

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-11 10:35:44 +02:00
Michael Niedermayer
d2d8e259fd Merge commit '5eb488bfa835f2902a31ba99d57c16ae36c4f598'
* commit '5eb488bfa835f2902a31ba99d57c16ae36c4f598':
  h264: use explicit variable names for *_field_flag

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-11 10:28:49 +02:00
Michael Niedermayer
e0b45ca730 Merge commit 'b3dc260e7fa6f3f852dd5cb7d86763c4b5736714'
* commit 'b3dc260e7fa6f3f852dd5cb7d86763c4b5736714':
  h264: return meaningful values

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-11 10:08:48 +02:00