summaryrefslogtreecommitdiff
path: root/libavcodec/hevc_sei.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/hevc_sei: Fix integer overflows in decode_nal_sei_message()Michael Niedermayer2017-12-171-0/+4
| | | | | | | | Fixes: signed integer overflow: 2147483520 + 255 cannot be represented in type 'int' Fixes: 4554/clusterfuzz-testcase-minimized-4843714515042304 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '99e9697e3a12ab4a6638a36b95edafd6a98f9eaa'James Almer2017-11-291-4/+5
|\ | | | | | | | | | | | | * commit '99e9697e3a12ab4a6638a36b95edafd6a98f9eaa': stereo3d: Support view type for frame sequence type Merged-by: James Almer <jamrial@gmail.com>
| * stereo3d: Support view type for frame sequence typeVittorio Giovara2017-11-281-4/+5
| | | | | | | | | | | | Implement detection in h264 and hevc and insertion in framepack filter. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * hevc: Add support for alternative transfer characterics SEIVittorio Giovara2017-06-281-0/+9
| | | | | | | | | | | | | | | | | | | | The use of this SEI is for backward compatibility in HLG HDR systems: older devices that cannot interpret the "arib-std-b67" transfer will get the compatible transfer (usually bt709 or bt2020) from the VUI, while newer devices that can interpret HDR will read the SEI and use its value instead. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * hevcdec: move SEI message parsing into a separate headerJames Almer2017-05-091-32/+5
| | | | | | | | | | | | | | It doesn't depend on hevcdec anymore. Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * hevcdec: remove HEVCContext usage from hevc_seiJames Almer2017-05-091-39/+32
| | | | | | | | | | | | | | | | | | | | Based on the H264 SEI implementation. This will be mainly useful once support for SEI messages that can be used by the hevc parser are implemented, like Picture Timing. Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * golomb: Convert to the new bitstream readerDiego Biurrun2017-01-311-1/+1
| |
* | avcodec/hevc_sei: reorder some parameters in static functionsJames Almer2017-10-311-10/+9
| | | | | | | | | | | | | | Cosmetic change skipped in 0b30cb8dae5e7edb2a5f35900547321499c217f1 by mistake. Signed-off-by: James Almer <jamrial@gmail.com>
* | avcodec/hevc_sei: rename HEVCSEIContext to HEVCSEIJames Almer2017-10-311-8/+8
| | | | | | | | | | | | | | Cosmetic change skipped in 0b30cb8dae5e7edb2a5f35900547321499c217f1 by mistake. Signed-off-by: James Almer <jamrial@gmail.com>
* | avcodec/hevc_sei: Support HEVC paired fields.Brian Matherly2017-09-301-2/+2
| | | | | | | | | | | | | | Correctly set the interlaced_frame and top_field_first fields when pic_struct indicates paired fields. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | hevc: Add support for alternative transfer characterics SEIVittorio Giovara2017-06-281-0/+9
| | | | | | | | | | | | | | | | | | | | The use of this SEI is for backward compatibility in HLG HDR systems: older devices that cannot interpret the "arib-std-b67" transfer will get the compatible transfer (usually bt709 or bt2020) from the VUI, while newer devices that can interpret HDR will read the SEI and use its value instead. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/hevc_sei: remove bugus debug messageJames Almer2017-05-101-4/+2
| | | | | | | | | | | | | | Also Change the active_parameter_sets function name to one more in line with the rest of the file. Signed-off-by: James Almer <jamrial@gmail.com>
* | avcodec/hevc_sei: fix amount of bits skipped when reading picture timing SEI ↵James Almer2017-05-101-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | message The code was skipping the entire reported SEI message size regardless of the amount of bits read. While in theory safe for NALU where the picture timing SEI message is alone or at the end as we're using the checked bitstream reader, it isn't in any other situation, where every SEI message in the NALU after the picture timing one would potentially fail to parse. Change the function name to one more in line with the rest of file, and remove the bogus "Skipped SEI" debug message while at it. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | avcodec/hevc_sei: actually propagate error codesJames Almer2017-05-061-1/+1
| |
* | avcodec/hevcdec: move SEI message parsing into a separate headerJames Almer2017-05-051-37/+10
| | | | | | | | | | | | | | | | It doesn't depend on hevcdec anymore. Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Reviewed-by: Aaron Levinson <alevinsn@aracnet.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | avcodec/hevcdec: remove HEVCContext usage from hevc_seiJames Almer2017-05-051-77/+67
| | | | | | | | | | | | | | | | Based on the H264 SEI implementation. Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Reviewed-by: Aaron Levinson <alevinsn@aracnet.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | lavc: Add Content Light Level side metadata found in HEVCSteve Lhomme2017-04-061-0/+15
| | | | | | | | | | | | These data are necessary when transmitting HDR over HDMI. Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit '67351924fa91dea4339109100a4c0689f006581f'Clément Bœsch2017-03-301-1/+0
|\ \ | |/ | | | | | | | | | | * commit '67351924fa91dea4339109100a4c0689f006581f': Drop unreachable break and return statements Merged-by: Clément Bœsch <cboesch@gopro.com>
| * Drop unreachable break and return statementsDiego Biurrun2016-11-031-1/+0
| |
* | Merge commit 'c359d624d3efc3fd1d83210d78c4152bd329b765'James Almer2017-03-231-2/+2
|\ \ | |/ | | | | | | | | | | * commit 'c359d624d3efc3fd1d83210d78c4152bd329b765': hevcdec: move decoder-independent declarations into a separate header Merged-by: James Almer <jamrial@gmail.com>
| * hevcdec: move decoder-independent declarations into a separate headerAnton Khirnov2016-10-161-1/+1
| | | | | | | | | | | | | | This way they can be reused by other code without including the whole decoder-specific hevcdec.h Also, add the HEVC_ prefix to them, since similarly named values exist for H.264 as well and are sometimes used in the same code.
* | Merge commit '4abe3b049d987420eb891f74a35af2cebbf52144'Clément Bœsch2017-03-231-1/+1
|\ \ | |/ | | | | | | | | | | * commit '4abe3b049d987420eb891f74a35af2cebbf52144': hevc: rename hevc.[ch] to hevcdec.[ch] Merged-by: Clément Bœsch <u@pkh.me>
| * hevc: rename hevc.[ch] to hevcdec.[ch]Anton Khirnov2016-10-161-1/+1
| | | | | | | | | | This is more consistent with the rest of libav and frees up the hevc.h name for decoder-independent shared declarations.
* | Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-211-1/+1
|\ \ | |/ | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-041-1/+1
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | hevc: Fix memory leak related to a53_caption dataWill Kelleher2016-05-151-0/+6
| | | | | | | | | | Signed-off-by: Will Kelleher <wkelleher@gogoair.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc/hevc Parse SEI_TYPE_MASTERING_DISPLAY_INFO and propagate content into ↵Neil Birkbeck2016-02-141-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | avcodec: Use get_ue_golomb_long() when neededMark Harris2015-12-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | hevc: Fix a53 caption extractionWill Kelleher2015-11-121-10/+17
| | | | | | | | | | | | | | | | | | | | | | 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>
* | hevc: extract SEI caption dataWill Kelleher2015-11-071-0/+79
| | | | | | | | | | Signed-off-by: Will Kelleher <wkelleher@gogoair.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '979cb55103fa8e8274806e496901203742c686d1'Hendrik Leppkes2015-08-021-31/+45
|\ \ | |/ | | | | | | | | | | | | | | | | * commit '979cb55103fa8e8274806e496901203742c686d1': hevc: Split the sei parsing in 3 functions Conflicts: libavcodec/hevc_sei.c Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * hevc: Split the sei parsing in 3 functionsLuca Barbato2015-08-011-20/+34
| |
* | Merge commit '043f46f5741e1a5caedf55d788e1a72aae3b7605'Hendrik Leppkes2015-08-021-20/+31
|\ \ | |/ | | | | | | | | | | | | | | | | * 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>
| * hevc: Use switch instead of if-nests in decode_nal_sei_messageLuca Barbato2015-08-011-13/+21
| | | | | | | | | | | | Makes simpler to add support for more SEI types. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '2cd841c0776535be56e4db67485fdd9509c9b9f4'Hendrik Leppkes2015-08-021-6/+34
|\ \ | |/ | | | | | | | | | | | | | | | | * commit '2cd841c0776535be56e4db67485fdd9509c9b9f4': hevc: Use a proper enum for the SEI values Conflicts: libavcodec/hevc_sei.c Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * hevc: Use a proper enum for the SEI valuesLuca Barbato2015-08-011-4/+32
| | | | | | | | | | | | And use the correct value for decoded_picture_hash. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'b11acd57326db6c2cc1475dd0bea2a06fbc85aa2'Michael Niedermayer2015-07-121-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* | avcodec/hevc_sei: Check num_sps_ids_minus1 valueMichael Niedermayer2015-05-131-0/+5
| | | | | | | | | | | | Fixes CID1271794 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/hevc_sei: factor return 1 out of if/else chainMichael Niedermayer2014-07-101-6/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '0569a7e0bd2006d9a5248d17a1f4bf3ca654ae50'Michael Niedermayer2014-07-101-0/+18
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit '0569a7e0bd2006d9a5248d17a1f4bf3ca654ae50': hevc: parse display orientation SEI message Conflicts: libavcodec/hevc.h libavcodec/hevc_sei.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * hevc: parse display orientation SEI messageVittorio Giovara2014-07-091-0/+17
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/hevc_sei: fix invalid get_bits() in a commentMichael Niedermayer2014-06-071-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '3a149e23d37f06d49ab0bb013a3b9cb0224bba5c'Michael Niedermayer2013-12-171-15/+7
|\ \ | |/ | | | | | | | | | | | | | | | | * commit '3a149e23d37f06d49ab0bb013a3b9cb0224bba5c': hevc: Refactor decode_nal_sei_frame_packing_arrangement Conflicts: libavcodec/hevc_sei.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * hevc: Refactor decode_nal_sei_frame_packing_arrangementLuca Barbato2013-12-171-12/+7
| | | | | | | | | | | | Directly set the fields when necessary. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/hevc_sei: fix use of uninitialized variables in ↵Michael Niedermayer2013-12-131-1/+4
| | | | | | | | | | | | | | decode_nal_sei_frame_packing_arrangement() Fixes CID1135773/1135774/1135775 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | hevc: avoid some unnecessary differences with libavGuillaume Martres2013-12-101-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-12-091-2/+7
|\ \ | |/ | | | | | | | | | | | | | | | | | | * 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>
| * hevc: parse frame packing arrangement SEI messages and save relevant ↵Vittorio Giovara2013-12-091-5/+10
| | | | | | | | stereo3d information
* | Merge commit 'c673fc919c374c60b1e6d80d8822712eadf67f16'Michael Niedermayer2013-11-191-4/+3
|\ \ | |/ | | | | | | | | | | | | | | | | * commit 'c673fc919c374c60b1e6d80d8822712eadf67f16': hevc_sei: drop unused parameter Conflicts: libavcodec/hevc_sei.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * hevc_sei: drop unused parameterVittorio Giovara2013-11-191-4/+3
| |