Commit Graph

35 Commits

Author SHA1 Message Date
Neil Birkbeck
3b0974d3ef lavc/hevc Parse SEI_TYPE_MASTERING_DISPLAY_INFO and propagate content into the AVMasteringDisplayMetadata side data.
Add support for parsing SEI_TYPE_MASTERING_DISPLAY_INFO and propagate contents into
the AVMasteringDisplayMetadata side data. Primaries are ordered in RGB order and
the values are converted to rationals ([0,1] for CEI 1931 Chroma coords,
and cd/m^2 for luma).

Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-14 00:36:05 +01: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
Will Kelleher
b1a32429ef hevc: Fix a53 caption extraction
Just realized my previous patch doesn't work quite right.  I uploaded a better
sample file that actually has visible captions to /incoming/hevc_cc.ts.  I
tested with that file doing hevc->x264 and it works.

This is basically an exact copy of the existing h264 logic.

Signed-off-by: Will Kelleher <wkelleher@gogoair.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 13:16:25 +01:00
Will Kelleher
7f7fa90f7b hevc: extract SEI caption data
Signed-off-by: Will Kelleher <wkelleher@gogoair.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-07 12:10:55 +01:00
Hendrik Leppkes
b3e5d59537 Merge commit '979cb55103fa8e8274806e496901203742c686d1'
* commit '979cb55103fa8e8274806e496901203742c686d1':
  hevc: Split the sei parsing in 3 functions

Conflicts:
	libavcodec/hevc_sei.c

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-08-02 12:29:30 +02:00
Hendrik Leppkes
90ec89a629 Merge commit '043f46f5741e1a5caedf55d788e1a72aae3b7605'
* commit '043f46f5741e1a5caedf55d788e1a72aae3b7605':
  hevc: Use switch instead of if-nests in decode_nal_sei_message

Conflicts:
	libavcodec/hevc_sei.c

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-08-02 12:25:41 +02:00
Hendrik Leppkes
2e290d6114 Merge commit '2cd841c0776535be56e4db67485fdd9509c9b9f4'
* commit '2cd841c0776535be56e4db67485fdd9509c9b9f4':
  hevc: Use a proper enum for the SEI values

Conflicts:
	libavcodec/hevc_sei.c

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-08-02 12:18:40 +02:00
Luca Barbato
979cb55103 hevc: Split the sei parsing in 3 functions 2015-08-01 15:45:50 +02:00
Luca Barbato
043f46f574 hevc: Use switch instead of if-nests in decode_nal_sei_message
Makes simpler to add support for more SEI types.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-08-01 15:34:45 +02:00
Luca Barbato
2cd841c077 hevc: Use a proper enum for the SEI values
And use the correct value for decoded_picture_hash.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-08-01 15:23:05 +02:00
Michael Niedermayer
d5fcca83b9 Merge commit 'b11acd57326db6c2cc1475dd0bea2a06fbc85aa2'
* commit 'b11acd57326db6c2cc1475dd0bea2a06fbc85aa2':
  hevc: remove HEVCContext usage from hevc_ps

Conflicts:
	libavcodec/hevc.c
	libavcodec/hevc_cabac.c
	libavcodec/hevc_filter.c
	libavcodec/hevc_mvs.c
	libavcodec/hevc_ps.c
	libavcodec/hevc_refs.c
	libavcodec/hevcpred_template.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-12 22:28:54 +02:00
Michael Niedermayer
93b0ee21a2 avcodec/hevc_sei: Check num_sps_ids_minus1 value
Fixes CID1271794

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-13 01:42:52 +02:00
Michael Niedermayer
92c29914de avcodec/hevc_sei: factor return 1 out of if/else chain
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-10 00:19:49 +02:00
Michael Niedermayer
efc66d69bf Merge commit '0569a7e0bd2006d9a5248d17a1f4bf3ca654ae50'
* commit '0569a7e0bd2006d9a5248d17a1f4bf3ca654ae50':
  hevc: parse display orientation SEI message

Conflicts:
	libavcodec/hevc.h
	libavcodec/hevc_sei.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-10 00:19:43 +02:00
Vittorio Giovara
0569a7e0bd hevc: parse display orientation SEI message
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-07-09 10:18:06 -04:00
Michael Niedermayer
5183fac92f avcodec/hevc_sei: fix invalid get_bits() in a comment
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-07 23:37:27 +02:00
Michael Niedermayer
4e1dc600a1 Merge commit '3a149e23d37f06d49ab0bb013a3b9cb0224bba5c'
* commit '3a149e23d37f06d49ab0bb013a3b9cb0224bba5c':
  hevc: Refactor decode_nal_sei_frame_packing_arrangement

Conflicts:
	libavcodec/hevc_sei.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-17 19:04:32 +01:00
Luca Barbato
3a149e23d3 hevc: Refactor decode_nal_sei_frame_packing_arrangement
Directly set the fields when necessary.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2013-12-17 09:34:08 +01:00
Michael Niedermayer
180a0b1bcb avcodec/hevc_sei: fix use of uninitialized variables in decode_nal_sei_frame_packing_arrangement()
Fixes CID1135773/1135774/1135775
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-13 00:07:06 +01:00
Guillaume Martres
679a6377e4 hevc: avoid some unnecessary differences with libav
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-10 16:20:48 +01:00
Michael Niedermayer
31a52a60c9 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  hevc: parse frame packing arrangement SEI messages and save relevant stereo3d information

Conflicts:
	libavcodec/hevc.h
	libavcodec/hevc_sei.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-09 22:25:38 +01:00
Vittorio Giovara
acb77dff6a hevc: parse frame packing arrangement SEI messages and save relevant stereo3d information 2013-12-09 16:02:43 +01:00
Michael Niedermayer
8983dea426 Merge commit 'c673fc919c374c60b1e6d80d8822712eadf67f16'
* commit 'c673fc919c374c60b1e6d80d8822712eadf67f16':
  hevc_sei: drop unused parameter

Conflicts:
	libavcodec/hevc_sei.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-19 17:59:47 +01:00
Vittorio Giovara
c673fc919c hevc_sei: drop unused parameter 2013-11-19 14:48:36 +01:00
Michael Niedermayer
8a701ef7dd avcodec/hevc_sei: Fix null dereference in decode_pic_timing()
Fixes Ticket3106

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-03 02:19:28 +01:00
Michael Niedermayer
63a37d0e1e avcodec/hevc_sei: check active_seq_parameter_set_id validity
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-03 02:13:55 +01:00
Michael Niedermayer
35594c48ca libavcodec/hevc: random cosmetics to reduce diff to 064698d381
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-02 17:28:44 +01:00
Michael Niedermayer
2c4f573696 libavcodec/hevc: random cosmetics to reduce diff to 064698d381
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-02 15:32:15 +01:00
Michael Niedermayer
b23692b3a8 libavcodec/hevc: reduce whitespace differences to 064698d381
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-02 14:10:21 +01:00
Michael Niedermayer
1a6948fa70 libavcodec/hevc: reduce bracket differences to 064698d381
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-02 13:09:31 +01:00
Michael Niedermayer
f578e5d937 avcodec/hevc: Adjust white-spaces to reduce difference to 064698d381
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-02 00:44:54 +01:00
Guillaume Martres
064698d381 Add HEVC decoder
Initially written by Guillaume Martres <smarter@ubuntu.com> as a GSoC
project. Further contributions by the OpenHEVC project and other
developers, namely:

Mickaël Raulet <mraulet@insa-rennes.fr>
Seppo Tomperi <seppo.tomperi@vtt.fi>
Gildas Cocherel <gildas.cocherel@laposte.net>
Khaled Jerbi <khaled_jerbi@yahoo.fr>
Wassim Hamidouche <wassim.hamidouche@insa-rennes.fr>
Vittorio Giovara <vittorio.giovara@gmail.com>
Jan Ekström <jeebjp@gmail.com>
Anton Khirnov <anton@khirnov.net>
Martin Storsjö <martin@martin.st>
Luca Barbato <lu_zero@gentoo.org>
Yusuke Nakamura <muken.the.vfrmaniac@gmail.com>
Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diego Biurrun <diego@biurrun.de>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-10-31 20:19:59 +01:00
Mickaël Raulet
7c8b65f688 hevc: add partial support for interlaced(cherry picked from commit 44b592ae6d323445c076ef3ec966ebf9daa8bccf)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-31 10:00:22 +01:00
Mickaël Raulet
0c8aba3842 hevc: add wavefront parallel processing
cherry picked from commit b971f2c8fdc60f8bab605a6e8060492eb548a53a
cherry picked from commit e57b0a2c915ce6b8a9d57b8292f6581f0680842e

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-22 20:20:40 +02:00
Guillaume Martres
c8dd048ab8 lavc: add a HEVC decoder.
Initially written by Guillaume Martres <smarter@ubuntu.com> as a GSoC
project. Further contributions by the OpenHEVC project and other
developers, namely:

Mickaël Raulet <mraulet@insa-rennes.fr>
Seppo Tomperi <seppo.tomperi@vtt.fi>
Gildas Cocherel <gildas.cocherel@laposte.net>
Khaled Jerbi <khaled_jerbi@yahoo.fr>
Wassim Hamidouche <wassim.hamidouche@insa-rennes.fr>
Vittorio Giovara <vittorio.giovara@gmail.com>
Jan Ekström <jeebjp@gmail.com>
Anton Khirnov <anton@khirnov.net>
Martin Storsjö <martin@martin.st>
Luca Barbato <lu_zero@gentoo.org>
Yusuke Nakamura <muken.the.vfrmaniac@gmail.com>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-15 22:13:02 +02:00