Cleanup dead code

Remove code that is dead since 65c00ae13329ee9910b6bb715be54e989602f1f8.

Change-Id: Id74b96fbfbd70ebb293650601a36b9ea3b495055
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index fa5742d..100a9e0 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -5410,264 +5410,6 @@
   }
 }
 
-// This function is now obsolete
-void av1_decode_frame(AV1Decoder *pbi, const uint8_t *data,
-                      const uint8_t *data_end, const uint8_t **p_data_end) {
-  AV1_COMMON *const cm = &pbi->common;
-  MACROBLOCKD *const xd = &pbi->mb;
-  struct aom_read_bit_buffer rb;
-  int context_updated = 0;
-  uint8_t clear_data[MAX_AV1_HEADER_SIZE];
-  size_t first_partition_size;
-  YV12_BUFFER_CONFIG *new_fb;
-
-#if CONFIG_ADAPT_SCAN
-  av1_deliver_eob_threshold(cm, xd);
-#endif
-#if CONFIG_BITSTREAM_DEBUG
-  bitstream_queue_set_frame_read(cm->current_video_frame * 2 + cm->show_frame);
-#endif
-
-#if CONFIG_GLOBAL_MOTION
-  int i;
-  for (i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
-    set_default_warp_params(&cm->global_motion[i]);
-    set_default_warp_params(&cm->cur_frame->global_motion[i]);
-  }
-  xd->global_motion = cm->global_motion;
-#endif  // CONFIG_GLOBAL_MOTION
-
-  first_partition_size = read_uncompressed_header(
-      pbi, init_read_bit_buffer(pbi, &rb, data, data_end, clear_data));
-
-#if CONFIG_EXT_TILE
-  // If cm->single_tile_decoding = 0, the independent decoding of a single tile
-  // or a section of a frame is not allowed.
-  if (!cm->single_tile_decoding &&
-      (pbi->dec_tile_row >= 0 || pbi->dec_tile_col >= 0)) {
-    pbi->dec_tile_row = -1;
-    pbi->dec_tile_col = -1;
-  }
-#endif  // CONFIG_EXT_TILE
-
-  pbi->first_partition_size = first_partition_size;
-  pbi->uncomp_hdr_size = aom_rb_bytes_read(&rb);
-  new_fb = get_frame_new_buffer(cm);
-  xd->cur_buf = new_fb;
-#if CONFIG_INTRABC
-#if CONFIG_HIGHBITDEPTH
-  av1_setup_scale_factors_for_frame(
-      &xd->sf_identity, xd->cur_buf->y_crop_width, xd->cur_buf->y_crop_height,
-      xd->cur_buf->y_crop_width, xd->cur_buf->y_crop_height,
-      cm->use_highbitdepth);
-#else
-  av1_setup_scale_factors_for_frame(
-      &xd->sf_identity, xd->cur_buf->y_crop_width, xd->cur_buf->y_crop_height,
-      xd->cur_buf->y_crop_width, xd->cur_buf->y_crop_height);
-#endif  // CONFIG_HIGHBITDEPTH
-#endif  // CONFIG_INTRABC
-
-  if (cm->show_existing_frame) {
-    // showing a frame directly
-    *p_data_end = data + aom_rb_bytes_read(&rb);
-    return;
-  }
-
-  data += aom_rb_bytes_read(&rb);
-  if (first_partition_size)
-    if (!read_is_valid(data, first_partition_size, data_end))
-      aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
-                         "Truncated packet or corrupt header length");
-
-  cm->setup_mi(cm);
-
-#if CONFIG_MFMV
-  av1_setup_frame_buf_refs(cm);
-  av1_setup_motion_field(cm);
-#endif
-
-  av1_setup_block_planes(xd, cm->subsampling_x, cm->subsampling_y);
-#if CONFIG_NO_FRAME_CONTEXT_SIGNALING
-  if (cm->error_resilient_mode || frame_is_intra_only(cm)) {
-    // use the default frame context values
-    *cm->fc = cm->frame_contexts[FRAME_CONTEXT_DEFAULTS];
-    cm->pre_fc = &cm->frame_contexts[FRAME_CONTEXT_DEFAULTS];
-  } else {
-    *cm->fc = cm->frame_contexts[cm->frame_refs[0].idx];
-    cm->pre_fc = &cm->frame_contexts[cm->frame_refs[0].idx];
-  }
-#else
-  *cm->fc = cm->frame_contexts[cm->frame_context_idx];
-  cm->pre_fc = &cm->frame_contexts[cm->frame_context_idx];
-#endif  // CONFIG_NO_FRAME_CONTEXT_SIGNALING
-  if (!cm->fc->initialized)
-    aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
-                       "Uninitialized entropy context.");
-
-  av1_zero(cm->counts);
-
-  xd->corrupted = 0;
-  if (first_partition_size) {
-    new_fb->corrupted = read_compressed_header(pbi, data, first_partition_size);
-    if (new_fb->corrupted)
-      aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
-                         "Decode failed. Frame data header is corrupted.");
-  }
-
-#if CONFIG_LOOP_RESTORATION
-  if (cm->rst_info[0].frame_restoration_type != RESTORE_NONE ||
-      cm->rst_info[1].frame_restoration_type != RESTORE_NONE ||
-      cm->rst_info[2].frame_restoration_type != RESTORE_NONE) {
-    av1_alloc_restoration_buffers(cm);
-  }
-#endif
-
-#if !CONFIG_LOOPFILTER_LEVEL
-  if (cm->lf.filter_level && !cm->skip_loop_filter) {
-    av1_loop_filter_frame_init(cm, cm->lf.filter_level, cm->lf.filter_level);
-  }
-#endif
-
-  // If encoded in frame parallel mode, frame context is ready after decoding
-  // the frame header.
-  if (cm->frame_parallel_decode &&
-      cm->refresh_frame_context != REFRESH_FRAME_CONTEXT_BACKWARD) {
-    AVxWorker *const worker = pbi->frame_worker_owner;
-    FrameWorkerData *const frame_worker_data = worker->data1;
-    if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_FORWARD) {
-      context_updated = 1;
-#if CONFIG_NO_FRAME_CONTEXT_SIGNALING
-      cm->frame_contexts[cm->new_fb_idx] = *cm->fc;
-#else
-      cm->frame_contexts[cm->frame_context_idx] = *cm->fc;
-#endif  // CONFIG_NO_FRAME_CONTEXT_SIGNALING
-    }
-    av1_frameworker_lock_stats(worker);
-    pbi->cur_buf->row = -1;
-    pbi->cur_buf->col = -1;
-    frame_worker_data->frame_context_ready = 1;
-    // Signal the main thread that context is ready.
-    av1_frameworker_signal_stats(worker);
-    av1_frameworker_unlock_stats(worker);
-  }
-
-  dec_setup_frame_boundary_info(cm);
-
-  if (pbi->max_threads > 1 && !CONFIG_CB4X4 &&
-#if CONFIG_EXT_TILE
-      pbi->dec_tile_col < 0 &&  // Decoding all columns
-#endif                          // CONFIG_EXT_TILE
-      cm->tile_cols > 1) {
-    // Multi-threaded tile decoder
-    *p_data_end = decode_tiles_mt(pbi, data + first_partition_size, data_end);
-    if (!xd->corrupted) {
-      if (!cm->skip_loop_filter) {
-// If multiple threads are used to decode tiles, then we use those
-// threads to do parallel loopfiltering.
-#if CONFIG_LOOPFILTER_LEVEL
-        av1_loop_filter_frame_mt(new_fb, cm, pbi->mb.plane,
-                                 cm->lf.filter_level[0], cm->lf.filter_level[1],
-                                 0, 0, pbi->tile_workers, pbi->num_tile_workers,
-                                 &pbi->lf_row_sync);
-#else
-        av1_loop_filter_frame_mt(new_fb, cm, pbi->mb.plane, cm->lf.filter_level,
-                                 0, 0, pbi->tile_workers, pbi->num_tile_workers,
-                                 &pbi->lf_row_sync);
-#endif  // CONFIG_LOOPFILTER_LEVEL
-      }
-    } else {
-      aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
-                         "Decode failed. Frame data is corrupted.");
-    }
-  } else {
-    *p_data_end = decode_tiles(pbi, data + first_partition_size, data_end, 0,
-                               cm->tile_rows * cm->tile_cols - 1);
-  }
-
-#if CONFIG_STRIPED_LOOP_RESTORATION
-  if (cm->rst_info[0].frame_restoration_type != RESTORE_NONE ||
-      cm->rst_info[1].frame_restoration_type != RESTORE_NONE ||
-      cm->rst_info[2].frame_restoration_type != RESTORE_NONE) {
-    av1_loop_restoration_save_boundary_lines(&pbi->cur_buf->buf, cm);
-  }
-#endif
-
-#if CONFIG_CDEF
-  if (!cm->skip_loop_filter && !cm->all_lossless) {
-    av1_cdef_frame(&pbi->cur_buf->buf, cm, &pbi->mb);
-  }
-#endif  // CONFIG_CDEF
-
-#if CONFIG_FRAME_SUPERRES
-  superres_post_decode(pbi);
-#endif  // CONFIG_FRAME_SUPERRES
-
-#if CONFIG_LOOP_RESTORATION
-  if (cm->rst_info[0].frame_restoration_type != RESTORE_NONE ||
-      cm->rst_info[1].frame_restoration_type != RESTORE_NONE ||
-      cm->rst_info[2].frame_restoration_type != RESTORE_NONE) {
-    aom_extend_frame_borders(new_fb);
-    av1_loop_restoration_frame(new_fb, cm, cm->rst_info, 7, 0, NULL);
-  }
-#endif  // CONFIG_LOOP_RESTORATION
-
-  if (!xd->corrupted) {
-    if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_BACKWARD) {
-      FRAME_CONTEXT **tile_ctxs = aom_malloc(cm->tile_rows * cm->tile_cols *
-                                             sizeof(&pbi->tile_data[0].tctx));
-      aom_cdf_prob **cdf_ptrs =
-          aom_malloc(cm->tile_rows * cm->tile_cols *
-                     sizeof(&pbi->tile_data[0].tctx.partition_cdf[0][0]));
-      make_update_tile_list_dec(pbi, cm->tile_rows, cm->tile_cols, tile_ctxs);
-#if CONFIG_LV_MAP
-      av1_adapt_coef_probs(cm);
-#endif  // CONFIG_LV_MAP
-      av1_adapt_intra_frame_probs(cm);
-      av1_average_tile_coef_cdfs(pbi->common.fc, tile_ctxs, cdf_ptrs,
-                                 cm->tile_rows * cm->tile_cols);
-      av1_average_tile_intra_cdfs(pbi->common.fc, tile_ctxs, cdf_ptrs,
-                                  cm->tile_rows * cm->tile_cols);
-#if CONFIG_PVQ
-      av1_average_tile_pvq_cdfs(pbi->common.fc, tile_ctxs,
-                                cm->tile_rows * cm->tile_cols);
-#endif  // CONFIG_PVQ
-#if CONFIG_ADAPT_SCAN
-      av1_adapt_scan_order(cm);
-#endif  // CONFIG_ADAPT_SCAN
-
-      if (!frame_is_intra_only(cm)) {
-        av1_adapt_inter_frame_probs(cm);
-        av1_adapt_mv_probs(cm, cm->allow_high_precision_mv);
-        av1_average_tile_inter_cdfs(&pbi->common, pbi->common.fc, tile_ctxs,
-                                    cdf_ptrs, cm->tile_rows * cm->tile_cols);
-        av1_average_tile_mv_cdfs(pbi->common.fc, tile_ctxs, cdf_ptrs,
-                                 cm->tile_rows * cm->tile_cols);
-      }
-      aom_free(tile_ctxs);
-      aom_free(cdf_ptrs);
-    } else {
-      debug_check_frame_counts(cm);
-    }
-  } else {
-    aom_internal_error(&cm->error, AOM_CODEC_CORRUPT_FRAME,
-                       "Decode failed. Frame data is corrupted.");
-  }
-
-#if CONFIG_INSPECTION
-  if (pbi->inspect_cb != NULL) {
-    (*pbi->inspect_cb)(pbi, pbi->inspect_ctx);
-  }
-#endif
-
-// Non frame parallel update frame context here.
-#if CONFIG_NO_FRAME_CONTEXT_SIGNALING
-  if (!context_updated) cm->frame_contexts[cm->new_fb_idx] = *cm->fc;
-#else
-  if (!cm->error_resilient_mode && !context_updated)
-    cm->frame_contexts[cm->frame_context_idx] = *cm->fc;
-#endif
-}
-
 size_t av1_decode_frame_headers_and_setup(AV1Decoder *pbi, const uint8_t *data,
                                           const uint8_t *data_end,
                                           const uint8_t **p_data_end) {
diff --git a/av1/decoder/decoder.c b/av1/decoder/decoder.c
index b4a83c9b..f87d0aa 100644
--- a/av1/decoder/decoder.c
+++ b/av1/decoder/decoder.c
@@ -376,17 +376,11 @@
   cm->error.setjmp = 1;
 
 #if !CONFIG_OBU
-#if 0
-  // This function is now obsolete
-  av1_decode_frame(pbi, source, source + size, psource);
-#endif
-#if 1
   av1_decode_frame_headers_and_setup(pbi, source, source + size, psource);
   if (!cm->show_existing_frame) {
     av1_decode_tg_tiles_and_wrapup(pbi, source, source + size, psource, 0,
                                    cm->tile_rows * cm->tile_cols - 1, 1);
   }
-#endif
 #else
   av1_decode_frame_from_obus(pbi, source, source + size, psource);
 #endif