Commit Graph

367 Commits

Author SHA1 Message Date
Michael Niedermayer
f3b5b139ad avcodec/h264: make the first field of H264Context an AVClass
Fixes use of freed memory
Fixes: asan_heap-uaf_3660f67_757_cov_1257014655_Hi422FR1_SONY_A.jsv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-17 01:33:06 +01:00
Michael Niedermayer
74622ad320 Merge commit '6fd91fa11909f27902498648680dbb3d13f1f175'
* commit '6fd91fa11909f27902498648680dbb3d13f1f175':
  h264: increase MAX_SLICES to 32

The available sample decodes correctly before, but the reporter of the bug
claims that this change reduces artifacts. This is thus merged
If someone has samples that decode differently depending in the MAX_SLICES
value, please open a ticket on trac.
Also this change should be reverted if it turns out that the artifacts
that where seen had a different cause

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 21:48:36 +01:00
Vittorio Giovara
6fd91fa119 h264: increase MAX_SLICES to 32
H264 streams from CounterPath Bria and some Cisco phones need an
increased pool for correct decoding.

Bug-Id: 645
Sample-Id: bria-h264.mka
2014-12-08 13:30:38 +00:00
Michael Niedermayer
3b678da5e3 avcodec/h264: simplify find_start_code()
this also uses avpriv_find_start_code(), though no speed change is expected as
the area searched is generally small

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-27 04:26:33 +01:00
Michael Niedermayer
4898440f6b Move get_avc_nalsize() and find_start_code() to h264.h
This allows sharing them with the h264 parser

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-27 04:22:42 +01:00
Michael Niedermayer
0782fb6bcb libavcodec/h264_parser: Increase parse_history, fix huge resolutions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-31 16:39:04 +02:00
Michael Niedermayer
3a2d1465c8 Merge commit '2d60444331fca1910510038dd3817bea885c2367'
* commit '2d60444331fca1910510038dd3817bea885c2367':
  dsputil: Split motion estimation compare bits off into their own context

Conflicts:
	configure
	libavcodec/Makefile
	libavcodec/arm/Makefile
	libavcodec/dvenc.c
	libavcodec/error_resilience.c
	libavcodec/h264.h
	libavcodec/h264_slice.c
	libavcodec/me_cmp.c
	libavcodec/me_cmp.h
	libavcodec/motion_est.c
	libavcodec/motion_est_template.c
	libavcodec/mpeg4videoenc.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/x86/Makefile
	libavcodec/x86/me_cmp_init.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-17 23:27:40 +02:00
Diego Biurrun
2d60444331 dsputil: Split motion estimation compare bits off into their own context 2014-07-17 09:07:10 -07:00
Clément Bœsch
7e7168b82d Fix 2 coeffecient typo 2014-07-10 15:29:54 +02:00
Michael Niedermayer
cd0dc88751 Merge commit '18e3d61e9e3b52c177aa7a1f2a054a8a753e1b09'
* commit '18e3d61e9e3b52c177aa7a1f2a054a8a753e1b09':
  h264: parse display orientation SEI message

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-10 00:07:04 +02:00
Vittorio Giovara
18e3d61e9e h264: parse display orientation SEI message
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-07-09 10:17:42 -04:00
Michael Niedermayer
5bf5e6b1c0 avcodec/h264: Use named identifier for single thread fall-back return from ff_h264_decode_slice_header()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-19 19:49:26 +02:00
Michael Niedermayer
7eae8cd870 avcodec/h264: fix frame skip code
Fixes Ticket3475

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-16 13:28:52 +02:00
Michael Niedermayer
19c9d1e8e7 avcodec/h264: in the absence of recovery points, be more tolerant on accepting plain I frames
Fixes: Ticket3652
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-04 04:25:14 +02:00
Michael Niedermayer
98a6806fdd Merge commit '368f50359eb328b0b9d67451f56fda20b3255f9a'
* commit '368f50359eb328b0b9d67451f56fda20b3255f9a':
  dsputil: Split off quarterpel bits into their own context

Conflicts:
	configure
	libavcodec/dsputil.c
	libavcodec/h263dec.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/vc1dec.c
	libavcodec/vc1dsp.c
	libavcodec/x86/dsputil_init.c
	libavcodec/x86/qpeldsp.asm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-30 02:43:34 +02:00
Diego Biurrun
368f50359e dsputil: Split off quarterpel bits into their own context 2014-05-29 06:48:31 -07:00
Michael Niedermayer
af62b42736 avcodec/h264: fix () in macros
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-25 03:45:10 +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
Michael Niedermayer
fc567ac49e avcodec: Add padding after the remaining AVFrames
This limits ABI issues in case libavcodec is linked to a libavutil with larger AVFrame
Which can happen if they are shiped in seperate binary packages and libavutil is upgraded

A cleaner alternative would be to replace them by pointers but this would likely cause
a small speedloss

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 00:28:51 +01:00
Michael Niedermayer
ad9a6e19e1 Merge commit 'd24e9a99a40166bf881ccd2e3ae5688af4726658'
* commit 'd24e9a99a40166bf881ccd2e3ae5688af4726658':
  h264 does not depend on mpegvideo any more

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-17 13:46:23 +01:00
Michael Niedermayer
dc226c023d Merge commit '7245a0ae872d4f65396a37d13f5d1d2c2efe11c2'
* commit '7245a0ae872d4f65396a37d13f5d1d2c2efe11c2':
  mpegvideo: remove h264-only fields

Conflicts:
	libavcodec/mpegvideo.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-17 13:31:28 +01:00
Michael Niedermayer
9517900bef Merge commit 'e0c16e4e3259cf50b5bac4c23bb6e517f397c74b'
* commit 'e0c16e4e3259cf50b5bac4c23bb6e517f397c74b':
  mpegvideo: move mpegvideo formats-related defines to mpegutils.h

Conflicts:
	libavcodec/h264_cabac.c
	libavcodec/h264_cavlc.c
	libavcodec/h264_mvpred.h
	libavcodec/svq1enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-17 12:36:48 +01:00
Michael Niedermayer
3e5833802e Merge commit '136034d86b5cb1819a2c3e6ecdfeb05dcba7140d'
* commit '136034d86b5cb1819a2c3e6ecdfeb05dcba7140d':
  h264: Remove MotionEstContext and move the relevant fields to H264Context

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-17 12:26:09 +01:00
Michael Niedermayer
bb3c0571d3 Merge commit 'e3c2d0f3d41f79f7be7ba944aaca2e287c7d5c7c'
* commit 'e3c2d0f3d41f79f7be7ba944aaca2e287c7d5c7c':
  h264: Replace mpegvideo-specific MAX_THREADS by private define

Conflicts:
	libavcodec/h264.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-17 06:17:29 +01:00
Michael Niedermayer
a81a2b514e Merge commit '5d1c2e53ab3ce27b48c138d22bb01ff8e8304f27'
* commit '5d1c2e53ab3ce27b48c138d22bb01ff8e8304f27':
  h264: Replace mpegvideo-specific MAX_PICTURE_COUNT by private define

Conflicts:
	libavcodec/h264.c
	libavcodec/h264_ps.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-17 06:05:19 +01:00
Michael Niedermayer
c237e88d51 Merge commit '9b749c8274f6b6f35dde2cf29b99fa4f719abf87'
* commit '9b749c8274f6b6f35dde2cf29b99fa4f719abf87':
  h264: move relevant fields from Picture to H264Picture

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-17 05:51:27 +01:00
Vittorio Giovara
d24e9a99a4 h264 does not depend on mpegvideo any more 2014-03-16 23:05:47 +01:00
Vittorio Giovara
e0c16e4e32 mpegvideo: move mpegvideo formats-related defines to mpegutils.h 2014-03-16 23:04:41 +01:00
Vittorio Giovara
136034d86b h264: Remove MotionEstContext and move the relevant fields to H264Context
Unused buffers scratchpad and temp have been dropped too.
2014-03-16 23:01:01 +01:00
Vittorio Giovara
e3c2d0f3d4 h264: Replace mpegvideo-specific MAX_THREADS by private define 2014-03-16 23:01:01 +01:00
Vittorio Giovara
5d1c2e53ab h264: Replace mpegvideo-specific MAX_PICTURE_COUNT by private define 2014-03-16 23:01:01 +01:00
Vittorio Giovara
9b749c8274 h264: move relevant fields from Picture to H264Picture 2014-03-16 23:01:00 +01:00
Michael Niedermayer
1d91af5aba Merge commit '304e916a92bc17385a485bec2f957e192257ddb6'
* commit '304e916a92bc17385a485bec2f957e192257ddb6':
  h264_sei: name buffering period type consistently

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-14 14:13:06 +01:00
Michael Niedermayer
a7eb93b367 Merge commit '15210354cf27cf4e24d91f84d66cf471511ce718'
* commit '15210354cf27cf4e24d91f84d66cf471511ce718':
  h264: drop outdated comments

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-14 14:07:19 +01:00
Michael Niedermayer
99b12357f4 Merge commit '3a0576702825423abecb32627c530dbc4c0f73bc'
* commit '3a0576702825423abecb32627c530dbc4c0f73bc':
  h264: store current_sps_id inside the current sps

Conflicts:
	libavcodec/h264.c
	libavcodec/h264_ps.c

The current_sps_id is not removed as it used in security related code.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-14 13:58:02 +01:00
Vittorio Giovara
304e916a92 h264_sei: name buffering period type consistently 2014-02-14 05:08:47 +01:00
Vittorio Giovara
15210354cf h264: drop outdated comments 2014-02-14 05:08:37 +01:00
Vittorio Giovara
3a05767028 h264: store current_sps_id inside the current sps
In preparation for MVC support.
2014-02-14 05:05:46 +01:00
Michael Niedermayer
4df9d9ca4f Merge commit 'b141c7b37eb52aca41ac83738f159b63b9c09d5c'
* commit 'b141c7b37eb52aca41ac83738f159b63b9c09d5c':
  h264: give numbers to nalus

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-08 17:09:39 +01:00
Vittorio Giovara
b141c7b37e h264: give numbers to nalus
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2014-02-08 13:38:31 +01:00
Michael Niedermayer
e708424b70 avcodec/h264: Disallow pps_id changing between slices
Such changes are forbidden in H.264 and lead to race conditions

Fixes out of array read
Fixes: signal_sigsegv_f9796a_1613_cov_3114610371_FM1_BT_B.h264
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-04 00:07:27 +01:00
Michael Niedermayer
6ea05ef278 avcodec/h264: remove unused variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-28 18:19:46 +01:00
Michael Niedermayer
be6e81463c Merge commit '5b10ef729f610fcbc9c485e7b643ce53268144cb'
* commit '5b10ef729f610fcbc9c485e7b643ce53268144cb':
  h264: parse frame packing arrangement SEI messages and save relevant stereo3d information

Conflicts:
	libavcodec/h264.c
	libavcodec/h264_sei.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-09 21:53:23 +01:00
Vittorio Giovara
5b10ef729f h264: parse frame packing arrangement SEI messages and save relevant stereo3d information 2013-12-09 16:02:43 +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
Michael Niedermayer
10c6d1b28c Merge commit '93f305473f880729d18b5e42067f19d2106cb2e5'
* commit '93f305473f880729d18b5e42067f19d2106cb2e5':
  lavc: Convert some remaining strides to ptrdiff_t

Conflicts:
	libavcodec/h264.h
	libavcodec/mpegvideo_enc.c
	libavcodec/mpegvideo_motion.c
	libavcodec/vp56.c
	libavcodec/wmv2.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-16 13:08:37 +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