Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: source/libvpx/vp9/common/vp9_debugmodes.c

Issue 232133009: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/vp9/common/vp9_blockd.c ('k') | source/libvpx/vp9/common/vp9_entropy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include <stdio.h> 11 #include <stdio.h>
12 12
13 #include "vp9/common/vp9_blockd.h" 13 #include "vp9/common/vp9_blockd.h"
14 #include "vp9/common/vp9_onyxc_int.h" 14 #include "vp9/common/vp9_onyxc_int.h"
15 15
16 static void log_frame_info(VP9_COMMON *cm, const char *str, FILE *f) { 16 static void log_frame_info(VP9_COMMON *cm, const char *str, FILE *f) {
17 fprintf(f, "%s", str); 17 fprintf(f, "%s", str);
18 fprintf(f, "(Frame %d, Show:%d, Q:%d): \n", cm->current_video_frame, 18 fprintf(f, "(Frame %d, Show:%d, Q:%d): \n", cm->current_video_frame,
19 cm->show_frame, cm->base_qindex); 19 cm->show_frame, cm->base_qindex);
20 } 20 }
21 /* This function dereferences a pointer to the mbmi structure 21 /* This function dereferences a pointer to the mbmi structure
22 * and uses the passed in member offset to print out the value of an integer 22 * and uses the passed in member offset to print out the value of an integer
23 * for each mbmi member value in the mi structure. 23 * for each mbmi member value in the mi structure.
24 */ 24 */
25 static void print_mi_data(VP9_COMMON *cm, FILE *file, char *descriptor, 25 static void print_mi_data(VP9_COMMON *cm, FILE *file, const char *descriptor,
26 size_t member_offset) { 26 size_t member_offset) {
27 int mi_row; 27 int mi_row;
28 int mi_col; 28 int mi_col;
29 int mi_index = 0; 29 int mi_index = 0;
30 MODE_INFO **mi_8x8 = cm->mi_grid_visible; 30 MODE_INFO **mi_8x8 = cm->mi_grid_visible;
31 int rows = cm->mi_rows; 31 int rows = cm->mi_rows;
32 int cols = cm->mi_cols; 32 int cols = cm->mi_cols;
33 char prefix = descriptor[0]; 33 char prefix = descriptor[0];
34 34
35 log_frame_info(cm, descriptor, file); 35 log_frame_info(cm, descriptor, file);
36 mi_index = 0; 36 mi_index = 0;
37 for (mi_row = 0; mi_row < rows; mi_row++) { 37 for (mi_row = 0; mi_row < rows; mi_row++) {
38 fprintf(file, "%c ", prefix); 38 fprintf(file, "%c ", prefix);
39 for (mi_col = 0; mi_col < cols; mi_col++) { 39 for (mi_col = 0; mi_col < cols; mi_col++) {
40 fprintf(file, "%2d ", 40 fprintf(file, "%2d ",
41 *((int*) ((char *) (&mi_8x8[mi_index]->mbmi) + 41 *((int*) ((char *) (&mi_8x8[mi_index]->mbmi) +
42 member_offset))); 42 member_offset)));
43 mi_index++; 43 mi_index++;
44 } 44 }
45 fprintf(file, "\n"); 45 fprintf(file, "\n");
46 mi_index += 8; 46 mi_index += 8;
47 } 47 }
48 fprintf(file, "\n"); 48 fprintf(file, "\n");
49 } 49 }
50 void vp9_print_modes_and_motion_vectors(VP9_COMMON *cm, char *file) { 50 void vp9_print_modes_and_motion_vectors(VP9_COMMON *cm, const char *file) {
51 int mi_row; 51 int mi_row;
52 int mi_col; 52 int mi_col;
53 int mi_index = 0; 53 int mi_index = 0;
54 FILE *mvs = fopen(file, "a"); 54 FILE *mvs = fopen(file, "a");
55 MODE_INFO **mi_8x8 = cm->mi_grid_visible; 55 MODE_INFO **mi_8x8 = cm->mi_grid_visible;
56 int rows = cm->mi_rows; 56 int rows = cm->mi_rows;
57 int cols = cm->mi_cols; 57 int cols = cm->mi_cols;
58 58
59 print_mi_data(cm, mvs, "Partitions:", offsetof(MB_MODE_INFO, sb_type)); 59 print_mi_data(cm, mvs, "Partitions:", offsetof(MB_MODE_INFO, sb_type));
60 print_mi_data(cm, mvs, "Modes:", offsetof(MB_MODE_INFO, mode)); 60 print_mi_data(cm, mvs, "Modes:", offsetof(MB_MODE_INFO, mode));
(...skipping 10 matching lines...) Expand all
71 mi_8x8[mi_index]->mbmi.mv[0].as_mv.col); 71 mi_8x8[mi_index]->mbmi.mv[0].as_mv.col);
72 mi_index++; 72 mi_index++;
73 } 73 }
74 fprintf(mvs, "\n"); 74 fprintf(mvs, "\n");
75 mi_index += 8; 75 mi_index += 8;
76 } 76 }
77 fprintf(mvs, "\n"); 77 fprintf(mvs, "\n");
78 78
79 fclose(mvs); 79 fclose(mvs);
80 } 80 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/common/vp9_blockd.c ('k') | source/libvpx/vp9/common/vp9_entropy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698