summaryrefslogtreecommitdiff
path: root/libavcodec/cbs_h264_syntax_template.c
Commit message (Collapse)AuthorAge
* cbs_h264: add support for Film Grain Characteristics SEI messagesJames Almer2021-07-23
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* cbs_h2645: Merge SEI message handling in common between codecsMark Thompson2021-01-21
|
* h264: Use common SEI typesMark Thompson2021-01-21
|
* cbs_h2645: Merge SEI messages in common between codecsMark Thompson2021-01-21
| | | | | Make a new template file for common SEI messages - this will also apply to H.266.
* avcodec/cbs_h264_syntax_template: fix off by 1 error with ↵Michael Niedermayer2020-04-05
| | | | | | | | | | slice_group_change_cycle Fixes: assertion failure Fixes: 20390/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_REDUNDANT_PPS_fuzzer-5683400772157440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/cbs_h2645_syntax_template: Fix memleakAndriy Gelman2019-12-16
| | | | | | | | | | | | | | | | | payload_count is used to track the number of SEI payloads. It is also used to free the SEIs in cbs_h264_free_sei()/cbs_h265_free_sei(). Currently, payload_count is set after for loop is completed. Hence if there is an error and the function exits, the payload remains zero causing a memleak. This commit keeps track of payload_count inside the for loop to fix the issue. Note that that the contents of current are initialized with av_mallocz() so there is no need to zero initialize payload_count. Found-by: libFuzzer Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* cbs_h264: Fix missing inferred colour description fieldsMark Thompson2019-07-29
| | | | | With video_signal_type_present_flag set but colour_description_present_flag unset the colour fields would not have had their correct values inferred.
* libavcodec: Reduce the size of some arraysAndreas Rheinhardt2019-06-20
| | | | | | | | | | This commit uses smaller types for some static const arrays to reduce their size in case the entries can be represented in the smaller type. The biggest savings came from inv_map_table in vp9.c. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h264: add support for Alternative Transfer Characteristics SEI ↵James Almer2019-06-03
| | | | | | | message Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h2645: use the fixed() macro for forbidden_zero_bitJames Almer2019-04-28
| | | | | | | | This follows the spec definition, and removes a field from the relevant structs. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h2645: add macros to read and write fields with no custom range ↵James Almer2019-04-28
| | | | | | | of values Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h264: fix storage type for time_offset in Pic Timing SEIJames Almer2019-04-16
| | | | | | | The spec defines it as a signed value. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* cbs_h264: Fix handling of auxiliary picturesAndreas Rheinhardt2018-11-08
| | | | | | | | | | The earlier code used the most recent non-auxiliary slice to determine whether an auxiliary slice has the syntax of an IDR slice, even when the most recent slice was from a slice of a redundant frame. Now only slices of the primary coded picture are used, as the specifications mandate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
* cbs_h264: Include SEI type names in trace outputMark Thompson2018-10-31
|
* cbs_h2645: Allocate all internal buffers with paddingMark Thompson2018-10-22
| | | | | Any of these buffers (for both H.264 and H.265) might reasonably be parsed using the bitstream reader, so include padding on all of them.
* cbs_h264: Fix SPS used for pic_timing timestampMark Thompson2018-10-22
| | | | | It should be the same as the one used for the rest of the pic_timing structure.
* cbs_h264: Actually decompose end-of-sequence NAL unitsMark Thompson2018-10-22
| | | | | | | 64c50c0e978cd556dc2da238dfe0bb367e7c1ab9 declared support for decomposing them but omitted to implement it; this adds an implementation. Also do the same for end-of-stream NAL units, since they are equivalent.
* avcodec/cbs: ensure user_data is padded for GBC parsingAman Gupta2018-10-15
| | | | | | | | | | | | | | | | | | | | | Fixes crash noticed in the cbs_userdata patchset. ====ERROR: AddressSanitizer: heap-buffer-overflow on address 0x609000026c89 at pc 0x00010725d37b bp 0x7ffeea04e750 sp 0x7ffeea04e748 READ of size 4 at 0x609000026c89 thread T0 #0 0x10725d37a in ff_cbs_read_unsigned get_bits.h:274 #1 0x1072d2767 in ff_cbs_read_a53_user_data cbs_misc_syntax_template.c:119 #2 0x1078251a7 in h264_metadata_filter h264_metadata_bsf.c:595 #3 0x105c1321d in output_packet ffmpeg.c:853 0x609000026c89 is located 1 bytes to the right of 8-byte region [0x609000026c80,0x609000026c88) allocated by thread T0 here: #0 0x10aef08d7 in wrap_posix_memalign (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x578d7) #1 0x10aca95e6 in av_malloc mem.c:87 #2 0x10ac545fe in av_buffer_allocz buffer.c:72 #3 0x107263b27 in cbs_h264_read_nal_unit cbs_h264_syntax_template.c:722 #4 0x10725b688 in cbs_read_fragment_content cbs.c:155 Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/cbs: fix crash in sei_pic_timestampAman Gupta2018-10-15
| | | | Signed-off-by: Aman Gupta <aman@tmm1.net>
* cbs_h264: Infer default VUI values if VUI parameters are not presentMark Thompson2018-09-23
|
* cbs_h264: Fix profile typoMark Thompson2018-09-23
|
* cbs_h264: Fix default value for max mv lengthsMark Thompson2018-09-23
| | | | | | A recent version of the standard changed the max and default to 15, from 16 in older versions. This updates the default to 15 to match, but the max stays as 16 so that we don't reject older streams.
* cbs_h264: Add support for mastering display SEI messagesMark Thompson2018-05-10
|
* cbs_h264: Add support for pan-scan rectangle SEI messagesMark Thompson2018-05-10
|
* cbs_h264: Fix handling of unknown SEIMark Thompson2018-05-10
| | | | | The user should only interact directly with the data length, not the payload size.
* cbs_h264: Need [] in the name when subscript is requiredHaihao Xiang2018-05-07
| | | | | | | Otherwise it will hit an assert in the function ff_cbs_trace_syntax_element() in cbs.c, line 400. Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* cbs: Add support for array subscripts in trace outputMark Thompson2018-05-02
| | | | This makes the trace output for arrays significantly nicer.
* cbs_h2645: Simplify representation of fixed valuesMark Thompson2018-05-01
|
* cbs_h264: Fix overflow in shiftsMark Thompson2018-03-18
| | | | | | | | | The type of the result of a shift operation is unaffected by the type of the right operand, so some existing code overflows with undefined behaviour when the element length is 32. Add a helper macro to calculate the maximum value correctly and then use it everywhere this pattern appears. Found-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
* Merge commit 'eccc03c8fbc603a0a3257df66f0705f74fe2581a'Mark Thompson2018-02-21
|\ | | | | | | | | | | | | | | | | * commit 'eccc03c8fbc603a0a3257df66f0705f74fe2581a': cbs_h264: Add support for filler NAL units Some bitstream -> get_bits. Merged-by: Mark Thompson <sw@jkqxz.net>
| * cbs_h264: Add support for filler NAL unitsMark Thompson2018-02-20
| |
* | Merge commit '7157d959264f3729da463725c6faa580d9394d19'Mark Thompson2018-02-21
|\| | | | | | | | | | | | | * commit '7157d959264f3729da463725c6faa580d9394d19': cbs_h264: Move slice_group_id array out of PPS structure Merged-by: Mark Thompson <sw@jkqxz.net>
| * cbs_h264: Move slice_group_id array out of PPS structureMark Thompson2018-02-20
| | | | | | | | It's very large, and is only used in some FMO streams.
* | Merge commit '13ca5d34ba5c473211daaae0a101123bcaada3e6'Mark Thompson2018-02-21
|\| | | | | | | | | | | | | | | | | | | * commit '13ca5d34ba5c473211daaae0a101123bcaada3e6': cbs_h264: Add hack for pic_timing with no active SPS Partially fixes #6896 - the sample stream from that ticket now works, but more obscure cases can still fail. Merged-by: Mark Thompson <sw@jkqxz.net>
| * cbs_h264: Add hack for pic_timing with no active SPSMark Thompson2018-02-20
| | | | | | | | | | If there is exactly one possible SPS but it is not yet active then just assume that it should be the active one.
| * lavc: Add coded bitstream read/write support for H.264Mark Thompson2017-08-12
|
* cbs_h264: Fix format specifierMark Thompson2017-10-24
|
* lavc: Add coded bitstream read/write support for H.264Mark Thompson2017-10-17
(cherry picked from commit acf06f45441be24c5cbae0920579cd69427326a1) (cherry picked from commit 768eb9182e94a94bc2ef46f565a0dac7afef3b57) (cherry picked from commit e7f64191b27bcf37cbf7006606f0f439c6cdc24f)