Commit Graph

20 Commits

Author SHA1 Message Date
James Almer
e0b574c483 avcodec/cbs_h266: move decoded_picture_hash to CBS SEI
It's defined in H.274 as a common SEI message type and not in H.266

Signed-off-by: James Almer <jamrial@gmail.com>
2024-06-28 13:16:57 -03:00
Nuo Mi
8b3d1f1fb3 cbs_h266: add VVC_MAX_VBS for max num of virtual boundaries 2024-06-25 19:32:17 +08:00
Nuo Mi
64d5cc67cd avcodec/vvcdec: misc, add specification name for pps members 2024-04-02 20:24:31 +08:00
Frank Plowman
0c517fcbe8 lavc/vvc: Fix emulation prevention byte handling
nal->skipped_bytes_pos contains the positions of errors relative to the
start of the slice header, whereas the position they were tested against
is relative to the start of the slice data, i.e. one byte after the end
of the slice header.

Patch fixes this by storing the size of the slice header in H266RawSlice
and adding it to the position given by the GetBitContext before
comparing to skipped_bytes_pos.  This fixes AVERROR_INVALIDDATAs for
various valid bitstreams, such as the LMCS_B_Dolby_2 conformance
bitstream.

Signed-off-by: Frank Plowman <post@frankplowman.com>
2024-01-27 11:29:40 -03:00
Nuo Mi
09f783692e avcodec/cbs_h266: H266RawSliceHeader, expose curr_subpic_idx
Signed-off-by: James Almer <jamrial@gmail.com>
2023-11-11 11:53:21 -03:00
Andreas Rheinhardt
3e9b8d14e5 avcodec/cbs: Use RefStruct-API for unit content
This avoids allocations and error checks etc. as well
as duplicate pointer lists in the CodedBitstreamFooContexts.
It also avoids casting const away for use as opaque,
as the RefStruct API supports const opaques.

The fact that some of the units are not refcounted
(i.e. they are sometimes part of an encoding context
like VAAPIEncodeH264Context) meant that CodedBitstreamUnit
still contains two pointers, one to the content
and another ownership pointer, replacing the AVBufferRef* pointer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-10-07 22:35:05 +02:00
Nuo Mi
763eb59187 cbs_h266: H266RawSliceHeader, expose NumRefIdxActive[]
Signed-off-by: James Almer <jamrial@gmail.com>
2023-08-17 10:05:24 -03:00
Nuo Mi
088bda0f8e cbs_h266: H266RawPredWeightTable, expose num_weights_l0 and num_weights_l1
Signed-off-by: James Almer <jamrial@gmail.com>
2023-08-17 10:05:24 -03:00
Nuo Mi
ea8571dc99 cbs_h266: H266RawSliceHeader, expose NumEntryPoints
Signed-off-by: James Almer <jamrial@gmail.com>
2023-08-17 10:05:24 -03:00
James Almer
68e9d2835f avcodec/cbs_h266: add support for Adaptation parameter set NALU type
Reviewed-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-06 11:43:13 -03:00
Frank Plowman
4b19690ff4 cbs_h266: add range extension support
example clips:
  * 12b444vvc1_E_Sony_2
  * 12b444Ietsrc_A_Kwai_2
  * 10b444P16_D_Sony_2
  * 12b444Iepp_A_Sharp_2
  * 12b444SPetsrc_B_Kwai_2

Co-authored-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-06 09:05:13 -03:00
James Almer
8995e2f77e avcodec/cbs_h266: add support for Decoding capability information NALU type
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-05 18:18:33 -03:00
James Almer
6cb57bb457 avcodec/cbs_h266: add support for Operating point information NALU type
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-05 18:18:33 -03:00
James Almer
319a6b3ae2 avcodec/cbs_h266: store RowHeightVal and ColWidthVal in the context
Stop overwriting values from the bitstream arrays pps_tile_column_width_minus1
and pps_tile_row_height_minus1.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-05 18:18:33 -03:00
Nuo Mi
8489e317bf cbs_h266: fix sign for pps_xxx_qp_offset_list
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-02 09:36:45 -03:00
James Almer
a77f5019f5 avcodec/cbs_h266: store SubpicIdVal in the context
And use it to derive CurrSubpicIdx

Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-01 19:41:12 -03:00
James Almer
96d6990517 avcodec/cbs_h266: use VVC_MAX_VPS_COUNT for range checks and array size
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-30 08:42:07 -03:00
James Almer
995976750a avcodec/cbs_h2645: fix parsing and storing Picture Header references in the context
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-30 08:26:38 -03:00
Andreas Rheinhardt
e132fae1a5 avcodec/cbs_h266: Remove double ;
Fixes a warning from GCC when in pedantic mode:
"extra semicolon in struct or union specified"
May also fix compilation with MSVC, see
https://fate.ffmpeg.org/report.cgi?time=20230629174305&slot=x86_64-msvc17-windows-native

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-06-29 20:21:24 +02:00
Nuo Mi
dfc62fd1c6 avcodec/cbs: add cbs implementation for H266/VVC
Add CodedBitstreamContext to parse VPS,SPS,PPS in VVC nal units.
Implement parsing and writing of SPS,PPS,VPS,PH,AUD,SEI and slices.
Add ff_cbs_type_h266 to cbs types tables and AV_CODEC_ID_H266
to cbs codec ids.

Co-authored-by: Thomas Siedel <thomas.ff@spin-digital.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00