diff options
author | James Almer <jamrial@gmail.com> | 2019-03-25 06:11:39 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-04-14 20:51:51 +0300 |
commit | 1f260d7285c841f9e13c1d76158949a5d3c73a06 (patch) | |
tree | 4688d31cf37b0d51b6ae6abfbe831fa793a95e27 /libavcodec/cbs_av1.c | |
parent | 62074b8f85e083212abdf09c849e148e7634f5a2 (diff) |
avcodec/cbs_av1: add support for Padding OBUs
Based on itut_t35 Matadata OBU parsing code.
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/cbs_av1.c')
-rw-r--r-- | libavcodec/cbs_av1.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c index f8f7e5f050..41dd4c97ac 100644 --- a/libavcodec/cbs_av1.c +++ b/libavcodec/cbs_av1.c @@ -868,6 +868,11 @@ static void cbs_av1_free_tile_data(AV1RawTileData *td) av_buffer_unref(&td->data_ref); } +static void cbs_av1_free_padding(AV1RawPadding *pd) +{ + av_buffer_unref(&pd->payload_ref); +} + static void cbs_av1_free_metadata(AV1RawMetadata *md) { switch (md->metadata_type) { @@ -894,6 +899,9 @@ static void cbs_av1_free_obu(void *unit, uint8_t *content) case AV1_OBU_METADATA: cbs_av1_free_metadata(&obu->obu.metadata); break; + case AV1_OBU_PADDING: + cbs_av1_free_padding(&obu->obu.padding); + break; } av_freep(&obu); @@ -1068,6 +1076,12 @@ static int cbs_av1_read_unit(CodedBitstreamContext *ctx, } break; case AV1_OBU_PADDING: + { + err = cbs_av1_read_padding_obu(ctx, &gbc, &obu->obu.padding); + if (err < 0) + return err; + } + break; default: return AVERROR(ENOSYS); } @@ -1193,6 +1207,12 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx, } break; case AV1_OBU_PADDING: + { + err = cbs_av1_write_padding_obu(ctx, pbc, &obu->obu.padding); + if (err < 0) + return err; + } + break; default: return AVERROR(ENOSYS); } |