hardware/intel/libva
Revision | f5ced7eb08e6ab15e7d0a41bf42ad9bf5dd48c80 (tree) |
---|---|
Zeit | 2013-06-19 15:44:23 |
Autor | Cheng Yao <yao.cheng@inte...> |
Commiter | Xiang, Haihao |
libva: Add VABuffer dumping for JPEG parameters
BZ: 98966
Dump VABuffer of JPEG parameters in libva
Change-Id: I87450d92db402a4730e0c0433215c857bc5b494d
Signed-off-by: Cheng Yao <yao.cheng@intel.com>
(cherry picked from commit 40ffef8d1fcbbc709472dc1342d7e3e983ae5d96)
@@ -28,7 +28,7 @@ | ||
28 | 28 | #include "va_backend.h" |
29 | 29 | #include "va_trace.h" |
30 | 30 | #include "va_enc_h264.h" |
31 | - | |
31 | +#include "va_dec_jpeg.h" | |
32 | 32 | #include <assert.h> |
33 | 33 | #include <stdarg.h> |
34 | 34 | #include <stdlib.h> |
@@ -793,6 +793,132 @@ static void va_TraceVASliceParameterBufferMPEG2( | ||
793 | 793 | return; |
794 | 794 | } |
795 | 795 | |
796 | +static void va_TraceVAPictureParameterBufferJPEG( | |
797 | + VADisplay dpy, | |
798 | + VAContextID context, | |
799 | + VABufferID buffer, | |
800 | + VABufferType type, | |
801 | + unsigned int size, | |
802 | + unsigned int num_elements, | |
803 | + void *data) | |
804 | +{ | |
805 | + int i; | |
806 | + VAPictureParameterBufferJPEGBaseline *p=(VAPictureParameterBufferJPEGBaseline *)data; | |
807 | + DPY2INDEX(dpy); | |
808 | + | |
809 | + va_TraceMsg(idx,"*VAPictureParameterBufferJPEG\n"); | |
810 | + va_TraceMsg(idx,"\tpicture_width = %u\n", p->picture_width); | |
811 | + va_TraceMsg(idx,"\tpicture_height = %u\n", p->picture_height); | |
812 | + va_TraceMsg(idx,"\tcomponents = \n"); | |
813 | + for (i = 0; i < p->num_components && i < 255; ++i) { | |
814 | + va_TraceMsg(idx,"\t\t[%d] component_id = %u\n", i, p->components[i].component_id); | |
815 | + va_TraceMsg(idx,"\t\t[%d] h_sampling_factor = %u\n", i, p->components[i].h_sampling_factor); | |
816 | + va_TraceMsg(idx,"\t\t[%d] v_sampling_factor = %u\n", i, p->components[i].v_sampling_factor); | |
817 | + va_TraceMsg(idx,"\t\t[%d] quantiser_table_selector = %u\n", i, p->components[i].quantiser_table_selector); | |
818 | + } | |
819 | +} | |
820 | + | |
821 | +static void va_TraceVAIQMatrixBufferJPEG( | |
822 | + VADisplay dpy, | |
823 | + VAContextID context, | |
824 | + VABufferID buffer, | |
825 | + VABufferType type, | |
826 | + unsigned int size, | |
827 | + unsigned int num_elements, | |
828 | + void *data) | |
829 | +{ | |
830 | + int i, j; | |
831 | + static char tmp[1024]; | |
832 | + VAIQMatrixBufferJPEGBaseline *p=(VAIQMatrixBufferJPEGBaseline *)data; | |
833 | + DPY2INDEX(dpy); | |
834 | + va_TraceMsg(idx,"*VAIQMatrixParameterBufferJPEG\n"); | |
835 | + va_TraceMsg(idx,"\tload_quantiser_table =\n"); | |
836 | + for (i = 0; i < 4; ++i) { | |
837 | + va_TraceMsg(idx,"\t\t[%d] = %u\n", i, p->load_quantiser_table[i]); | |
838 | + } | |
839 | + va_TraceMsg(idx,"\tquantiser_table =\n"); | |
840 | + for (i = 0; i < 4; ++i) { | |
841 | + memset(tmp, 0, sizeof tmp); | |
842 | + for (j = 0; j < 64; ++j) { | |
843 | + sprintf(tmp + strlen(tmp), "%u ", p->quantiser_table[i][j]); | |
844 | + } | |
845 | + va_TraceMsg(idx,"\t\t[%d] = %s\n", i, tmp); | |
846 | + } | |
847 | +} | |
848 | + | |
849 | +static void va_TraceVASliceParameterBufferJPEG( | |
850 | + VADisplay dpy, | |
851 | + VAContextID context, | |
852 | + VABufferID buffer, | |
853 | + VABufferType type, | |
854 | + unsigned int size, | |
855 | + unsigned int num_elements, | |
856 | + void *data) | |
857 | +{ | |
858 | + int i; | |
859 | + VASliceParameterBufferJPEGBaseline *p=(VASliceParameterBufferJPEGBaseline *)data; | |
860 | + DPY2INDEX(dpy); | |
861 | + va_TraceMsg(idx,"*VASliceParameterBufferJPEG\n"); | |
862 | + va_TraceMsg(idx,"\tslice_data_size = %u\n", p->slice_data_size); | |
863 | + va_TraceMsg(idx,"\tslice_data_offset = %u\n", p->slice_data_offset); | |
864 | + va_TraceMsg(idx,"\tslice_data_flag = %u\n", p->slice_data_flag); | |
865 | + va_TraceMsg(idx,"\tslice_horizontal_position = %u\n", p->slice_horizontal_position); | |
866 | + va_TraceMsg(idx,"\tslice_vertical_position = %u\n", p->slice_vertical_position); | |
867 | + va_TraceMsg(idx,"\tcomponents = \n"); | |
868 | + for (i = 0; i < p->num_components && i < 4; ++i) { | |
869 | + va_TraceMsg(idx,"\t\t[%d] component_selector = %u\n", i, p->components[i].component_selector); | |
870 | + va_TraceMsg(idx,"\t\t[%d] dc_table_selector = %u\n", i, p->components[i].dc_table_selector); | |
871 | + va_TraceMsg(idx,"\t\t[%d] ac_table_selector = %u\n", i, p->components[i].ac_table_selector); | |
872 | + } | |
873 | + va_TraceMsg(idx,"\trestart_interval = %u\n", p->restart_interval); | |
874 | + va_TraceMsg(idx,"\tnum_mcus = %u\n", p->num_mcus); | |
875 | +} | |
876 | + | |
877 | +static void va_TraceVAHuffmanTableBufferJPEG( | |
878 | + VADisplay dpy, | |
879 | + VAContextID context, | |
880 | + VABufferID buffer, | |
881 | + VABufferType type, | |
882 | + unsigned int size, | |
883 | + unsigned int num_elements, | |
884 | + void *data) | |
885 | +{ | |
886 | + int i, j; | |
887 | + static char tmp[1024]; | |
888 | + VAHuffmanTableBufferJPEGBaseline *p=(VAHuffmanTableBufferJPEGBaseline *)data; | |
889 | + DPY2INDEX(dpy); | |
890 | + va_TraceMsg(idx,"*VAHuffmanTableBufferJPEG\n"); | |
891 | + | |
892 | + for (i = 0; i < 2; ++i) { | |
893 | + va_TraceMsg(idx,"\tload_huffman_table[%d] =%u\n", i, p->load_huffman_table[0]); | |
894 | + va_TraceMsg(idx,"\thuffman_table[%d] =\n", i); | |
895 | + memset(tmp, 0, sizeof tmp); | |
896 | + for (j = 0; j < 16; ++j) { | |
897 | + sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].num_dc_codes[j]); | |
898 | + } | |
899 | + va_TraceMsg(idx,"\t\tnum_dc_codes =%s\n", tmp); | |
900 | + memset(tmp, 0, sizeof tmp); | |
901 | + for (j = 0; j < 12; ++j) { | |
902 | + sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].dc_values[j]); | |
903 | + } | |
904 | + va_TraceMsg(idx,"\t\tdc_values =%s\n", tmp); | |
905 | + memset(tmp, 0, sizeof tmp); | |
906 | + for (j = 0; j < 16; ++j) { | |
907 | + sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].num_ac_codes[j]); | |
908 | + } | |
909 | + va_TraceMsg(idx,"\t\tnum_dc_codes =%s\n", tmp); | |
910 | + memset(tmp, 0, sizeof tmp); | |
911 | + for (j = 0; j < 162; ++j) { | |
912 | + sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].ac_values[j]); | |
913 | + } | |
914 | + va_TraceMsg(idx,"\t\tnum_dc_codes =%s\n", tmp); | |
915 | + memset(tmp, 0, sizeof tmp); | |
916 | + for (j = 0; j < 2; ++j) { | |
917 | + sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].pad[j]); | |
918 | + } | |
919 | + va_TraceMsg(idx,"\t\tnum_dc_codes =%s\n", tmp); | |
920 | + } | |
921 | +} | |
796 | 922 | |
797 | 923 | static void va_TraceVAPictureParameterBufferMPEG4( |
798 | 924 | VADisplay dpy, |
@@ -1927,11 +2053,8 @@ static void va_TraceJPEGBuf( | ||
1927 | 2053 | ) |
1928 | 2054 | { |
1929 | 2055 | switch (type) { |
1930 | - case VAPictureParameterBufferType:/* print MPEG4 buffer */ | |
1931 | - case VAIQMatrixBufferType:/* print MPEG4 buffer */ | |
1932 | - case VABitPlaneBufferType:/* print MPEG4 buffer */ | |
2056 | + case VABitPlaneBufferType: | |
1933 | 2057 | case VASliceGroupMapBufferType: |
1934 | - case VASliceParameterBufferType:/* print MPEG4 buffer */ | |
1935 | 2058 | case VASliceDataBufferType: |
1936 | 2059 | case VAMacroblockParameterBufferType: |
1937 | 2060 | case VAResidualDataBufferType: |
@@ -1943,6 +2066,18 @@ static void va_TraceJPEGBuf( | ||
1943 | 2066 | case VAEncSliceParameterBufferType: |
1944 | 2067 | va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf); |
1945 | 2068 | break; |
2069 | + case VAPictureParameterBufferType: | |
2070 | + va_TraceVAPictureParameterBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf); | |
2071 | + break; | |
2072 | + case VAIQMatrixBufferType: | |
2073 | + va_TraceVAIQMatrixBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf); | |
2074 | + break; | |
2075 | + case VASliceParameterBufferType: | |
2076 | + va_TraceVASliceParameterBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf); | |
2077 | + break; | |
2078 | + case VAHuffmanTableBufferType: | |
2079 | + va_TraceVAHuffmanTableBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf); | |
2080 | + break; | |
1946 | 2081 | case VAEncPictureParameterBufferType: |
1947 | 2082 | va_TraceVAEncPictureParameterBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf); |
1948 | 2083 | break; |