michael@0: /* michael@0: * Copyright (c) 2010 The WebM project authors. All Rights Reserved. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license michael@0: * that can be found in the LICENSE file in the root of the source michael@0: * tree. An additional intellectual property rights grant can be found michael@0: * in the file PATENTS. All contributing project authors may michael@0: * be found in the AUTHORS file in the root of the source tree. michael@0: */ michael@0: michael@0: michael@0: #include michael@0: #include "blockd.h" michael@0: michael@0: michael@0: void vp8_print_modes_and_motion_vectors(MODE_INFO *mi, int rows, int cols, int frame) michael@0: { michael@0: michael@0: int mb_row; michael@0: int mb_col; michael@0: int mb_index = 0; michael@0: FILE *mvs = fopen("mvs.stt", "a"); michael@0: michael@0: /* print out the macroblock Y modes */ michael@0: mb_index = 0; michael@0: fprintf(mvs, "Mb Modes for Frame %d\n", frame); michael@0: michael@0: for (mb_row = 0; mb_row < rows; mb_row++) michael@0: { michael@0: for (mb_col = 0; mb_col < cols; mb_col++) michael@0: { michael@0: michael@0: fprintf(mvs, "%2d ", mi[mb_index].mbmi.mode); michael@0: michael@0: mb_index++; michael@0: } michael@0: michael@0: fprintf(mvs, "\n"); michael@0: mb_index++; michael@0: } michael@0: michael@0: fprintf(mvs, "\n"); michael@0: michael@0: mb_index = 0; michael@0: fprintf(mvs, "Mb mv ref for Frame %d\n", frame); michael@0: michael@0: for (mb_row = 0; mb_row < rows; mb_row++) michael@0: { michael@0: for (mb_col = 0; mb_col < cols; mb_col++) michael@0: { michael@0: michael@0: fprintf(mvs, "%2d ", mi[mb_index].mbmi.ref_frame); michael@0: michael@0: mb_index++; michael@0: } michael@0: michael@0: fprintf(mvs, "\n"); michael@0: mb_index++; michael@0: } michael@0: michael@0: fprintf(mvs, "\n"); michael@0: michael@0: /* print out the macroblock UV modes */ michael@0: mb_index = 0; michael@0: fprintf(mvs, "UV Modes for Frame %d\n", frame); michael@0: michael@0: for (mb_row = 0; mb_row < rows; mb_row++) michael@0: { michael@0: for (mb_col = 0; mb_col < cols; mb_col++) michael@0: { michael@0: michael@0: fprintf(mvs, "%2d ", mi[mb_index].mbmi.uv_mode); michael@0: michael@0: mb_index++; michael@0: } michael@0: michael@0: mb_index++; michael@0: fprintf(mvs, "\n"); michael@0: } michael@0: michael@0: fprintf(mvs, "\n"); michael@0: michael@0: /* print out the block modes */ michael@0: mb_index = 0; michael@0: fprintf(mvs, "Mbs for Frame %d\n", frame); michael@0: { michael@0: int b_row; michael@0: michael@0: for (b_row = 0; b_row < 4 * rows; b_row++) michael@0: { michael@0: int b_col; michael@0: int bindex; michael@0: michael@0: for (b_col = 0; b_col < 4 * cols; b_col++) michael@0: { michael@0: mb_index = (b_row >> 2) * (cols + 1) + (b_col >> 2); michael@0: bindex = (b_row & 3) * 4 + (b_col & 3); michael@0: michael@0: if (mi[mb_index].mbmi.mode == B_PRED) michael@0: fprintf(mvs, "%2d ", mi[mb_index].bmi[bindex].as_mode); michael@0: else michael@0: fprintf(mvs, "xx "); michael@0: michael@0: } michael@0: michael@0: fprintf(mvs, "\n"); michael@0: } michael@0: } michael@0: fprintf(mvs, "\n"); michael@0: michael@0: /* print out the macroblock mvs */ michael@0: mb_index = 0; michael@0: fprintf(mvs, "MVs for Frame %d\n", frame); michael@0: michael@0: for (mb_row = 0; mb_row < rows; mb_row++) michael@0: { michael@0: for (mb_col = 0; mb_col < cols; mb_col++) michael@0: { michael@0: fprintf(mvs, "%5d:%-5d", mi[mb_index].mbmi.mv.as_mv.row / 2, mi[mb_index].mbmi.mv.as_mv.col / 2); michael@0: michael@0: mb_index++; michael@0: } michael@0: michael@0: mb_index++; michael@0: fprintf(mvs, "\n"); michael@0: } michael@0: michael@0: fprintf(mvs, "\n"); michael@0: michael@0: michael@0: /* print out the block modes */ michael@0: mb_index = 0; michael@0: fprintf(mvs, "MVs for Frame %d\n", frame); michael@0: { michael@0: int b_row; michael@0: michael@0: for (b_row = 0; b_row < 4 * rows; b_row++) michael@0: { michael@0: int b_col; michael@0: int bindex; michael@0: michael@0: for (b_col = 0; b_col < 4 * cols; b_col++) michael@0: { michael@0: mb_index = (b_row >> 2) * (cols + 1) + (b_col >> 2); michael@0: bindex = (b_row & 3) * 4 + (b_col & 3); michael@0: fprintf(mvs, "%3d:%-3d ", mi[mb_index].bmi[bindex].mv.as_mv.row, mi[mb_index].bmi[bindex].mv.as_mv.col); michael@0: michael@0: } michael@0: michael@0: fprintf(mvs, "\n"); michael@0: } michael@0: } michael@0: fprintf(mvs, "\n"); michael@0: michael@0: michael@0: fclose(mvs); michael@0: }