X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=va%2Fva_trace.c;h=421fe6d4a757e8d986557ad106b806a974316f90;hb=08fd3ba492333d94256929ccf52d7eebf9eca134;hp=d2893833f5ad88e965b18a969f7cb96dea125d84;hpb=881b49c5f154ee6603eee4aebb8becae6097a4bd;p=android-x86%2Fhardware-intel-common-libva.git diff --git a/va/va_trace.c b/va/va_trace.c index d289383..421fe6d 100644 --- a/va/va_trace.c +++ b/va/va_trace.c @@ -1,5 +1,5 @@ /* - * 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 * copy of this software and associated documentation files (the @@ -24,8 +24,10 @@ #define _GNU_SOURCE 1 #include "va.h" +#include "va_enc_h264.h" #include "va_backend.h" #include "va_trace.h" +#include "va_enc_h264.h" #include #include @@ -38,30 +40,29 @@ #include #include #include - +#include /* * Env. to debug some issue, e.g. the decode/encode issue in a video conference scenerio: * .LIBVA_TRACE=log_file: general VA parameters saved into log_file * .LIBVA_TRACE_BUFDATA: dump VA buffer data into log_file (if not set, just calculate a checksum) * .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=yuv_file: save surface YUV into file yuv_file. Use file name to determine + * decode/encode or jpeg surfaces + * .LIBVA_TRACE_SURFACE_GEOMETRY=WIDTHxHEIGHT+XOFF+YOFF: only save part of surface context into file + * due to storage bandwidth limitation * .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 */ - /* global settings */ /* LIBVA_TRACE */ -unsigned int trace_flag = 0; +int trace_flag = 0; /* LIBVA_TRACE_LOGSIZE */ static unsigned int trace_logsize = 0xffffffff; /* truncate the log when the size is bigger than it */ -/* LIBVA_TRACE_BUFDATA */ -static unsigned int trace_buffer_data; /* dump buffer data or not */ - #define TRACE_CONTEXT_MAX 4 /* per context settings */ static struct _trace_context { @@ -69,15 +70,15 @@ static struct _trace_context { /* LIBVA_TRACE */ FILE *trace_fp_log; /* save the log into a file */ - char trace_log_fn[1024]; /* file name */ + char *trace_log_fn; /* file name */ /* LIBVA_TRACE_CODEDBUF */ FILE *trace_fp_codedbuf; /* save the encode result into a file */ - char trace_codedbuf_fn[1024]; /* file name */ + char *trace_codedbuf_fn; /* file name */ /* LIBVA_TRACE_SURFACE */ FILE *trace_fp_surface; /* save the surface YUV into a file */ - char trace_surface_fn[1024]; /* file name */ + char *trace_surface_fn; /* file name */ VAContextID trace_context; /* current context */ @@ -90,10 +91,15 @@ static struct _trace_context { unsigned int trace_slice_no; /* current slice NO */ unsigned int trace_slice_size; /* current slice buffer size */ + unsigned int trace_surface_width; /* surface dumping geometry */ + unsigned int trace_surface_height; + unsigned int trace_surface_xoff; + unsigned int trace_surface_yoff; + unsigned int trace_frame_width; /* current frame width */ unsigned int trace_frame_height; /* current frame height */ unsigned int trace_sequence_start; /* get a new sequence for encoding or not */ -} trace_context[TRACE_CONTEXT_MAX] = { {0} }; /* trace five context at the same time */ +} trace_context[TRACE_CONTEXT_MAX]; /* trace five context at the same time */ #define DPY2INDEX(dpy) \ int idx; \ @@ -116,35 +122,46 @@ int va_parseConfig(char *env, char *env_value); VAStatus vaBufferInfo( VADisplay dpy, - VAContextID context, /* in */ - VABufferID buf_id, /* in */ - VABufferType *type, /* out */ - unsigned int *size, /* out */ - unsigned int *num_elements /* out */ -); + VAContextID context, /* in */ + VABufferID buf_id, /* in */ + VABufferType *type, /* out */ + unsigned int *size, /* out */ + unsigned int *num_elements /* out */ + ); VAStatus vaLockSurface(VADisplay dpy, - VASurfaceID surface, - unsigned int *fourcc, /* following are output argument */ - unsigned int *luma_stride, - unsigned int *chroma_u_stride, - unsigned int *chroma_v_stride, - unsigned int *luma_offset, - unsigned int *chroma_u_offset, - unsigned int *chroma_v_offset, - unsigned int *buffer_name, - void **buffer -); + VASurfaceID surface, + unsigned int *fourcc, /* following are output argument */ + unsigned int *luma_stride, + unsigned int *chroma_u_stride, + unsigned int *chroma_v_stride, + unsigned int *luma_offset, + unsigned int *chroma_u_offset, + unsigned int *chroma_v_offset, + unsigned int *buffer_name, + void **buffer + ); VAStatus vaUnlockSurface(VADisplay dpy, - VASurfaceID surface -); + VASurfaceID surface + ); +#define FILE_NAME_SUFFIX(env_value) \ +do { \ + int tmp = strnlen(env_value, sizeof(env_value)); \ + int left = sizeof(env_value) - tmp; \ + \ + snprintf(env_value+tmp, \ + left, \ + ".%04d.%05d", \ + trace_index, \ + suffix); \ +} while (0) void va_TraceInit(VADisplay dpy) { char env_value[1024]; - unsigned int suffix = 0xffff & ((unsigned int)time(NULL)); + unsigned short suffix = 0xffff & ((unsigned int)time(NULL)); int trace_index = 0; FILE *tmp; @@ -155,69 +172,77 @@ void va_TraceInit(VADisplay dpy) if (trace_index == TRACE_CONTEXT_MAX) return; + memset(&trace_context[trace_index], 0, sizeof(struct _trace_context)); if (va_parseConfig("LIBVA_TRACE", &env_value[0]) == 0) { - trace_flag = 1; + FILE_NAME_SUFFIX(env_value); + trace_context[trace_index].trace_log_fn = strdup(env_value); - sprintf(env_value+strlen(env_value), ".%d.%d", trace_index, suffix); - tmp = fopen(env_value, "w"); - if (tmp) { + if (tmp) { trace_context[trace_index].trace_fp_log = tmp; - strcpy(trace_context[trace_index].trace_log_fn, env_value); - } else { - trace_context[trace_index].trace_fp_log = stderr; - strcpy(trace_context[trace_index].trace_codedbuf_fn, "/dev/stderr"); - } - va_infoMessage("LIBVA_TRACE is on, save log into %s\n", trace_context[trace_index].trace_log_fn); + va_infoMessage("LIBVA_TRACE is on, save log into %s\n", trace_context[trace_index].trace_log_fn); + trace_flag = VA_TRACE_FLAG_LOG; + } else + va_errorMessage("Open file %s failed (%s)\n", env_value, strerror(errno)); } - if (trace_flag == 0) - return; - /* may re-get the global settings for multiple context */ if (va_parseConfig("LIBVA_TRACE_LOGSIZE", &env_value[0]) == 0) { trace_logsize = atoi(env_value); va_infoMessage("LIBVA_TRACE_LOGSIZE is on, size is %d\n", trace_logsize); } - - if (va_parseConfig("LIBVA_TRACE_BUFDATA", NULL) == 0) { - trace_buffer_data = 1; /* dump buffer data */ + if ((trace_flag & VA_TRACE_FLAG_LOG) && (va_parseConfig("LIBVA_TRACE_BUFDATA", NULL) == 0)) { + trace_flag |= VA_TRACE_FLAG_BUFDATA; va_infoMessage("LIBVA_TRACE_BUFDATA is on, dump buffer into log file\n"); } - /* per-context setting */ if (va_parseConfig("LIBVA_TRACE_CODEDBUF", &env_value[0]) == 0) { - sprintf(env_value+strlen(env_value), ".%d.%d", trace_index, suffix); - - tmp = fopen(env_value, "w"); - - if (tmp) { - trace_context[trace_index].trace_fp_codedbuf = tmp; - strcpy(trace_context[trace_index].trace_codedbuf_fn, env_value); - } else { - trace_context[trace_index].trace_fp_codedbuf = stderr; - strcpy(trace_context[trace_index].trace_codedbuf_fn, "/dev/stderr"); - } - - va_infoMessage("LIBVA_TRACE_CODEDBUF is on, save coded clip into %s\n", trace_context[trace_index].trace_codedbuf_fn); + FILE_NAME_SUFFIX(env_value); + trace_context[trace_index].trace_codedbuf_fn = strdup(env_value); + va_infoMessage("LIBVA_TRACE_CODEDBUF is on, save codedbuf into log file %s\n", + trace_context[trace_index].trace_codedbuf_fn); + trace_flag |= VA_TRACE_FLAG_CODEDBUF; } if (va_parseConfig("LIBVA_TRACE_SURFACE", &env_value[0]) == 0) { - sprintf(env_value+strlen(env_value), ".%d.%d", trace_index, suffix); - - tmp = fopen(env_value, "w"); - - if (tmp) { - trace_context[trace_index].trace_fp_surface = tmp; - strcpy(trace_context[trace_index].trace_surface_fn, env_value); - } else { - trace_context[trace_index].trace_fp_surface = stderr; - strcpy(trace_context[trace_index].trace_surface_fn, "/dev/stderr"); + FILE_NAME_SUFFIX(env_value); + trace_context[trace_index].trace_surface_fn = strdup(env_value); + + va_infoMessage("LIBVA_TRACE_SURFACE is on, save surface into %s\n", + trace_context[trace_index].trace_surface_fn); + + /* for surface data dump, it is time-consume, and may + * cause some side-effect, so only trace the needed surfaces + * to trace encode surface, set the trace file name to sth like *enc* + * to trace decode surface, set the trace file name to sth like *dec* + * if no dec/enc in file name, set both + */ + if (strstr(env_value, "dec")) + trace_flag |= VA_TRACE_FLAG_SURFACE_DECODE; + if (strstr(env_value, "enc")) + trace_flag |= VA_TRACE_FLAG_SURFACE_ENCODE; + if (strstr(env_value, "jpeg") || strstr(env_value, "jpg")) + trace_flag |= VA_TRACE_FLAG_SURFACE_JPEG; + + if (va_parseConfig("LIBVA_TRACE_SURFACE_GEOMETRY", &env_value[0]) == 0) { + char *p = env_value, *q; + + trace_context[trace_index].trace_surface_width = strtod(p, &q); + p = q+1; /* skip "x" */ + trace_context[trace_index].trace_surface_height = strtod(p, &q); + p = q+1; /* skip "+" */ + trace_context[trace_index].trace_surface_xoff = strtod(p, &q); + p = q+1; /* skip "+" */ + trace_context[trace_index].trace_surface_yoff = strtod(p, &q); + + va_infoMessage("LIBVA_TRACE_SURFACE_GEOMETRY is on, only dump surface %dx%d+%d+%d content\n", + trace_context[trace_index].trace_surface_width, + trace_context[trace_index].trace_surface_height, + trace_context[trace_index].trace_surface_xoff, + trace_context[trace_index].trace_surface_yoff); } - - va_infoMessage("LIBVA_TRACE_SURFACE is on, save coded clip into %s\n", trace_context[trace_index].trace_surface_fn); } trace_context[trace_index].dpy = dpy; @@ -228,18 +253,28 @@ void va_TraceEnd(VADisplay dpy) { DPY2INDEX(dpy); - if (trace_context[idx].trace_fp_log && (trace_context[idx].trace_fp_log != stderr)) + if (trace_context[idx].trace_fp_log) fclose(trace_context[idx].trace_fp_log); - if (trace_context[idx].trace_fp_codedbuf && (trace_context[idx].trace_fp_codedbuf != stderr)) + if (trace_context[idx].trace_fp_codedbuf) fclose(trace_context[idx].trace_fp_codedbuf); - if (trace_context[idx].trace_fp_surface && (trace_context[idx].trace_fp_surface != stderr)) + if (trace_context[idx].trace_fp_surface) fclose(trace_context[idx].trace_fp_surface); - memset(&trace_context[idx], sizeof(struct _trace_context), 0); + if (trace_context[idx].trace_log_fn) + free(trace_context[idx].trace_log_fn); + + if (trace_context[idx].trace_codedbuf_fn) + free(trace_context[idx].trace_codedbuf_fn); + + if (trace_context[idx].trace_surface_fn) + free(trace_context[idx].trace_surface_fn); + + memset(&trace_context[idx], 0, sizeof(struct _trace_context)); } + static unsigned int file_size(FILE *fp) { struct stat buf; @@ -260,9 +295,11 @@ void va_TraceMsg(int idx, const char *msg, ...) { va_list args; + if (!(trace_flag & VA_TRACE_FLAG_LOG)) + return; + if (file_size(trace_context[idx].trace_fp_log) >= trace_logsize) truncate_file(trace_context[idx].trace_fp_log); - if (msg) { va_start(args, msg); vfprintf(trace_context[idx].trace_fp_log, msg, args); @@ -298,7 +335,7 @@ void va_TraceCodedBuf(VADisplay dpy) unsigned int i; va_TraceMsg(idx, "\tsize = %d\n", buf_list->size); - if (trace_context[idx].trace_fp_log) + if (trace_context[idx].trace_fp_codedbuf) fwrite(buf_list->buf, buf_list->size, 1, trace_context[idx].trace_fp_codedbuf); for (i=0; isize; i++) @@ -309,6 +346,7 @@ void va_TraceCodedBuf(VADisplay dpy) vaUnmapBuffer(dpy,trace_context[idx].trace_codedbuf); va_TraceMsg(idx, "\tchecksum = 0x%02x\n", check_sum); + va_TraceMsg(idx, NULL); } @@ -328,22 +366,25 @@ void va_TraceSurface(VADisplay dpy) VAStatus va_status; unsigned char check_sum = 0; DPY2INDEX(dpy); - + va_TraceMsg(idx, "==========dump surface data in file %s\n", trace_context[idx].trace_surface_fn); if ((file_size(trace_context[idx].trace_fp_surface) >= trace_logsize)) { va_TraceMsg(idx, "==========truncate file %s\n", trace_context[idx].trace_surface_fn); truncate_file(trace_context[idx].trace_fp_surface); } + va_TraceMsg(idx, NULL); - va_status = vaLockSurface(dpy, trace_context[idx].trace_rendertarget, &fourcc, - &luma_stride, &chroma_u_stride, &chroma_v_stride, - &luma_offset, &chroma_u_offset, &chroma_v_offset, - &buffer_name, &buffer); + va_status = vaLockSurface( + dpy, + trace_context[idx].trace_rendertarget, + &fourcc, + &luma_stride, &chroma_u_stride, &chroma_v_stride, + &luma_offset, &chroma_u_offset, &chroma_v_offset, + &buffer_name, &buffer); if (va_status != VA_STATUS_SUCCESS) { va_TraceMsg(idx, "Error:vaLockSurface failed\n"); - return; } @@ -357,46 +398,65 @@ void va_TraceSurface(VADisplay dpy) va_TraceMsg(idx, "\tchroma_u_offset = %d\n", chroma_u_offset); va_TraceMsg(idx, "\tchroma_v_offset = %d\n", chroma_v_offset); - if (*(unsigned int *)buffer == 0) { + if (buffer == NULL) { va_TraceMsg(idx, "Error:vaLockSurface return NULL buffer\n"); - + va_TraceMsg(idx, NULL); + vaUnlockSurface(dpy, trace_context[idx].trace_rendertarget); return; } va_TraceMsg(idx, "\tbuffer location = 0x%08x\n", buffer); + va_TraceMsg(idx, NULL); - Y_data = buffer; - UV_data = buffer + chroma_u_offset; - - tmp = Y_data; - for (i=0; inext; } - - + va_TraceMsg(idx, NULL); } static void va_TraceVABuffers( @@ -569,16 +673,17 @@ static void va_TraceVABuffers( for (i=0; ihorizontal_size); + va_TraceMsg(idx,"\tvertical size= %d\n", p->vertical_size); + va_TraceMsg(idx,"\tforward reference picture= %d\n", p->forward_reference_picture); + va_TraceMsg(idx,"\tbackward reference picture= %d\n", p->backward_reference_picture); + va_TraceMsg(idx,"\tpicture coding type= %d\n", p->picture_coding_type); + va_TraceMsg(idx,"\tf mode= %d\n", p->f_code); + + va_TraceMsg(idx,"\tpicture coding extension = %d\n", p->picture_coding_extension.value); + va_TraceMsg(idx,"\tintra_dc_precision= %d\n", p->picture_coding_extension.bits.intra_dc_precision); + va_TraceMsg(idx,"\tpicture_structure= %d\n", p->picture_coding_extension.bits.picture_structure); + va_TraceMsg(idx,"\ttop_field_first= %d\n", p->picture_coding_extension.bits.top_field_first); + va_TraceMsg(idx,"\tframe_pred_frame_dct= %d\n", p->picture_coding_extension.bits.frame_pred_frame_dct); + va_TraceMsg(idx,"\tconcealment_motion_vectors= %d\n", p->picture_coding_extension.bits.concealment_motion_vectors); + va_TraceMsg(idx,"\tq_scale_type= %d\n", p->picture_coding_extension.bits.q_scale_type); + va_TraceMsg(idx,"\tintra_vlc_format= %d\n", p->picture_coding_extension.bits.intra_vlc_format); + va_TraceMsg(idx,"\talternate_scan= %d\n", p->picture_coding_extension.bits.alternate_scan); + 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,"\tis_first_field= %d\n", p->picture_coding_extension.bits.is_first_field); + va_TraceMsg(idx, NULL); + return; } @@ -610,10 +737,21 @@ static void va_TraceVAIQMatrixBufferMPEG2( unsigned int num_elements, void *data) { + VAIQMatrixBufferMPEG2 *p=(VAIQMatrixBufferMPEG2 *)data; DPY2INDEX(dpy); - - va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, data); - + + va_TraceMsg(idx,"VAIQMatrixBufferMPEG2\n"); + + va_TraceMsg(idx,"\tload_intra_quantiser_matrix = %d\n", p->load_intra_quantiser_matrix); + va_TraceMsg(idx,"\tload_non_intra_quantiser_matrix = %d\n", p->load_non_intra_quantiser_matrix); + va_TraceMsg(idx,"\tload_chroma_intra_quantiser_matrix = %d\n", p->load_chroma_intra_quantiser_matrix); + va_TraceMsg(idx,"\tload_chroma_non_intra_quantiser_matrix = %d\n", p->load_chroma_non_intra_quantiser_matrix); + va_TraceMsg(idx,"\tintra_quantiser_matrix = %d\n", p->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_non_intra_quantiser_matrix = %d\n", p->chroma_non_intra_quantiser_matrix); + va_TraceMsg(idx, NULL); + return; } @@ -627,20 +765,120 @@ static void va_TraceVASliceParameterBufferMPEG2( unsigned int num_elements, void *data) { + VASliceParameterBufferMPEG2 *p=(VASliceParameterBufferMPEG2 *)data; + DPY2INDEX(dpy); trace_context[idx].trace_slice_no++; - /* todo: log TraceVASliceParameterBufferMPEG2 */ - /* trace_context[idx].trace_slice_size = p->slice_data_size; */ - va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, data); + trace_context[idx].trace_slice_size = p->slice_data_size; + + va_TraceMsg(idx,"VASliceParameterBufferMPEG2\n"); + + va_TraceMsg(idx,"\tslice_data_size = %d\n", p->slice_data_size); + va_TraceMsg(idx,"\tslice_data_offset = %d\n", p->slice_data_offset); + 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,"\tslice_horizontal_position = %d\n", p->slice_horizontal_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,"\tintra_slice_flag = %d\n", p->intra_slice_flag); + va_TraceMsg(idx, NULL); + + return; +} + + +static void va_TraceVAPictureParameterBufferMPEG4( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void *data) +{ + int i; + VAPictureParameterBufferMPEG4 *p=(VAPictureParameterBufferMPEG4 *)data; + DPY2INDEX(dpy); + + va_TraceMsg(idx,"*VAPictureParameterBufferMPEG4\n"); + va_TraceMsg(idx,"\tvop_width = %d\n", p->vop_width); + va_TraceMsg(idx,"\tvop_height = %d\n", p->vop_height); + va_TraceMsg(idx,"\tforward_reference_picture = %d\n", p->forward_reference_picture); + va_TraceMsg(idx,"\tbackward_reference_picture = %d\n", p->backward_reference_picture); + va_TraceMsg(idx,"\tvol_fields value = %d\n", p->vol_fields.value); + va_TraceMsg(idx,"\tshort_video_header= %d\n", p->vol_fields.bits.short_video_header); + va_TraceMsg(idx,"\tchroma_format= %d\n", p->vol_fields.bits.chroma_format); + va_TraceMsg(idx,"\tinterlaced= %d\n", p->vol_fields.bits.interlaced); + va_TraceMsg(idx,"\tobmc_disable= %d\n", p->vol_fields.bits.obmc_disable); + va_TraceMsg(idx,"\tsprite_enable= %d\n", p->vol_fields.bits.sprite_enable); + va_TraceMsg(idx,"\tsprite_warping_accuracy= %d\n", p->vol_fields.bits.sprite_warping_accuracy); + va_TraceMsg(idx,"\tquant_type= %d\n", p->vol_fields.bits.quant_type); + va_TraceMsg(idx,"\tquarter_sample= %d\n", p->vol_fields.bits.quarter_sample); + va_TraceMsg(idx,"\tdata_partitioned= %d\n", p->vol_fields.bits.data_partitioned); + va_TraceMsg(idx,"\treversible_vlc= %d\n", p->vol_fields.bits.reversible_vlc); + va_TraceMsg(idx,"\tresync_marker_disable= %d\n", p->vol_fields.bits.resync_marker_disable); + va_TraceMsg(idx,"\tno_of_sprite_warping_points = %d\n", p->no_of_sprite_warping_points); + va_TraceMsg(idx,"\tsprite_trajectory_du ="); + for(i=0;i<3;i++) + va_TraceMsg(idx,"\t%d", p->sprite_trajectory_du[i]); + + va_TraceMsg(idx,"\n"); + va_TraceMsg(idx,"\tsprite_trajectory_dv ="); + for(i=0;i<3;i++) + va_TraceMsg(idx,"\t%d", p->sprite_trajectory_dv[i]); + va_TraceMsg(idx,"\n"); + 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,"\tbackward_reference_vop_coding_type= %d\n", p->vop_fields.bits.backward_reference_vop_coding_type); + va_TraceMsg(idx,"\tvop_rounding_type= %d\n", p->vop_fields.bits.vop_rounding_type); + va_TraceMsg(idx,"\tintra_dc_vlc_thr= %d\n", p->vop_fields.bits.intra_dc_vlc_thr); + va_TraceMsg(idx,"\ttop_field_first= %d\n", p->vop_fields.bits.top_field_first); + va_TraceMsg(idx,"\talternate_vertical_scan_flag= %d\n", p->vop_fields.bits.alternate_vertical_scan_flag); + va_TraceMsg(idx,"\tvop_fcode_forward = %d\n", p->vop_fcode_forward); + va_TraceMsg(idx,"\tvop_fcode_backward = %d\n", p->vop_fcode_backward); + va_TraceMsg(idx,"\tnum_gobs_in_vop = %d\n", p->num_gobs_in_vop); + 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,"\tTRD = %d\n", p->TRD); + va_TraceMsg(idx, NULL); + return; } +static void va_TraceVAIQMatrixBufferMPEG4( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void *data) +{ + int i; + VAIQMatrixBufferMPEG4 *p=(VAIQMatrixBufferMPEG4 *)data; + DPY2INDEX(dpy); + + va_TraceMsg(idx,"VAIQMatrixBufferMPEG4\n"); + + va_TraceMsg(idx,"\tload_intra_quant_mat = %d\n", p->load_intra_quant_mat); + va_TraceMsg(idx,"\tload_non_intra_quant_mat = %d\n", p->load_non_intra_quant_mat); + va_TraceMsg(idx,"\tintra_quant_mat =\n"); + for(i=0;i<64;i++) + va_TraceMsg(idx,"\t\t%d\n", p->intra_quant_mat[i]); -static void va_TraceVAPictureParameterBufferMPEG4( + va_TraceMsg(idx,"\tnon_intra_quant_mat =\n"); + for(i=0;i<64;i++) + va_TraceMsg(idx,"\t\t%d\n", p->non_intra_quant_mat[i]); + va_TraceMsg(idx, NULL); + + return; +} + +static void va_TraceVAEncSequenceParameterBufferMPEG4( VADisplay dpy, VAContextID context, VABufferID buffer, @@ -649,15 +887,31 @@ static void va_TraceVAPictureParameterBufferMPEG4( unsigned int num_elements, void *data) { + VAEncSequenceParameterBufferMPEG4 *p = (VAEncSequenceParameterBufferMPEG4 *)data; DPY2INDEX(dpy); - va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, data); + va_TraceMsg(idx, "VAEncSequenceParameterBufferMPEG4\n"); + va_TraceMsg(idx, "\tprofile_and_level_indication = %d\n", p->profile_and_level_indication); + va_TraceMsg(idx, "\tintra_period = %d\n", p->intra_period); + va_TraceMsg(idx, "\tvideo_object_layer_width = %d\n", p->video_object_layer_width); + va_TraceMsg(idx, "\tvideo_object_layer_height = %d\n", p->video_object_layer_height); + va_TraceMsg(idx, "\tvop_time_increment_resolution = %d\n", p->vop_time_increment_resolution); + va_TraceMsg(idx, "\tfixed_vop_rate = %d\n", p->fixed_vop_rate); + va_TraceMsg(idx, "\tfixed_vop_time_increment = %d\n", p->fixed_vop_time_increment); + va_TraceMsg(idx, "\tbits_per_second = %d\n", p->bits_per_second); + va_TraceMsg(idx, "\tframe_rate = %d\n", p->frame_rate); + va_TraceMsg(idx, "\tinitial_qp = %d\n", p->initial_qp); + va_TraceMsg(idx, "\tmin_qp = %d\n", p->min_qp); + va_TraceMsg(idx, NULL); + + /* start a new sequce, coded log file can be truncated */ + trace_context[idx].trace_sequence_start = 1; + return; } - -static void va_TraceVAIQMatrixBufferMPEG4( +static void va_TraceVAEncPictureParameterBufferMPEG4( VADisplay dpy, VAContextID context, VABufferID buffer, @@ -666,10 +920,21 @@ static void va_TraceVAIQMatrixBufferMPEG4( unsigned int num_elements, void *data) { + VAEncPictureParameterBufferMPEG4 *p = (VAEncPictureParameterBufferMPEG4 *)data; DPY2INDEX(dpy); + + va_TraceMsg(idx, "VAEncPictureParameterBufferMPEG4\n"); + va_TraceMsg(idx, "\treference_picture = 0x%08x\n", p->reference_picture); + va_TraceMsg(idx, "\treconstructed_picture = 0x%08x\n", p->reconstructed_picture); + va_TraceMsg(idx, "\tcoded_buf = %08x\n", p->coded_buf); + va_TraceMsg(idx, "\tpicture_width = %d\n", p->picture_width); + va_TraceMsg(idx, "\tpicture_height = %d\n", p->picture_height); + va_TraceMsg(idx, "\tmodulo_time_base = %d\n", p->modulo_time_base); + va_TraceMsg(idx, "\tvop_time_increment = %d\n", p->vop_time_increment); + va_TraceMsg(idx, "\tpicture_type = %d\n", p->picture_type); + va_TraceMsg(idx, NULL); - /* todo: log VAIQMatrixBufferMPEG4 */ - va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, data); + trace_context[idx].trace_codedbuf = p->coded_buf; return; } @@ -684,18 +949,40 @@ static void va_TraceVASliceParameterBufferMPEG4( unsigned int num_elements, void *data) { + VASliceParameterBufferMPEG4 *p=(VASliceParameterBufferMPEG4 *)data; + DPY2INDEX(dpy); trace_context[idx].trace_slice_no++; - /* todo: log VASliceParameterBufferMPEG4 */ - /* trace_context[idx].trace_slice_size = p->slice_data_size; */ - va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, data); - + trace_context[idx].trace_slice_size = p->slice_data_size; + + va_TraceMsg(idx,"VASliceParameterBufferMPEG4\n"); + + va_TraceMsg(idx,"\tslice_data_size = %d\n", p->slice_data_size); + va_TraceMsg(idx,"\tslice_data_offset = %d\n", p->slice_data_offset); + 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_number = %d\n", p->macroblock_number); + va_TraceMsg(idx,"\tquant_scale = %d\n", p->quant_scale); + va_TraceMsg(idx, NULL); + 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( VADisplay dpy, VAContextID context, @@ -706,13 +993,13 @@ static void va_TraceVAPictureParameterBufferH264( void *data) { int i; - DPY2INDEX(dpy); - VAPictureParameterBufferH264 *p = (VAPictureParameterBufferH264*)data; + + DPY2INDEX(dpy); 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.flags = %d\n", p->CurrPic.flags); va_TraceMsg(idx, "\tCurrPic.TopFieldOrderCnt = %d\n", p->CurrPic.TopFieldOrderCnt); @@ -722,13 +1009,13 @@ static void va_TraceVAPictureParameterBufferH264( for (i = 0; i < 16; i++) { 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].BottomFieldOrderCnt, p->ReferenceFrames[i].picture_id, p->ReferenceFrames[i].frame_idx); } else - va_TraceMsg(idx, "\t\t%inv-%inv-%inv-%inv\n"); + va_TraceMsg(idx, "\t\tinv-inv-inv-inv\n"); } va_TraceMsg(idx, "\n"); @@ -751,14 +1038,19 @@ static void va_TraceVAPictureParameterBufferH264( 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, "\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, "\tentropy_coding_mode_flag = %d\n", p->pic_fields.bits.entropy_coding_mode_flag); - va_TraceMsg(idx, "\tweighted_pred_flag = %d\n", p->pic_fields.bits.weighted_pred_flag); - va_TraceMsg(idx, "\tweighted_bipred_idc = %d\n", 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_TraceMsg(idx, "\tfield_pic_flag = %d\n", 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_TraceMsg(idx, "\tpic_fields = 0x%03x\n", p->pic_fields.value); + va_TraceFlagIfNotZero(idx, "\t\tentropy_coding_mode_flag", p->pic_fields.bits.entropy_coding_mode_flag); + va_TraceFlagIfNotZero(idx, "\t\tweighted_pred_flag", p->pic_fields.bits.weighted_pred_flag); + va_TraceFlagIfNotZero(idx, "\t\tweighted_bipred_idc", p->pic_fields.bits.weighted_bipred_idc); + va_TraceFlagIfNotZero(idx, "\t\ttransform_8x8_mode_flag", p->pic_fields.bits.transform_8x8_mode_flag); + va_TraceFlagIfNotZero(idx, "\t\tfield_pic_flag", p->pic_fields.bits.field_pic_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, NULL); return; } @@ -793,18 +1085,18 @@ static void va_TraceVASliceParameterBufferH264( 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, "\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) { va_TraceMsg(idx, "\tRefPicList0 ="); - 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); + for (i = 0; (i < p->num_ref_idx_l0_active_minus1 + 1 && i < 32); i++) { + 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) { 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 < 32); 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); } } } @@ -818,7 +1110,7 @@ static void va_TraceVASliceParameterBufferH264( va_TraceMsg(idx, "\t%d ", p->luma_offset_l0[i]); } } - + va_TraceMsg(idx, "\tchroma_weight_l0_flag = %d\n", p->chroma_weight_l0_flag); if (p->chroma_weight_l0_flag) { for (i = 0; i <= p->num_ref_idx_l0_active_minus1; i++) { @@ -845,8 +1137,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_offset_l1[i][1]); } - va_TraceMsg(idx, "\n"); - } + va_TraceMsg(idx, "\n"); + } + va_TraceMsg(idx, NULL); } static void va_TraceVAIQMatrixBufferH264( @@ -859,8 +1152,9 @@ static void va_TraceVAIQMatrixBufferH264( void *data ) { + int i, j; VAIQMatrixBufferH264* p = (VAIQMatrixBufferH264* )data; - int i, j; + DPY2INDEX(dpy); va_TraceMsg(idx, "VAIQMatrixBufferH264\n"); @@ -880,10 +1174,14 @@ static void va_TraceVAIQMatrixBufferH264( va_TraceMsg(idx, "\t%d", p->ScalingList8x8[i][j]); if ((j + 1) % 8 == 0) va_TraceMsg(idx, "\n"); - } + } } + + va_TraceMsg(idx, NULL); } + + static void va_TraceVAEncSequenceParameterBufferH264( VADisplay dpy, VAContextID context, @@ -895,28 +1193,61 @@ static void va_TraceVAEncSequenceParameterBufferH264( { VAEncSequenceParameterBufferH264 *p = (VAEncSequenceParameterBufferH264 *)data; DPY2INDEX(dpy); - + int i; + va_TraceMsg(idx, "VAEncSequenceParameterBufferH264\n"); - + va_TraceMsg(idx, "\tseq_parameter_set_id = %d\n", p->seq_parameter_set_id); va_TraceMsg(idx, "\tlevel_idc = %d\n", p->level_idc); va_TraceMsg(idx, "\tintra_period = %d\n", p->intra_period); va_TraceMsg(idx, "\tintra_idr_period = %d\n", p->intra_idr_period); + va_TraceMsg(idx, "\tip_period = %d\n", p->ip_period); + va_TraceMsg(idx, "\tbits_per_second = %d\n", p->bits_per_second); + va_TraceMsg(idx, "\tmax_num_ref_frames = %d\n", p->max_num_ref_frames); va_TraceMsg(idx, "\tpicture_width_in_mbs = %d\n", p->picture_width_in_mbs); va_TraceMsg(idx, "\tpicture_height_in_mbs = %d\n", p->picture_height_in_mbs); - va_TraceMsg(idx, "\tbits_per_second = %d\n", p->bits_per_second); - va_TraceMsg(idx, "\tframe_rate = %d\n", p->frame_rate); - va_TraceMsg(idx, "\tinitial_qp = %d\n", p->initial_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, "\tvui_flag = %d\n", p->vui_flag); + va_TraceMsg(idx, "\tchroma_format_idc = %d\n", p->seq_fields.bits.chroma_format_idc); + va_TraceMsg(idx, "\tframe_mbs_only_flag = %d\n", p->seq_fields.bits.frame_mbs_only_flag); + va_TraceMsg(idx, "\tmb_adaptive_frame_field_flag = %d\n", p->seq_fields.bits.mb_adaptive_frame_field_flag); + va_TraceMsg(idx, "\tseq_scaling_matrix_present_flag = %d\n", p->seq_fields.bits.seq_scaling_matrix_present_flag); + va_TraceMsg(idx, "\tdirect_8x8_inference_flag = %d\n", p->seq_fields.bits.direct_8x8_inference_flag); + va_TraceMsg(idx, "\tlog2_max_frame_num_minus4 = %d\n", p->seq_fields.bits.log2_max_frame_num_minus4); + va_TraceMsg(idx, "\tpic_order_cnt_type = %d\n", p->seq_fields.bits.pic_order_cnt_type); + va_TraceMsg(idx, "\tlog2_max_pic_order_cnt_lsb_minus4 = %d\n", p->seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4); + va_TraceMsg(idx, "\tdelta_pic_order_always_zero_flag = %d\n", p->seq_fields.bits.delta_pic_order_always_zero_flag); + va_TraceMsg(idx, "\tbit_depth_luma_minus8 = %d\n", p->bit_depth_luma_minus8); + va_TraceMsg(idx, "\tbit_depth_chroma_minus8 = %d\n", p->bit_depth_chroma_minus8); + va_TraceMsg(idx, "\tnum_ref_frames_in_pic_order_cnt_cycle = %d\n", p->num_ref_frames_in_pic_order_cnt_cycle); + va_TraceMsg(idx, "\toffset_for_non_ref_pic = %d\n", p->offset_for_non_ref_pic); + va_TraceMsg(idx, "\toffset_for_top_to_bottom_field = %d\n", p->offset_for_top_to_bottom_field); + for(i = 0; i< p->max_num_ref_frames; ++i) + va_TraceMsg(idx, "\toffset_for_ref_frame[%d] = %d\n", i, p->offset_for_ref_frame[i]); + va_TraceMsg(idx, "\tframe_cropping_flag = %d\n", p->frame_cropping_flag); + va_TraceMsg(idx, "\tframe_crop_left_offset = %d\n", p->frame_crop_left_offset); + va_TraceMsg(idx, "\tframe_crop_right_offset = %d\n", p->frame_crop_right_offset); + va_TraceMsg(idx, "\tframe_crop_top_offset = %d\n", p->frame_crop_top_offset); + va_TraceMsg(idx, "\tframe_crop_bottom_offset = %d\n", p->frame_crop_bottom_offset); + va_TraceMsg(idx, "\tvui_parameters_present_flag = %d\n", p->vui_parameters_present_flag); + va_TraceMsg(idx, "\taspect_ratio_info_present_flag = %d\n", p->vui_fields.bits.aspect_ratio_info_present_flag); + va_TraceMsg(idx, "\ttiming_info_present_flag = %d\n", p->vui_fields.bits.timing_info_present_flag); + va_TraceMsg(idx, "\tbitstream_restriction_flag = %d\n", p->vui_fields.bits.bitstream_restriction_flag); + va_TraceMsg(idx, "\tlog2_max_mv_length_horizontal = %d\n", p->vui_fields.bits.log2_max_mv_length_horizontal); + va_TraceMsg(idx, "\tlog2_max_mv_length_vertical = %d\n", p->vui_fields.bits.log2_max_mv_length_vertical); + va_TraceMsg(idx, "\taspect_ratio_idc = %d\n", p->aspect_ratio_idc); + va_TraceMsg(idx, "\tsar_width = %d\n", p->sar_width); + va_TraceMsg(idx, "\tsar_height = %d\n", p->sar_height); + va_TraceMsg(idx, "\tnum_units_in_tick = %d\n", p->num_units_in_tick); + va_TraceMsg(idx, "\ttime_scale = %d\n", p->time_scale); + + va_TraceMsg(idx, NULL); /* start a new sequce, coded log file can be truncated */ trace_context[idx].trace_sequence_start = 1; - + return; } + static void va_TraceVAEncPictureParameterBufferH264( VADisplay dpy, VAContextID context, @@ -928,21 +1259,57 @@ static void va_TraceVAEncPictureParameterBufferH264( { VAEncPictureParameterBufferH264 *p = (VAEncPictureParameterBufferH264 *)data; DPY2INDEX(dpy); - - va_TraceMsg(idx, "VAEncSequenceParameterBufferH264\n"); - va_TraceMsg(idx, "\treference_picture = 0x%08x\n", p->reference_picture); - va_TraceMsg(idx, "\treconstructed_picture = 0x%08x\n", p->reconstructed_picture); + int i; + + va_TraceMsg(idx, "VAEncPictureParameterBufferH264\n"); + + 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.flags = %d\n", p->CurrPic.flags); + va_TraceMsg(idx, "\tCurrPic.TopFieldOrderCnt = %d\n", p->CurrPic.TopFieldOrderCnt); + va_TraceMsg(idx, "\tCurrPic.BottomFieldOrderCnt = %d\n", p->CurrPic.BottomFieldOrderCnt); + va_TraceMsg(idx, "\tReferenceFrames (TopFieldOrderCnt-BottomFieldOrderCnt-picture_id-frame_idx:\n"); + for (i = 0; i < 16; i++) + { + if (p->ReferenceFrames[i].flags != VA_PICTURE_H264_INVALID) { + va_TraceMsg(idx, "\t\t%d-%d-0x%08x-%d\n", + p->ReferenceFrames[i].TopFieldOrderCnt, + p->ReferenceFrames[i].BottomFieldOrderCnt, + p->ReferenceFrames[i].picture_id, + p->ReferenceFrames[i].frame_idx); + } else + va_TraceMsg(idx, "\t\tinv-inv-inv-inv\n"); + } va_TraceMsg(idx, "\tcoded_buf = %08x\n", p->coded_buf); - va_TraceMsg(idx, "\tpicture_width = %d\n", p->picture_width); - va_TraceMsg(idx, "\tpicture_height = %d\n", p->picture_height); + va_TraceMsg(idx, "\tpic_parameter_set_id = %d\n", p->pic_parameter_set_id); + va_TraceMsg(idx, "\tseq_parameter_set_id = %d\n", p->seq_parameter_set_id); va_TraceMsg(idx, "\tlast_picture = 0x%08x\n", p->last_picture); + va_TraceMsg(idx, "\tframe_num = %d\n", p->frame_num); + va_TraceMsg(idx, "\tpic_init_qp = %d\n", p->pic_init_qp); + va_TraceMsg(idx, "\tnum_ref_idx_l0_active_minus1 = %d\n", p->num_ref_idx_l0_active_minus1); + va_TraceMsg(idx, "\tnum_ref_idx_l1_active_minus1 = %d\n", p->num_ref_idx_l1_active_minus1); + 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, "\tpic_fields = 0x%03x\n", p->pic_fields.value); + va_TraceMsg(idx, "\tidr_pic_flag = %d\n", p->pic_fields.bits.idr_pic_flag); + va_TraceMsg(idx, "\treference_pic_flag = %d\n", p->pic_fields.bits.reference_pic_flag); + va_TraceMsg(idx, "\tentropy_coding_mode_flag = %d\n", p->pic_fields.bits.entropy_coding_mode_flag); + va_TraceMsg(idx, "\tweighted_pred_flag = %d\n", p->pic_fields.bits.weighted_pred_flag); + va_TraceMsg(idx, "\tweighted_bipred_idc = %d\n", p->pic_fields.bits.weighted_bipred_idc); + va_TraceMsg(idx, "\tconstrained_intra_pred_flag = %d\n", p->pic_fields.bits.constrained_intra_pred_flag); + va_TraceMsg(idx, "\ttransform_8x8_mode_flag = %d\n", p->pic_fields.bits.transform_8x8_mode_flag); + va_TraceMsg(idx, "\tdeblocking_filter_control_present_flag = %d\n", p->pic_fields.bits.deblocking_filter_control_present_flag); + va_TraceMsg(idx, "\tredundant_pic_cnt_present_flag = %d\n", p->pic_fields.bits.redundant_pic_cnt_present_flag); + va_TraceMsg(idx, "\tpic_order_present_flag = %d\n", p->pic_fields.bits.pic_order_present_flag); + va_TraceMsg(idx, "\tpic_scaling_matrix_present_flag = %d\n", p->pic_fields.bits.pic_scaling_matrix_present_flag); + + va_TraceMsg(idx, NULL); trace_context[idx].trace_codedbuf = p->coded_buf; - + return; } - static void va_TraceVAEncSliceParameterBuffer( VADisplay dpy, VAContextID context, @@ -961,11 +1328,14 @@ static void va_TraceVAEncSliceParameterBuffer( va_TraceMsg(idx, "\tslice_height = %d\n", p->slice_height); va_TraceMsg(idx, "\tslice_flags.is_intra = %d\n", p->slice_flags.bits.is_intra); 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.is_long_term_ref = %d\n", p->slice_flags.bits.is_long_term_ref); + va_TraceMsg(idx, NULL); + return; } -static void va_TraceVAEncMiscParameterBuffer( +static void va_TraceVAEncSliceParameterBufferH264( VADisplay dpy, VAContextID context, VABufferID buffer, @@ -974,28 +1344,127 @@ static void va_TraceVAEncMiscParameterBuffer( unsigned int num_elements, void *data) { - VAEncMiscParameterBuffer* tmp = (VAEncMiscParameterBuffer*)data; + VAEncSliceParameterBufferH264* p = (VAEncSliceParameterBufferH264*)data; DPY2INDEX(dpy); - - switch (tmp->type) { - case VAEncMiscParameterTypeFrameRate: - { - VAEncMiscParameterFrameRate *p = (VAEncMiscParameterFrameRate *)tmp->data; - va_TraceMsg(idx, "VAEncMiscParameterFrameRate\n"); - va_TraceMsg(idx, "\tframerate = %d\n", p->framerate); - - break; - } - case VAEncMiscParameterTypeRateControl: - { - VAEncMiscParameterRateControl *p = (VAEncMiscParameterRateControl *)tmp->data; + int i; - va_TraceMsg(idx, "VAEncMiscParameterRateControl\n"); - va_TraceMsg(idx, "\tbits_per_second = %d\n", p->bits_per_second); - va_TraceMsg(idx, "\twindow_size = %d\n", p->window_size); - va_TraceMsg(idx, "\tinitial_qp = %d\n", p->initial_qp); - va_TraceMsg(idx, "\tmin_qp = %d\n", p->min_qp); - break; + if (!p) + return; + va_TraceMsg(idx, "VAEncSliceParameterBufferH264\n"); + va_TraceMsg(idx, "\tmacroblock_address = %d\n", p->macroblock_address); + va_TraceMsg(idx, "\tnum_macroblocks = %d\n", p->num_macroblocks); + va_TraceMsg(idx, "\tmacroblock_info = %08x\n", p->macroblock_info); + va_TraceMsg(idx, "\tslice_type = %d\n", p->slice_type); + va_TraceMsg(idx, "\tpic_parameter_set_id = %d\n", p->pic_parameter_set_id); + va_TraceMsg(idx, "\tidr_pic_id = %d\n", p->idr_pic_id); + va_TraceMsg(idx, "\tpic_order_cnt_lsb = %d\n", p->pic_order_cnt_lsb); + va_TraceMsg(idx, "\tdelta_pic_order_cnt_bottom = %d\n", p->delta_pic_order_cnt_bottom); + va_TraceMsg(idx, "\tdelta_pic_order_cnt[0] = %d\n", p->delta_pic_order_cnt[0]); + va_TraceMsg(idx, "\tdelta_pic_order_cnt[1] = %d\n", p->delta_pic_order_cnt[1]); + va_TraceMsg(idx, "\tdirect_spatial_mv_pred_flag = %d\n", p->direct_spatial_mv_pred_flag); + va_TraceMsg(idx, "\tnum_ref_idx_active_override_flag = %d\n", p->num_ref_idx_active_override_flag); + va_TraceMsg(idx, "\tnum_ref_idx_l1_active_minus1 = %d\n", p->num_ref_idx_l1_active_minus1); + va_TraceMsg(idx, "\tslice_beta_offset_div2 = %d\n", p->slice_beta_offset_div2); + + if (p->slice_type == 0 || p->slice_type == 1) { + va_TraceMsg(idx, "\tRefPicList0 ="); + for (i = 0; i < p->num_ref_idx_l0_active_minus1 + 1 && i < 32; i++) { + 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) { + va_TraceMsg(idx, "\tRefPicList1 ="); + for (i = 0; i < p->num_ref_idx_l1_active_minus1 + 1 && i < 32; i++) + { + 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); + } + } + } + + va_TraceMsg(idx, "\tluma_log2_weight_denom = %d\n", p->luma_log2_weight_denom); + va_TraceMsg(idx, "\tchroma_log2_weight_denom = %d\n", p->chroma_log2_weight_denom); + va_TraceMsg(idx, "\tluma_weight_l0_flag = %d\n", p->luma_weight_l0_flag); + if (p->luma_weight_l0_flag && p->num_ref_idx_l0_active_minus1 < 32) { + for (i = 0; i <= p->num_ref_idx_l0_active_minus1; i++) { + va_TraceMsg(idx, "\t%d ", p->luma_weight_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); + if (p->chroma_weight_l0_flag && p->num_ref_idx_l0_active_minus1 < 32) { + for (i = 0; i <= p->num_ref_idx_l0_active_minus1; i++) { + va_TraceMsg(idx, "\t\t%d ", p->chroma_weight_l0[i][0]); + va_TraceMsg(idx, "\t\t%d ", p->chroma_offset_l0[i][0]); + va_TraceMsg(idx, "\t\t%d ", p->chroma_weight_l0[i][1]); + va_TraceMsg(idx, "\t\t%d ", p->chroma_offset_l0[i][1]); + } + } + + va_TraceMsg(idx, "\tluma_weight_l1_flag = %d\n", p->luma_weight_l1_flag); + if (p->luma_weight_l1_flag && p->num_ref_idx_l1_active_minus1 < 32) { + for (i = 0; i <= p->num_ref_idx_l1_active_minus1; i++) { + va_TraceMsg(idx, "\t\t%d ", p->luma_weight_l1[i]); + va_TraceMsg(idx, "\t\t%d ", p->luma_offset_l1[i]); + } + } + + va_TraceMsg(idx, "\tchroma_weight_l1_flag = %d\n", p->chroma_weight_l1_flag); + if (p->chroma_weight_l1_flag && p->num_ref_idx_l1_active_minus1 < 32) { + for (i = 0; i <= p->num_ref_idx_l1_active_minus1; i++) { + va_TraceMsg(idx, "\t\t%d ", p->chroma_weight_l1[i][0]); + va_TraceMsg(idx, "\t\t%d ", p->chroma_offset_l1[i][0]); + 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, "\n"); + } + va_TraceMsg(idx, NULL); + + va_TraceMsg(idx, "\tcabac_init_idc = %d\n", p->cabac_init_idc); + 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, "\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, NULL); + + return; +} + +static void va_TraceVAEncMiscParameterBuffer( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void *data) +{ + VAEncMiscParameterBuffer* tmp = (VAEncMiscParameterBuffer*)data; + DPY2INDEX(dpy); + + switch (tmp->type) { + case VAEncMiscParameterTypeFrameRate: + { + VAEncMiscParameterFrameRate *p = (VAEncMiscParameterFrameRate *)tmp->data; + va_TraceMsg(idx, "VAEncMiscParameterFrameRate\n"); + va_TraceMsg(idx, "\tframerate = %d\n", p->framerate); + + break; + } + case VAEncMiscParameterTypeRateControl: + { + VAEncMiscParameterRateControl *p = (VAEncMiscParameterRateControl *)tmp->data; + + va_TraceMsg(idx, "VAEncMiscParameterRateControl\n"); + va_TraceMsg(idx, "\tbits_per_second = %d\n", p->bits_per_second); + va_TraceMsg(idx, "\twindow_size = %d\n", p->window_size); + va_TraceMsg(idx, "\tinitial_qp = %d\n", p->initial_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, "\trc_flags.reset = %d \n", p->rc_flags.bits.reset); + va_TraceMsg(idx, "\trc_flags.disable_frame_skip = %d\n", p->rc_flags.bits.disable_frame_skip); + va_TraceMsg(idx, "\trc_flags.disable_bit_stuffing = %d\n", p->rc_flags.bits.disable_bit_stuffing); + break; } case VAEncMiscParameterTypeMaxSliceSize: { @@ -1015,11 +1484,21 @@ static void va_TraceVAEncMiscParameterBuffer( va_TraceMsg(idx, "\tair_auto = %d\n", p->air_auto); break; } + case VAEncMiscParameterTypeHRD: + { + VAEncMiscParameterHRD *p = (VAEncMiscParameterHRD *)tmp->data; + + va_TraceMsg(idx, "VAEncMiscParameterHRD\n"); + va_TraceMsg(idx, "\tinitial_buffer_fullness = %d\n", p->initial_buffer_fullness); + va_TraceMsg(idx, "\tbuffer_size = %d\n", p->buffer_size); + break; + } default: va_TraceMsg(idx, "invalid VAEncMiscParameterBuffer type = %d\n", tmp->type); break; } - + va_TraceMsg(idx, NULL); + return; } @@ -1053,6 +1532,7 @@ static void va_TraceVAPictureParameterBufferVC1( 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, "\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_height = %d\n", p->coded_height); va_TraceMsg(idx, "\tclosed_entry = %d\n", p->entrypoint_fields.bits.closed_entry); @@ -1125,6 +1605,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_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, NULL); } static void va_TraceVASliceParameterBufferVC1( @@ -1149,6 +1630,7 @@ static void va_TraceVASliceParameterBufferVC1( 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, "\tslice_vertical_position = %d\n", p->slice_vertical_position); + va_TraceMsg(idx, NULL); } void va_TraceBeginPicture( @@ -1160,9 +1642,11 @@ void va_TraceBeginPicture( DPY2INDEX(dpy); TRACE_FUNCNAME(idx); - + va_TraceMsg(idx, "\tcontext = 0x%08x\n", context); 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, NULL); trace_context[idx].trace_rendertarget = render_target; /* for surface data dump after vaEndPicture */ @@ -1221,9 +1705,219 @@ static void va_TraceMPEG2Buf( break; case VAEncSliceParameterBufferType: break; - case VAEncH264VUIBufferType: + default: break; - case VAEncH264SEIBufferType: + } +} + +static void va_TraceVAEncSequenceParameterBufferH263( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void *data) +{ + VAEncSequenceParameterBufferH263 *p = (VAEncSequenceParameterBufferH263 *)data; + DPY2INDEX(dpy); + + va_TraceMsg(idx, "VAEncSequenceParameterBufferH263\n"); + + va_TraceMsg(idx, "\tintra_period = %d\n", p->intra_period); + va_TraceMsg(idx, "\tbits_per_second = %d\n", p->bits_per_second); + va_TraceMsg(idx, "\tframe_rate = %d\n", p->frame_rate); + va_TraceMsg(idx, "\tinitial_qp = %d\n", p->initial_qp); + va_TraceMsg(idx, "\tmin_qp = %d\n", p->min_qp); + va_TraceMsg(idx, NULL); + + /* start a new sequce, coded log file can be truncated */ + trace_context[idx].trace_sequence_start = 1; + + return; +} + + +static void va_TraceVAEncPictureParameterBufferH263( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void *data) +{ + VAEncPictureParameterBufferH263 *p = (VAEncPictureParameterBufferH263 *)data; + DPY2INDEX(dpy); + + va_TraceMsg(idx, "VAEncPictureParameterBufferH263\n"); + va_TraceMsg(idx, "\treference_picture = 0x%08x\n", p->reference_picture); + va_TraceMsg(idx, "\treconstructed_picture = 0x%08x\n", p->reconstructed_picture); + va_TraceMsg(idx, "\tcoded_buf = %08x\n", p->coded_buf); + va_TraceMsg(idx, "\tpicture_width = %d\n", p->picture_width); + va_TraceMsg(idx, "\tpicture_height = %d\n", p->picture_height); + va_TraceMsg(idx, "\tpicture_type = 0x%08x\n", p->picture_type); + va_TraceMsg(idx, NULL); + + trace_context[idx].trace_codedbuf = p->coded_buf; + + return; +} + +static void va_TraceVAEncPictureParameterBufferJPEG( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void *data) +{ + VAEncPictureParameterBufferJPEG *p = (VAEncPictureParameterBufferJPEG *)data; + DPY2INDEX(dpy); + + va_TraceMsg(idx, "VAEncPictureParameterBufferJPEG\n"); + va_TraceMsg(idx, "\treconstructed_picture = 0x%08x\n", p->reconstructed_picture); + va_TraceMsg(idx, "\tcoded_buf = %08x\n", p->coded_buf); + va_TraceMsg(idx, "\tpicture_width = %d\n", p->picture_width); + va_TraceMsg(idx, "\tpicture_height = %d\n", p->picture_height); + va_TraceMsg(idx, NULL); + + trace_context[idx].trace_codedbuf = p->coded_buf; + + return; +} + +static void va_TraceVAEncQMatrixBufferJPEG( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void *data) +{ + VAQMatrixBufferJPEG *p = (VAQMatrixBufferJPEG *)data; + DPY2INDEX(dpy); + + va_TraceMsg(idx, "VAQMatrixBufferJPEG\n"); + va_TraceMsg(idx, "\tload_lum_quantiser_matrix = %d", p->load_lum_quantiser_matrix); + if (p->load_lum_quantiser_matrix) { + int i; + for (i = 0; i < 64; i++) { + if ((i % 8) == 0) + va_TraceMsg(idx, "\n\t"); + va_TraceMsg(idx, "\t0x%02x", p->lum_quantiser_matrix[i]); + } + va_TraceMsg(idx, "\n"); + } + va_TraceMsg(idx, "\tload_chroma_quantiser_matrix = %08x\n", p->load_chroma_quantiser_matrix); + if (p->load_chroma_quantiser_matrix) { + int i; + for (i = 0; i < 64; i++) { + if ((i % 8) == 0) + va_TraceMsg(idx, "\n\t"); + va_TraceMsg(idx, "\t0x%02x", p->chroma_quantiser_matrix[i]); + } + va_TraceMsg(idx, "\n"); + } + + va_TraceMsg(idx, NULL); + + return; +} + +static void va_TraceH263Buf( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void *pbuf +) +{ + switch (type) { + case VAPictureParameterBufferType:/* print MPEG4 buffer */ + va_TraceVAPictureParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VAIQMatrixBufferType:/* print MPEG4 buffer */ + va_TraceVAIQMatrixBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VABitPlaneBufferType:/* print MPEG4 buffer */ + va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VASliceGroupMapBufferType: + break; + case VASliceParameterBufferType:/* print MPEG4 buffer */ + va_TraceVASliceParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VASliceDataBufferType: + va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VAMacroblockParameterBufferType: + va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VAResidualDataBufferType: + va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VADeblockingParameterBufferType: + va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VAImageBufferType: + break; + case VAProtectedSliceDataBufferType: + va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VAEncCodedBufferType: + break; + case VAEncSequenceParameterBufferType: + va_TraceVAEncSequenceParameterBufferH263(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VAEncPictureParameterBufferType: + va_TraceVAEncPictureParameterBufferH263(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VAEncSliceParameterBufferType: + va_TraceVAEncSliceParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf); + break; + default: + break; + } +} + + +static void va_TraceJPEGBuf( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void *pbuf +) +{ + switch (type) { + case VAPictureParameterBufferType:/* print MPEG4 buffer */ + case VAIQMatrixBufferType:/* print MPEG4 buffer */ + case VABitPlaneBufferType:/* print MPEG4 buffer */ + case VASliceGroupMapBufferType: + case VASliceParameterBufferType:/* print MPEG4 buffer */ + case VASliceDataBufferType: + case VAMacroblockParameterBufferType: + case VAResidualDataBufferType: + case VADeblockingParameterBufferType: + case VAImageBufferType: + case VAProtectedSliceDataBufferType: + case VAEncCodedBufferType: + case VAEncSequenceParameterBufferType: + case VAEncSliceParameterBufferType: + va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VAEncPictureParameterBufferType: + va_TraceVAEncPictureParameterBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VAQMatrixBufferType: + va_TraceVAEncQMatrixBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf); break; default: break; @@ -1275,18 +1969,14 @@ static void va_TraceMPEG4Buf( case VAEncCodedBufferType: break; case VAEncSequenceParameterBufferType: - va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf); + va_TraceVAEncSequenceParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf); break; case VAEncPictureParameterBufferType: - va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf); + va_TraceVAEncPictureParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf); break; case VAEncSliceParameterBufferType: va_TraceVAEncSliceParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf); break; - case VAEncH264VUIBufferType: - break; - case VAEncH264SEIBufferType: - break; default: break; } @@ -1347,13 +2037,10 @@ static void va_TraceH264Buf( va_TraceVAEncPictureParameterBufferH264(dpy, context, buffer, type, size, num_elements, pbuf); break; case VAEncSliceParameterBufferType: - va_TraceVAEncSliceParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf); - break; - case VAEncH264VUIBufferType: - va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf); - break; - case VAEncH264SEIBufferType: - va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf); + if (size == sizeof(VAEncSliceParameterBuffer)) + va_TraceVAEncSliceParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf); + else + va_TraceVAEncSliceParameterBufferH264(dpy, context, buffer, type, size, num_elements, pbuf); break; case VAEncMiscParameterBufferType: va_TraceVAEncMiscParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf); @@ -1442,7 +2129,7 @@ void va_TraceRenderPicture( va_TraceMsg(idx, "\tcontext = 0x%08x\n", context); va_TraceMsg(idx, "\tnum_buffers = %d\n", num_buffers); for (i = 0; i < num_buffers; i++) { - void *pbuf; + unsigned char *pbuf; unsigned int j; /* get buffer type information */ @@ -1454,14 +2141,14 @@ void va_TraceRenderPicture( va_TraceMsg(idx, "\t size = %d\n", size); va_TraceMsg(idx, "\t num_elements = %d\n", num_elements); - vaMapBuffer(dpy, buffers[i], &pbuf); + vaMapBuffer(dpy, buffers[i], (void **)&pbuf); switch (trace_context[idx].trace_profile) { case VAProfileMPEG2Simple: case VAProfileMPEG2Main: for (j=0; jstatus != -1) { + va_TraceMsg(idx, "\t\tstatus = %d\n", p->status); + va_TraceMsg(idx, "\t\tstart_mb = %d\n", p->start_mb); + va_TraceMsg(idx, "\t\tend_mb = %d\n", p->end_mb); + p++; /* next error record */ + } + } + va_TraceMsg(idx, NULL); +} + void va_TraceMaxNumDisplayAttributes ( VADisplay dpy, int number @@ -1552,13 +2311,14 @@ void va_TraceMaxNumDisplayAttributes ( TRACE_FUNCNAME(idx); - va_TraceMsg(idx, "\t>max_display_attributes = %d\n", number); + va_TraceMsg(idx, "\tmax_display_attributes = %d\n", number); + va_TraceMsg(idx, NULL); } void va_TraceQueryDisplayAttributes ( VADisplay dpy, - VADisplayAttribute *attr_list, /* out */ - int *num_attributes /* out */ + VADisplayAttribute *attr_list, /* out */ + int *num_attributes /* out */ ) { int i; @@ -1575,6 +2335,7 @@ void va_TraceQueryDisplayAttributes ( 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, NULL); } @@ -1597,6 +2358,7 @@ static void va_TraceDisplayAttributes ( 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, NULL); } @@ -1650,15 +2412,16 @@ void va_TracePutSurface ( va_TraceMsg(idx, "\tsurface = 0x%08x\n", surface); va_TraceMsg(idx, "\tdraw = 0x%08x\n", draw); - va_TraceMsg(idx, "\tsrcx = %d\n", surface); - va_TraceMsg(idx, "\tsrcy = %d\n", surface); - va_TraceMsg(idx, "\tsrcw = %d\n", surface); - va_TraceMsg(idx, "\tsrch = %d\n", surface); - va_TraceMsg(idx, "\tdestx = %d\n", surface); - va_TraceMsg(idx, "\tdesty = %d\n", surface); + va_TraceMsg(idx, "\tsrcx = %d\n", srcx); + va_TraceMsg(idx, "\tsrcy = %d\n", srcy); + va_TraceMsg(idx, "\tsrcw = %d\n", srcw); + va_TraceMsg(idx, "\tsrch = %d\n", srch); + va_TraceMsg(idx, "\tdestx = %d\n", destx); + va_TraceMsg(idx, "\tdesty = %d\n", desty); va_TraceMsg(idx, "\tdestw = %d\n", destw); va_TraceMsg(idx, "\tdesth = %d\n", desth); va_TraceMsg(idx, "\tcliprects = 0x%08x\n", cliprects); va_TraceMsg(idx, "\tnumber_cliprects = %d\n", number_cliprects); va_TraceMsg(idx, "\tflags = 0x%08x\n", flags); + va_TraceMsg(idx, NULL); }