Commit Graph

24 Commits

Author SHA1 Message Date
James Almer
41d1dba4d2 cbs_h264: add support for Film Grain Characteristics SEI messages
Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-23 11:05:04 -03:00
Andreas Rheinhardt
ec54c32d4a avcodec/cbs_h26[45]: Remove redundant enum constants
Unused since 8843607f49.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-12 23:25:23 +01:00
Mark Thompson
8843607f49 cbs_h2645: Merge SEI message handling in common between codecs 2021-01-21 17:13:54 +00:00
Mark Thompson
4bf3384800 cbs_h2645: Merge SEI messages in common between codecs
Make a new template file for common SEI messages - this will also apply
to H.266.
2021-01-21 17:13:54 +00:00
Mark Thompson
1fe77d4a63 cbs: Ensure that reference fields always follow the associated pointer
Having these together allows us to find both pointers given the address
of only one of them.
2020-09-02 00:00:50 +01:00
Andreas Rheinhardt
1bdbc50bf4 avcodec/cbs: Remove unused function parameters
Several cbs-functions had an unused CodedBitstreamContext parameter.
This commit removes these.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-07 04:46:51 +02:00
Andreas Rheinhardt
f83ac5fd79 avcodec/cbs_h264: Automatically free SEI payload on error
If adding an SEI message to an access unit fails, said SEI message was
not touched, so that the caller had to free any data associated with it
that might need to be freed. But given that ff_cbs_h264_add_sei_message
can simply call cbs_h264_free_sei_payload, one can easily free
the content of the SEI payload.

This fixes a memleak when inserting a user data unregistered string for
h264_metadata fails.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-09-24 15:54:31 +01:00
Andreas Rheinhardt
d9418aba66 cbs_h264, h264_metadata: Deleting SEI messages never fails
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>
2019-07-08 22:59:41 +01:00
James Almer
ff2a638c83 avcodec/cbs_h264: add support for Alternative Transfer Characteristics SEI message
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-06-03 19:21:38 -03:00
James Almer
45048ece81 avcodec/cbs_h2645: use the fixed() macro for forbidden_zero_bit
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>
2019-04-28 20:29:40 -03:00
James Almer
9bf520d04d avcodec/cbs_h264: fix storage type for time_offset in Pic Timing SEI
The spec defines it as a signed value.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-04-16 20:32:43 -03:00
Mark Thompson
ac687add84 cbs_h264: Add support for mastering display SEI messages 2018-05-10 23:54:01 +01:00
Mark Thompson
d94dda742c cbs_h264: Add support for pan-scan rectangle SEI messages 2018-05-10 23:54:01 +01:00
James Almer
c6a63e1109 avcodec/cbs_h2645: use AVBufferRef to store list of active parameter sets
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>
2018-05-09 11:14:14 -03:00
Mark Thompson
fbeac5356c Merge commit 'eccc03c8fbc603a0a3257df66f0705f74fe2581a'
* commit 'eccc03c8fbc603a0a3257df66f0705f74fe2581a':
  cbs_h264: Add support for filler NAL units

Some bitstream -> get_bits.

Merged-by: Mark Thompson <sw@jkqxz.net>
2018-02-21 22:51:46 +00:00
Mark Thompson
ab6edb173b Merge commit '7157d959264f3729da463725c6faa580d9394d19'
* commit '7157d959264f3729da463725c6faa580d9394d19':
  cbs_h264: Move slice_group_id array out of PPS structure

Merged-by: Mark Thompson <sw@jkqxz.net>
2018-02-21 22:41:00 +00:00
Mark Thompson
77eba7bd99 Merge commit 'a2ca8ed903b435446031a8a0792ca535e6ee2913'
* commit 'a2ca8ed903b435446031a8a0792ca535e6ee2913':
  cbs_h264: Add utility functions to insert/delete SEI messages

Merged-by: Mark Thompson <sw@jkqxz.net>
2018-02-21 22:27:07 +00:00
Mark Thompson
0cc8e34a94 Merge commit 'ce5870a3a8f2b10668ee4f04c2ae0287f66f31b2'
* commit 'ce5870a3a8f2b10668ee4f04c2ae0287f66f31b2':
  cbs: Refcount all the things!

Some changes for bitstream API.

Merged-by: Mark Thompson <sw@jkqxz.net>
2018-02-21 22:22:54 +00:00
Mark Thompson
eccc03c8fb cbs_h264: Add support for filler NAL units 2018-02-20 22:04:12 +00:00
Mark Thompson
7157d95926 cbs_h264: Move slice_group_id array out of PPS structure
It's very large, and is only used in some FMO streams.
2018-02-20 22:04:12 +00:00
Mark Thompson
a2ca8ed903 cbs_h264: Add utility functions to insert/delete SEI messages 2018-02-20 22:04:12 +00:00
Mark Thompson
ce5870a3a8 cbs: Refcount all the things!
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).
2018-02-20 22:04:12 +00:00
Mark Thompson
b4c915f4b3 lavc: Add coded bitstream read/write support for H.264
(cherry picked from commit acf06f4544)
(cherry picked from commit 768eb9182e)
(cherry picked from commit e7f64191b2)
2017-10-17 20:56:29 +01:00
Mark Thompson
acf06f4544 lavc: Add coded bitstream read/write support for H.264 2017-08-12 22:17:20 +01:00