- 28 Aug, 2019 1 commit
-
-
Thierry Foucu authored
Follow the description of av_realloc, the memory needs to be allocated by av_realloc.
-
- 29 Jul, 2019 2 commits
-
-
Andreas Rheinhardt authored
Up until now, if an SEI messages was to be added to a fragment, it was tried to add said SEI message to the first SEI NAL unit of the fragment and if this SEI NAL unit already contained H264_NAL_SEI SEI messages (an arbitrary limit imposed by cbs_h264), adding failed; if there was no SEI NAL unit, a new one has been added. With this commit, the fragment is searched for further NAL units to add the SEI messages to. If all of them are full, a new SEI NAL unit is added. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
Andreas Rheinhardt authored
cbs is currently inconsistent regarding the opaque field that can be used as a special argument to av_buffer_create in order to be used during freeing the buffer: ff_cbs_alloc_unit_content and all the free functions used name this parameter as if it should contain a pointer to the unit whose content is about to be created; but both ff_cbs_alloc_unit_content as well as ff_cbs_h264_add_sei_message actually use a pointer to the CodedBitstreamContext as opaque. It should actually be neither, because it is unneeded (as is evidenced by the fact that none of the free functions use this pointer at all) and because it ties the unit's content to the lifetime of other objects, although a refcounted buffer is supposed to have its own lifetime that only ends when its reference count reaches zero. This problem manifests itself in the pointer becoming dangling. The pointer to the unit can become dangling if another unit is added to the fragment later as happens in the bitstream filters; in this case, the pointer can point to the wrong unit (if the fragment's unit array needn't be relocated) or it can point to where the array was earlier. It can also become dangling if the unit's content is meant to survive the resetting of the fragment it was originally read with. This applies to the extradata of H.264 and HEVC. The pointer to the context can become dangling if the context is closed before the content is freed. Although this doesn't seem to happen right now, it could happen, in particular if one uses different CodedBitstreamContexts for in- and output. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
- 27 Jul, 2019 1 commit
-
-
Andreas Rheinhardt authored
Up until now, a temporary variable was used and initialized every time a value was read in CBS; if reading turned out to be successfull, this value was overwritten (without having ever been looked at) with the value read if reading was successfull; on failure the variable wasn't touched either. Therefore these initializations can be and have been removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
- 20 Jul, 2019 2 commits
-
-
James Almer authored
As defined in sections F.14.2.8 and F.14.3.8 Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
-
Andreas Rheinhardt authored
cbs_h2645_read_more_rbsp_data does not handle malformed input very well: 1. If there were <= 8 bits left in the bitreader, these bits were read via show_bits. But show_bits requires the number of bits to be read to be > 0 (internally it shifts by 32 - number of bits to be read which is undefined behaviour if said number is zero; there is also an assert for this, but it is only an av_assert2). Furthermore, in this case a shift by -1 was performed which is of course undefined behaviour, too. 2. If there were > 0 and <= 8 bits left and all of them were zero (this can only happen for defective input), it was reported that there was further RBSP data. This can lead to an infinite loop in H.265's cbs_h265_read_extension_data corresponding to the [vsp]ps_extension_data_flag syntax elements. If the relevant flag indicates the (potential) occurence of these syntax elements, while all bits after this flag are zero, cbs_h2645_read_more_rbsp_data always returns 1 on x86. Given that a checked bitstream reader is used, we are also not "saved" by an overflow in the bitstream reader's index. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
- 08 Jul, 2019 3 commits
-
-
Andreas Rheinhardt authored
This has been forgotten in 44cde38c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
Andreas Rheinhardt authored
Given the recent changes to ff_cbs_delete_unit, it is no longer sensible to use a return value for ff_cbs_h264_delete_sei_message; instead, use asserts to ensure that the required conditions are met and remove the callers' checks for the return value. Also, document said conditions. An assert that is essentially equivalent to the one used in ff_cbs_delete_unit has been removed, too. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
Andreas Rheinhardt authored
ff_cbs_delete_unit never fails if the index of the unit to delete is valid, as it is with all current callers of the function. So just assert in ff_cbs_delete_unit that the index is valid and change the return value to void in order to remove the callers' checks for whether ff_cbs_delete_unit failed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
- 03 Jun, 2019 1 commit
-
-
James Almer authored
Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
-
- 28 Apr, 2019 1 commit
-
-
James Almer authored
Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
-
- 16 Apr, 2019 1 commit
-
-
James Almer authored
Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
-
- 23 Jan, 2019 2 commits
-
-
Andreas Rheinhardt authored
Now memcpy can be avoided for NAL units containing escapes, too. Particularly improves performance for files with hardcoded black bars. For such a file, time spent in cbs_h2645_split_fragment went down from 369410 decicycles to 327677 decicycles. (It were 379114 decicycles when every NAL unit was copied.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
-
Andreas Rheinhardt authored
This is in preparation for a patch for cbs_h2645. Now the packet's rbsp_buffer can be owned by an AVBuffer. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
-
- 22 Nov, 2018 1 commit
-
-
Andreas Rheinhardt authored
Now memcpy is avoided for NAL units that don't contain 0x03 escape characters. Improves performance of cbs_h2645_fragment_add_nals from 36940 decicycles to 6364 decicycles based on 8 runs with a 5.1 Mb/s H.264 sample (262144 runs each). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com> Signed-off-by: Mark Thompson <sw@jkqxz.net>
-
- 18 Nov, 2018 1 commit
-
-
Mark Thompson authored
Supports both prefix and suffix SEI, decoding all of the common SEI types and some more obscure ones. Most of this is tested by the existing tests in fate.
-
- 12 Nov, 2018 1 commit
-
-
Andreas Rheinhardt authored
Instead of using a combination of bitreader and -writer for copying data, one can byte-align the (obsolete and removed) bitreader to improve performance. With the right alignment one can even use memcpy. The right alignment normally exists for CABAC and hence for H.265 in general. For aligned data this reduced the time to copy the slicedata from 776520 decicycles to 33889 with 262144 runs and a 6.5mb/s H.264 video. For unaligned data the number went down from 279196 to 97739 decicycles. Signed-off-by: Mark Thompson <sw@jkqxz.net>
-
- 22 Oct, 2018 2 commits
-
-
Mark Thompson authored
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.
-
Mark Thompson authored
64c50c0e 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.
-
- 15 Oct, 2018 1 commit
-
-
Aman Gupta authored
[ffmpeg] AVBSFContext: Decomposition unimplemented for unit 4 (type 10). Signed-off-by: Aman Gupta <aman@tmm1.net>
-
- 10 May, 2018 4 commits
-
-
Mark Thompson authored
-
Mark Thompson authored
-
Haihao Xiang authored
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
-
Haihao Xiang authored
Similar to H264, cbs_h265_{read, write}_nal_unit() can handle HEVC prefix SEI NAL units. Currently mastering display colour volume SEI message is added only, we may add more SEI message if needed later Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
-
- 09 May, 2018 1 commit
-
-
James Almer authored
Removes unnecessary data copies, and partially fixes potential issues with dangling references held in said lists. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
-
- 02 May, 2018 1 commit
-
-
Mark Thompson authored
This makes the trace output for arrays significantly nicer.
-
- 01 May, 2018 1 commit
-
-
Mark Thompson authored
-
- 30 Apr, 2018 1 commit
-
-
James Almer authored
Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
-
- 05 Mar, 2018 1 commit
-
-
James Almer authored
This saves one malloc + memcpy per packet The CodedBitstreamFragment buffer is padded to follow the requirements of AVPacket. Reviewed-by: jkqxz Signed-off-by: James Almer <jamrial@gmail.com>
-
- 20 Feb, 2018 6 commits
-
-
Mark Thompson authored
-
Mark Thompson authored
It's very large, and is only used in some FMO streams.
-
Mark Thompson authored
-
Mark Thompson authored
This makes it easier for users of the CBS API to get alloc/free right - all subelements use the buffer API so that it's clear how to free them. It also allows eliding some redundant copies: the packet -> fragment copy disappears after this change if the input packet is refcounted, and more codec-specific cases are now possible (but not included in this patch).
-
Mark Thompson authored
-
Mark Thompson authored
Also fix conversion specifiers used for the unit type.
-
- 17 Dec, 2017 1 commit
-
-
Carl Eugen Hoyos authored
-
- 02 Dec, 2017 1 commit
-
-
Mark Thompson authored
These may be read by the bitstream reader, so they should include the necessary padding for overreads.
-
- 12 Nov, 2017 1 commit
-
-
Mark Thompson authored
-
- 18 Oct, 2017 2 commits
-
-
Mark Thompson authored
Fixes CID 1419834.
-
Mark Thompson authored
Tested with the alphaconformanceG sample. Fixes CID 1419836. (cherry picked from commit 9ed18f30)
-