1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

85 Commits

Author SHA1 Message Date
Michael Niedermayer
6a37abc59a avcodec/h264_sei: Check actual presence of SEI picture timing instead of implying it
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-15 00:19:50 +01:00
James Almer
4c121ad546 Merge commit '1cf2f3d334f52849aae2be868bad1e5fa5f59aa0'
* commit '1cf2f3d334f52849aae2be868bad1e5fa5f59aa0':
  h264_sei: drop an unnecessary h264dec.h include

Merged-by: James Almer <jamrial@gmail.com>
2016-08-01 13:04:30 -03: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
Benoit Fouet
879330c561 h264: make H264ParamSets sps const 2016-06-30 09:24:39 +02:00
Michael Niedermayer
9981b70da5 avcodec/h264_sei: Do not skip subsequent SEIs on errors potentially caused by missing parameter sets.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-26 00:44:47 +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
1cf2f3d334 h264_sei: drop an unnecessary h264dec.h include
The code does not depend on the h264 decoder anymore and only needs
information from h264_ps
2016-06-21 11:15:44 +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
Clément Bœsch
5584f019b5 Merge commit '728d90a0c1973661a9e73da697bf4f90c9d19577'
* commit '728d90a0c1973661a9e73da697bf4f90c9d19577':
  h264: decouple h264_sei from the h264 decoder

Main changes:

- SEI decoding doesn't have access to the debug flag in the codec context so a
  few logging are dropped.

- naming of quincunx_sampling_flag and frame_packing_arrangement_type are kept
  as they are in FFmpeg instead of respectively quincunx_subsampling and
  arrangement_type used in Libav because the former match the specifications.

- don't reset the x264 build info once read in order to fix
  fate-h264-lossless (change by Hendrik)

- H264Context.has_recovery_point and deprecated
  AVCodecContext.dtg_active_format are set after ff_h264_sei_decode()
  based on the SEI state since ff_h264_sei_decode() doesn't have access
  to H264Context anymore.

- frame_packing_arrangement_type is not checked against <= 0 in
  decode_postinit() since it is always read as a positive value with
  get_bits(). This fixes a -Wtype-limits warning by GCC spotted by
  Michael.

Side Notes:

- tested that ffprobe on the file from ticket #3652 still returns 4
  keyframes
- tested that playback from ticket #3063 still works

Merged-by: Clément Bœsch <clement@stupeflix.com>
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-06-18 14:04:55 +02:00
Clément Bœsch
7dd8cd1933 lavc/h264_sei: fix broken style around green metadata code 2016-06-14 08:23:23 +02:00
Clément Bœsch
5342bb624d lavc/h264: rename GreenMetaData to H264SEIGreenMetaData
Reduces diff for the next merge with Libav.
2016-06-14 08:23:23 +02:00
Clément Bœsch
b0ec36c9b1 lavc/h264_sei: reduce scope of parameters for green meta decode
This is again will help the merge as ff_h264_decode_sei will not have
access to H264Context anymore.
2016-06-14 08:23:23 +02:00
Clément Bœsch
fef89aae98 lavc/h264: move green meta logging out of the sei decoding
This will simplify the next Libav merge where SEI decoding doesn't have
access to the debug level anymore.
2016-06-14 08:23:23 +02:00
Clément Bœsch
7a2a8b541a lavc/h264_sei: fix green metadata typo 2016-06-13 22:41:38 +02:00
Clément Bœsch
1534ef87c7 Merge commit '3176217c60ca7828712985092d9102d331ea4f3d'
* commit '3176217c60ca7828712985092d9102d331ea4f3d':
  h264: decouple h264_ps from the h264 decoder

Main changes:

- a local GetBitContext is created for the various
  ff_h264_decode_seq_parameter_set() attempts

- just like the old code, remove_sps() is adjusted so it doesn't remove
  the pps.

  Fixes decode with Ticket #631
  http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20111108/dae58f17/attachment.mp4
  but see next point as well.

- ff_h264_update_thread_context() is updated to work even when SPS
  isn't set as it breaks current skip_frame code. This makes sure we
  can still decode the sample from ticket #631 without the need for
  -flags2 +chunks. (Thanks to Michael)

- keep {sps,pps}_ref pointers that stay alive even when the active
  pps/sps get removed from the available lists (patch by michaelni with
  additionnal frees in ff_h264_free_context() from mateo)

- added a check on sps in avpriv_h264_has_num_reorder_frames() to fix
  crashes with mpegts_with_dvbsubs.ts from Ticket #4074
  http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket4074/mpegts_with_dvbsubs.ts

- in h264_parser.c:h264_parse(), after the ff_h264_decode_extradata() is
  called, the pps and sps from the local parser context are updated with
  the pps and sps from the used h264context. This fixes fate-flv-demux.

- in h264_slice.c, "PPS changed between slices" error is not triggered
  anymore in one condition as it makes fate-h264-xavc-4389 fails with
  THREADS=N (Thanks to Michael)

Merged-by: Clément Bœsch <clement@stupeflix.com>
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
Merged-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
2016-06-12 13:26:52 +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
728d90a0c1 h264: decouple h264_sei from the h264 decoder
Make the SEI parsing independent of the H264Context, to allow
decoupling the parser from the decoder.
2016-04-24 10:06:24 +02:00
Anton Khirnov
3176217c60 h264: decouple h264_ps from the h264 decoder
Make the SPS/PPS parsing independent of the H264Context, to allow
decoupling the parser from the decoder. The change is modelled after the
one done earlier for HEVC.

Move the dequant buffers to the PPS to avoid complex checks whether they
changed and an expensive copy for frame threads.
2016-04-24 10:06:23 +02:00
Mark Harris
c51c08e0e7 avcodec: Use get_ue_golomb_long() when needed
get_ue_golomb() cannot decode values larger than 8190 (the maximum
value that can be golomb encoded in 25 bits) and produces the error
"Invalid UE golomb code" if a larger value is encountered.  Use
get_ue_golomb_long() instead (which supports 63 bits, up to 4294967294)
when valid h264/hevc values can exceed 8190.

This updates decoding of the following values:   (maximum)
  first_mb_in_slice                                36863* for level 5.2
  abs_diff_pic_num_minus1                         131071
  difference_of_pic_nums_minus1                   131071
  idr_pic_id                                       65535
  recovery_frame_cnt                               65535
  frame_packing_arrangement_id                4294967294
  frame_packing_arrangement_repetition_period      16384
  display_orientation_repetition_period            16384

An alternative would be to modify get_ue_golomb() to handle encoded
values of up to 49 bits as was done for get_se_golomb() in a92816c.
In that case get_ue_golomb() could continue to be used for all of
these except frame_packing_arrangement_id.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-29 13:11:51 +01:00
Hendrik Leppkes
3ff6d40cbc Merge commit 'b4a82e740743744136e07054525560351e4892ae'
* commit 'b4a82e740743744136e07054525560351e4892ae':
  h264: Print the complete user message

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-02 11:54:34 +01:00
Hendrik Leppkes
ed6d451d93 Merge commit '8487987b87a252963b27b6adfd82887ea5933918'
* commit '8487987b87a252963b27b6adfd82887ea5933918':
  h264: Print user data SEI under normal debug verbosity

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-02 11:53:55 +01:00
Vittorio Giovara
b4a82e7407 h264: Print the complete user message
Previously the message was cut off at 256th byte.
This will allow dumping the complete x264 encode info when needed.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-30 12:46:56 +01:00
Vittorio Giovara
8487987b87 h264: Print user data SEI under normal debug verbosity
Drop the need of setting -debug bugs since it's not a bug, and the
message is already under a AV_LOG_DEBUG log level. Instead only print
it when there is an actual string in it.
2015-10-30 12:46:56 +01:00
Michael Niedermayer
91ca8105dd avcodec/h264_sei: Remove "Subtitles with data type 0x%02x" sample request
Suggested-by: Carl and Hendrik
2015-09-09 00:17:59 +02:00
Hendrik Leppkes
a4c13f95fb Merge commit 'f9ab4fe1f7c1e9d410ca5ee2c9ff8d2892aad068'
* commit 'f9ab4fe1f7c1e9d410ca5ee2c9ff8d2892aad068':
  h264: Discard currently unsupported registered sei

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-08-24 10:36:07 +02:00
Luca Barbato
61d8fa2a1a h264: Fix faulty call to avpriv_request_sample
Broken in f9ab4fe1f7
2015-08-22 01:42:19 +02:00
John Högberg
f9ab4fe1f7 h264: Discard currently unsupported registered sei
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-08-21 12:03:36 +02:00
Hendrik Leppkes
db395bef7f Merge commit '80ea66112817c719b476de8f7d8d3b325f4c7dd1'
* commit '80ea66112817c719b476de8f7d8d3b325f4c7dd1':
  avcodec: h264: Extract decoder methods

Conflicts:
	libavcodec/h264_sei.c

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-08-02 10:59:06 +02:00
David Holm
80ea661128 avcodec: h264: Extract decoder methods
Extract two methods from decode_registered_user_data in order to improve
code readability. Also make the constant holding the allocation size a
64-bit unsigned integer so that the size comparison against INT_MAX makes
sense.

Bug-Id: CID1312090

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-08-01 14:29:53 +02:00
Michael Niedermayer
441d5a7084 Merge commit 'b0017579b6e8de3d0d13dcfe0a4dd848dc6baa37'
* commit 'b0017579b6e8de3d0d13dcfe0a4dd848dc6baa37':
  h264: Add support for Closed Caption export

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

See: 8234f0e3b4
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-17 14:13:19 +02:00
Kieran Kunhya
b0017579b6 h264: Add support for Closed Caption export
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-17 01:44:22 +01:00
Kieran Kunhya
8234f0e3b4 avcodec: Add support for Closed Caption export in h264
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-06 15:25:22 +02:00
Nicolas DEROUINEAU
04a68f4348 avcodec/h264: Greenmetadata SEI parsing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-30 23:20:36 +02:00
Michael Niedermayer
7e9c7b623f Merge commit '271ce76d317c5432e151216cf23f12b77ed6cb7e'
* commit '271ce76d317c5432e151216cf23f12b77ed6cb7e':
  h264: Parse registered data SEI message and AFD value

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

See: d6e9566949
See: 22291c372f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-30 22:54:33 +02:00
Michael Niedermayer
8e6c5c4322 Merge commit '0bfab80a0d9fce0180e8aa2a947267f89b725091'
* commit '0bfab80a0d9fce0180e8aa2a947267f89b725091':
  h264_sei: Group error check outside the switch block

Conflicts:
	libavcodec/h264_sei.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-30 22:29:34 +02:00
Vittorio Giovara
271ce76d31 h264: Parse registered data SEI message and AFD value
Partially based on code by Marton Balint and Kieran Kunhya.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-06-30 15:34:38 +02:00
Vittorio Giovara
0bfab80a0d h264_sei: Group error check outside the switch block 2015-06-30 15:34:38 +02:00
Kieran Kunhya
22291c372f avcodec: Add support for per-frame AFD output in h264
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-26 23:11:17 +02:00
Michael Niedermayer
688a40b4ed avcodec/h264_sei: ff_h264_decode_sei: dont try to parse trailing zeroes
reduces noise for tserrors.ts

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-16 04:07:22 +02:00
Vittorio Giovara
7ab551f9fd h264: prevent theoretical infinite loop in SEI parsing
Properly address CVE-2011-3946 and parse bitstream as described in the spec.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-08-01 13:08:32 +01: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
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
a062bee1c1 Merge commit '066ad249843bde656265b59110c2521e2b1ce131'
* commit '066ad249843bde656265b59110c2521e2b1ce131':
  h264_sei: reorder headers

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-14 14:18:04 +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
Vittorio Giovara
066ad24984 h264_sei: reorder headers
Also drop unused assert.h.
2014-02-14 05:10:58 +01:00
Vittorio Giovara
304e916a92 h264_sei: name buffering period type consistently 2014-02-14 05:08:47 +01:00
Michael Niedermayer
d6acf45ec2 Merge commit '3d9fc21e593aa89b5877bd739268499b079052f2'
* commit '3d9fc21e593aa89b5877bd739268499b079052f2':
  h264: Refactor decode_frame_packing_arrangement

Conflicts:
	libavcodec/h264_sei.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-17 19:30:57 +01:00
Vittorio Giovara
3d9fc21e59 h264: Refactor decode_frame_packing_arrangement
Directly set the fields when necessary.
2013-12-17 09:34:08 +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