From 107345d0a1162f4a0aa8cb413d15150ead849587 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Mon, 9 Dec 2019 23:26:02 +0100 Subject: [PATCH] avcodec/cbs_h2645: Remove dead code to delete trailing zeroes Trailing zeroes are already discarded when splitting a fragment, which makes the code to remove them when decomposing slices dead code. Signed-off-by: Andreas Rheinhardt Signed-off-by: Michael Niedermayer (cherry picked from commit 8f701932b39a6345f2a8bab85f48d555a98802e3) Signed-off-by: Michael Niedermayer --- libavcodec/cbs_h2645.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c index 54a593464b..58aa65aeb1 100644 --- a/libavcodec/cbs_h2645.c +++ b/libavcodec/cbs_h2645.c @@ -841,13 +841,6 @@ static int cbs_h264_read_nal_unit(CodedBitstreamContext *ctx, pos = get_bits_count(&gbc); len = unit->data_size; - if (!unit->data[len - 1]) { - int z; - for (z = 0; z < len && !unit->data[len - z - 1]; z++); - av_log(ctx->log_ctx, AV_LOG_DEBUG, "Deleted %d trailing zeroes " - "from slice data.\n", z); - len -= z; - } slice->data_size = len - pos / 8; slice->data_ref = av_buffer_ref(unit->data_ref); @@ -1023,13 +1016,6 @@ static int cbs_h265_read_nal_unit(CodedBitstreamContext *ctx, pos = get_bits_count(&gbc); len = unit->data_size; - if (!unit->data[len - 1]) { - int z; - for (z = 0; z < len && !unit->data[len - z - 1]; z++); - av_log(ctx->log_ctx, AV_LOG_DEBUG, "Deleted %d trailing zeroes " - "from slice data.\n", z); - len -= z; - } slice->data_size = len - pos / 8; slice->data_ref = av_buffer_ref(unit->data_ref);