Remove unneeded type casts.

This is a follow-up to https://aomedia-review.googlesource.com/c/aom/+/58684.

Also remove the unused static function get_obu_length_field_size() in
av1/av1_dx_iface.c.

Change-Id: I9e01d59c5d449a1748e035d28d1b206fa5f41942
diff --git a/av1/av1_dx_iface.c b/av1/av1_dx_iface.c
index 5829b08..e361eb5 100644
--- a/av1/av1_dx_iface.c
+++ b/av1/av1_dx_iface.c
@@ -155,15 +155,6 @@
   return AOM_CODEC_OK;
 }
 
-static size_t get_obu_length_field_size(const uint8_t *data, size_t data_sz) {
-  const size_t max_bytes = AOMMIN(sizeof(uint64_t), data_sz);
-  size_t length_field_size = 1;
-  for (size_t i = 0; i < max_bytes && (data[i] & 0x80); ++i) {
-    ++length_field_size;
-  }
-  return length_field_size;
-}
-
 static void parse_operating_points(struct aom_read_bit_buffer *rb,
                                    int is_reduced_header,
                                    aom_codec_stream_info_t *si) {
@@ -239,7 +230,7 @@
     // Skip any associated payload (there shouldn't be one, but just in case)
     if (data_sz < bytes_read + payload_size) return AOM_CODEC_CORRUPT_FRAME;
     data += bytes_read + payload_size;
-    data_sz -= (uint32_t)(bytes_read + payload_size);
+    data_sz -= bytes_read + payload_size;
 
     status = aom_read_obu_header_and_size(
         data, data_sz, si->is_annexb, &obu_header, &payload_size, &bytes_read);
@@ -251,7 +242,7 @@
 
   // Read a few values from the sequence header payload
   data += bytes_read;
-  data_sz -= (uint32_t)bytes_read;
+  data_sz -= bytes_read;
   struct aom_read_bit_buffer rb = { data, data + data_sz, 0, NULL, NULL };
 
   av1_read_profile(&rb);  // profile
@@ -559,8 +550,6 @@
       frame_size = (uint64_t)(data_end - data_start);
     }
 
-    if (frame_size > UINT32_MAX) return AOM_CODEC_CORRUPT_FRAME;
-
     res = decode_one(ctx, &data_start, (size_t)frame_size, user_priv);
     if (res != AOM_CODEC_OK) return res;