Dead code removal: superframe index parsing.
Change-Id: Ibb48216d8cca6ae560732cab95539592d78872cf
diff --git a/av1/av1_dx_iface.c b/av1/av1_dx_iface.c
index 8861409..e5013a0 100644
--- a/av1/av1_dx_iface.c
+++ b/av1/av1_dx_iface.c
@@ -182,20 +182,6 @@
si->is_kf = 0;
si->w = si->h = 0;
- // skip a potential superframe index
- {
- uint32_t frame_sizes[8];
- int frame_count;
- int index_size = 0;
- aom_codec_err_t res = av1_parse_superframe_index(data, data_sz, frame_sizes,
- &frame_count, &index_size);
- if (res != AOM_CODEC_OK) return res;
-
- data += index_size;
- data_sz -= index_size;
- if (data + data_sz <= data) return AOM_CODEC_INVALID_PARAM;
- }
-
{
si->is_kf = 1;
intra_only_flag = 1;
diff --git a/av1/decoder/decoder.c b/av1/decoder/decoder.c
index 5ba33fa..190b1fb 100644
--- a/av1/decoder/decoder.c
+++ b/av1/decoder/decoder.c
@@ -471,58 +471,3 @@
*frame = *cm->frame_to_show;
return 0;
}
-
-aom_codec_err_t av1_parse_superframe_index(const uint8_t *data, size_t data_sz,
- uint32_t sizes[8], int *count,
- int *index_size) {
- // A chunk ending with a byte matching 0xc0 is an invalid chunk unless
- // it is a super frame index. If the last byte of real video compression
- // data is 0xc0 the encoder must add a 0 byte. If we have the marker but
- // not the associated matching marker byte at the front of the index we have
- // an invalid bitstream and need to return an error.
-
- uint8_t marker;
- size_t frame_sz_sum = 0;
-
- assert(data_sz);
- marker = data[0];
- *count = 0;
-
- if ((marker & 0xe0) == 0xc0) {
- const uint32_t frames = (marker & 0x7) + 1;
- const uint32_t mag = ((marker >> 3) & 0x3) + 1;
- const size_t index_sz = 2 + mag * (frames - 1);
- *index_size = (int)index_sz;
-
- // This chunk is marked as having a superframe index but doesn't have
- // enough data for it, thus it's an invalid superframe index.
- if (data_sz < index_sz) return AOM_CODEC_CORRUPT_FRAME;
-
- {
- const uint8_t marker2 = data[index_sz - 1];
-
- // This chunk is marked as having a superframe index but doesn't have
- // the matching marker byte at the front of the index therefore it's an
- // invalid chunk.
- if (marker != marker2) return AOM_CODEC_CORRUPT_FRAME;
- }
-
- {
- // Found a valid superframe index.
- uint32_t i, j;
- const uint8_t *x = &data[1];
-
- for (i = 0; i < frames - 1; ++i) {
- uint32_t this_sz = 0;
-
- for (j = 0; j < mag; ++j) this_sz |= ((uint32_t)(*x++)) << (j * 8);
- this_sz += 1;
- sizes[i] = this_sz;
- frame_sz_sum += this_sz;
- }
- sizes[i] = (uint32_t)(data_sz - index_sz - frame_sz_sum);
- *count = frames;
- }
- }
- return AOM_CODEC_OK;
-}
diff --git a/av1/decoder/decoder.h b/av1/decoder/decoder.h
index 7b56a04..9b4a6ca 100644
--- a/av1/decoder/decoder.h
+++ b/av1/decoder/decoder.h
@@ -115,11 +115,6 @@
aom_codec_err_t av1_set_reference_dec(AV1_COMMON *cm, int idx,
YV12_BUFFER_CONFIG *sd);
-// This function is exposed for use in tests
-aom_codec_err_t av1_parse_superframe_index(const uint8_t *data, size_t data_sz,
- uint32_t sizes[8], int *count,
- int *index_size);
-
struct AV1Decoder *av1_decoder_create(BufferPool *const pool);
void av1_decoder_remove(struct AV1Decoder *pbi);