summaryrefslogtreecommitdiffstats
path: root/libavcodec/cbs_av1_syntax_template.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2019-03-25 00:11:39 -0300
committerJames Almer <jamrial@gmail.com>2019-04-14 14:51:51 -0300
commit1f260d7285c841f9e13c1d76158949a5d3c73a06 (patch)
tree4688d31cf37b0d51b6ae6abfbe831fa793a95e27 /libavcodec/cbs_av1_syntax_template.c
parent62074b8f85e083212abdf09c849e148e7634f5a2 (diff)
downloadffmpeg-streaming-1f260d7285c841f9e13c1d76158949a5d3c73a06.zip
ffmpeg-streaming-1f260d7285c841f9e13c1d76158949a5d3c73a06.tar.gz
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_syntax_template.c')
-rw-r--r--libavcodec/cbs_av1_syntax_template.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c
index 5600914..0e019aa 100644
--- a/libavcodec/cbs_av1_syntax_template.c
+++ b/libavcodec/cbs_av1_syntax_template.c
@@ -1755,3 +1755,27 @@ static int FUNC(metadata_obu)(CodedBitstreamContext *ctx, RWContext *rw,
return 0;
}
+
+static int FUNC(padding_obu)(CodedBitstreamContext *ctx, RWContext *rw,
+ AV1RawPadding *current)
+{
+ int i, err;
+
+ HEADER("Padding");
+
+#ifdef READ
+ // The payload runs up to the start of the trailing bits, but there might
+ // be arbitrarily many trailing zeroes so we need to read through twice.
+ current->payload_size = cbs_av1_get_payload_bytes_left(rw);
+
+ current->payload_ref = av_buffer_alloc(current->payload_size);
+ if (!current->payload_ref)
+ return AVERROR(ENOMEM);
+ current->payload = current->payload_ref->data;
+#endif
+
+ for (i = 0; i < current->payload_size; i++)
+ xf(8, obu_padding_byte[i], current->payload[i], 0x00, 0xff, 1, i);
+
+ return 0;
+}
OpenPOWER on IntegriCloud