LCOV - code coverage report
Current view: directory - media/libvpx/vp8/common - debugmodes.c (source / functions) Found Hit Coverage
Test: app.info Lines: 61 0 0.0 %
Date: 2012-06-02 Functions: 1 0 0.0 %

       1                 : /*
       2                 :  *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
       3                 :  *
       4                 :  *  Use of this source code is governed by a BSD-style license
       5                 :  *  that can be found in the LICENSE file in the root of the source
       6                 :  *  tree. An additional intellectual property rights grant can be found
       7                 :  *  in the file PATENTS.  All contributing project authors may
       8                 :  *  be found in the AUTHORS file in the root of the source tree.
       9                 :  */
      10                 : 
      11                 : 
      12                 : #include <stdio.h>
      13                 : #include "blockd.h"
      14                 : 
      15                 : 
      16               0 : void vp8_print_modes_and_motion_vectors(MODE_INFO *mi, int rows, int cols, int frame)
      17                 : {
      18                 : 
      19                 :     int mb_row;
      20                 :     int mb_col;
      21               0 :     int mb_index = 0;
      22               0 :     FILE *mvs = fopen("mvs.stt", "a");
      23                 : 
      24                 :     /* print out the macroblock Y modes */
      25               0 :     mb_index = 0;
      26               0 :     fprintf(mvs, "Mb Modes for Frame %d\n", frame);
      27                 : 
      28               0 :     for (mb_row = 0; mb_row < rows; mb_row++)
      29                 :     {
      30               0 :         for (mb_col = 0; mb_col < cols; mb_col++)
      31                 :         {
      32                 : 
      33               0 :             fprintf(mvs, "%2d ", mi[mb_index].mbmi.mode);
      34                 : 
      35               0 :             mb_index++;
      36                 :         }
      37                 : 
      38               0 :         fprintf(mvs, "\n");
      39               0 :         mb_index++;
      40                 :     }
      41                 : 
      42               0 :     fprintf(mvs, "\n");
      43                 : 
      44               0 :     mb_index = 0;
      45               0 :     fprintf(mvs, "Mb mv ref for Frame %d\n", frame);
      46                 : 
      47               0 :     for (mb_row = 0; mb_row < rows; mb_row++)
      48                 :     {
      49               0 :         for (mb_col = 0; mb_col < cols; mb_col++)
      50                 :         {
      51                 : 
      52               0 :             fprintf(mvs, "%2d ", mi[mb_index].mbmi.ref_frame);
      53                 : 
      54               0 :             mb_index++;
      55                 :         }
      56                 : 
      57               0 :         fprintf(mvs, "\n");
      58               0 :         mb_index++;
      59                 :     }
      60                 : 
      61               0 :     fprintf(mvs, "\n");
      62                 : 
      63                 :     /* print out the macroblock UV modes */
      64               0 :     mb_index = 0;
      65               0 :     fprintf(mvs, "UV Modes for Frame %d\n", frame);
      66                 : 
      67               0 :     for (mb_row = 0; mb_row < rows; mb_row++)
      68                 :     {
      69               0 :         for (mb_col = 0; mb_col < cols; mb_col++)
      70                 :         {
      71                 : 
      72               0 :             fprintf(mvs, "%2d ", mi[mb_index].mbmi.uv_mode);
      73                 : 
      74               0 :             mb_index++;
      75                 :         }
      76                 : 
      77               0 :         mb_index++;
      78               0 :         fprintf(mvs, "\n");
      79                 :     }
      80                 : 
      81               0 :     fprintf(mvs, "\n");
      82                 : 
      83                 :     /* print out the block modes */
      84               0 :     mb_index = 0;
      85               0 :     fprintf(mvs, "Mbs for Frame %d\n", frame);
      86                 :     {
      87                 :         int b_row;
      88                 : 
      89               0 :         for (b_row = 0; b_row < 4 * rows; b_row++)
      90                 :         {
      91                 :             int b_col;
      92                 :             int bindex;
      93                 : 
      94               0 :             for (b_col = 0; b_col < 4 * cols; b_col++)
      95                 :             {
      96               0 :                 mb_index = (b_row >> 2) * (cols + 1) + (b_col >> 2);
      97               0 :                 bindex = (b_row & 3) * 4 + (b_col & 3);
      98                 : 
      99               0 :                 if (mi[mb_index].mbmi.mode == B_PRED)
     100               0 :                     fprintf(mvs, "%2d ", mi[mb_index].bmi[bindex].as_mode);
     101                 :                 else
     102               0 :                     fprintf(mvs, "xx ");
     103                 : 
     104                 :             }
     105                 : 
     106               0 :             fprintf(mvs, "\n");
     107                 :         }
     108                 :     }
     109               0 :     fprintf(mvs, "\n");
     110                 : 
     111                 :     /* print out the macroblock mvs */
     112               0 :     mb_index = 0;
     113               0 :     fprintf(mvs, "MVs for Frame %d\n", frame);
     114                 : 
     115               0 :     for (mb_row = 0; mb_row < rows; mb_row++)
     116                 :     {
     117               0 :         for (mb_col = 0; mb_col < cols; mb_col++)
     118                 :         {
     119               0 :             fprintf(mvs, "%5d:%-5d", mi[mb_index].mbmi.mv.as_mv.row / 2, mi[mb_index].mbmi.mv.as_mv.col / 2);
     120                 : 
     121               0 :             mb_index++;
     122                 :         }
     123                 : 
     124               0 :         mb_index++;
     125               0 :         fprintf(mvs, "\n");
     126                 :     }
     127                 : 
     128               0 :     fprintf(mvs, "\n");
     129                 : 
     130                 : 
     131                 :     /* print out the block modes */
     132               0 :     mb_index = 0;
     133               0 :     fprintf(mvs, "MVs for Frame %d\n", frame);
     134                 :     {
     135                 :         int b_row;
     136                 : 
     137               0 :         for (b_row = 0; b_row < 4 * rows; b_row++)
     138                 :         {
     139                 :             int b_col;
     140                 :             int bindex;
     141                 : 
     142               0 :             for (b_col = 0; b_col < 4 * cols; b_col++)
     143                 :             {
     144               0 :                 mb_index = (b_row >> 2) * (cols + 1) + (b_col >> 2);
     145               0 :                 bindex = (b_row & 3) * 4 + (b_col & 3);
     146               0 :                 fprintf(mvs, "%3d:%-3d ", mi[mb_index].bmi[bindex].mv.as_mv.row, mi[mb_index].bmi[bindex].mv.as_mv.col);
     147                 : 
     148                 :             }
     149                 : 
     150               0 :             fprintf(mvs, "\n");
     151                 :         }
     152                 :     }
     153               0 :     fprintf(mvs, "\n");
     154                 : 
     155                 : 
     156               0 :     fclose(mvs);
     157               0 : }

Generated by: LCOV version 1.7