Commit ce998b14 authored by Alexander Osin's avatar Alexander Osin Committed by Austin Yuan

Corrected trace prints (updated, change format, etc), replaced \t by spaces in source code

parent f7848e8f
/* /*
* Copyright (c) 2009 Intel Corporation. All Rights Reserved. * Copyright (c) 2009-2011 Intel Corporation. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the * copy of this software and associated documentation files (the
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
* .LIBVA_TRACE_CODEDBUF=coded_clip_file: save the coded clip into file coded_clip_file * .LIBVA_TRACE_CODEDBUF=coded_clip_file: save the coded clip into file coded_clip_file
* .LIBVA_TRACE_SURFACE=decoded_yuv_file: save the decoded YUV file decoded_yuv_file * .LIBVA_TRACE_SURFACE=decoded_yuv_file: save the decoded YUV file decoded_yuv_file
* .LIBVA_TRACE_LOGSIZE=numeric number: truncate the log_file or coded_clip_file, or decoded_yuv_file * .LIBVA_TRACE_LOGSIZE=numeric number: truncate the log_file or coded_clip_file, or decoded_yuv_file
* when the size is bigger than the number * when the size is bigger than the number
*/ */
...@@ -116,11 +116,11 @@ int va_parseConfig(char *env, char *env_value); ...@@ -116,11 +116,11 @@ int va_parseConfig(char *env, char *env_value);
VAStatus vaBufferInfo( VAStatus vaBufferInfo(
VADisplay dpy, VADisplay dpy,
VAContextID context, /* in */ VAContextID context, /* in */
VABufferID buf_id, /* in */ VABufferID buf_id, /* in */
VABufferType *type, /* out */ VABufferType *type, /* out */
unsigned int *size, /* out */ unsigned int *size, /* out */
unsigned int *num_elements /* out */ unsigned int *num_elements /* out */
); );
VAStatus vaLockSurface(VADisplay dpy, VAStatus vaLockSurface(VADisplay dpy,
...@@ -159,13 +159,13 @@ void va_TraceInit(VADisplay dpy) ...@@ -159,13 +159,13 @@ void va_TraceInit(VADisplay dpy)
trace_flag = 1; trace_flag = 1;
/*Check if there is still room for suffix .%d.%d*/ /*Check if there is still room for suffix .%d.%d*/
if (strnlen(env_value, 1024) < (1024 - 8)) if (strnlen(env_value, 1024) < (1024 - 8))
snprintf(env_value+strnlen(env_value, 1024), snprintf(env_value+strnlen(env_value, 1024),
(1025 - 8 - strnlen(env_value, 1024)), (1025 - 8 - strnlen(env_value, 1024)),
".%d.%d", trace_index, suffix); ".%d.%d", trace_index, suffix);
tmp = fopen(env_value, "w"); tmp = fopen(env_value, "w");
if (tmp) { if (tmp) {
trace_context[trace_index].trace_fp_log = tmp; trace_context[trace_index].trace_fp_log = tmp;
strcpy(trace_context[trace_index].trace_log_fn, env_value); strcpy(trace_context[trace_index].trace_log_fn, env_value);
} else { } else {
...@@ -193,10 +193,10 @@ void va_TraceInit(VADisplay dpy) ...@@ -193,10 +193,10 @@ void va_TraceInit(VADisplay dpy)
/* per-context setting */ /* per-context setting */
if (va_parseConfig("LIBVA_TRACE_CODEDBUF", &env_value[0]) == 0) { if (va_parseConfig("LIBVA_TRACE_CODEDBUF", &env_value[0]) == 0) {
if (strnlen(env_value, 1024) < (1024 - 8)) if (strnlen(env_value, 1024) < (1024 - 8))
snprintf(env_value+strnlen(env_value, 1024), snprintf(env_value+strnlen(env_value, 1024),
(1025 - 8 - strnlen(env_value, 1024)), (1025 - 8 - strnlen(env_value, 1024)),
".%d.%d", trace_index, suffix); ".%d.%d", trace_index, suffix);
tmp = fopen(env_value, "w"); tmp = fopen(env_value, "w");
...@@ -247,6 +247,7 @@ void va_TraceEnd(VADisplay dpy) ...@@ -247,6 +247,7 @@ void va_TraceEnd(VADisplay dpy)
memset(&trace_context[idx], sizeof(struct _trace_context), 0); memset(&trace_context[idx], sizeof(struct _trace_context), 0);
} }
static unsigned int file_size(FILE *fp) static unsigned int file_size(FILE *fp)
{ {
struct stat buf; struct stat buf;
...@@ -269,7 +270,7 @@ void va_TraceMsg(int idx, const char *msg, ...) ...@@ -269,7 +270,7 @@ void va_TraceMsg(int idx, const char *msg, ...)
if (file_size(trace_context[idx].trace_fp_log) >= trace_logsize) if (file_size(trace_context[idx].trace_fp_log) >= trace_logsize)
truncate_file(trace_context[idx].trace_fp_log); truncate_file(trace_context[idx].trace_fp_log);
if (msg) { if (msg) {
va_start(args, msg); va_start(args, msg);
vfprintf(trace_context[idx].trace_fp_log, msg, args); vfprintf(trace_context[idx].trace_fp_log, msg, args);
...@@ -316,6 +317,7 @@ void va_TraceCodedBuf(VADisplay dpy) ...@@ -316,6 +317,7 @@ void va_TraceCodedBuf(VADisplay dpy)
vaUnmapBuffer(dpy,trace_context[idx].trace_codedbuf); vaUnmapBuffer(dpy,trace_context[idx].trace_codedbuf);
va_TraceMsg(idx, "\tchecksum = 0x%02x\n", check_sum); va_TraceMsg(idx, "\tchecksum = 0x%02x\n", check_sum);
va_TraceMsg(idx, NULL);
} }
...@@ -342,6 +344,7 @@ void va_TraceSurface(VADisplay dpy) ...@@ -342,6 +344,7 @@ void va_TraceSurface(VADisplay dpy)
va_TraceMsg(idx, "==========truncate file %s\n", trace_context[idx].trace_surface_fn); va_TraceMsg(idx, "==========truncate file %s\n", trace_context[idx].trace_surface_fn);
truncate_file(trace_context[idx].trace_fp_surface); truncate_file(trace_context[idx].trace_fp_surface);
} }
va_TraceMsg(idx, NULL);
va_status = vaLockSurface( va_status = vaLockSurface(
dpy, dpy,
...@@ -368,11 +371,13 @@ void va_TraceSurface(VADisplay dpy) ...@@ -368,11 +371,13 @@ void va_TraceSurface(VADisplay dpy)
if (buffer == NULL) { if (buffer == NULL) {
va_TraceMsg(idx, "Error:vaLockSurface return NULL buffer\n"); va_TraceMsg(idx, "Error:vaLockSurface return NULL buffer\n");
va_TraceMsg(idx, NULL);
vaUnlockSurface(dpy, trace_context[idx].trace_rendertarget); vaUnlockSurface(dpy, trace_context[idx].trace_rendertarget);
return; return;
} }
va_TraceMsg(idx, "\tbuffer location = 0x%08x\n", buffer); va_TraceMsg(idx, "\tbuffer location = 0x%08x\n", buffer);
va_TraceMsg(idx, NULL);
Y_data = (unsigned char*)buffer; Y_data = (unsigned char*)buffer;
UV_data = (unsigned char*)buffer + chroma_u_offset; UV_data = (unsigned char*)buffer + chroma_u_offset;
...@@ -404,13 +409,14 @@ void va_TraceSurface(VADisplay dpy) ...@@ -404,13 +409,14 @@ void va_TraceSurface(VADisplay dpy)
vaUnlockSurface(dpy, trace_context[idx].trace_rendertarget); vaUnlockSurface(dpy, trace_context[idx].trace_rendertarget);
va_TraceMsg(idx, "\tchecksum = 0x%02x\n", check_sum & 0xff); va_TraceMsg(idx, "\tchecksum = 0x%02x\n", check_sum & 0xff);
va_TraceMsg(idx, NULL);
} }
void va_TraceInitialize ( void va_TraceInitialize (
VADisplay dpy, VADisplay dpy,
int *major_version, /* out */ int *major_version, /* out */
int *minor_version /* out */ int *minor_version /* out */
) )
{ {
DPY2INDEX(dpy); DPY2INDEX(dpy);
...@@ -444,9 +450,10 @@ void va_TraceCreateConfig( ...@@ -444,9 +450,10 @@ void va_TraceCreateConfig(
va_TraceMsg(idx, "\tentrypoint = %d\n", entrypoint); va_TraceMsg(idx, "\tentrypoint = %d\n", entrypoint);
va_TraceMsg(idx, "\tnum_attribs = %d\n", num_attribs); va_TraceMsg(idx, "\tnum_attribs = %d\n", num_attribs);
for (i = 0; i < num_attribs; i++) { for (i = 0; i < num_attribs; i++) {
va_TraceMsg(idx, "\t\tattrib_list[%d].type = 0x%08x\n", i, attrib_list[i].type); va_TraceMsg(idx, "\t\tattrib_list[%d].type = 0x%08x\n", i, attrib_list[i].type);
va_TraceMsg(idx, "\t\tattrib_list[%d].value = 0x%08x\n", i, attrib_list[i].value); va_TraceMsg(idx, "\t\tattrib_list[%d].value = 0x%08x\n", i, attrib_list[i].value);
} }
va_TraceMsg(idx, NULL);
trace_context[idx].trace_profile = profile; trace_context[idx].trace_profile = profile;
trace_context[idx].trace_entrypoint = entrypoint; trace_context[idx].trace_entrypoint = entrypoint;
...@@ -459,7 +466,7 @@ void va_TraceCreateSurface( ...@@ -459,7 +466,7 @@ void va_TraceCreateSurface(
int height, int height,
int format, int format,
int num_surfaces, int num_surfaces,
VASurfaceID *surfaces /* out */ VASurfaceID *surfaces /* out */
) )
{ {
int i; int i;
...@@ -474,6 +481,8 @@ void va_TraceCreateSurface( ...@@ -474,6 +481,8 @@ void va_TraceCreateSurface(
for (i = 0; i < num_surfaces; i++) for (i = 0; i < num_surfaces; i++)
va_TraceMsg(idx, "\t\tsurfaces[%d] = 0x%08x\n", i, surfaces[i]); va_TraceMsg(idx, "\t\tsurfaces[%d] = 0x%08x\n", i, surfaces[i]);
va_TraceMsg(idx, NULL);
} }
...@@ -485,7 +494,7 @@ void va_TraceCreateContext( ...@@ -485,7 +494,7 @@ void va_TraceCreateContext(
int flag, int flag,
VASurfaceID *render_targets, VASurfaceID *render_targets,
int num_render_targets, int num_render_targets,
VAContextID *context /* out */ VAContextID *context /* out */
) )
{ {
int i; int i;
...@@ -500,7 +509,7 @@ void va_TraceCreateContext( ...@@ -500,7 +509,7 @@ void va_TraceCreateContext(
for (i=0; i<num_render_targets; i++) for (i=0; i<num_render_targets; i++)
va_TraceMsg(idx, "\t\trender_targets[%d] = 0x%08x\n", i, render_targets[i]); va_TraceMsg(idx, "\t\trender_targets[%d] = 0x%08x\n", i, render_targets[i]);
va_TraceMsg(idx, "\tcontext = 0x%08x\n", *context); va_TraceMsg(idx, "\tcontext = 0x%08x\n", *context);
va_TraceMsg(idx, NULL);
trace_context[idx].trace_context = *context; trace_context[idx].trace_context = *context;
...@@ -537,8 +546,8 @@ static char * buffer_type_to_string(int type) ...@@ -537,8 +546,8 @@ static char * buffer_type_to_string(int type)
void va_TraceMapBuffer ( void va_TraceMapBuffer (
VADisplay dpy, VADisplay dpy,
VABufferID buf_id, /* in */ VABufferID buf_id, /* in */
void **pbuf /* out */ void **pbuf /* out */
) )
{ {
VABufferType type; VABufferType type;
...@@ -574,6 +583,7 @@ void va_TraceMapBuffer ( ...@@ -574,6 +583,7 @@ void va_TraceMapBuffer (
buf_list = buf_list->next; buf_list = buf_list->next;
} }
va_TraceMsg(idx, NULL);
} }
static void va_TraceVABuffers( static void va_TraceVABuffers(
...@@ -606,6 +616,7 @@ static void va_TraceVABuffers( ...@@ -606,6 +616,7 @@ static void va_TraceVABuffers(
} }
va_TraceMsg(idx, "\tchecksum = 0x%02x\n", check_sum & 0xff); va_TraceMsg(idx, "\tchecksum = 0x%02x\n", check_sum & 0xff);
va_TraceMsg(idx, NULL);
return; return;
} }
...@@ -644,6 +655,7 @@ static void va_TraceVAPictureParameterBufferMPEG2( ...@@ -644,6 +655,7 @@ static void va_TraceVAPictureParameterBufferMPEG2(
va_TraceMsg(idx,"\trepeat_first_field= %d\n", p->picture_coding_extension.bits.repeat_first_field); va_TraceMsg(idx,"\trepeat_first_field= %d\n", p->picture_coding_extension.bits.repeat_first_field);
va_TraceMsg(idx,"\tprogressive_frame= %d\n", p->picture_coding_extension.bits.progressive_frame); va_TraceMsg(idx,"\tprogressive_frame= %d\n", p->picture_coding_extension.bits.progressive_frame);
va_TraceMsg(idx,"\tis_first_field= %d\n", p->picture_coding_extension.bits.is_first_field); va_TraceMsg(idx,"\tis_first_field= %d\n", p->picture_coding_extension.bits.is_first_field);
va_TraceMsg(idx, NULL);
return; return;
} }
...@@ -671,6 +683,7 @@ static void va_TraceVAIQMatrixBufferMPEG2( ...@@ -671,6 +683,7 @@ static void va_TraceVAIQMatrixBufferMPEG2(
va_TraceMsg(idx,"\tnon_intra_quantiser_matrix = %d\n", p->non_intra_quantiser_matrix); va_TraceMsg(idx,"\tnon_intra_quantiser_matrix = %d\n", p->non_intra_quantiser_matrix);
va_TraceMsg(idx,"\tchroma_intra_quantiser_matrix = %d\n", p->chroma_intra_quantiser_matrix); va_TraceMsg(idx,"\tchroma_intra_quantiser_matrix = %d\n", p->chroma_intra_quantiser_matrix);
va_TraceMsg(idx,"\tchroma_non_intra_quantiser_matrix = %d\n", p->chroma_non_intra_quantiser_matrix); va_TraceMsg(idx,"\tchroma_non_intra_quantiser_matrix = %d\n", p->chroma_non_intra_quantiser_matrix);
va_TraceMsg(idx, NULL);
return; return;
} }
...@@ -703,12 +716,12 @@ static void va_TraceVASliceParameterBufferMPEG2( ...@@ -703,12 +716,12 @@ static void va_TraceVASliceParameterBufferMPEG2(
va_TraceMsg(idx,"\tslice_vertical_position = %d\n", p->slice_vertical_position); va_TraceMsg(idx,"\tslice_vertical_position = %d\n", p->slice_vertical_position);
va_TraceMsg(idx,"\tquantiser_scale_code = %d\n", p->quantiser_scale_code); va_TraceMsg(idx,"\tquantiser_scale_code = %d\n", p->quantiser_scale_code);
va_TraceMsg(idx,"\tintra_slice_flag = %d\n", p->intra_slice_flag); va_TraceMsg(idx,"\tintra_slice_flag = %d\n", p->intra_slice_flag);
va_TraceMsg(idx, NULL);
return; return;
} }
static void va_TraceVAPictureParameterBufferMPEG4( static void va_TraceVAPictureParameterBufferMPEG4(
VADisplay dpy, VADisplay dpy,
VAContextID context, VAContextID context,
...@@ -749,7 +762,7 @@ static void va_TraceVAPictureParameterBufferMPEG4( ...@@ -749,7 +762,7 @@ static void va_TraceVAPictureParameterBufferMPEG4(
va_TraceMsg(idx,"\tsprite_trajectory_dv ="); va_TraceMsg(idx,"\tsprite_trajectory_dv =");
for(i=0;i<3;i++) for(i=0;i<3;i++)
va_TraceMsg(idx,"\t%d", p->sprite_trajectory_dv[i]); va_TraceMsg(idx,"\t%d", p->sprite_trajectory_dv[i]);
va_TraceMsg(idx,"\n"); va_TraceMsg(idx,"\n");
va_TraceMsg(idx,"\tvop_fields value = %d\n", p->vop_fields.value); va_TraceMsg(idx,"\tvop_fields value = %d\n", p->vop_fields.value);
va_TraceMsg(idx,"\tvop_coding_type= %d\n", p->vop_fields.bits.vop_coding_type); va_TraceMsg(idx,"\tvop_coding_type= %d\n", p->vop_fields.bits.vop_coding_type);
va_TraceMsg(idx,"\tbackward_reference_vop_coding_type= %d\n", p->vop_fields.bits.backward_reference_vop_coding_type); va_TraceMsg(idx,"\tbackward_reference_vop_coding_type= %d\n", p->vop_fields.bits.backward_reference_vop_coding_type);
...@@ -763,6 +776,7 @@ static void va_TraceVAPictureParameterBufferMPEG4( ...@@ -763,6 +776,7 @@ static void va_TraceVAPictureParameterBufferMPEG4(
va_TraceMsg(idx,"\tnum_macroblocks_in_gob = %d\n", p->num_macroblocks_in_gob); va_TraceMsg(idx,"\tnum_macroblocks_in_gob = %d\n", p->num_macroblocks_in_gob);
va_TraceMsg(idx,"\tTRB = %d\n", p->TRB); va_TraceMsg(idx,"\tTRB = %d\n", p->TRB);
va_TraceMsg(idx,"\tTRD = %d\n", p->TRD); va_TraceMsg(idx,"\tTRD = %d\n", p->TRD);
va_TraceMsg(idx, NULL);
return; return;
} }
...@@ -792,6 +806,7 @@ static void va_TraceVAIQMatrixBufferMPEG4( ...@@ -792,6 +806,7 @@ static void va_TraceVAIQMatrixBufferMPEG4(
va_TraceMsg(idx,"\tnon_intra_quant_mat =\n"); va_TraceMsg(idx,"\tnon_intra_quant_mat =\n");
for(i=0;i<64;i++) for(i=0;i<64;i++)
va_TraceMsg(idx,"\t\t%d\n", p->non_intra_quant_mat[i]); va_TraceMsg(idx,"\t\t%d\n", p->non_intra_quant_mat[i]);
va_TraceMsg(idx, NULL);
return; return;
} }
...@@ -822,11 +837,24 @@ static void va_TraceVASliceParameterBufferMPEG4( ...@@ -822,11 +837,24 @@ static void va_TraceVASliceParameterBufferMPEG4(
va_TraceMsg(idx,"\tmacroblock_offset = %d\n", p->macroblock_offset); va_TraceMsg(idx,"\tmacroblock_offset = %d\n", p->macroblock_offset);
va_TraceMsg(idx,"\tmacroblock_number = %d\n", p->macroblock_number); va_TraceMsg(idx,"\tmacroblock_number = %d\n", p->macroblock_number);
va_TraceMsg(idx,"\tquant_scale = %d\n", p->quant_scale); va_TraceMsg(idx,"\tquant_scale = %d\n", p->quant_scale);
va_TraceMsg(idx, NULL);
return; return;
} }
static inline void va_TraceFlagIfNotZero(
int idx, /* in */
const char *name, /* in */
unsigned int flag /* in */
)
{
if (flag != 0) {
va_TraceMsg(idx, "%s = %x\n", name, flag);
}
}
static void va_TraceVAPictureParameterBufferH264( static void va_TraceVAPictureParameterBufferH264(
VADisplay dpy, VADisplay dpy,
VAContextID context, VAContextID context,
...@@ -843,7 +871,7 @@ static void va_TraceVAPictureParameterBufferH264( ...@@ -843,7 +871,7 @@ static void va_TraceVAPictureParameterBufferH264(
va_TraceMsg(idx, "VAPictureParameterBufferH264\n"); va_TraceMsg(idx, "VAPictureParameterBufferH264\n");
va_TraceMsg(idx, "\tCurrPic.picture_id = %d\n", p->CurrPic.picture_id); va_TraceMsg(idx, "\tCurrPic.picture_id = 0x%08x\n", p->CurrPic.picture_id);
va_TraceMsg(idx, "\tCurrPic.frame_idx = %d\n", p->CurrPic.frame_idx); va_TraceMsg(idx, "\tCurrPic.frame_idx = %d\n", p->CurrPic.frame_idx);
va_TraceMsg(idx, "\tCurrPic.flags = %d\n", p->CurrPic.flags); va_TraceMsg(idx, "\tCurrPic.flags = %d\n", p->CurrPic.flags);
va_TraceMsg(idx, "\tCurrPic.TopFieldOrderCnt = %d\n", p->CurrPic.TopFieldOrderCnt); va_TraceMsg(idx, "\tCurrPic.TopFieldOrderCnt = %d\n", p->CurrPic.TopFieldOrderCnt);
...@@ -853,7 +881,7 @@ static void va_TraceVAPictureParameterBufferH264( ...@@ -853,7 +881,7 @@ static void va_TraceVAPictureParameterBufferH264(
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
{ {
if (p->ReferenceFrames[i].flags != VA_PICTURE_H264_INVALID) { if (p->ReferenceFrames[i].flags != VA_PICTURE_H264_INVALID) {
va_TraceMsg(idx, "\t\t%d-%d-%d-%d\n", va_TraceMsg(idx, "\t\t%d-%d-0x%08x-%d\n",
p->ReferenceFrames[i].TopFieldOrderCnt, p->ReferenceFrames[i].TopFieldOrderCnt,
p->ReferenceFrames[i].BottomFieldOrderCnt, p->ReferenceFrames[i].BottomFieldOrderCnt,
p->ReferenceFrames[i].picture_id, p->ReferenceFrames[i].picture_id,
...@@ -882,14 +910,19 @@ static void va_TraceVAPictureParameterBufferH264( ...@@ -882,14 +910,19 @@ static void va_TraceVAPictureParameterBufferH264(
va_TraceMsg(idx, "\tpic_init_qs_minus26 = %d\n", p->pic_init_qs_minus26); va_TraceMsg(idx, "\tpic_init_qs_minus26 = %d\n", p->pic_init_qs_minus26);
va_TraceMsg(idx, "\tchroma_qp_index_offset = %d\n", p->chroma_qp_index_offset); va_TraceMsg(idx, "\tchroma_qp_index_offset = %d\n", p->chroma_qp_index_offset);
va_TraceMsg(idx, "\tsecond_chroma_qp_index_offset = %d\n", p->second_chroma_qp_index_offset); va_TraceMsg(idx, "\tsecond_chroma_qp_index_offset = %d\n", p->second_chroma_qp_index_offset);
va_TraceMsg(idx, "\tpic_fields = %d\n", p->pic_fields.value); va_TraceMsg(idx, "\tpic_fields = 0x%03x\n", p->pic_fields.value);
va_TraceMsg(idx, "\tentropy_coding_mode_flag = %d\n", p->pic_fields.bits.entropy_coding_mode_flag); va_TraceFlagIfNotZero(idx, "\t\tentropy_coding_mode_flag", p->pic_fields.bits.entropy_coding_mode_flag);
va_TraceMsg(idx, "\tweighted_pred_flag = %d\n", p->pic_fields.bits.weighted_pred_flag); va_TraceFlagIfNotZero(idx, "\t\tweighted_pred_flag", p->pic_fields.bits.weighted_pred_flag);
va_TraceMsg(idx, "\tweighted_bipred_idc = %d\n", p->pic_fields.bits.weighted_bipred_idc); va_TraceFlagIfNotZero(idx, "\t\tweighted_bipred_idc", p->pic_fields.bits.weighted_bipred_idc);
va_TraceMsg(idx, "\ttransform_8x8_mode_flag = %d\n", p->pic_fields.bits.transform_8x8_mode_flag); va_TraceFlagIfNotZero(idx, "\t\ttransform_8x8_mode_flag", p->pic_fields.bits.transform_8x8_mode_flag);
va_TraceMsg(idx, "\tfield_pic_flag = %d\n", p->pic_fields.bits.field_pic_flag); va_TraceFlagIfNotZero(idx, "\t\tfield_pic_flag", p->pic_fields.bits.field_pic_flag);
va_TraceMsg(idx, "\tconstrained_intra_pred_flag = %d\n", p->pic_fields.bits.constrained_intra_pred_flag); va_TraceFlagIfNotZero(idx, "\t\tconstrained_intra_pred_flag", p->pic_fields.bits.constrained_intra_pred_flag);
va_TraceFlagIfNotZero(idx, "\t\tpic_order_present_flag", p->pic_fields.bits.pic_order_present_flag);
va_TraceFlagIfNotZero(idx, "\t\tdeblocking_filter_control_present_flag", p->pic_fields.bits.deblocking_filter_control_present_flag);
va_TraceFlagIfNotZero(idx, "\t\tredundant_pic_cnt_present_flag", p->pic_fields.bits.redundant_pic_cnt_present_flag);
va_TraceFlagIfNotZero(idx, "\t\treference_pic_flag", p->pic_fields.bits.reference_pic_flag);
va_TraceMsg(idx, "\tframe_num = %d\n", p->frame_num); va_TraceMsg(idx, "\tframe_num = %d\n", p->frame_num);
va_TraceMsg(idx, NULL);
return; return;
} }
...@@ -924,18 +957,18 @@ static void va_TraceVASliceParameterBufferH264( ...@@ -924,18 +957,18 @@ static void va_TraceVASliceParameterBufferH264(
va_TraceMsg(idx, "\tslice_qp_delta = %d\n", p->slice_qp_delta); va_TraceMsg(idx, "\tslice_qp_delta = %d\n", p->slice_qp_delta);
va_TraceMsg(idx, "\tdisable_deblocking_filter_idc = %d\n", p->disable_deblocking_filter_idc); va_TraceMsg(idx, "\tdisable_deblocking_filter_idc = %d\n", p->disable_deblocking_filter_idc);
va_TraceMsg(idx, "\tslice_alpha_c0_offset_div2 = %d\n", p->slice_alpha_c0_offset_div2); va_TraceMsg(idx, "\tslice_alpha_c0_offset_div2 = %d\n", p->slice_alpha_c0_offset_div2);
va_TraceMsg(idx, "\tslice_beta_offset_div2 = %d\n", p->slice_beta_offset_div2); va_TraceMsg(idx, "\tslice_beta_offset_div2 = %d\n", p->slice_beta_offset_div2);
if (p->slice_type == 0 || p->slice_type == 1) { if (p->slice_type == 0 || p->slice_type == 1) {
va_TraceMsg(idx, "\tRefPicList0 ="); va_TraceMsg(idx, "\tRefPicList0 =");
for (i = 0; i < p->num_ref_idx_l0_active_minus1 + 1; i++) { for (i = 0; i < p->num_ref_idx_l0_active_minus1 + 1; i++) {
va_TraceMsg(idx, "%d-%d-%d-%d\n", p->RefPicList0[i].TopFieldOrderCnt, p->RefPicList0[i].BottomFieldOrderCnt, p->RefPicList0[i].picture_id, p->RefPicList0[i].frame_idx); va_TraceMsg(idx, "%d-%d-0x%08x-%d\n", p->RefPicList0[i].TopFieldOrderCnt, p->RefPicList0[i].BottomFieldOrderCnt, p->RefPicList0[i].picture_id, p->RefPicList0[i].frame_idx);
} }
if (p->slice_type == 1) { if (p->slice_type == 1) {
va_TraceMsg(idx, "\tRefPicList1 ="); va_TraceMsg(idx, "\tRefPicList1 =");
for (i = 0; i < p->num_ref_idx_l1_active_minus1 + 1; i++) for (i = 0; i < p->num_ref_idx_l1_active_minus1 + 1; i++)
{ {
va_TraceMsg(idx, "%d-%d-%d-%d\n", p->RefPicList1[i].TopFieldOrderCnt, p->RefPicList1[i].BottomFieldOrderCnt, p->RefPicList1[i].picture_id, p->RefPicList1[i].frame_idx); va_TraceMsg(idx, "%d-%d-0x%08x-%d\n", p->RefPicList1[i].TopFieldOrderCnt, p->RefPicList1[i].BottomFieldOrderCnt, p->RefPicList1[i].picture_id, p->RefPicList1[i].frame_idx);
} }
} }
} }
...@@ -949,7 +982,7 @@ static void va_TraceVASliceParameterBufferH264( ...@@ -949,7 +982,7 @@ static void va_TraceVASliceParameterBufferH264(
va_TraceMsg(idx, "\t%d ", p->luma_offset_l0[i]); va_TraceMsg(idx, "\t%d ", p->luma_offset_l0[i]);
} }
} }
va_TraceMsg(idx, "\tchroma_weight_l0_flag = %d\n", p->chroma_weight_l0_flag); va_TraceMsg(idx, "\tchroma_weight_l0_flag = %d\n", p->chroma_weight_l0_flag);
if (p->chroma_weight_l0_flag) { if (p->chroma_weight_l0_flag) {
for (i = 0; i <= p->num_ref_idx_l0_active_minus1; i++) { for (i = 0; i <= p->num_ref_idx_l0_active_minus1; i++) {
...@@ -976,8 +1009,9 @@ static void va_TraceVASliceParameterBufferH264( ...@@ -976,8 +1009,9 @@ static void va_TraceVASliceParameterBufferH264(
va_TraceMsg(idx, "\t\t%d ", p->chroma_weight_l1[i][1]); va_TraceMsg(idx, "\t\t%d ", p->chroma_weight_l1[i][1]);
va_TraceMsg(idx, "\t\t%d ", p->chroma_offset_l1[i][1]); va_TraceMsg(idx, "\t\t%d ", p->chroma_offset_l1[i][1]);
} }
va_TraceMsg(idx, "\n"); va_TraceMsg(idx, "\n");
} }
va_TraceMsg(idx, NULL);
} }
static void va_TraceVAIQMatrixBufferH264( static void va_TraceVAIQMatrixBufferH264(
...@@ -1012,8 +1046,10 @@ static void va_TraceVAIQMatrixBufferH264( ...@@ -1012,8 +1046,10 @@ static void va_TraceVAIQMatrixBufferH264(
va_TraceMsg(idx, "\t%d", p->ScalingList8x8[i][j]); va_TraceMsg(idx, "\t%d", p->ScalingList8x8[i][j]);
if ((j + 1) % 8 == 0) if ((j + 1) % 8 == 0)
va_TraceMsg(idx, "\n"); va_TraceMsg(idx, "\n");
} }
} }
va_TraceMsg(idx, NULL);
} }
static void va_TraceVAEncSequenceParameterBufferH264( static void va_TraceVAEncSequenceParameterBufferH264(
...@@ -1043,10 +1079,11 @@ static void va_TraceVAEncSequenceParameterBufferH264( ...@@ -1043,10 +1079,11 @@ static void va_TraceVAEncSequenceParameterBufferH264(
va_TraceMsg(idx, "\tmin_qp = %d\n", p->min_qp); va_TraceMsg(idx, "\tmin_qp = %d\n", p->min_qp);
va_TraceMsg(idx, "\tbasic_unit_size = %d\n", p->basic_unit_size); va_TraceMsg(idx, "\tbasic_unit_size = %d\n", p->basic_unit_size);
va_TraceMsg(idx, "\tvui_flag = %d\n", p->vui_flag); va_TraceMsg(idx, "\tvui_flag = %d\n", p->vui_flag);
va_TraceMsg(idx, NULL);
/* start a new sequce, coded log file can be truncated */ /* start a new sequce, coded log file can be truncated */
trace_context[idx].trace_sequence_start = 1; trace_context[idx].trace_sequence_start = 1;
return; return;
} }
...@@ -1069,6 +1106,7 @@ static void va_TraceVAEncPictureParameterBufferH264( ...@@ -1069,6 +1106,7 @@ static void va_TraceVAEncPictureParameterBufferH264(
va_TraceMsg(idx, "\tpicture_width = %d\n", p->picture_width); va_TraceMsg(idx, "\tpicture_width = %d\n", p->picture_width);
va_TraceMsg(idx, "\tpicture_height = %d\n", p->picture_height); va_TraceMsg(idx, "\tpicture_height = %d\n", p->picture_height);
va_TraceMsg(idx, "\tlast_picture = 0x%08x\n", p->last_picture); va_TraceMsg(idx, "\tlast_picture = 0x%08x\n", p->last_picture);
va_TraceMsg(idx, NULL);
trace_context[idx].trace_codedbuf = p->coded_buf; trace_context[idx].trace_codedbuf = p->coded_buf;
...@@ -1096,7 +1134,8 @@ static void va_TraceVAEncSliceParameterBuffer( ...@@ -1096,7 +1134,8 @@ static void va_TraceVAEncSliceParameterBuffer(
va_TraceMsg(idx, "\tslice_flags.disable_deblocking_filter_idc = %d\n", p->slice_flags.bits.disable_deblocking_filter_idc); va_TraceMsg(idx, "\tslice_flags.disable_deblocking_filter_idc = %d\n", p->slice_flags.bits.disable_deblocking_filter_idc);
va_TraceMsg(idx, "\tslice_flags.uses_long_term_ref = %d\n", p->slice_flags.bits.uses_long_term_ref); va_TraceMsg(idx, "\tslice_flags.uses_long_term_ref = %d\n", p->slice_flags.bits.uses_long_term_ref);
va_TraceMsg(idx, "\tslice_flags.is_long_term_ref = %d\n", p->slice_flags.bits.is_long_term_ref); va_TraceMsg(idx, "\tslice_flags.is_long_term_ref = %d\n", p->slice_flags.bits.is_long_term_ref);
va_TraceMsg(idx, NULL);
return; return;
} }
...@@ -1154,7 +1193,8 @@ static void va_TraceVAEncMiscParameterBuffer( ...@@ -1154,7 +1193,8 @@ static void va_TraceVAEncMiscParameterBuffer(
va_TraceMsg(idx, "invalid VAEncMiscParameterBuffer type = %d\n", tmp->type); va_TraceMsg(idx, "invalid VAEncMiscParameterBuffer type = %d\n", tmp->type);
break; break;
} }
va_TraceMsg(idx, NULL);
return; return;
} }
...@@ -1188,6 +1228,7 @@ static void va_TraceVAPictureParameterBufferVC1( ...@@ -1188,6 +1228,7 @@ static void va_TraceVAPictureParameterBufferVC1(
va_TraceMsg(idx, "\tsyncmarker = %d\n", p->sequence_fields.bits.syncmarker); va_TraceMsg(idx, "\tsyncmarker = %d\n", p->sequence_fields.bits.syncmarker);
va_TraceMsg(idx, "\trangered = %d\n", p->sequence_fields.bits.rangered); va_TraceMsg(idx, "\trangered = %d\n", p->sequence_fields.bits.rangered);
va_TraceMsg(idx, "\tmax_b_frames = %d\n", p->sequence_fields.bits.max_b_frames); va_TraceMsg(idx, "\tmax_b_frames = %d\n", p->sequence_fields.bits.max_b_frames);
va_TraceMsg(idx, "\tprofile = %d\n", p->sequence_fields.bits.profile);
va_TraceMsg(idx, "\tcoded_width = %d\n", p->coded_width); va_TraceMsg(idx, "\tcoded_width = %d\n", p->coded_width);
va_TraceMsg(idx, "\tcoded_height = %d\n", p->coded_height); va_TraceMsg(idx, "\tcoded_height = %d\n", p->coded_height);
va_TraceMsg(idx, "\tclosed_entry = %d\n", p->entrypoint_fields.bits.closed_entry); va_TraceMsg(idx, "\tclosed_entry = %d\n", p->entrypoint_fields.bits.closed_entry);
...@@ -1260,6 +1301,7 @@ static void va_TraceVAPictureParameterBufferVC1( ...@@ -1260,6 +1301,7 @@ static void va_TraceVAPictureParameterBufferVC1(
va_TraceMsg(idx, "\ttransform_ac_codingset_idx1 = %d\n", p->transform_fields.bits.transform_ac_codingset_idx1); va_TraceMsg(idx, "\ttransform_ac_codingset_idx1 = %d\n", p->transform_fields.bits.transform_ac_codingset_idx1);
va_TraceMsg(idx, "\ttransform_ac_codingset_idx2 = %d\n", p->transform_fields.bits.transform_ac_codingset_idx2); va_TraceMsg(idx, "\ttransform_ac_codingset_idx2 = %d\n", p->transform_fields.bits.transform_ac_codingset_idx2);
va_TraceMsg(idx, "\tintra_transform_dc_table = %d\n", p->transform_fields.bits.intra_transform_dc_table); va_TraceMsg(idx, "\tintra_transform_dc_table = %d\n", p->transform_fields.bits.intra_transform_dc_table);
va_TraceMsg(idx, NULL);
} }
static void va_TraceVASliceParameterBufferVC1( static void va_TraceVASliceParameterBufferVC1(
...@@ -1284,6 +1326,7 @@ static void va_TraceVASliceParameterBufferVC1( ...@@ -1284,6 +1326,7 @@ static void va_TraceVASliceParameterBufferVC1(
va_TraceMsg(idx, "\tslice_data_flag = %d\n", p->slice_data_flag); va_TraceMsg(idx, "\tslice_data_flag = %d\n", p->slice_data_flag);
va_TraceMsg(idx, "\tmacroblock_offset = %d\n", p->macroblock_offset); va_TraceMsg(idx, "\tmacroblock_offset = %d\n", p->macroblock_offset);
va_TraceMsg(idx, "\tslice_vertical_position = %d\n", p->slice_vertical_position); va_TraceMsg(idx, "\tslice_vertical_position = %d\n", p->slice_vertical_position);
va_TraceMsg(idx, NULL);
} }
void va_TraceBeginPicture( void va_TraceBeginPicture(
...@@ -1299,6 +1342,7 @@ void va_TraceBeginPicture( ...@@ -1299,6 +1342,7 @@ void va_TraceBeginPicture(
va_TraceMsg(idx, "\tcontext = 0x%08x\n", context); va_TraceMsg(idx, "\tcontext = 0x%08x\n", context);
va_TraceMsg(idx, "\trender_targets = 0x%08x\n", render_target); va_TraceMsg(idx, "\trender_targets = 0x%08x\n", render_target);
va_TraceMsg(idx, "\tframe_count = #%d\n", trace_context[idx].trace_frame_no); va_TraceMsg(idx, "\tframe_count = #%d\n", trace_context[idx].trace_frame_no);
va_TraceMsg(idx, NULL);
trace_context[idx].trace_rendertarget = render_target; /* for surface data dump after vaEndPicture */ trace_context[idx].trace_rendertarget = render_target; /* for surface data dump after vaEndPicture */
...@@ -1645,6 +1689,8 @@ void va_TraceRenderPicture( ...@@ -1645,6 +1689,8 @@ void va_TraceRenderPicture(
vaUnmapBuffer(dpy, buffers[i]); vaUnmapBuffer(dpy, buffers[i]);
} }
va_TraceMsg(idx, NULL);
} }
...@@ -1660,7 +1706,6 @@ void va_TraceEndPicture( ...@@ -1660,7 +1706,6 @@ void va_TraceEndPicture(
va_TraceMsg(idx, "\tcontext = 0x%08x\n", context); va_TraceMsg(idx, "\tcontext = 0x%08x\n", context);
va_TraceMsg(idx, "\trender_targets = 0x%08x\n", trace_context[idx].trace_rendertarget); va_TraceMsg(idx, "\trender_targets = 0x%08x\n", trace_context[idx].trace_rendertarget);
/* want to trace codedbuf, and it is encode */ /* want to trace codedbuf, and it is encode */
if (trace_context[idx].trace_fp_codedbuf && if (trace_context[idx].trace_fp_codedbuf &&
((trace_context[idx].trace_entrypoint == VAEntrypointEncSlice) || ((trace_context[idx].trace_entrypoint == VAEntrypointEncSlice) ||
...@@ -1677,6 +1722,8 @@ void va_TraceEndPicture( ...@@ -1677,6 +1722,8 @@ void va_TraceEndPicture(
va_TraceSurface(dpy); va_TraceSurface(dpy);
} }
va_TraceMsg(idx, NULL);
} }
void va_TraceSyncSurface( void va_TraceSyncSurface(
...@@ -1689,13 +1736,14 @@ void va_TraceSyncSurface( ...@@ -1689,13 +1736,14 @@ void va_TraceSyncSurface(
TRACE_FUNCNAME(idx); TRACE_FUNCNAME(idx);
va_TraceMsg(idx, "\trender_target = 0x%08x\n", render_target); va_TraceMsg(idx, "\trender_target = 0x%08x\n", render_target);
va_TraceMsg(idx, NULL);
} }
void va_TraceQuerySurfaceStatus( void va_TraceQuerySurfaceStatus(
VADisplay dpy, VADisplay dpy,
VASurfaceID render_target, VASurfaceID render_target,
VASurfaceStatus *status /* out */ VASurfaceStatus *status /* out */
) )
{ {
DPY2INDEX(dpy); DPY2INDEX(dpy);
...@@ -1704,14 +1752,15 @@ void va_TraceQuerySurfaceStatus( ...@@ -1704,14 +1752,15 @@ void va_TraceQuerySurfaceStatus(
va_TraceMsg(idx, "\trender_target = 0x%08x\n", render_target); va_TraceMsg(idx, "\trender_target = 0x%08x\n", render_target);
va_TraceMsg(idx, "\tstatus = 0x%08x\n", *status); va_TraceMsg(idx, "\tstatus = 0x%08x\n", *status);
va_TraceMsg(idx, NULL);
} }
void va_TraceQuerySurfaceError( void va_TraceQuerySurfaceError(
VADisplay dpy, VADisplay dpy,
VASurfaceID surface, VASurfaceID surface,
VAStatus error_status, VAStatus error_status,
void **error_info /*out*/ void **error_info /*out*/
) )
{ {
DPY2INDEX(dpy); DPY2INDEX(dpy);
...@@ -1720,14 +1769,15 @@ void va_TraceQuerySurfaceError( ...@@ -1720,14 +1769,15 @@ void va_TraceQuerySurfaceError(
va_TraceMsg(idx, "\tsurface = 0x%08x\n", surface); va_TraceMsg(idx, "\tsurface = 0x%08x\n", surface);
va_TraceMsg(idx, "\terror_status = 0x%08x\n", error_status); va_TraceMsg(idx, "\terror_status = 0x%08x\n", error_status);
if (error_status == VA_STATUS_ERROR_DECODING_ERROR) { if (error_status == VA_STATUS_ERROR_DECODING_ERROR) {
VASurfaceDecodeMBErrors *p = *error_info; VASurfaceDecodeMBErrors *p = *error_info;
while (p->status != -1) { while (p->status != -1) {
va_TraceMsg(idx, "\t\tstatus = %d\n", p->status); va_TraceMsg(idx, "\t\tstatus = %d\n", p->status);
va_TraceMsg(idx, "\t\tstart_mb = %d\n", p->start_mb); va_TraceMsg(idx, "\t\tstart_mb = %d\n", p->start_mb);
va_TraceMsg(idx, "\t\tend_mb = %d\n", p->end_mb); va_TraceMsg(idx, "\t\tend_mb = %d\n", p->end_mb);
p++; /* next error record */ p++; /* next error record */
} }
} }
va_TraceMsg(idx, NULL);
} }
void va_TraceMaxNumDisplayAttributes ( void va_TraceMaxNumDisplayAttributes (
...@@ -1740,12 +1790,13 @@ void va_TraceMaxNumDisplayAttributes ( ...@@ -1740,12 +1790,13 @@ void va_TraceMaxNumDisplayAttributes (
TRACE_FUNCNAME(idx); TRACE_FUNCNAME(idx);
va_TraceMsg(idx, "\tmax_display_attributes = %d\n", number); va_TraceMsg(idx, "\tmax_display_attributes = %d\n", number);
va_TraceMsg(idx, NULL);
} }
void va_TraceQueryDisplayAttributes ( void va_TraceQueryDisplayAttributes (
VADisplay dpy, VADisplay dpy,
VADisplayAttribute *attr_list, /* out */ VADisplayAttribute *attr_list, /* out */
int *num_attributes /* out */ int *num_attributes /* out */
) )
{ {
int i; int i;
...@@ -1762,6 +1813,7 @@ void va_TraceQueryDisplayAttributes ( ...@@ -1762,6 +1813,7 @@ void va_TraceQueryDisplayAttributes (
va_TraceMsg(idx, "\t value = %d\n", attr_list[i].value); va_TraceMsg(idx, "\t value = %d\n", attr_list[i].value);
va_TraceMsg(idx, "\t flags = %d\n", attr_list[i].flags); va_TraceMsg(idx, "\t flags = %d\n", attr_list[i].flags);
} }
va_TraceMsg(idx, NULL);
} }
...@@ -1784,6 +1836,7 @@ static void va_TraceDisplayAttributes ( ...@@ -1784,6 +1836,7 @@ static void va_TraceDisplayAttributes (
va_TraceMsg(idx, "\t value = %d\n", attr_list[i].value); va_TraceMsg(idx, "\t value = %d\n", attr_list[i].value);
va_TraceMsg(idx, "\t flags = %d\n", attr_list[i].flags); va_TraceMsg(idx, "\t flags = %d\n", attr_list[i].flags);
} }
va_TraceMsg(idx, NULL);
} }
...@@ -1848,4 +1901,5 @@ void va_TracePutSurface ( ...@@ -1848,4 +1901,5 @@ void va_TracePutSurface (
va_TraceMsg(idx, "\tcliprects = 0x%08x\n", cliprects); va_TraceMsg(idx, "\tcliprects = 0x%08x\n", cliprects);
va_TraceMsg(idx, "\tnumber_cliprects = %d\n", number_cliprects); va_TraceMsg(idx, "\tnumber_cliprects = %d\n", number_cliprects);
va_TraceMsg(idx, "\tflags = 0x%08x\n", flags); va_TraceMsg(idx, "\tflags = 0x%08x\n", flags);
va_TraceMsg(idx, NULL);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment