diff options
author | Cheng Yao <yao.cheng@intel.com> | 2013-04-17 14:58:11 +0800 |
---|---|---|
committer | buildbot <buildbot@intel.com> | 2013-04-26 19:44:34 -0700 |
commit | 9992891b62398a80bd0867f8d167c0faa49861fd (patch) | |
tree | 5d8b05c6c3bc8d642c8293e870d7eece34938350 /va | |
parent | c31b44d6c9589c1dcc48d86ad72aec89760433bc (diff) | |
download | libva-9992891b62398a80bd0867f8d167c0faa49861fd.tar.gz |
libva: Add VABuffer dumping for JPEG parameters
BZ: 98966
Dump VABuffer of JPEG parameters in libva
Change-Id: I9349d15a528bd0175de3ccbb86c65c7b22b5709f
Signed-off-by: Cheng Yao <yao.cheng@intel.com>
Reviewed-on: http://android.intel.com:8080/103727
Reviewed-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'va')
-rwxr-xr-x | va/va_trace.c | 152 |
1 files changed, 147 insertions, 5 deletions
diff --git a/va/va_trace.c b/va/va_trace.c index 2e318e8..3e02824 100755 --- a/va/va_trace.c +++ b/va/va_trace.c @@ -28,7 +28,7 @@ #include "va_backend.h" #include "va_trace.h" #include "va_enc_h264.h" - +#include "va_dec_jpeg.h" #include <assert.h> #include <stdarg.h> #include <stdlib.h> @@ -794,6 +794,139 @@ static void va_TraceVASliceParameterBufferMPEG2( return; } +static void va_TraceVAPictureParameterBufferJPEG( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void *data) +{ + int i; + VAPictureParameterBufferJPEGBaseline *p=(VAPictureParameterBufferJPEGBaseline *)data; + DPY2INDEX(dpy); + + va_TraceMsg(idx,"*VAPictureParameterBufferJPEG\n"); + va_TraceMsg(idx,"\tpicture_width = %u\n", p->picture_width); + va_TraceMsg(idx,"\tpicture_height = %u\n", p->picture_height); + va_TraceMsg(idx,"\tcomponents = \n"); + for (i = 0; i < p->num_components && i < 255; ++i) { + va_TraceMsg(idx,"\t\t[%d] component_id = %u\n", i, p->components[i].component_id); + va_TraceMsg(idx,"\t\t[%d] h_sampling_factor = %u\n", i, p->components[i].h_sampling_factor); + va_TraceMsg(idx,"\t\t[%d] v_sampling_factor = %u\n", i, p->components[i].v_sampling_factor); + va_TraceMsg(idx,"\t\t[%d] quantiser_table_selector = %u\n", i, p->components[i].quantiser_table_selector); + } + va_TraceMsg(idx,"\tsample_precision = %u\n", p->sample_precision); + va_TraceMsg(idx,"\tframe_cropping_flag = %u\n", p->frame_cropping_flag); + va_TraceMsg(idx,"\tframe_crop_left_offset = %u\n", p->frame_crop_left_offset); + va_TraceMsg(idx,"\tframe_crop_right_offset = %u\n", p->frame_crop_right_offset); + va_TraceMsg(idx,"\tframe_crop_top_offset = %u\n", p->frame_crop_top_offset); + va_TraceMsg(idx,"\tframe_crop_bottom_offset = %u\n", p->frame_crop_bottom_offset); + va_TraceMsg(idx,"\trotation = %u\n", p->rotation); +} + +static void va_TraceVAIQMatrixBufferJPEG( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void *data) +{ + int i, j; + static char tmp[1024]; + VAIQMatrixBufferJPEGBaseline *p=(VAIQMatrixBufferJPEGBaseline *)data; + DPY2INDEX(dpy); + va_TraceMsg(idx,"*VAIQMatrixParameterBufferJPEG\n"); + va_TraceMsg(idx,"\tload_quantiser_table =\n"); + for (i = 0; i < 4; ++i) { + va_TraceMsg(idx,"\t\t[%d] = %u\n", i, p->load_quantiser_table[i]); + } + va_TraceMsg(idx,"\tquantiser_table =\n"); + for (i = 0; i < 4; ++i) { + memset(tmp, 0, sizeof tmp); + for (j = 0; j < 64; ++j) { + sprintf(tmp + strlen(tmp), "%u ", p->quantiser_table[i][j]); + } + va_TraceMsg(idx,"\t\t[%d] = %s\n", i, tmp); + } +} + +static void va_TraceVASliceParameterBufferJPEG( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void *data) +{ + int i; + VASliceParameterBufferJPEGBaseline *p=(VASliceParameterBufferJPEGBaseline *)data; + DPY2INDEX(dpy); + va_TraceMsg(idx,"*VASliceParameterBufferJPEG\n"); + va_TraceMsg(idx,"\tslice_data_size = %u\n", p->slice_data_size); + va_TraceMsg(idx,"\tslice_data_offset = %u\n", p->slice_data_offset); + va_TraceMsg(idx,"\tslice_data_flag = %u\n", p->slice_data_flag); + va_TraceMsg(idx,"\tslice_horizontal_position = %u\n", p->slice_horizontal_position); + va_TraceMsg(idx,"\tslice_vertical_position = %u\n", p->slice_vertical_position); + va_TraceMsg(idx,"\tcomponents = \n"); + for (i = 0; i < p->num_components && i < 4; ++i) { + va_TraceMsg(idx,"\t\t[%d] component_selector = %u\n", i, p->components[i].component_selector); + va_TraceMsg(idx,"\t\t[%d] dc_table_selector = %u\n", i, p->components[i].dc_table_selector); + va_TraceMsg(idx,"\t\t[%d] ac_table_selector = %u\n", i, p->components[i].ac_table_selector); + } + va_TraceMsg(idx,"\trestart_interval = %u\n", p->restart_interval); + va_TraceMsg(idx,"\tnum_mcus = %u\n", p->num_mcus); +} + +static void va_TraceVAHuffmanTableBufferJPEG( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void *data) +{ + int i, j; + static char tmp[1024]; + VAHuffmanTableBufferJPEGBaseline *p=(VAHuffmanTableBufferJPEGBaseline *)data; + DPY2INDEX(dpy); + va_TraceMsg(idx,"*VAHuffmanTableBufferJPEG\n"); + + for (i = 0; i < 2; ++i) { + va_TraceMsg(idx,"\tload_huffman_table[%d] =%u\n", i, p->load_huffman_table[0]); + va_TraceMsg(idx,"\thuffman_table[%d] =\n", i); + memset(tmp, 0, sizeof tmp); + for (j = 0; j < 16; ++j) { + sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].num_dc_codes[j]); + } + va_TraceMsg(idx,"\t\tnum_dc_codes =%s\n", tmp); + memset(tmp, 0, sizeof tmp); + for (j = 0; j < 12; ++j) { + sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].dc_values[j]); + } + va_TraceMsg(idx,"\t\tdc_values =%s\n", tmp); + memset(tmp, 0, sizeof tmp); + for (j = 0; j < 16; ++j) { + sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].num_ac_codes[j]); + } + va_TraceMsg(idx,"\t\tnum_dc_codes =%s\n", tmp); + memset(tmp, 0, sizeof tmp); + for (j = 0; j < 162; ++j) { + sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].ac_values[j]); + } + va_TraceMsg(idx,"\t\tnum_dc_codes =%s\n", tmp); + memset(tmp, 0, sizeof tmp); + for (j = 0; j < 2; ++j) { + sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].pad[j]); + } + va_TraceMsg(idx,"\t\tnum_dc_codes =%s\n", tmp); + } +} static void va_TraceVAPictureParameterBufferMPEG4( VADisplay dpy, @@ -1904,11 +2037,8 @@ static void va_TraceJPEGBuf( ) { switch (type) { - case VAPictureParameterBufferType:/* print MPEG4 buffer */ - case VAIQMatrixBufferType:/* print MPEG4 buffer */ - case VABitPlaneBufferType:/* print MPEG4 buffer */ + case VABitPlaneBufferType: case VASliceGroupMapBufferType: - case VASliceParameterBufferType:/* print MPEG4 buffer */ case VASliceDataBufferType: case VAMacroblockParameterBufferType: case VAResidualDataBufferType: @@ -1920,6 +2050,18 @@ static void va_TraceJPEGBuf( case VAEncSliceParameterBufferType: va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf); break; + case VAPictureParameterBufferType: + va_TraceVAPictureParameterBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VAIQMatrixBufferType: + va_TraceVAIQMatrixBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VASliceParameterBufferType: + va_TraceVASliceParameterBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VAHuffmanTableBufferType: + va_TraceVAHuffmanTableBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf); + break; case VAEncPictureParameterBufferType: va_TraceVAEncPictureParameterBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf); break; |