3 * Copyright (c) 2009-2011 Intel Corporation. All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sub license, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 #include "va_enc_h264.h"
30 #include "va_backend.h"
31 #include "va_internal.h"
33 #include "va_enc_h264.h"
34 #include "va_enc_jpeg.h"
35 #include "va_enc_vp8.h"
36 #include "va_dec_jpeg.h"
37 #include "va_dec_vp8.h"
38 #include "va_dec_vp9.h"
39 #include "va_dec_hevc.h"
49 #include <sys/types.h>
51 #include <sys/syscall.h>
58 * Env. to debug some issue, e.g. the decode/encode issue in a video conference scenerio:
59 * .LIBVA_TRACE=log_file: general VA parameters saved into log_file
60 * .LIBVA_TRACE_BUFDATA: dump all VA data buffer into log_file
61 * .LIBVA_TRACE_CODEDBUF=coded_clip_file: save the coded clip into file coded_clip_file
62 * .LIBVA_TRACE_SURFACE=yuv_file: save surface YUV into file yuv_file. Use file name to determine
63 * decode/encode or jpeg surfaces
64 * .LIBVA_TRACE_SURFACE_GEOMETRY=WIDTHxHEIGHT+XOFF+YOFF: only save part of surface context into file
65 * due to storage bandwidth limitation
71 int va_trace_flag = 0;
73 #define MAX_TRACE_CTX_NUM 64
74 #define TRACE_CTX_ID_MASK (MAX_TRACE_CTX_NUM - 1)
76 #define MAX_TRACE_THREAD_NUM 64
78 #define MAX_TRACE_BUF_INFO_HASH_SIZE 1024 // 1<<10
79 #define MAX_TRACE_BUF_INFO_HASH_LEVEL 3
80 #define TRACE_BUF_INFO_HASH_ID_MASK (MAX_TRACE_BUF_INFO_HASH_SIZE - 1)
82 struct trace_buf_info {
89 struct trace_buf_manager {
90 struct trace_buf_info *pbuf_info[MAX_TRACE_BUF_INFO_HASH_LEVEL];
93 struct trace_log_file {
101 struct trace_log_files_manager {
104 struct trace_log_file log_file[MAX_TRACE_THREAD_NUM];
107 /* per context settings */
108 struct trace_context {
109 struct trace_log_file *plog_file;
110 struct trace_log_file *plog_file_list[MAX_TRACE_THREAD_NUM];
112 /* LIBVA_TRACE_CODEDBUF */
113 FILE *trace_fp_codedbuf; /* save the encode result into a file */
114 char *trace_codedbuf_fn; /* file name */
116 /* LIBVA_TRACE_SURFACE */
117 FILE *trace_fp_surface; /* save the surface YUV into a file */
118 char *trace_surface_fn; /* file name */
120 VAContextID trace_context; /* current context */
122 VASurfaceID trace_rendertarget; /* current render target */
123 VAProfile trace_profile; /* current profile for buffers */
124 VAEntrypoint trace_entrypoint; /* current entrypoint */
126 unsigned int trace_frame_no; /* current frame NO */
127 unsigned int trace_slice_no; /* current slice NO */
128 unsigned int trace_slice_size; /* current slice buffer size */
130 unsigned int trace_surface_width; /* surface dumping geometry */
131 unsigned int trace_surface_height;
132 unsigned int trace_surface_xoff;
133 unsigned int trace_surface_yoff;
135 unsigned int trace_frame_width; /* current frame width */
136 unsigned int trace_frame_height; /* current frame height */
138 unsigned int pts; /* IVF header information */
140 pid_t created_thd_id;
143 struct trace_config_info {
145 VAConfigID config_id;
147 VAProfile trace_profile;
148 VAEntrypoint trace_entrypoint;
150 pid_t created_thd_id;
154 struct trace_context *ptra_ctx[MAX_TRACE_CTX_NUM + 1];
156 struct trace_buf_manager buf_manager;
157 struct trace_log_files_manager log_files_manager;
158 struct trace_config_info config_info[MAX_TRACE_CTX_NUM];
161 char *fn_codedbuf_env;
162 char *fn_surface_env;
164 pthread_mutex_t resource_mutex;
165 pthread_mutex_t context_mutex;
169 #define LOCK_RESOURCE(pva_trace) \
171 pthread_mutex_lock(&pva_trace->resource_mutex)
173 #define UNLOCK_RESOURCE(pva_trace) \
175 pthread_mutex_unlock(&pva_trace->resource_mutex)
177 #define LOCK_CONTEXT(pva_trace) \
179 pthread_mutex_lock(&pva_trace->context_mutex)
181 #define UNLOCK_CONTEXT(pva_trace) \
183 pthread_mutex_unlock(&pva_trace->context_mutex)
185 #define DPY2TRACECTX(dpy, context, buf_id) \
186 struct va_trace *pva_trace = NULL; \
187 struct trace_context *trace_ctx = NULL; \
188 VAContextID ctx_id = context; \
190 pva_trace = (struct va_trace *)(((VADisplayContextP)dpy)->vatrace); \
194 if(ctx_id == VA_INVALID_ID) { \
195 if(buf_id != VA_INVALID_ID) \
196 ctx_id = get_ctx_by_buf(pva_trace, buf_id); \
201 if (ctx_id != VA_INVALID_ID) { \
202 int temp_idx = get_valid_ctx_idx(pva_trace, ctx_id); \
203 if(temp_idx < MAX_TRACE_CTX_NUM) \
204 trace_ctx = pva_trace->ptra_ctx[temp_idx]; \
208 || trace_ctx->trace_context != context) { \
211 refresh_log_file(pva_trace, trace_ctx)
213 #define DPY2TRACE_VIRCTX(dpy) \
214 struct va_trace *pva_trace = NULL; \
215 struct trace_context *trace_ctx = NULL; \
217 pva_trace = (struct va_trace *)(((VADisplayContextP)dpy)->vatrace); \
221 LOCK_CONTEXT(pva_trace); \
222 trace_ctx = pva_trace->ptra_ctx[MAX_TRACE_CTX_NUM]; \
224 UNLOCK_CONTEXT(pva_trace); \
227 refresh_log_file(pva_trace, trace_ctx)
229 #define DPY2TRACE_VIRCTX_EXIT(pva_trace) \
230 UNLOCK_CONTEXT(pva_trace)
232 #define TRACE_FUNCNAME(idx) va_TraceMsg(trace_ctx, "==========%s\n", __func__);
234 #define TRACE_NEWLINE() do { \
235 va_TracePrint(trace_ctx, "\n"); \
236 va_TraceMsg(trace_ctx, "") ; \
240 VAStatus vaBufferInfo(
242 VAContextID context, /* in */
243 VABufferID buf_id, /* in */
244 VABufferType *type, /* out */
245 unsigned int *size, /* out */
246 unsigned int *num_elements /* out */
249 VAStatus vaLockSurface(VADisplay dpy,
251 unsigned int *fourcc, /* following are output argument */
252 unsigned int *luma_stride,
253 unsigned int *chroma_u_stride,
254 unsigned int *chroma_v_stride,
255 unsigned int *luma_offset,
256 unsigned int *chroma_u_offset,
257 unsigned int *chroma_v_offset,
258 unsigned int *buffer_name,
262 VAStatus vaUnlockSurface(VADisplay dpy,
266 static int get_valid_config_idx(
267 struct va_trace *pva_trace,
268 VAConfigID config_id)
270 int idx = MAX_TRACE_CTX_NUM;
272 LOCK_RESOURCE(pva_trace);
274 for (idx = 0;idx < MAX_TRACE_CTX_NUM;idx++) {
275 if (pva_trace->config_info[idx].valid &&
276 pva_trace->config_info[idx].config_id == config_id)
280 UNLOCK_RESOURCE(pva_trace);
285 static void add_trace_config_info(
286 struct va_trace *pva_trace,
287 VAConfigID config_id,
289 VAEntrypoint entrypoint)
291 struct trace_config_info *pconfig_info;
293 pid_t thd_id = syscall(__NR_gettid);
295 LOCK_RESOURCE(pva_trace);
297 for (idx = 0;idx < MAX_TRACE_CTX_NUM;idx++) {
298 if (!pva_trace->config_info[idx].valid ||
299 pva_trace->config_info[idx].config_id == config_id)
303 if (idx < MAX_TRACE_CTX_NUM) {
304 pconfig_info = &pva_trace->config_info[idx];
306 pconfig_info->valid = 1;
307 pconfig_info->config_id = config_id;
308 pconfig_info->trace_profile = profile;
309 pconfig_info->trace_entrypoint = entrypoint;
310 pconfig_info->created_thd_id = thd_id;
313 UNLOCK_RESOURCE(pva_trace);
316 static void delete_trace_config_info(
317 struct va_trace *pva_trace,
318 VAConfigID config_id)
320 struct trace_config_info *pconfig_info;
323 LOCK_RESOURCE(pva_trace);
325 for (idx = 0;idx < MAX_TRACE_CTX_NUM;idx++) {
326 if (pva_trace->config_info[idx].valid &&
327 pva_trace->config_info[idx].config_id == config_id)
331 if (idx < MAX_TRACE_CTX_NUM) {
332 pconfig_info = &pva_trace->config_info[idx];
334 pconfig_info->valid = 0;
335 pconfig_info->config_id = -1;
338 UNLOCK_RESOURCE(pva_trace);
341 static VAContextID get_ctx_by_buf(
342 struct va_trace *pva_trace,
345 struct trace_buf_manager *pbuf_mgr = &pva_trace->buf_manager;
346 struct trace_buf_info *pbuf_info = pbuf_mgr->pbuf_info[0];
347 VAContextID context = VA_INVALID_ID;
350 LOCK_RESOURCE(pva_trace);
352 idx = buf_id & TRACE_BUF_INFO_HASH_ID_MASK;
353 for(i = 0;i < MAX_TRACE_BUF_INFO_HASH_LEVEL;i++) {
354 pbuf_info = pbuf_mgr->pbuf_info[i];
358 if(pbuf_info[idx].valid
359 && pbuf_info[idx].buf_id == buf_id) {
360 context = pbuf_info[idx].ctx_id;
365 UNLOCK_RESOURCE(pva_trace);
370 static void add_trace_buf_info(
371 struct va_trace *pva_trace,
375 struct trace_buf_manager *pbuf_mgr = &pva_trace->buf_manager;
376 struct trace_buf_info *pbuf_info = NULL;
379 LOCK_RESOURCE(pva_trace);
381 idx = buf_id & TRACE_BUF_INFO_HASH_ID_MASK;
382 for(i = 0;i < MAX_TRACE_BUF_INFO_HASH_LEVEL;i++) {
383 pbuf_info = pbuf_mgr->pbuf_info[i];
385 pbuf_info = (struct trace_buf_info *)calloc(
386 sizeof(struct trace_buf_info) * MAX_TRACE_BUF_INFO_HASH_SIZE,
391 pbuf_mgr->pbuf_info[i] = pbuf_info;
394 if(pbuf_info[idx].valid
395 && pbuf_info[idx].buf_id != buf_id)
398 pbuf_info[idx].buf_id = buf_id;
399 pbuf_info[idx].ctx_id = context;
400 pbuf_info[idx].valid = 1;
404 if(i >= MAX_TRACE_BUF_INFO_HASH_LEVEL)
405 va_errorMessage(pva_trace->dpy, "Add buf info failed\n");
407 UNLOCK_RESOURCE(pva_trace);
410 static void delete_trace_buf_info(
411 struct va_trace *pva_trace,
414 struct trace_buf_manager *pbuf_mgr = &pva_trace->buf_manager;
415 struct trace_buf_info *pbuf_info = NULL;
418 LOCK_RESOURCE(pva_trace);
420 idx = buf_id & TRACE_BUF_INFO_HASH_ID_MASK;
421 for(i = 0;i < MAX_TRACE_BUF_INFO_HASH_LEVEL;i++) {
422 pbuf_info = pbuf_mgr->pbuf_info[i];
426 if(pbuf_info[idx].valid
427 && pbuf_info[idx].buf_id == buf_id) {
428 pbuf_info[idx].valid = 0;
433 UNLOCK_RESOURCE(pva_trace);
437 static void delete_trace_all_context_buf(
438 struct va_trace *pva_trace,
441 struct trace_buf_manager *pbuf_mgr = &pva_trace->buf_manager;
442 struct trace_buf_info *pbuf_info = NULL;
445 LOCK_RESOURCE(pva_trace);
447 for(i = 0;i < MAX_TRACE_BUF_INFO_HASH_LEVEL;i++) {
448 pbuf_info = pbuf_mgr->pbuf_info[i];
452 for(j = 0;j < MAX_TRACE_BUF_INFO_HASH_SIZE;j++)
453 if(pbuf_info[j].valid
454 && pbuf_info[j].ctx_id == context)
455 pbuf_info[j].valid = 0;
458 UNLOCK_RESOURCE(pva_trace);
462 static int get_free_ctx_idx(
463 struct va_trace *pva_trace,
468 LOCK_RESOURCE(pva_trace);
470 for (idx = 0;idx < MAX_TRACE_CTX_NUM;idx++)
471 if (!pva_trace->ptra_ctx[idx] ||
472 pva_trace->ptra_ctx[idx]->trace_context == context)
475 UNLOCK_RESOURCE(pva_trace);
480 static int get_valid_ctx_idx(
481 struct va_trace *pva_trace,
486 LOCK_RESOURCE(pva_trace);
488 for (idx = 0;idx < MAX_TRACE_CTX_NUM;idx++)
489 if (pva_trace->ptra_ctx[idx] &&
490 pva_trace->ptra_ctx[idx]->trace_context == context)
493 UNLOCK_RESOURCE(pva_trace);
498 static void FILE_NAME_SUFFIX(
502 unsigned int suffix_handle)
504 int tmp = strnlen(env_value, max_size);
505 int left = max_size - tmp;
510 size = strlen(suffix_str);
512 if(left < (size + 8 + 10))
515 if(gettimeofday(&tv, NULL) == 0) {
516 sprintf(env_value + tmp,
518 (unsigned int)(tv.tv_sec/3600)%24,
519 (unsigned int)(tv.tv_sec/60)%60,
520 (unsigned int)tv.tv_sec%60);
527 strcat(env_value + tmp,
535 sprintf(env_value + tmp,
541 static int open_tracing_specil_file(
542 struct va_trace *pva_trace,
543 struct trace_context *ptra_ctx,
544 int type) // 0: codedbuf, 1: surface
546 char *fn_env = type == 0 ?
547 pva_trace->fn_codedbuf_env : pva_trace->fn_surface_env;
548 char env_value[1024];
551 strncpy(env_value, fn_env, 1024);
552 env_value[1023] = '\0';
553 FILE_NAME_SUFFIX(env_value, 1024,
554 "ctx-", (unsigned int)ptra_ctx->trace_context);
556 fn_env = strdup(env_value);
560 fp = fopen(fn_env, "w");
568 ptra_ctx->trace_codedbuf_fn = fn_env;
569 ptra_ctx->trace_fp_codedbuf = fp;
570 va_infoMessage(pva_trace->dpy, "LIBVA_TRACE_CODEDBUF is on, save codedbuf into %s\n",
574 ptra_ctx->trace_surface_fn = fn_env;
575 ptra_ctx->trace_fp_surface = fp;
576 va_infoMessage(pva_trace->dpy, "LIBVA_TRACE_SURFACE is on, save surface into %s\n",
583 static int open_tracing_log_file(
584 struct va_trace *pva_trace,
585 struct trace_log_file *plog_file,
591 if(plog_file->used && plog_file->thread_id != thd_id) {
592 va_errorMessage(pva_trace->dpy, "Try to open a busy log file occupied by other thread\n");
597 if(plog_file->thread_id != thd_id) {
598 char env_value[1024];
600 strncpy(env_value, pva_trace->fn_log_env, 1024);
601 env_value[1023] = '\0';
602 FILE_NAME_SUFFIX(env_value, 1024,
603 "thd-", (unsigned int)thd_id);
605 if(plog_file->fn_log)
606 free(plog_file->fn_log);
608 plog_file->fn_log = strdup(env_value);
609 if(!plog_file->fn_log)
615 if(!plog_file->used) {
617 pfp = fopen(plog_file->fn_log, "w");
619 pfp = fopen(plog_file->fn_log, "a");
624 va_infoMessage(pva_trace->dpy, "%s %s for the thread 0x%08x\n",
625 new_fn_flag ? "Open new log file" : "Append to log file",
626 plog_file->fn_log, thd_id);
628 plog_file->fp_log = pfp;
629 plog_file->thread_id = thd_id;
636 if(plog_file->fn_log) {
637 free(plog_file->fn_log);
638 plog_file->fn_log = NULL;
644 static int get_log_file_idx_by_thd(
645 struct trace_log_files_manager *plog_files_mgr,
648 struct trace_log_file *plog_file = plog_files_mgr->log_file;
649 int first_free_idx = MAX_TRACE_THREAD_NUM;
652 for(i = 0;i < MAX_TRACE_THREAD_NUM;i++) {
653 if(plog_file[i].thread_id == thd_id)
655 else if(!plog_file[i].used &&
656 first_free_idx >= MAX_TRACE_THREAD_NUM)
660 if(i >= MAX_TRACE_THREAD_NUM)
666 static struct trace_log_file *start_tracing2log_file(
667 struct va_trace *pva_trace)
669 struct trace_log_files_manager *plog_files_mgr = NULL;
670 struct trace_log_file *plog_file = NULL;
671 pid_t thd_id = syscall(__NR_gettid);
674 LOCK_RESOURCE(pva_trace);
676 plog_files_mgr = &pva_trace->log_files_manager;
677 i = get_log_file_idx_by_thd(plog_files_mgr, thd_id);
678 if(i < MAX_TRACE_THREAD_NUM) {
679 plog_file = &plog_files_mgr->log_file[i];
680 if(open_tracing_log_file(pva_trace, plog_file, thd_id) < 0) {
685 UNLOCK_RESOURCE(pva_trace);
689 static void stop_tracing2log_file(
690 struct va_trace *pva_trace,
691 struct trace_log_file *plog_file)
693 LOCK_RESOURCE(pva_trace);
695 if(--plog_file->used <= 0) {
696 if(plog_file->fp_log) {
697 fclose(plog_file->fp_log);
698 plog_file->fp_log = NULL;
702 UNLOCK_RESOURCE(pva_trace);
705 static void refresh_log_file(
706 struct va_trace *pva_trace,
707 struct trace_context *ptra_ctx)
709 struct trace_log_file *plog_file = NULL;
710 pid_t thd_id = syscall(__NR_gettid);
713 plog_file = ptra_ctx->plog_file;
714 if(plog_file && plog_file->thread_id != thd_id) {
715 plog_file = start_tracing2log_file(pva_trace);
717 int first_free_idx = -1;
719 ptra_ctx->plog_file = plog_file;
721 for(i = 0;i < MAX_TRACE_THREAD_NUM;i++) {
722 if(!ptra_ctx->plog_file_list[i]){
723 if(first_free_idx < 0)
726 else if(ptra_ctx->plog_file_list[i]->thread_id == thd_id)
730 if(i > MAX_TRACE_THREAD_NUM
731 && first_free_idx >= 0)
732 ptra_ctx->plog_file_list[first_free_idx] = plog_file;
737 void va_TraceInit(VADisplay dpy)
739 char env_value[1024];
740 struct va_trace *pva_trace = calloc(sizeof(struct va_trace), 1);
741 struct trace_context *trace_ctx = calloc(sizeof(struct trace_context), 1);
743 if (pva_trace == NULL || trace_ctx == NULL) {
750 pva_trace->dpy = dpy;
752 pthread_mutex_init(&pva_trace->resource_mutex, NULL);
753 pthread_mutex_init(&pva_trace->context_mutex, NULL);
755 if (va_parseConfig("LIBVA_TRACE", &env_value[0]) == 0) {
756 pva_trace->fn_log_env = strdup(env_value);
757 trace_ctx->plog_file = start_tracing2log_file(pva_trace);
758 if(trace_ctx->plog_file) {
759 trace_ctx->plog_file_list[0] = trace_ctx->plog_file;
760 va_trace_flag = VA_TRACE_FLAG_LOG;
762 va_infoMessage(dpy, "LIBVA_TRACE is on, save log into %s\n",
763 trace_ctx->plog_file->fn_log);
766 va_errorMessage(dpy, "Open file %s failed (%s)\n", env_value, strerror(errno));
769 /* may re-get the global settings for multiple context */
770 if ((va_trace_flag & VA_TRACE_FLAG_LOG) && (va_parseConfig("LIBVA_TRACE_BUFDATA", NULL) == 0)) {
771 va_trace_flag |= VA_TRACE_FLAG_BUFDATA;
773 va_infoMessage(dpy, "LIBVA_TRACE_BUFDATA is on, dump buffer into log file\n");
776 /* per-context setting */
777 if (va_parseConfig("LIBVA_TRACE_CODEDBUF", &env_value[0]) == 0) {
778 pva_trace->fn_codedbuf_env = strdup(env_value);
779 va_trace_flag |= VA_TRACE_FLAG_CODEDBUF;
782 if (va_parseConfig("LIBVA_TRACE_SURFACE", &env_value[0]) == 0) {
783 pva_trace->fn_surface_env = strdup(env_value);
785 /* for surface data dump, it is time-consume, and may
786 * cause some side-effect, so only trace the needed surfaces
787 * to trace encode surface, set the trace file name to sth like *enc*
788 * to trace decode surface, set the trace file name to sth like *dec*
789 * if no dec/enc in file name, set both
791 if (strstr(env_value, "dec"))
792 va_trace_flag |= VA_TRACE_FLAG_SURFACE_DECODE;
793 if (strstr(env_value, "enc"))
794 va_trace_flag |= VA_TRACE_FLAG_SURFACE_ENCODE;
795 if (strstr(env_value, "jpeg") || strstr(env_value, "jpg"))
796 va_trace_flag |= VA_TRACE_FLAG_SURFACE_JPEG;
798 if (va_parseConfig("LIBVA_TRACE_SURFACE_GEOMETRY", &env_value[0]) == 0) {
799 char *p = env_value, *q;
801 trace_ctx->trace_surface_width = strtod(p, &q);
802 p = q+1; /* skip "x" */
803 trace_ctx->trace_surface_height = strtod(p, &q);
804 p = q+1; /* skip "+" */
805 trace_ctx->trace_surface_xoff = strtod(p, &q);
806 p = q+1; /* skip "+" */
807 trace_ctx->trace_surface_yoff = strtod(p, &q);
809 va_infoMessage(dpy, "LIBVA_TRACE_SURFACE_GEOMETRY is on, only dump surface %dx%d+%d+%d content\n",
810 trace_ctx->trace_surface_width,
811 trace_ctx->trace_surface_height,
812 trace_ctx->trace_surface_xoff,
813 trace_ctx->trace_surface_yoff);
817 trace_ctx->trace_context = VA_INVALID_ID;
818 pva_trace->ptra_ctx[MAX_TRACE_CTX_NUM] = trace_ctx;
820 ((VADisplayContextP)dpy)->vatrace = (void *)pva_trace;
826 void va_TraceEnd(VADisplay dpy)
828 struct va_trace *pva_trace = NULL;
831 pva_trace = (struct va_trace *)(((VADisplayContextP)dpy)->vatrace);
835 if(pva_trace->fn_log_env)
836 free(pva_trace->fn_log_env);
838 if(pva_trace->fn_codedbuf_env)
839 free(pva_trace->fn_codedbuf_env);
841 if(pva_trace->fn_surface_env)
842 free(pva_trace->fn_surface_env);
844 for(i = 0;i < MAX_TRACE_BUF_INFO_HASH_LEVEL;i++)
845 if(pva_trace->buf_manager.pbuf_info[i])
846 free(pva_trace->buf_manager.pbuf_info[i]);
848 for(i = 0;i < MAX_TRACE_THREAD_NUM;i++) {
849 struct trace_log_file *plog_file = NULL;
851 if(pva_trace->log_files_manager.num <= 0)
854 plog_file = &pva_trace->log_files_manager.log_file[i];
856 if(plog_file->fn_log)
857 free(plog_file->fn_log);
859 if(plog_file->fp_log)
860 fclose(plog_file->fp_log);
862 pva_trace->log_files_manager.num--;
866 for(i = 0;i < MAX_TRACE_CTX_NUM;i++) {
867 struct trace_context *trace_ctx = NULL;
869 if(pva_trace->context_num <= 0)
872 trace_ctx = pva_trace->ptra_ctx[i];
874 if(trace_ctx->trace_codedbuf_fn)
875 free(trace_ctx->trace_codedbuf_fn);
877 if(trace_ctx->trace_fp_codedbuf)
878 fclose(trace_ctx->trace_fp_codedbuf);
880 if(trace_ctx->trace_surface_fn)
881 free(trace_ctx->trace_surface_fn);
883 if(trace_ctx->trace_fp_surface)
884 fclose(trace_ctx->trace_fp_surface);
886 free(pva_trace->ptra_ctx[i]);
887 pva_trace->context_num--;
890 free(pva_trace->ptra_ctx[MAX_TRACE_CTX_NUM]);
892 pva_trace->dpy = NULL;
894 ((VADisplayContextP)dpy)->vatrace = NULL;
897 static void va_TraceVPrint(struct trace_context *trace_ctx, const char *msg, va_list args)
901 if (!(va_trace_flag & VA_TRACE_FLAG_LOG)
902 || !trace_ctx->plog_file)
905 fp = trace_ctx->plog_file->fp_log;
907 vfprintf(fp, msg, args);
912 static void va_TracePrint(struct trace_context *trace_ctx, const char *msg, ...)
916 va_TraceVPrint(trace_ctx, msg, args);
920 static void va_TraceMsg(struct trace_context *trace_ctx, const char *msg, ...)
926 va_TracePrint(trace_ctx, msg);
930 if (gettimeofday(&tv, NULL) == 0)
931 va_TracePrint(trace_ctx, "[%04d.%06d]",
932 (unsigned int)tv.tv_sec & 0xffff, (unsigned int)tv.tv_usec);
934 if(trace_ctx->trace_context != VA_INVALID_ID)
935 va_TracePrint(trace_ctx,
936 "[ctx 0x%08x]", trace_ctx->trace_context);
938 va_TracePrint(trace_ctx, "[ctx none]");
941 va_TraceVPrint(trace_ctx, msg, args);
945 static void va_TraceSurface(VADisplay dpy, VAContextID context)
948 unsigned int fourcc; /* following are output argument */
949 unsigned int luma_stride;
950 unsigned int chroma_u_stride;
951 unsigned int chroma_v_stride;
952 unsigned int luma_offset;
953 unsigned int chroma_u_offset;
954 unsigned int chroma_v_offset;
955 unsigned int buffer_name;
957 unsigned char *Y_data, *UV_data, *tmp;
959 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
961 if (!trace_ctx->trace_fp_surface)
964 va_TraceMsg(trace_ctx, "==========dump surface data in file %s\n", trace_ctx->trace_surface_fn);
966 va_TraceMsg(trace_ctx, NULL);
968 va_status = vaLockSurface(
970 trace_ctx->trace_rendertarget,
972 &luma_stride, &chroma_u_stride, &chroma_v_stride,
973 &luma_offset, &chroma_u_offset, &chroma_v_offset,
974 &buffer_name, &buffer);
976 if (va_status != VA_STATUS_SUCCESS) {
977 va_TraceMsg(trace_ctx, "Error:vaLockSurface failed\n");
981 va_TraceMsg(trace_ctx, "\tfourcc = 0x%08x\n", fourcc);
982 va_TraceMsg(trace_ctx, "\twidth = %d\n", trace_ctx->trace_frame_width);
983 va_TraceMsg(trace_ctx, "\theight = %d\n", trace_ctx->trace_frame_height);
984 va_TraceMsg(trace_ctx, "\tluma_stride = %d\n", luma_stride);
985 va_TraceMsg(trace_ctx, "\tchroma_u_stride = %d\n", chroma_u_stride);
986 va_TraceMsg(trace_ctx, "\tchroma_v_stride = %d\n", chroma_v_stride);
987 va_TraceMsg(trace_ctx, "\tluma_offset = %d\n", luma_offset);
988 va_TraceMsg(trace_ctx, "\tchroma_u_offset = %d\n", chroma_u_offset);
989 va_TraceMsg(trace_ctx, "\tchroma_v_offset = %d\n", chroma_v_offset);
991 if (buffer == NULL) {
992 va_TraceMsg(trace_ctx, "Error:vaLockSurface return NULL buffer\n");
993 va_TraceMsg(trace_ctx, NULL);
995 vaUnlockSurface(dpy, trace_ctx->trace_rendertarget);
998 va_TraceMsg(trace_ctx, "\tbuffer location = 0x%08x\n", buffer);
999 va_TraceMsg(trace_ctx, NULL);
1001 Y_data = (unsigned char*)buffer;
1002 UV_data = (unsigned char*)buffer + chroma_u_offset;
1004 tmp = Y_data + luma_stride * trace_ctx->trace_surface_yoff;
1005 for (i=0; i<trace_ctx->trace_surface_height; i++) {
1006 fwrite(tmp + trace_ctx->trace_surface_xoff,
1007 trace_ctx->trace_surface_width,
1008 1, trace_ctx->trace_fp_surface);
1012 tmp = UV_data + chroma_u_stride * trace_ctx->trace_surface_yoff / 2;
1013 if (fourcc == VA_FOURCC_NV12) {
1014 for (i=0; i<trace_ctx->trace_surface_height/2; i++) {
1015 fwrite(tmp + trace_ctx->trace_surface_xoff,
1016 trace_ctx->trace_surface_width,
1017 1, trace_ctx->trace_fp_surface);
1019 tmp += chroma_u_stride;
1023 fflush(trace_ctx->trace_fp_surface);
1025 vaUnlockSurface(dpy, trace_ctx->trace_rendertarget);
1027 va_TraceMsg(trace_ctx, NULL);
1031 void va_TraceInitialize (
1033 int *major_version, /* out */
1034 int *minor_version /* out */
1037 DPY2TRACE_VIRCTX(dpy);
1038 TRACE_FUNCNAME(idx);
1039 DPY2TRACE_VIRCTX_EXIT(pva_trace);
1042 void va_TraceTerminate (
1046 DPY2TRACE_VIRCTX(dpy);
1047 TRACE_FUNCNAME(idx);
1048 va_TraceMsg(trace_ctx, NULL);
1049 DPY2TRACE_VIRCTX_EXIT(pva_trace);
1053 void va_TraceCreateConfig(
1056 VAEntrypoint entrypoint,
1057 VAConfigAttrib *attrib_list,
1059 VAConfigID *config_id /* out */
1064 DPY2TRACE_VIRCTX(dpy);
1066 TRACE_FUNCNAME(idx);
1068 va_TraceMsg(trace_ctx, "\tprofile = %d\n", profile);
1069 va_TraceMsg(trace_ctx, "\tentrypoint = %d\n", entrypoint);
1070 va_TraceMsg(trace_ctx, "\tnum_attribs = %d\n", num_attribs);
1072 for (i = 0; i < num_attribs; i++) {
1073 va_TraceMsg(trace_ctx, "\t\tattrib_list[%d].type = 0x%08x\n", i, attrib_list[i].type);
1074 va_TraceMsg(trace_ctx, "\t\tattrib_list[%d].value = 0x%08x\n", i, attrib_list[i].value);
1077 va_TraceMsg(trace_ctx, NULL);
1079 add_trace_config_info(pva_trace, *config_id, profile, entrypoint);
1081 DPY2TRACE_VIRCTX_EXIT(pva_trace);
1084 void va_TraceDestroyConfig (
1086 VAConfigID config_id
1089 DPY2TRACE_VIRCTX(dpy);
1091 TRACE_FUNCNAME(idx);
1093 va_TraceMsg(trace_ctx, "\tconfig = 0x%08x\n", config_id);
1094 va_TraceMsg(trace_ctx, NULL);
1096 delete_trace_config_info(pva_trace, config_id);
1098 DPY2TRACE_VIRCTX_EXIT(pva_trace);
1101 static void va_TraceSurfaceAttributes(
1102 struct trace_context *trace_ctx,
1103 VASurfaceAttrib *attrib_list,
1104 unsigned int *num_attribs
1110 if (!attrib_list || !num_attribs)
1115 if (num > VASurfaceAttribCount)
1116 num = VASurfaceAttribCount;
1118 for (i=0; i<num; i++) {
1119 int type = p->value.type;
1121 va_TraceMsg(trace_ctx, "\tattrib_list[%i] =\n", i);
1123 va_TraceMsg(trace_ctx, "\t\ttype = %d\n", p->type);
1124 va_TraceMsg(trace_ctx, "\t\tflags = %d\n", p->flags);
1125 va_TraceMsg(trace_ctx, "\t\tvalue.type = %d\n", type);
1127 case VAGenericValueTypeInteger:
1128 va_TraceMsg(trace_ctx, "\t\tvalue.value.i = 0x%08x\n", p->value.value.i);
1130 case VAGenericValueTypeFloat:
1131 va_TraceMsg(trace_ctx, "\t\tvalue.value.f = %f\n", p->value.value.f);
1133 case VAGenericValueTypePointer:
1134 va_TraceMsg(trace_ctx, "\t\tvalue.value.p = %p\n", p->value.value.p);
1135 if ((p->type == VASurfaceAttribExternalBufferDescriptor) && p->value.value.p) {
1136 VASurfaceAttribExternalBuffers *tmp = (VASurfaceAttribExternalBuffers *) p->value.value.p;
1139 va_TraceMsg(trace_ctx, "\t\t--VASurfaceAttribExternalBufferDescriptor\n");
1140 va_TraceMsg(trace_ctx, "\t\t pixel_format=0x%08x\n", tmp->pixel_format);
1141 va_TraceMsg(trace_ctx, "\t\t width=%d\n", tmp->width);
1142 va_TraceMsg(trace_ctx, "\t\t height=%d\n", tmp->height);
1143 va_TraceMsg(trace_ctx, "\t\t data_size=%d\n", tmp->data_size);
1144 va_TraceMsg(trace_ctx, "\t\t num_planes=%d\n", tmp->num_planes);
1145 va_TraceMsg(trace_ctx, "\t\t pitches[4]=%d %d %d %d\n",
1146 tmp->pitches[0], tmp->pitches[1], tmp->pitches[2], tmp->pitches[3]);
1147 va_TraceMsg(trace_ctx, "\t\t offsets[4]=%d %d %d %d\n",
1148 tmp->offsets[0], tmp->offsets[1], tmp->offsets[2], tmp->offsets[3]);
1149 va_TraceMsg(trace_ctx, "\t\t flags=0x%08x\n", tmp->flags);
1150 va_TraceMsg(trace_ctx, "\t\t num_buffers=0x%08x\n", tmp->num_buffers);
1151 va_TraceMsg(trace_ctx, "\t\t buffers=%p\n", tmp->buffers);
1152 for (j = 0; j < tmp->num_buffers; j++) {
1153 va_TraceMsg(trace_ctx, "\t\t\tbuffers[%d]=%p\n", j, tmp->buffers[j]);
1157 case VAGenericValueTypeFunc:
1158 va_TraceMsg(trace_ctx, "\t\tvalue.value.fn = %p\n", p->value.value.fn);
1168 void va_TraceCreateSurfaces(
1174 VASurfaceID *surfaces, /* out */
1175 VASurfaceAttrib *attrib_list,
1176 unsigned int num_attribs
1180 DPY2TRACE_VIRCTX(dpy);
1182 TRACE_FUNCNAME(idx);
1184 va_TraceMsg(trace_ctx, "\twidth = %d\n", width);
1185 va_TraceMsg(trace_ctx, "\theight = %d\n", height);
1186 va_TraceMsg(trace_ctx, "\tformat = %d\n", format);
1187 va_TraceMsg(trace_ctx, "\tnum_surfaces = %d\n", num_surfaces);
1190 for (i = 0; i < num_surfaces; i++)
1191 va_TraceMsg(trace_ctx, "\t\tsurfaces[%d] = 0x%08x\n", i, surfaces[i]);
1194 va_TraceSurfaceAttributes(trace_ctx, attrib_list, &num_attribs);
1196 va_TraceMsg(trace_ctx, NULL);
1198 DPY2TRACE_VIRCTX_EXIT(pva_trace);
1201 void va_TraceDestroySurfaces(
1203 VASurfaceID *surface_list,
1208 DPY2TRACE_VIRCTX(dpy);
1210 TRACE_FUNCNAME(idx);
1213 for (i = 0; i < num_surfaces; i++)
1214 va_TraceMsg(trace_ctx, "\t\tsurfaces[%d] = 0x%08x\n", i, surface_list[i]);
1217 va_TraceMsg(trace_ctx, NULL);
1219 DPY2TRACE_VIRCTX_EXIT(pva_trace);
1223 static void internal_TraceUpdateContext (
1224 struct va_trace *pva_trace,
1226 struct trace_context *new_trace_ctx,
1227 VAContextID context,
1231 struct trace_context *trace_ctx = NULL;
1232 int i = 0, delete = 1;
1233 pid_t thd_id = syscall(__NR_gettid);
1235 if(tra_ctx_idx >= MAX_TRACE_CTX_NUM)
1238 LOCK_RESOURCE(pva_trace);
1240 trace_ctx = pva_trace->ptra_ctx[tra_ctx_idx];
1242 if(!new_trace_ctx &&
1243 trace_ctx->created_thd_id != thd_id
1248 pva_trace->context_num--;
1249 pva_trace->ptra_ctx[tra_ctx_idx] = NULL;
1254 new_trace_ctx->created_thd_id = thd_id;
1255 pva_trace->ptra_ctx[tra_ctx_idx] = new_trace_ctx;
1256 pva_trace->context_num++;
1259 UNLOCK_RESOURCE(pva_trace);
1261 if(trace_ctx && delete) {
1262 for(i = 0;i < MAX_TRACE_THREAD_NUM;i++)
1263 if(trace_ctx->plog_file_list[i])
1264 stop_tracing2log_file(pva_trace, trace_ctx->plog_file_list[i]);
1266 if(trace_ctx->trace_codedbuf_fn)
1267 free(trace_ctx->trace_codedbuf_fn);
1269 if(trace_ctx->trace_fp_codedbuf)
1270 fclose(trace_ctx->trace_fp_codedbuf);
1272 if(trace_ctx->trace_surface_fn)
1273 free(trace_ctx->trace_surface_fn);
1275 if(trace_ctx->trace_fp_surface)
1276 fclose(trace_ctx->trace_fp_surface);
1278 //delete_trace_all_context_buf(pva_trace, context);
1284 void va_TraceCreateContext(
1286 VAConfigID config_id,
1290 VASurfaceID *render_targets,
1291 int num_render_targets,
1292 VAContextID *context /* out */
1295 struct va_trace *pva_trace = NULL;
1296 struct trace_context *trace_ctx = NULL;
1298 int encode = 0, decode = 0, jpeg = 0;
1301 pva_trace = (struct va_trace *)(((VADisplayContextP)dpy)->vatrace);
1303 || *context == VA_INVALID_ID
1305 va_errorMessage(dpy, "Invalid context id 0x%08x\n",
1306 context == NULL ? 0 : (int)*context);
1310 LOCK_CONTEXT(pva_trace);
1312 tra_ctx_id = get_free_ctx_idx(pva_trace, *context);
1313 if(tra_ctx_id >= MAX_TRACE_CTX_NUM) {
1314 va_errorMessage(dpy, "Can't get trace context for ctx 0x%08x\n",
1320 trace_ctx = calloc(sizeof(struct trace_context), 1);
1321 if(trace_ctx == NULL) {
1322 va_errorMessage(dpy, "Allocate trace context failed for ctx 0x%08x\n",
1328 i = get_valid_config_idx(pva_trace, config_id);
1329 if(i >= MAX_TRACE_CTX_NUM) {
1330 va_errorMessage(dpy, "Can't get trace config id for ctx 0x%08x cfg %x\n",
1331 *context, config_id);
1335 trace_ctx->trace_profile = pva_trace->config_info[i].trace_profile;
1336 trace_ctx->trace_entrypoint = pva_trace->config_info[i].trace_entrypoint;
1338 if(va_trace_flag & VA_TRACE_FLAG_LOG) {
1339 trace_ctx->plog_file = start_tracing2log_file(pva_trace);
1340 if(!trace_ctx->plog_file) {
1341 va_errorMessage(dpy, "Can't get trace log file for ctx 0x%08x\n",
1347 va_infoMessage(dpy, "Save context 0x%08x into log file %s\n", *context,
1348 trace_ctx->plog_file->fn_log);
1350 trace_ctx->plog_file_list[0] = trace_ctx->plog_file;
1353 trace_ctx->trace_context = *context;
1354 TRACE_FUNCNAME(idx);
1355 va_TraceMsg(trace_ctx, "\tcontext = 0x%08x va_trace_flag 0x%x\n", *context, va_trace_flag);
1356 va_TraceMsg(trace_ctx, "\tprofile = %d entrypoint = %d\n", trace_ctx->trace_profile,
1357 trace_ctx->trace_entrypoint);
1358 va_TraceMsg(trace_ctx, "\tconfig = 0x%08x\n", config_id);
1359 va_TraceMsg(trace_ctx, "\twidth = %d\n", picture_width);
1360 va_TraceMsg(trace_ctx, "\theight = %d\n", picture_height);
1361 va_TraceMsg(trace_ctx, "\tflag = 0x%08x\n", flag);
1362 va_TraceMsg(trace_ctx, "\tnum_render_targets = %d\n", num_render_targets);
1363 if (render_targets) {
1364 for (i=0; i<num_render_targets; i++)
1365 va_TraceMsg(trace_ctx, "\t\trender_targets[%d] = 0x%08x\n", i, render_targets[i]);
1368 trace_ctx->trace_frame_no = 0;
1369 trace_ctx->trace_slice_no = 0;
1371 trace_ctx->trace_frame_width = picture_width;
1372 trace_ctx->trace_frame_height = picture_height;
1374 if (trace_ctx->trace_surface_width == 0)
1375 trace_ctx->trace_surface_width = picture_width;
1376 if (trace_ctx->trace_surface_height == 0)
1377 trace_ctx->trace_surface_height = picture_height;
1379 /* avoid to create so many empty files */
1380 encode = (trace_ctx->trace_entrypoint == VAEntrypointEncSlice);
1381 decode = (trace_ctx->trace_entrypoint == VAEntrypointVLD);
1382 jpeg = (trace_ctx->trace_entrypoint == VAEntrypointEncPicture);
1383 if ((encode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_ENCODE)) ||
1384 (decode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_DECODE)) ||
1385 (jpeg && (va_trace_flag & VA_TRACE_FLAG_SURFACE_JPEG))) {
1386 if(open_tracing_specil_file(pva_trace, trace_ctx, 1) < 0) {
1387 va_errorMessage(dpy, "Open surface fail failed for ctx 0x%08x\n", *context);
1389 va_trace_flag &= ~(VA_TRACE_FLAG_SURFACE);
1393 if (encode && (va_trace_flag & VA_TRACE_FLAG_CODEDBUF)) {
1394 if(open_tracing_specil_file(pva_trace, trace_ctx, 0) < 0) {
1395 va_errorMessage(dpy, "Open codedbuf fail failed for ctx 0x%08x\n", *context);
1397 va_trace_flag &= ~(VA_TRACE_FLAG_CODEDBUF);
1401 internal_TraceUpdateContext(pva_trace, tra_ctx_id, trace_ctx, *context, 0);
1403 UNLOCK_CONTEXT(pva_trace);
1407 internal_TraceUpdateContext(pva_trace, tra_ctx_id, NULL, *context, 1);
1409 UNLOCK_CONTEXT(pva_trace);
1415 void va_TraceDestroyContext (
1420 struct va_trace *pva_trace = NULL;
1421 struct trace_context *trace_ctx = NULL;
1424 pva_trace = (struct va_trace *)(((VADisplayContextP)dpy)->vatrace);
1429 LOCK_CONTEXT(pva_trace);
1431 ctx_id = get_valid_ctx_idx(pva_trace, context);
1432 if(ctx_id < MAX_TRACE_CTX_NUM) {
1433 trace_ctx = pva_trace->ptra_ctx[ctx_id];
1436 refresh_log_file(pva_trace, trace_ctx);
1438 internal_TraceUpdateContext(pva_trace,
1439 get_valid_ctx_idx(pva_trace, context),
1444 UNLOCK_CONTEXT(pva_trace);
1447 void va_TraceCreateMFContext (
1449 VAMFContextID *mf_context /* out */
1452 DPY2TRACECTX(dpy, VA_INVALID_ID, VA_INVALID_ID);
1453 TRACE_FUNCNAME(idx);
1455 va_TraceMsg(trace_ctx, "\tmf_context = 0x%08x\n", *mf_context);
1456 trace_ctx->trace_context = *mf_context;
1458 trace_ctx->trace_context = VA_INVALID_ID;
1461 void va_TraceMFAddContext (
1463 VAMFContextID mf_context,
1467 DPY2TRACECTX(dpy, mf_context, VA_INVALID_ID);
1469 TRACE_FUNCNAME(idx);
1470 va_TraceMsg(trace_ctx, "\tmf_context = 0x%08x\n", mf_context);
1471 va_TraceMsg(trace_ctx, "\tcontext = 0x%08x\n", context);
1474 void va_TraceMFReleaseContext (
1476 VAMFContextID mf_context,
1480 DPY2TRACECTX(dpy, mf_context, VA_INVALID_ID);
1482 TRACE_FUNCNAME(idx);
1483 va_TraceMsg(trace_ctx, "\tmf_context = 0x%08x\n", mf_context);
1484 va_TraceMsg(trace_ctx, "\tcontext = 0x%08x\n", context);
1487 void va_TraceMFSubmit (
1489 VAMFContextID mf_context,
1490 VAContextID *contexts,
1496 DPY2TRACECTX(dpy, mf_context, VA_INVALID_ID);
1498 TRACE_FUNCNAME(idx);
1499 va_TraceMsg(trace_ctx, "\tmf_context = 0x%08x\n", mf_context);
1501 for(i = 0; i < num_contexts; i++){
1502 va_TraceMsg(trace_ctx, "\t\tcontext[%d] = 0x%08x\n", i, contexts[i]);
1506 void va_TraceCreateBuffer (
1508 VAContextID context, /* in */
1509 VABufferType type, /* in */
1510 unsigned int size, /* in */
1511 unsigned int num_elements, /* in */
1512 void *data, /* in */
1513 VABufferID *buf_id /* out */
1516 if (!buf_id || *buf_id == VA_INVALID_ID)
1519 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1521 add_trace_buf_info(pva_trace, context, *buf_id);
1523 /* only trace CodedBuffer */
1524 if (type != VAEncCodedBufferType)
1527 TRACE_FUNCNAME(idx);
1528 va_TraceMsg(trace_ctx, "\tbuf_type=%s\n", vaBufferTypeStr(type));
1530 va_TraceMsg(trace_ctx, "\tbuf_id=0x%x\n", *buf_id);
1531 va_TraceMsg(trace_ctx, "\tsize=%u\n", size);
1532 va_TraceMsg(trace_ctx, "\tnum_elements=%u\n", num_elements);
1534 va_TraceMsg(trace_ctx, NULL);
1537 void va_TraceDestroyBuffer (
1539 VABufferID buf_id /* in */
1544 unsigned int num_elements;
1546 if (buf_id == VA_INVALID_ID)
1549 DPY2TRACECTX(dpy, VA_INVALID_ID, buf_id);
1551 vaBufferInfo(dpy, trace_ctx->trace_context, buf_id, &type, &size, &num_elements);
1553 delete_trace_buf_info(pva_trace, buf_id);
1555 /* only trace CodedBuffer */
1556 if (type != VAEncCodedBufferType)
1559 TRACE_FUNCNAME(idx);
1560 va_TraceMsg(trace_ctx, "\tbuf_type=%s\n", vaBufferTypeStr(type));
1561 va_TraceMsg(trace_ctx, "\tbuf_id=0x%x\n", buf_id);
1562 va_TraceMsg(trace_ctx, "\tsize=%u\n", size);
1563 va_TraceMsg(trace_ctx, "\tnum_elements=%u\n", num_elements);
1565 va_TraceMsg(trace_ctx, NULL);
1569 static void mem_put_le16(char *mem, unsigned int val)
1575 static void mem_put_le32(char *mem, unsigned int val)
1583 static void va_TraceCodedBufferIVFHeader(struct trace_context *trace_ctx, void **pbuf)
1585 VACodedBufferSegment *buf_list;
1586 unsigned int frame_length = 0;
1589 buf_list = (VACodedBufferSegment *)(*pbuf);
1591 if (ftell(trace_ctx->trace_fp_codedbuf) == 0) { /* write ivf header */
1596 mem_put_le16(header+4, 0); /* version */
1597 mem_put_le16(header+6, 32); /* headersize */
1598 mem_put_le32(header+8, 0x30385056); /* headersize */
1599 /* write width and height of the first rc_param to IVF file header */
1600 mem_put_le16(header+12, trace_ctx->trace_frame_width); /* width */
1601 mem_put_le16(header+14, trace_ctx->trace_frame_height); /* height */
1602 mem_put_le32(header+16, 30); /* rate */
1603 mem_put_le32(header+20, 1); /* scale */
1604 mem_put_le32(header+24, 0xffffffff); /* length */
1605 mem_put_le32(header+28, 0); /* unused */
1606 fwrite(header, 1, 32, trace_ctx->trace_fp_codedbuf);
1609 /* write frame header */
1610 while (buf_list != NULL) {
1611 frame_length += buf_list->size;
1612 buf_list = (VACodedBufferSegment *) buf_list->next;
1614 mem_put_le32(header, frame_length);
1615 mem_put_le32(header+4, trace_ctx->pts&0xFFFFFFFF);
1616 mem_put_le32(header+8, 0);
1617 fwrite(header, 1, 12, trace_ctx->trace_fp_codedbuf);
1620 fflush(trace_ctx->trace_fp_codedbuf);
1623 void va_TraceMapBuffer (
1625 VABufferID buf_id, /* in */
1626 void **pbuf /* out */
1631 unsigned int num_elements;
1633 VACodedBufferSegment *buf_list;
1636 DPY2TRACECTX(dpy, VA_INVALID_ID, buf_id);
1638 vaBufferInfo(dpy, trace_ctx->trace_context, buf_id, &type, &size, &num_elements);
1640 /* only trace CodedBuffer */
1641 if (type != VAEncCodedBufferType)
1644 TRACE_FUNCNAME(idx);
1645 va_TraceMsg(trace_ctx, "\tbuf_id=0x%x\n", buf_id);
1646 va_TraceMsg(trace_ctx, "\tbuf_type=%s\n", vaBufferTypeStr(type));
1647 if ((pbuf == NULL) || (*pbuf == NULL))
1650 if (trace_ctx->trace_profile == VAProfileVP8Version0_3) {
1651 va_TraceMsg(trace_ctx, "\tAdd IVF header information\n");
1652 va_TraceCodedBufferIVFHeader(trace_ctx, pbuf);
1655 buf_list = (VACodedBufferSegment *)(*pbuf);
1656 while (buf_list != NULL) {
1657 va_TraceMsg(trace_ctx, "\tCodedbuf[%d] =\n", i++);
1659 va_TraceMsg(trace_ctx, "\t size = %u\n", buf_list->size);
1660 va_TraceMsg(trace_ctx, "\t bit_offset = %u\n", buf_list->bit_offset);
1661 va_TraceMsg(trace_ctx, "\t status = 0x%08x\n", buf_list->status);
1662 va_TraceMsg(trace_ctx, "\t reserved = 0x%08x\n", buf_list->reserved);
1663 va_TraceMsg(trace_ctx, "\t buf = 0x%08x\n", buf_list->buf);
1665 if (trace_ctx->trace_fp_codedbuf) {
1666 va_TraceMsg(trace_ctx, "\tDump the content to file\n");
1667 fwrite(buf_list->buf, buf_list->size, 1, trace_ctx->trace_fp_codedbuf);
1669 fflush(trace_ctx->trace_fp_codedbuf);
1672 buf_list = buf_list->next;
1674 va_TraceMsg(trace_ctx, NULL);
1677 static void va_TraceVABuffers(
1679 VAContextID context,
1683 unsigned int num_elements,
1688 unsigned char *p = pbuf;
1691 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1693 va_TracePrint(trace_ctx, "--%s\n", vaBufferTypeStr(type));
1695 if(trace_ctx->plog_file)
1696 fp = trace_ctx->plog_file->fp_log;
1698 if ((va_trace_flag & VA_TRACE_FLAG_BUFDATA) && fp) {
1699 for (i=0; i<size; i++) {
1700 unsigned char value = p[i];
1703 fprintf(fp, "\t\t0x%04x:", i);
1704 else if ((i%16) == 0)
1705 fprintf(fp, "\n\t\t0x%04x:", i);
1707 fprintf(fp, " %02x", value);
1712 va_TraceMsg(trace_ctx, NULL);
1718 static void va_TraceVAPictureParameterBufferMPEG2(
1720 VAContextID context,
1724 unsigned int num_elements,
1727 VAPictureParameterBufferMPEG2 *p=(VAPictureParameterBufferMPEG2 *)data;
1728 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1730 va_TraceMsg(trace_ctx,"VAPictureParameterBufferMPEG2\n");
1732 va_TraceMsg(trace_ctx,"\thorizontal size= %d\n", p->horizontal_size);
1733 va_TraceMsg(trace_ctx,"\tvertical size= %d\n", p->vertical_size);
1734 va_TraceMsg(trace_ctx,"\tforward reference picture= %d\n", p->forward_reference_picture);
1735 va_TraceMsg(trace_ctx,"\tbackward reference picture= %d\n", p->backward_reference_picture);
1736 va_TraceMsg(trace_ctx,"\tpicture coding type= %d\n", p->picture_coding_type);
1737 va_TraceMsg(trace_ctx,"\tf mode= %d\n", p->f_code);
1739 va_TraceMsg(trace_ctx,"\tpicture coding extension = %d\n", p->picture_coding_extension.value);
1740 va_TraceMsg(trace_ctx,"\tintra_dc_precision= %d\n", p->picture_coding_extension.bits.intra_dc_precision);
1741 va_TraceMsg(trace_ctx,"\tpicture_structure= %d\n", p->picture_coding_extension.bits.picture_structure);
1742 va_TraceMsg(trace_ctx,"\ttop_field_first= %d\n", p->picture_coding_extension.bits.top_field_first);
1743 va_TraceMsg(trace_ctx,"\tframe_pred_frame_dct= %d\n", p->picture_coding_extension.bits.frame_pred_frame_dct);
1744 va_TraceMsg(trace_ctx,"\tconcealment_motion_vectors= %d\n", p->picture_coding_extension.bits.concealment_motion_vectors);
1745 va_TraceMsg(trace_ctx,"\tq_scale_type= %d\n", p->picture_coding_extension.bits.q_scale_type);
1746 va_TraceMsg(trace_ctx,"\tintra_vlc_format= %d\n", p->picture_coding_extension.bits.intra_vlc_format);
1747 va_TraceMsg(trace_ctx,"\talternate_scan= %d\n", p->picture_coding_extension.bits.alternate_scan);
1748 va_TraceMsg(trace_ctx,"\trepeat_first_field= %d\n", p->picture_coding_extension.bits.repeat_first_field);
1749 va_TraceMsg(trace_ctx,"\tprogressive_frame= %d\n", p->picture_coding_extension.bits.progressive_frame);
1750 va_TraceMsg(trace_ctx,"\tis_first_field= %d\n", p->picture_coding_extension.bits.is_first_field);
1751 va_TraceMsg(trace_ctx, NULL);
1757 static void va_TraceVAIQMatrixBufferMPEG2(
1759 VAContextID context,
1763 unsigned int num_elements,
1766 VAIQMatrixBufferMPEG2 *p=(VAIQMatrixBufferMPEG2 *)data;
1767 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1769 va_TraceMsg(trace_ctx,"VAIQMatrixBufferMPEG2\n");
1771 va_TraceMsg(trace_ctx,"\tload_intra_quantiser_matrix = %d\n", p->load_intra_quantiser_matrix);
1772 va_TraceMsg(trace_ctx,"\tload_non_intra_quantiser_matrix = %d\n", p->load_non_intra_quantiser_matrix);
1773 va_TraceMsg(trace_ctx,"\tload_chroma_intra_quantiser_matrix = %d\n", p->load_chroma_intra_quantiser_matrix);
1774 va_TraceMsg(trace_ctx,"\tload_chroma_non_intra_quantiser_matrix = %d\n", p->load_chroma_non_intra_quantiser_matrix);
1775 va_TraceMsg(trace_ctx,"\tintra_quantiser_matrix = %d\n", p->intra_quantiser_matrix);
1776 va_TraceMsg(trace_ctx,"\tnon_intra_quantiser_matrix = %d\n", p->non_intra_quantiser_matrix);
1777 va_TraceMsg(trace_ctx,"\tchroma_intra_quantiser_matrix = %d\n", p->chroma_intra_quantiser_matrix);
1778 va_TraceMsg(trace_ctx,"\tchroma_non_intra_quantiser_matrix = %d\n", p->chroma_non_intra_quantiser_matrix);
1779 va_TraceMsg(trace_ctx, NULL);
1785 static void va_TraceVASliceParameterBufferMPEG2(
1787 VAContextID context,
1791 unsigned int num_elements,
1794 VASliceParameterBufferMPEG2 *p=(VASliceParameterBufferMPEG2 *)data;
1796 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1798 trace_ctx->trace_slice_no++;
1800 trace_ctx->trace_slice_size = p->slice_data_size;
1802 va_TraceMsg(trace_ctx,"VASliceParameterBufferMPEG2\n");
1804 va_TraceMsg(trace_ctx,"\tslice_data_size = %d\n", p->slice_data_size);
1805 va_TraceMsg(trace_ctx,"\tslice_data_offset = %d\n", p->slice_data_offset);
1806 va_TraceMsg(trace_ctx,"\tslice_data_flag = %d\n", p->slice_data_flag);
1807 va_TraceMsg(trace_ctx,"\tmacroblock_offset = %d\n", p->macroblock_offset);
1808 va_TraceMsg(trace_ctx,"\tslice_horizontal_position = %d\n", p->slice_horizontal_position);
1809 va_TraceMsg(trace_ctx,"\tslice_vertical_position = %d\n", p->slice_vertical_position);
1810 va_TraceMsg(trace_ctx,"\tquantiser_scale_code = %d\n", p->quantiser_scale_code);
1811 va_TraceMsg(trace_ctx,"\tintra_slice_flag = %d\n", p->intra_slice_flag);
1812 va_TraceMsg(trace_ctx, NULL);
1817 static void va_TraceVAPictureParameterBufferJPEG(
1819 VAContextID context,
1823 unsigned int num_elements,
1827 VAPictureParameterBufferJPEGBaseline *p=(VAPictureParameterBufferJPEGBaseline *)data;
1828 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1830 va_TraceMsg(trace_ctx,"*VAPictureParameterBufferJPEG\n");
1831 va_TraceMsg(trace_ctx,"\tpicture_width = %u\n", p->picture_width);
1832 va_TraceMsg(trace_ctx,"\tpicture_height = %u\n", p->picture_height);
1833 va_TraceMsg(trace_ctx,"\tcomponents = \n");
1834 for (i = 0; i < p->num_components && i < 255; ++i) {
1835 va_TraceMsg(trace_ctx,"\t\t[%d] component_id = %u\n", i, p->components[i].component_id);
1836 va_TraceMsg(trace_ctx,"\t\t[%d] h_sampling_factor = %u\n", i, p->components[i].h_sampling_factor);
1837 va_TraceMsg(trace_ctx,"\t\t[%d] v_sampling_factor = %u\n", i, p->components[i].v_sampling_factor);
1838 va_TraceMsg(trace_ctx,"\t\t[%d] quantiser_table_selector = %u\n", i, p->components[i].quantiser_table_selector);
1842 static void va_TraceVAIQMatrixBufferJPEG(
1844 VAContextID context,
1848 unsigned int num_elements,
1852 static char tmp[1024];
1853 VAIQMatrixBufferJPEGBaseline *p=(VAIQMatrixBufferJPEGBaseline *)data;
1854 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1855 va_TraceMsg(trace_ctx,"*VAIQMatrixParameterBufferJPEG\n");
1856 va_TraceMsg(trace_ctx,"\tload_quantiser_table =\n");
1857 for (i = 0; i < 4; ++i) {
1858 va_TraceMsg(trace_ctx,"\t\t[%d] = %u\n", i, p->load_quantiser_table[i]);
1860 va_TraceMsg(trace_ctx,"\tquantiser_table =\n");
1861 for (i = 0; i < 4; ++i) {
1862 memset(tmp, 0, sizeof tmp);
1863 for (j = 0; j < 64; ++j) {
1864 sprintf(tmp + strlen(tmp), "%u ", p->quantiser_table[i][j]);
1866 va_TraceMsg(trace_ctx,"\t\t[%d] = %s\n", i, tmp);
1870 static void va_TraceVASliceParameterBufferJPEG(
1872 VAContextID context,
1876 unsigned int num_elements,
1880 VASliceParameterBufferJPEGBaseline *p=(VASliceParameterBufferJPEGBaseline *)data;
1881 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1882 va_TraceMsg(trace_ctx,"*VASliceParameterBufferJPEG\n");
1883 va_TraceMsg(trace_ctx,"\tslice_data_size = %u\n", p->slice_data_size);
1884 va_TraceMsg(trace_ctx,"\tslice_data_offset = %u\n", p->slice_data_offset);
1885 va_TraceMsg(trace_ctx,"\tslice_data_flag = %u\n", p->slice_data_flag);
1886 va_TraceMsg(trace_ctx,"\tslice_horizontal_position = %u\n", p->slice_horizontal_position);
1887 va_TraceMsg(trace_ctx,"\tslice_vertical_position = %u\n", p->slice_vertical_position);
1888 va_TraceMsg(trace_ctx,"\tcomponents = \n");
1889 for (i = 0; i < p->num_components && i < 4; ++i) {
1890 va_TraceMsg(trace_ctx,"\t\t[%d] component_selector = %u\n", i, p->components[i].component_selector);
1891 va_TraceMsg(trace_ctx,"\t\t[%d] dc_table_selector = %u\n", i, p->components[i].dc_table_selector);
1892 va_TraceMsg(trace_ctx,"\t\t[%d] ac_table_selector = %u\n", i, p->components[i].ac_table_selector);
1894 va_TraceMsg(trace_ctx,"\trestart_interval = %u\n", p->restart_interval);
1895 va_TraceMsg(trace_ctx,"\tnum_mcus = %u\n", p->num_mcus);
1898 static void va_TraceVAHuffmanTableBufferJPEG(
1900 VAContextID context,
1904 unsigned int num_elements,
1908 static char tmp[1024];
1909 VAHuffmanTableBufferJPEGBaseline *p=(VAHuffmanTableBufferJPEGBaseline *)data;
1910 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1911 va_TraceMsg(trace_ctx,"*VAHuffmanTableBufferJPEG\n");
1913 for (i = 0; i < 2; ++i) {
1914 va_TraceMsg(trace_ctx,"\tload_huffman_table[%d] =%u\n", i, p->load_huffman_table[i]);
1915 va_TraceMsg(trace_ctx,"\thuffman_table[%d] =\n", i);
1916 memset(tmp, 0, sizeof tmp);
1917 for (j = 0; j < 16; ++j) {
1918 sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].num_dc_codes[j]);
1920 va_TraceMsg(trace_ctx,"\t\tnum_dc_codes =%s\n", tmp);
1921 memset(tmp, 0, sizeof tmp);
1922 for (j = 0; j < 12; ++j) {
1923 sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].dc_values[j]);
1925 va_TraceMsg(trace_ctx,"\t\tdc_values =%s\n", tmp);
1926 memset(tmp, 0, sizeof tmp);
1927 for (j = 0; j < 16; ++j) {
1928 sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].num_ac_codes[j]);
1930 va_TraceMsg(trace_ctx,"\t\tnum_ac_codes =%s\n", tmp);
1931 memset(tmp, 0, sizeof tmp);
1932 for (j = 0; j < 162; ++j) {
1933 sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].ac_values[j]);
1935 va_TraceMsg(trace_ctx,"\t\tac_values =%s\n", tmp);
1936 memset(tmp, 0, sizeof tmp);
1937 for (j = 0; j < 2; ++j) {
1938 sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].pad[j]);
1940 va_TraceMsg(trace_ctx,"\t\tpad =%s\n", tmp);
1944 static void va_TraceVAPictureParameterBufferMPEG4(
1946 VAContextID context,
1950 unsigned int num_elements,
1954 VAPictureParameterBufferMPEG4 *p=(VAPictureParameterBufferMPEG4 *)data;
1956 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1958 va_TraceMsg(trace_ctx,"*VAPictureParameterBufferMPEG4\n");
1959 va_TraceMsg(trace_ctx,"\tvop_width = %d\n", p->vop_width);
1960 va_TraceMsg(trace_ctx,"\tvop_height = %d\n", p->vop_height);
1961 va_TraceMsg(trace_ctx,"\tforward_reference_picture = %d\n", p->forward_reference_picture);
1962 va_TraceMsg(trace_ctx,"\tbackward_reference_picture = %d\n", p->backward_reference_picture);
1963 va_TraceMsg(trace_ctx,"\tvol_fields value = %d\n", p->vol_fields.value);
1964 va_TraceMsg(trace_ctx,"\tshort_video_header= %d\n", p->vol_fields.bits.short_video_header);
1965 va_TraceMsg(trace_ctx,"\tchroma_format= %d\n", p->vol_fields.bits.chroma_format);
1966 va_TraceMsg(trace_ctx,"\tinterlaced= %d\n", p->vol_fields.bits.interlaced);
1967 va_TraceMsg(trace_ctx,"\tobmc_disable= %d\n", p->vol_fields.bits.obmc_disable);
1968 va_TraceMsg(trace_ctx,"\tsprite_enable= %d\n", p->vol_fields.bits.sprite_enable);
1969 va_TraceMsg(trace_ctx,"\tsprite_warping_accuracy= %d\n", p->vol_fields.bits.sprite_warping_accuracy);
1970 va_TraceMsg(trace_ctx,"\tquant_type= %d\n", p->vol_fields.bits.quant_type);
1971 va_TraceMsg(trace_ctx,"\tquarter_sample= %d\n", p->vol_fields.bits.quarter_sample);
1972 va_TraceMsg(trace_ctx,"\tdata_partitioned= %d\n", p->vol_fields.bits.data_partitioned);
1973 va_TraceMsg(trace_ctx,"\treversible_vlc= %d\n", p->vol_fields.bits.reversible_vlc);
1974 va_TraceMsg(trace_ctx,"\tresync_marker_disable= %d\n", p->vol_fields.bits.resync_marker_disable);
1975 va_TraceMsg(trace_ctx,"\tno_of_sprite_warping_points = %d\n", p->no_of_sprite_warping_points);
1976 va_TraceMsg(trace_ctx,"\tsprite_trajectory_du =");
1978 va_TraceMsg(trace_ctx,"\t%d", p->sprite_trajectory_du[i]);
1980 va_TraceMsg(trace_ctx,"\n");
1981 va_TraceMsg(trace_ctx,"\tsprite_trajectory_dv =");
1983 va_TraceMsg(trace_ctx,"\t%d", p->sprite_trajectory_dv[i]);
1984 va_TraceMsg(trace_ctx,"\n");
1985 va_TraceMsg(trace_ctx,"\tvop_fields value = %d\n", p->vop_fields.value);
1986 va_TraceMsg(trace_ctx,"\tvop_coding_type= %d\n", p->vop_fields.bits.vop_coding_type);
1987 va_TraceMsg(trace_ctx,"\tbackward_reference_vop_coding_type= %d\n", p->vop_fields.bits.backward_reference_vop_coding_type);
1988 va_TraceMsg(trace_ctx,"\tvop_rounding_type= %d\n", p->vop_fields.bits.vop_rounding_type);
1989 va_TraceMsg(trace_ctx,"\tintra_dc_vlc_thr= %d\n", p->vop_fields.bits.intra_dc_vlc_thr);
1990 va_TraceMsg(trace_ctx,"\ttop_field_first= %d\n", p->vop_fields.bits.top_field_first);
1991 va_TraceMsg(trace_ctx,"\talternate_vertical_scan_flag= %d\n", p->vop_fields.bits.alternate_vertical_scan_flag);
1992 va_TraceMsg(trace_ctx,"\tvop_fcode_forward = %d\n", p->vop_fcode_forward);
1993 va_TraceMsg(trace_ctx,"\tvop_fcode_backward = %d\n", p->vop_fcode_backward);
1994 va_TraceMsg(trace_ctx,"\tnum_gobs_in_vop = %d\n", p->num_gobs_in_vop);
1995 va_TraceMsg(trace_ctx,"\tnum_macroblocks_in_gob = %d\n", p->num_macroblocks_in_gob);
1996 va_TraceMsg(trace_ctx,"\tTRB = %d\n", p->TRB);
1997 va_TraceMsg(trace_ctx,"\tTRD = %d\n", p->TRD);
1998 va_TraceMsg(trace_ctx, NULL);
2004 static void va_TraceVAIQMatrixBufferMPEG4(
2006 VAContextID context,
2010 unsigned int num_elements,
2014 VAIQMatrixBufferMPEG4 *p=(VAIQMatrixBufferMPEG4 *)data;
2015 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2017 va_TraceMsg(trace_ctx,"VAIQMatrixBufferMPEG4\n");
2019 va_TraceMsg(trace_ctx,"\tload_intra_quant_mat = %d\n", p->load_intra_quant_mat);
2020 va_TraceMsg(trace_ctx,"\tload_non_intra_quant_mat = %d\n", p->load_non_intra_quant_mat);
2021 va_TraceMsg(trace_ctx,"\tintra_quant_mat =\n");
2023 va_TraceMsg(trace_ctx,"\t\t%d\n", p->intra_quant_mat[i]);
2025 va_TraceMsg(trace_ctx,"\tnon_intra_quant_mat =\n");
2027 va_TraceMsg(trace_ctx,"\t\t%d\n", p->non_intra_quant_mat[i]);
2028 va_TraceMsg(trace_ctx, NULL);
2033 static void va_TraceVAEncSequenceParameterBufferMPEG4(
2035 VAContextID context,
2039 unsigned int num_elements,
2042 VAEncSequenceParameterBufferMPEG4 *p = (VAEncSequenceParameterBufferMPEG4 *)data;
2043 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2045 va_TraceMsg(trace_ctx, "\t--VAEncSequenceParameterBufferMPEG4\n");
2047 va_TraceMsg(trace_ctx, "\tprofile_and_level_indication = %d\n", p->profile_and_level_indication);
2048 va_TraceMsg(trace_ctx, "\tintra_period = %d\n", p->intra_period);
2049 va_TraceMsg(trace_ctx, "\tvideo_object_layer_width = %d\n", p->video_object_layer_width);
2050 va_TraceMsg(trace_ctx, "\tvideo_object_layer_height = %d\n", p->video_object_layer_height);
2051 va_TraceMsg(trace_ctx, "\tvop_time_increment_resolution = %d\n", p->vop_time_increment_resolution);
2052 va_TraceMsg(trace_ctx, "\tfixed_vop_rate = %d\n", p->fixed_vop_rate);
2053 va_TraceMsg(trace_ctx, "\tfixed_vop_time_increment = %d\n", p->fixed_vop_time_increment);
2054 va_TraceMsg(trace_ctx, "\tbits_per_second = %d\n", p->bits_per_second);
2055 va_TraceMsg(trace_ctx, "\tframe_rate = %d\n", p->frame_rate);
2056 va_TraceMsg(trace_ctx, "\tinitial_qp = %d\n", p->initial_qp);
2057 va_TraceMsg(trace_ctx, "\tmin_qp = %d\n", p->min_qp);
2058 va_TraceMsg(trace_ctx, NULL);
2063 static void va_TraceVAEncPictureParameterBufferMPEG4(
2065 VAContextID context,
2069 unsigned int num_elements,
2072 VAEncPictureParameterBufferMPEG4 *p = (VAEncPictureParameterBufferMPEG4 *)data;
2073 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2075 va_TraceMsg(trace_ctx, "\t--VAEncPictureParameterBufferMPEG4\n");
2076 va_TraceMsg(trace_ctx, "\treference_picture = 0x%08x\n", p->reference_picture);
2077 va_TraceMsg(trace_ctx, "\treconstructed_picture = 0x%08x\n", p->reconstructed_picture);
2078 va_TraceMsg(trace_ctx, "\tcoded_buf = 0x%08x\n", p->coded_buf);
2079 va_TraceMsg(trace_ctx, "\tpicture_width = %d\n", p->picture_width);
2080 va_TraceMsg(trace_ctx, "\tpicture_height = %d\n", p->picture_height);
2081 va_TraceMsg(trace_ctx, "\tmodulo_time_base = %d\n", p->modulo_time_base);
2082 va_TraceMsg(trace_ctx, "\tvop_time_increment = %d\n", p->vop_time_increment);
2083 va_TraceMsg(trace_ctx, "\tpicture_type = %d\n", p->picture_type);
2084 va_TraceMsg(trace_ctx, NULL);
2090 static void va_TraceVASliceParameterBufferMPEG4(
2092 VAContextID context,
2096 unsigned int num_elements,
2099 VASliceParameterBufferMPEG4 *p=(VASliceParameterBufferMPEG4 *)data;
2101 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2103 trace_ctx->trace_slice_no++;
2105 trace_ctx->trace_slice_size = p->slice_data_size;
2107 va_TraceMsg(trace_ctx,"VASliceParameterBufferMPEG4\n");
2109 va_TraceMsg(trace_ctx,"\tslice_data_size = %d\n", p->slice_data_size);
2110 va_TraceMsg(trace_ctx,"\tslice_data_offset = %d\n", p->slice_data_offset);
2111 va_TraceMsg(trace_ctx,"\tslice_data_flag = %d\n", p->slice_data_flag);
2112 va_TraceMsg(trace_ctx,"\tmacroblock_offset = %d\n", p->macroblock_offset);
2113 va_TraceMsg(trace_ctx,"\tmacroblock_number = %d\n", p->macroblock_number);
2114 va_TraceMsg(trace_ctx,"\tquant_scale = %d\n", p->quant_scale);
2115 va_TraceMsg(trace_ctx, NULL);
2121 static inline void va_TraceFlagIfNotZero(
2122 struct trace_context *trace_ctx,
2123 const char *name, /* in */
2124 unsigned int flag /* in */
2128 va_TraceMsg(trace_ctx, "%s = %x\n", name, flag);
2133 static void va_TraceVAPictureParameterBufferHEVC(
2135 VAContextID context,
2139 unsigned int num_elements,
2143 VAPictureParameterBufferHEVC *p = (VAPictureParameterBufferHEVC*)data;
2145 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2147 va_TracePrint(trace_ctx, "VAPictureParameterBufferHEVC\n");
2149 va_TraceMsg(trace_ctx, "\tCurrPic.picture_id = 0x%08x\n", p->CurrPic.picture_id);
2150 va_TraceMsg(trace_ctx, "\tCurrPic.frame_idx = %d\n", p->CurrPic.pic_order_cnt);
2151 va_TraceMsg(trace_ctx, "\tCurrPic.flags = %d\n", p->CurrPic.flags);
2153 va_TraceMsg(trace_ctx, "\tReferenceFrames (TopFieldOrderCnt-BottomFieldOrderCnt-picture_id-frame_idx-flags:\n");
2154 for (i = 0; i < 15; i++)
2156 if ((p->ReferenceFrames[i].picture_id != VA_INVALID_SURFACE) &&
2157 ((p->ReferenceFrames[i].flags & VA_PICTURE_HEVC_INVALID) == 0)) {
2158 va_TraceMsg(trace_ctx, "\t\t%08d-%08d-0x%08x\n",
2159 p->ReferenceFrames[i].picture_id,
2160 p->ReferenceFrames[i].pic_order_cnt,
2161 p->ReferenceFrames[i].flags);
2163 va_TraceMsg(trace_ctx, "\t\tinv-inv-inv-inv-inv\n");
2165 va_TraceMsg(trace_ctx, "\n");
2167 va_TraceMsg(trace_ctx, "\tpic_width_in_luma_samples = %d\n", p->pic_width_in_luma_samples);
2168 va_TraceMsg(trace_ctx, "\tpic_height_in_luma_samples = %d\n", p->pic_height_in_luma_samples);
2169 va_TraceMsg(trace_ctx, "\tpic_fields = %d\n", p->pic_fields.value);
2171 va_TraceMsg(trace_ctx, "\tchroma_format_idc = %d\n", p->pic_fields.bits.chroma_format_idc);
2172 va_TraceMsg(trace_ctx, "\tseparate_colour_plane_flag = %d\n", p->pic_fields.bits.separate_colour_plane_flag);
2173 va_TraceMsg(trace_ctx, "\tpcm_enabled_flag = %d\n", p->pic_fields.bits.pcm_enabled_flag);
2174 va_TraceMsg(trace_ctx, "\tscaling_list_enabled_flag = %d\n", p->pic_fields.bits.scaling_list_enabled_flag);
2175 va_TraceMsg(trace_ctx, "\ttransform_skip_enabled_flag = %d\n", p->pic_fields.bits.transform_skip_enabled_flag);
2176 va_TraceMsg(trace_ctx, "\tamp_enabled_flag = %d\n", p->pic_fields.bits.amp_enabled_flag);
2177 va_TraceMsg(trace_ctx, "\tstrong_intra_smoothing_enabled_flag = %d\n", p->pic_fields.bits.strong_intra_smoothing_enabled_flag);
2178 va_TraceMsg(trace_ctx, "\tsign_data_hiding_enabled_flag = %d\n", p->pic_fields.bits.sign_data_hiding_enabled_flag);
2179 va_TraceMsg(trace_ctx, "\tconstrained_intra_pred_flag = %d\n", p->pic_fields.bits.constrained_intra_pred_flag);
2180 va_TraceMsg(trace_ctx, "\tcu_qp_delta_enabled_flag = %d\n", p->pic_fields.bits.cu_qp_delta_enabled_flag);
2181 va_TraceMsg(trace_ctx, "\tweighted_pred_flag = %d\n", p->pic_fields.bits.weighted_pred_flag);
2182 va_TraceMsg(trace_ctx, "\tweighted_bipred_flag = %d\n", p->pic_fields.bits.weighted_bipred_flag);
2183 va_TraceMsg(trace_ctx, "\ttransquant_bypass_enabled_flag = %d\n", p->pic_fields.bits.transquant_bypass_enabled_flag);
2184 va_TraceMsg(trace_ctx, "\ttiles_enabled_flag = %d\n", p->pic_fields.bits.tiles_enabled_flag);
2185 va_TraceMsg(trace_ctx, "\tentropy_coding_sync_enabled_flag = %d\n", p->pic_fields.bits.entropy_coding_sync_enabled_flag);
2186 va_TraceMsg(trace_ctx, "\tpps_loop_filter_across_slices_enabled_flag = %d\n", p->pic_fields.bits.pps_loop_filter_across_slices_enabled_flag);
2187 va_TraceMsg(trace_ctx, "\tloop_filter_across_tiles_enabled_flag = %d\n", p->pic_fields.bits.loop_filter_across_tiles_enabled_flag);
2188 va_TraceMsg(trace_ctx, "\tpcm_loop_filter_disabled_flag = %d\n", p->pic_fields.bits.pcm_loop_filter_disabled_flag);
2189 va_TraceMsg(trace_ctx, "\tNoPicReorderingFlag = %d\n", p->pic_fields.bits.NoPicReorderingFlag);
2190 va_TraceMsg(trace_ctx, "\tNoBiPredFlag = %d\n", p->pic_fields.bits.NoBiPredFlag);
2191 va_TraceMsg(trace_ctx, "\tReservedBits = %d\n", p->pic_fields.bits.ReservedBits);
2193 va_TraceMsg(trace_ctx, "\tsps_max_dec_pic_buffering_minus1 = %d\n", p->sps_max_dec_pic_buffering_minus1);
2194 va_TraceMsg(trace_ctx, "\tbit_depth_luma_minus8 = %d\n", p->bit_depth_luma_minus8);
2195 va_TraceMsg(trace_ctx, "\tbit_depth_chroma_minus8 = %d\n", p->bit_depth_chroma_minus8);
2196 va_TraceMsg(trace_ctx, "\tpcm_sample_bit_depth_luma_minus1 = %d\n", p->pcm_sample_bit_depth_luma_minus1);
2197 va_TraceMsg(trace_ctx, "\tpcm_sample_bit_depth_chroma_minus1 = %d\n", p->pcm_sample_bit_depth_chroma_minus1);
2198 va_TraceMsg(trace_ctx, "\tlog2_min_luma_coding_block_size_minus3 = %d\n", p->log2_min_luma_coding_block_size_minus3);
2199 va_TraceMsg(trace_ctx, "\tlog2_diff_max_min_luma_coding_block_size = %d\n", p->log2_diff_max_min_luma_coding_block_size);
2200 va_TraceMsg(trace_ctx, "\tlog2_min_transform_block_size_minus2 = %d\n", p->log2_min_transform_block_size_minus2);
2201 va_TraceMsg(trace_ctx, "\tlog2_diff_max_min_transform_block_size = %d\n", p->log2_diff_max_min_transform_block_size);
2202 va_TraceMsg(trace_ctx, "\tlog2_min_pcm_luma_coding_block_size_minus3 = %d\n", p->log2_min_pcm_luma_coding_block_size_minus3);
2203 va_TraceMsg(trace_ctx, "\tlog2_diff_max_min_pcm_luma_coding_block_size = %d\n", p->log2_diff_max_min_pcm_luma_coding_block_size);
2204 va_TraceMsg(trace_ctx, "\tmax_transform_hierarchy_depth_intra = %d\n", p->max_transform_hierarchy_depth_intra);
2205 va_TraceMsg(trace_ctx, "\tmax_transform_hierarchy_depth_inter = %d\n", p->max_transform_hierarchy_depth_inter);
2206 va_TraceMsg(trace_ctx, "\tinit_qp_minus26 = %d\n", p->init_qp_minus26);
2207 va_TraceMsg(trace_ctx, "\tdiff_cu_qp_delta_depth = %d\n", p->diff_cu_qp_delta_depth);
2208 va_TraceMsg(trace_ctx, "\tpps_cb_qp_offset = %d\n", p->pps_cb_qp_offset);
2209 va_TraceMsg(trace_ctx, "\tpps_cr_qp_offset = %d\n", p->pps_cr_qp_offset);
2210 va_TraceMsg(trace_ctx, "\tlog2_parallel_merge_level_minus2 = %d\n", p->log2_parallel_merge_level_minus2);
2211 va_TraceMsg(trace_ctx, "\tnum_tile_columns_minus1 = %d\n", p->num_tile_columns_minus1);
2212 va_TraceMsg(trace_ctx, "\tnum_tile_rows_minus1 = %d\n", p->num_tile_rows_minus1);
2214 va_TraceMsg(trace_ctx, "\tcolumn_width_minus1[19]=\n");
2215 va_TraceMsg(trace_ctx, "");
2216 for (i = 0; i < 19; i++) {
2217 va_TracePrint(trace_ctx, "\t%d", p->column_width_minus1[i]);
2218 if ((i + 1) % 8 == 0)
2221 va_TracePrint(trace_ctx, "\n");
2222 va_TraceMsg(trace_ctx, "\trow_height_minus1[21]=\n");
2223 va_TraceMsg(trace_ctx, "");
2224 for (i = 0; i < 21; i++) {
2225 va_TracePrint(trace_ctx, "\t%d", p->row_height_minus1[i]);
2226 if ((i + 1) % 8 == 0)
2229 va_TracePrint(trace_ctx, "\n");
2231 va_TraceMsg(trace_ctx, "\tslice_parsing_fields = %d\n", p->slice_parsing_fields.value);
2232 va_TraceMsg(trace_ctx, "\tlists_modification_present_flag = %d\n", p->slice_parsing_fields.bits.lists_modification_present_flag);
2233 va_TraceMsg(trace_ctx, "\tlong_term_ref_pics_present_flag = %d\n", p->slice_parsing_fields.bits.long_term_ref_pics_present_flag);
2234 va_TraceMsg(trace_ctx, "\tsps_temporal_mvp_enabled_flag = %d\n", p->slice_parsing_fields.bits.sps_temporal_mvp_enabled_flag);
2235 va_TraceMsg(trace_ctx, "\tcabac_init_present_flag = %d\n", p->slice_parsing_fields.bits.cabac_init_present_flag);
2236 va_TraceMsg(trace_ctx, "\toutput_flag_present_flag = %d\n", p->slice_parsing_fields.bits.output_flag_present_flag);
2237 va_TraceMsg(trace_ctx, "\tdependent_slice_segments_enabled_flag = %d\n", p->slice_parsing_fields.bits.dependent_slice_segments_enabled_flag);
2238 va_TraceMsg(trace_ctx, "\tpps_slice_chroma_qp_offsets_present_flag = %d\n", p->slice_parsing_fields.bits.pps_slice_chroma_qp_offsets_present_flag);
2239 va_TraceMsg(trace_ctx, "\tsample_adaptive_offset_enabled_flag = %d\n", p->slice_parsing_fields.bits.sample_adaptive_offset_enabled_flag);
2240 va_TraceMsg(trace_ctx, "\tdeblocking_filter_override_enabled_flag = %d\n", p->slice_parsing_fields.bits.deblocking_filter_override_enabled_flag);
2241 va_TraceMsg(trace_ctx, "\tpps_disable_deblocking_filter_flag = %d\n", p->slice_parsing_fields.bits.pps_disable_deblocking_filter_flag);
2242 va_TraceMsg(trace_ctx, "\tslice_segment_header_extension_present_flag = %d\n", p->slice_parsing_fields.bits.slice_segment_header_extension_present_flag);
2243 va_TraceMsg(trace_ctx, "\tRapPicFlag = %d\n", p->slice_parsing_fields.bits.RapPicFlag);
2244 va_TraceMsg(trace_ctx, "\tIdrPicFlag = %d\n", p->slice_parsing_fields.bits.IdrPicFlag);
2245 va_TraceMsg(trace_ctx, "\tIntraPicFlag = %d\n", p->slice_parsing_fields.bits.IntraPicFlag);
2246 va_TraceMsg(trace_ctx, "\tReservedBits = %d\n", p->slice_parsing_fields.bits.ReservedBits);
2248 va_TraceMsg(trace_ctx, "\tlog2_max_pic_order_cnt_lsb_minus4 = %d\n", p->log2_max_pic_order_cnt_lsb_minus4);
2249 va_TraceMsg(trace_ctx, "\tnum_short_term_ref_pic_sets = %d\n", p->num_short_term_ref_pic_sets);
2250 va_TraceMsg(trace_ctx, "\tnum_long_term_ref_pic_sps = %d\n", p->num_long_term_ref_pic_sps);
2251 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l0_default_active_minus1 = %d\n", p->num_ref_idx_l0_default_active_minus1);
2252 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l1_default_active_minus1 = %d\n", p->num_ref_idx_l1_default_active_minus1);
2253 va_TraceMsg(trace_ctx, "\tpps_beta_offset_div2 = %d\n", p->pps_beta_offset_div2);
2254 va_TraceMsg(trace_ctx, "\tpps_tc_offset_div2 = %d\n", p->pps_tc_offset_div2);
2255 va_TraceMsg(trace_ctx, "\tnum_extra_slice_header_bits = %d\n", p->num_extra_slice_header_bits);
2256 va_TraceMsg(trace_ctx, "\tst_rps_bits = %d\n", p->st_rps_bits);
2261 static void va_TraceVASliceParameterBufferHEVC(
2263 VAContextID context,
2267 unsigned int num_elements,
2271 VASliceParameterBufferHEVC* p = (VASliceParameterBufferHEVC*)data;
2273 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2275 trace_ctx->trace_slice_no++;
2276 trace_ctx->trace_slice_size = p->slice_data_size;
2278 va_TracePrint(trace_ctx, "VASliceParameterBufferHEVC\n");
2279 va_TraceMsg(trace_ctx, "\tslice_data_size = %d\n", p->slice_data_size);
2280 va_TraceMsg(trace_ctx, "\tslice_data_offset = %d\n", p->slice_data_offset);
2281 va_TraceMsg(trace_ctx, "\tslice_data_flag = %d\n", p->slice_data_flag);
2282 va_TraceMsg(trace_ctx, "\tslice_data_byte_offset = %d\n", p->slice_data_byte_offset);
2283 va_TraceMsg(trace_ctx, "\tslice_segment_address = %d\n", p->slice_segment_address);
2285 va_TraceMsg(trace_ctx, "\tRefPicList[2][15]=\n");
2286 va_TraceMsg(trace_ctx, "");
2287 for (i = 0; i < 2; i++) {
2288 for (j = 0; j < 15; j++) {
2289 va_TracePrint(trace_ctx, "\t%d", p->RefPicList[i][j]);
2290 if ((j + 1) % 8 == 0)
2296 va_TracePrint(trace_ctx, "\tLongSliceFlags.value = %d\n", p->LongSliceFlags.value);
2297 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.LastSliceOfPic = %d\n", p->LongSliceFlags.fields.LastSliceOfPic);
2298 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.dependent_slice_segment_flag = %d\n", p->LongSliceFlags.fields.dependent_slice_segment_flag);
2299 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.slice_type = %d\n", p->LongSliceFlags.fields.slice_type);
2300 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.color_plane_id = %d\n", p->LongSliceFlags.fields.color_plane_id);
2301 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.slice_sao_luma_flag = %d\n", p->LongSliceFlags.fields.slice_sao_luma_flag);
2302 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.slice_sao_chroma_flag = %d\n", p->LongSliceFlags.fields.slice_sao_chroma_flag);
2303 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.mvd_l1_zero_flag = %d\n", p->LongSliceFlags.fields.mvd_l1_zero_flag);
2304 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.cabac_init_flag = %d\n", p->LongSliceFlags.fields.cabac_init_flag);
2305 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.slice_temporal_mvp_enabled_flag = %d\n", p->LongSliceFlags.fields.slice_temporal_mvp_enabled_flag);
2306 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.slice_deblocking_filter_disabled_flag = %d\n", p->LongSliceFlags.fields.slice_deblocking_filter_disabled_flag);
2307 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.collocated_from_l0_flag = %d\n", p->LongSliceFlags.fields.collocated_from_l0_flag);
2308 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.slice_loop_filter_across_slices_enabled_flag = %d\n", p->LongSliceFlags.fields.slice_loop_filter_across_slices_enabled_flag);
2309 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.reserved = %d\n", p->LongSliceFlags.fields.reserved);
2311 va_TraceMsg(trace_ctx, "\tcollocated_ref_idx = %d\n", p->collocated_ref_idx);
2313 va_TraceMsg(trace_ctx, "\tslice_qp_delta = %d\n", p->slice_qp_delta);
2314 va_TraceMsg(trace_ctx, "\tslice_cb_qp_offset = %d\n", p->slice_cb_qp_offset);
2315 va_TraceMsg(trace_ctx, "\tslice_cr_qp_offset = %d\n", p->slice_cr_qp_offset);
2316 va_TraceMsg(trace_ctx, "\tslice_beta_offset_div2 = %d\n", p->slice_beta_offset_div2);
2317 va_TraceMsg(trace_ctx, "\tslice_tc_offset_div2 = %d\n", p->slice_tc_offset_div2);
2318 va_TraceMsg(trace_ctx, "\tluma_log2_weight_denom = %d\n", p->luma_log2_weight_denom);
2319 va_TraceMsg(trace_ctx, "\tdelta_chroma_log2_weight_denom = %d\n", p->delta_chroma_log2_weight_denom);
2321 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l0_active_minus1 = %d\n", p->num_ref_idx_l0_active_minus1);
2322 for (i = 0; i <= p->num_ref_idx_l0_active_minus1; i++) {
2323 va_TraceMsg(trace_ctx, "\t% d ", p->delta_luma_weight_l0[i]);
2324 va_TracePrint(trace_ctx, "\t% d ", p->luma_offset_l0[i]);
2325 va_TracePrint(trace_ctx, "\t% d ", p->delta_chroma_weight_l0[i][0]);
2326 va_TracePrint(trace_ctx, "\t% d ", p->delta_chroma_weight_l0[i][1]);
2327 va_TracePrint(trace_ctx, "\t% d ", p->ChromaOffsetL0[i][0]);
2328 va_TracePrint(trace_ctx, "\t% d ", p->ChromaOffsetL0[i][1]);
2329 va_TracePrint(trace_ctx, "\n");
2332 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l1_active_minus1 = %d\n", p->num_ref_idx_l1_active_minus1);
2333 for (i = 0; i <= p->num_ref_idx_l1_active_minus1; i++) {
2334 va_TraceMsg(trace_ctx, "\t% d ", p->delta_luma_weight_l1[i]);
2335 va_TracePrint(trace_ctx, "\t% d ", p->luma_offset_l1[i]);
2336 va_TracePrint(trace_ctx, "\t% d ", p->delta_chroma_weight_l1[i][0]);
2337 va_TracePrint(trace_ctx, "\t% d ", p->delta_chroma_weight_l1[i][1]);
2338 va_TracePrint(trace_ctx, "\t% d ", p->ChromaOffsetL1[i][0]);
2339 va_TracePrint(trace_ctx, "\t% d ", p->ChromaOffsetL1[i][1]);
2340 va_TracePrint(trace_ctx, "\n");
2343 va_TraceMsg(trace_ctx, "\tfive_minus_max_num_merge_cand = %d\n", p->five_minus_max_num_merge_cand);
2345 va_TraceMsg(trace_ctx, NULL);
2348 static void va_TraceVAIQMatrixBufferHEVC(
2350 VAContextID context,
2354 unsigned int num_elements,
2359 VAIQMatrixBufferHEVC* p = (VAIQMatrixBufferHEVC* )data;
2361 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2363 va_TracePrint(trace_ctx, "VAIQMatrixBufferHEVC\n");
2365 va_TraceMsg(trace_ctx, "\tScalingList4x4[6][16]=\n");
2366 va_TraceMsg(trace_ctx, "");
2367 for (i = 0; i < 6; i++) {
2368 for (j = 0; j < 16; j++) {
2369 va_TracePrint(trace_ctx, "\t%d\t", p->ScalingList4x4[i][j]);
2370 if ((j + 1) % 8 == 0)
2375 va_TracePrint(trace_ctx, "\tScalingList8x8[6][64]=\n");
2376 va_TraceMsg(trace_ctx, "");
2377 for (i = 0; i < 6; i++) {
2378 for (j = 0; j < 64; j++) {
2379 va_TracePrint(trace_ctx, "\t%d", p->ScalingList8x8[i][j]);
2380 if ((j + 1) % 8 == 0)
2385 va_TracePrint(trace_ctx, "\tScalingList16x16[6][64]=\n");
2386 va_TraceMsg(trace_ctx, "");
2387 for (i = 0; i < 6; i++) {
2388 for (j = 0; j < 64; j++) {
2389 va_TracePrint(trace_ctx, "\t%d", p->ScalingList16x16[i][j]);
2390 if ((j + 1) % 8 == 0)
2395 va_TracePrint(trace_ctx, "\tScalingList32x32[2][64]=\n");
2396 va_TraceMsg(trace_ctx, "");
2397 for (i = 0; i < 2; i++) {
2398 for (j = 0; j < 64; j++) {
2399 va_TracePrint(trace_ctx, "\t%d", p->ScalingList32x32[i][j]);
2400 if ((j + 1) % 8 == 0)
2405 va_TracePrint(trace_ctx, "\tScalingListDC16x16[6]=\n");
2406 va_TraceMsg(trace_ctx, "");
2407 for (j = 0; j < 6; j++) {
2408 va_TracePrint(trace_ctx, "\t%d", p->ScalingListDC16x16[j]);
2410 va_TracePrint(trace_ctx, "\n");
2411 va_TraceMsg(trace_ctx, "\tScalingListDC32x32[2]=\n");
2412 va_TraceMsg(trace_ctx, "");
2413 for (j = 0; j < 2; j++) {
2414 va_TracePrint(trace_ctx, "\t%d", p->ScalingListDC32x32[j]);
2416 va_TracePrint(trace_ctx, "\n");
2418 va_TraceMsg(trace_ctx, NULL);
2421 static void va_TraceVAEncSequenceParameterBufferHEVC(
2423 VAContextID context,
2427 unsigned int num_elements,
2430 VAEncSequenceParameterBufferHEVC *p = (VAEncSequenceParameterBufferHEVC *)data;
2432 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2437 va_TracePrint(trace_ctx, "\t--VAEncSequenceParameterBufferHEVC\n");
2439 va_TraceMsg(trace_ctx, "\tgeneral_profile_idc = %d\n", p->general_profile_idc);
2440 va_TraceMsg(trace_ctx, "\tgeneral_level_idc = %d\n", p->general_level_idc);
2441 va_TraceMsg(trace_ctx, "\tgeneral_tier_flag = %d\n", p->general_tier_flag);
2442 va_TraceMsg(trace_ctx, "\tintra_period = %d\n", p->intra_period);
2443 va_TraceMsg(trace_ctx, "\tintra_idr_period = %d\n", p->intra_idr_period);
2444 va_TraceMsg(trace_ctx, "\tip_period = %d\n", p->ip_period);
2445 va_TraceMsg(trace_ctx, "\tbits_per_second = %d\n", p->bits_per_second);
2446 va_TraceMsg(trace_ctx, "\tpic_width_in_luma_samples = %d\n", p->pic_width_in_luma_samples);
2447 va_TraceMsg(trace_ctx, "\tpic_height_in_luma_samples = %d\n", p->pic_height_in_luma_samples);
2448 va_TraceMsg(trace_ctx, "\tchroma_format_idc = %d\n", p->seq_fields.bits.chroma_format_idc);
2449 va_TraceMsg(trace_ctx, "\tseparate_colour_plane_flag = %d\n", p->seq_fields.bits.separate_colour_plane_flag);
2450 va_TraceMsg(trace_ctx, "\tbit_depth_luma_minus8 = %d\n", p->seq_fields.bits.bit_depth_luma_minus8);
2451 va_TraceMsg(trace_ctx, "\tbit_depth_chroma_minus8 = %d\n", p->seq_fields.bits.bit_depth_chroma_minus8);
2452 va_TraceMsg(trace_ctx, "\tscaling_list_enabled_flag = %d\n", p->seq_fields.bits.scaling_list_enabled_flag);
2453 va_TraceMsg(trace_ctx, "\tstrong_intra_smoothing_enabled_flag = %d\n", p->seq_fields.bits.strong_intra_smoothing_enabled_flag);
2454 va_TraceMsg(trace_ctx, "\tamp_enabled_flag = %d\n", p->seq_fields.bits.amp_enabled_flag);
2455 va_TraceMsg(trace_ctx, "\tsample_adaptive_offset_enabled_flag = %d\n", p->seq_fields.bits.sample_adaptive_offset_enabled_flag);
2456 va_TraceMsg(trace_ctx, "\tpcm_enabled_flag = %d\n", p->seq_fields.bits.pcm_enabled_flag);
2457 va_TraceMsg(trace_ctx, "\tpcm_loop_filter_disabled_flag = %d\n", p->seq_fields.bits.pcm_loop_filter_disabled_flag);
2458 va_TraceMsg(trace_ctx, "\tsps_temporal_mvp_enabled_flag = %d\n", p->seq_fields.bits.sps_temporal_mvp_enabled_flag);
2459 va_TraceMsg(trace_ctx, "\treserved_bits = %d\n", p->seq_fields.bits.reserved_bits);
2460 va_TraceMsg(trace_ctx, "\tlog2_min_luma_coding_block_size_minus3 = %d\n", p->log2_min_luma_coding_block_size_minus3);
2461 va_TraceMsg(trace_ctx, "\tlog2_diff_max_min_luma_coding_block_size = %d\n", p->log2_diff_max_min_luma_coding_block_size);
2462 va_TraceMsg(trace_ctx, "\tlog2_min_transform_block_size_minus2 = %d\n", p->log2_min_transform_block_size_minus2);
2463 va_TraceMsg(trace_ctx, "\tlog2_diff_max_min_transform_block_size = %d\n", p->log2_diff_max_min_transform_block_size);
2464 va_TraceMsg(trace_ctx, "\tmax_transform_hierarchy_depth_inter = %d\n", p->max_transform_hierarchy_depth_inter);
2465 va_TraceMsg(trace_ctx, "\tmax_transform_hierarchy_depth_intra = %d\n", p->max_transform_hierarchy_depth_intra);
2466 va_TraceMsg(trace_ctx, "\tpcm_sample_bit_depth_luma_minus1 = %d\n", p->pcm_sample_bit_depth_luma_minus1);
2467 va_TraceMsg(trace_ctx, "\tpcm_sample_bit_depth_chroma_minus1 = %d\n", p->pcm_sample_bit_depth_chroma_minus1);
2468 va_TraceMsg(trace_ctx, "\tlog2_min_pcm_luma_coding_block_size_minus3 = %d\n", p->log2_min_pcm_luma_coding_block_size_minus3);
2469 va_TraceMsg(trace_ctx, "\tlog2_max_pcm_luma_coding_block_size_minus3 = %d\n", p->log2_max_pcm_luma_coding_block_size_minus3);
2470 va_TraceMsg(trace_ctx, "\tvui_parameters_present_flag = %d\n", p->vui_parameters_present_flag);
2471 va_TraceMsg(trace_ctx, "\taspect_ratio_info_present_flag = %d\n", p->vui_fields.bits.aspect_ratio_info_present_flag);
2472 va_TraceMsg(trace_ctx, "\tneutral_chroma_indication_flag = %d\n", p->vui_fields.bits.neutral_chroma_indication_flag);
2473 va_TraceMsg(trace_ctx, "\tfield_seq_flag = %d\n", p->vui_fields.bits.field_seq_flag);
2474 va_TraceMsg(trace_ctx, "\tvui_timing_info_present_flag = %d\n", p->vui_fields.bits.vui_timing_info_present_flag);
2475 va_TraceMsg(trace_ctx, "\tbitstream_restriction_flag = %d\n", p->vui_fields.bits.bitstream_restriction_flag);
2476 va_TraceMsg(trace_ctx, "\ttiles_fixed_structure_flag = %d\n", p->vui_fields.bits.tiles_fixed_structure_flag);
2477 va_TraceMsg(trace_ctx, "\tmotion_vectors_over_pic_boundaries_flag = %d\n", p->vui_fields.bits.motion_vectors_over_pic_boundaries_flag);
2478 va_TraceMsg(trace_ctx, "\trestricted_ref_pic_lists_flag = %d\n", p->vui_fields.bits.restricted_ref_pic_lists_flag);
2479 va_TraceMsg(trace_ctx, "\tlog2_max_mv_length_horizontal = %d\n", p->vui_fields.bits.log2_max_mv_length_horizontal);
2480 va_TraceMsg(trace_ctx, "\tlog2_max_mv_length_vertical = %d\n", p->vui_fields.bits.log2_max_mv_length_vertical);
2481 va_TraceMsg(trace_ctx, "\taspect_ratio_idc = %d\n", p->aspect_ratio_idc);
2482 va_TraceMsg(trace_ctx, "\tsar_width = %d\n", p->sar_width);
2483 va_TraceMsg(trace_ctx, "\tsar_height = %d\n", p->sar_height);
2484 va_TraceMsg(trace_ctx, "\tvui_num_units_in_tick = %d\n", p->vui_num_units_in_tick);
2485 va_TraceMsg(trace_ctx, "\tvui_time_scale = %d\n", p->vui_time_scale);
2486 va_TraceMsg(trace_ctx, "\tmin_spatial_segmentation_idc = %d\n", p->min_spatial_segmentation_idc);
2487 va_TraceMsg(trace_ctx, "\tmax_bytes_per_pic_denom = %d\n", p->max_bytes_per_pic_denom);
2488 va_TraceMsg(trace_ctx, "\tmax_bits_per_min_cu_denom = %d\n", p->max_bits_per_min_cu_denom);
2493 static void va_TraceVAEncPictureParameterBufferHEVC(
2495 VAContextID context,
2499 unsigned int num_elements,
2503 VAEncPictureParameterBufferHEVC *p = (VAEncPictureParameterBufferHEVC *)data;
2505 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2510 va_TracePrint(trace_ctx, "\t--VAEncPictureParameterBufferHEVC\n");
2512 va_TraceMsg(trace_ctx, "\tdecoded_curr_pic.picture_id = %d\n", p->decoded_curr_pic.picture_id);
2513 va_TraceMsg(trace_ctx, "\tdecoded_curr_pic.pic_order_cnt = %d\n", p->decoded_curr_pic.pic_order_cnt);
2514 va_TraceMsg(trace_ctx, "\tdecoded_curr_pic.flags = %d\n", p->decoded_curr_pic.flags);
2516 for(i = 0; i < 15; i ++)
2518 va_TraceMsg(trace_ctx, "\treference_frames[%d].picture_id = %d\n", i, p->reference_frames[i].picture_id);
2519 va_TraceMsg(trace_ctx, "\treference_frames[%d].pic_order_cnt = %d\n", i, p->reference_frames[i].pic_order_cnt);
2520 va_TraceMsg(trace_ctx, "\treference_frames[%d].flags = %d\n", i, p->reference_frames[i].flags);
2523 va_TraceMsg(trace_ctx, "\tcoded_buf = %d\n", p->coded_buf);
2524 va_TraceMsg(trace_ctx, "\tcollocated_ref_pic_index = %d\n", p->collocated_ref_pic_index);
2525 va_TraceMsg(trace_ctx, "\tlast_picture = %d\n", p->last_picture);
2526 va_TraceMsg(trace_ctx, "\tpic_init_qp = %d\n", p->pic_init_qp);
2527 va_TraceMsg(trace_ctx, "\tdiff_cu_qp_delta_depth = %d\n", p->diff_cu_qp_delta_depth);
2528 va_TraceMsg(trace_ctx, "\tpps_cb_qp_offset = %d\n", p->pps_cb_qp_offset);
2529 va_TraceMsg(trace_ctx, "\tpps_cr_qp_offset = %d\n", p->pps_cr_qp_offset);
2530 va_TraceMsg(trace_ctx, "\tnum_tile_columns_minus1 = %d\n", p->num_tile_columns_minus1);
2531 va_TraceMsg(trace_ctx, "\tnum_tile_rows_minus1 = %d\n", p->num_tile_rows_minus1);
2533 for(i = 0; i < 19; i ++)
2535 va_TraceMsg(trace_ctx, "\tcolumn_width_minus1[%d] = %d\n", i, p->column_width_minus1[i]);
2538 for(i = 0; i < 21; i ++)
2540 va_TraceMsg(trace_ctx, "\trow_height_minus1[%d] = %d\n", i, p->row_height_minus1[i]);
2543 va_TraceMsg(trace_ctx, "\tlog2_parallel_merge_level_minus2 = %d\n", p->log2_parallel_merge_level_minus2);
2544 va_TraceMsg(trace_ctx, "\tctu_max_bitsize_allowed = %d\n", p->ctu_max_bitsize_allowed);
2545 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l0_default_active_minus1 = %d\n", p->num_ref_idx_l0_default_active_minus1);
2546 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l1_default_active_minus1 = %d\n", p->num_ref_idx_l1_default_active_minus1);
2547 va_TraceMsg(trace_ctx, "\tslice_pic_parameter_set_id = %d\n", p->slice_pic_parameter_set_id);
2548 va_TraceMsg(trace_ctx, "\tnal_unit_type = %d\n", p->nal_unit_type);
2549 va_TraceMsg(trace_ctx, "\tidr_pic_flag = %d\n", p->pic_fields.bits.idr_pic_flag);
2550 va_TraceMsg(trace_ctx, "\tcoding_type = %d\n", p->pic_fields.bits.coding_type);
2551 va_TraceMsg(trace_ctx, "\treference_pic_flag = %d\n", p->pic_fields.bits.reference_pic_flag);
2552 va_TraceMsg(trace_ctx, "\tdependent_slice_segments_enabled_flag = %d\n", p->pic_fields.bits.dependent_slice_segments_enabled_flag);
2553 va_TraceMsg(trace_ctx, "\tsign_data_hiding_enabled_flag = %d\n", p->pic_fields.bits.sign_data_hiding_enabled_flag);
2554 va_TraceMsg(trace_ctx, "\tconstrained_intra_pred_flag = %d\n", p->pic_fields.bits.constrained_intra_pred_flag);
2555 va_TraceMsg(trace_ctx, "\ttransform_skip_enabled_flag = %d\n", p->pic_fields.bits.transform_skip_enabled_flag);
2556 va_TraceMsg(trace_ctx, "\tcu_qp_delta_enabled_flag = %d\n", p->pic_fields.bits.cu_qp_delta_enabled_flag);
2557 va_TraceMsg(trace_ctx, "\tweighted_pred_flag = %d\n", p->pic_fields.bits.weighted_pred_flag);
2558 va_TraceMsg(trace_ctx, "\tweighted_bipred_flag = %d\n", p->pic_fields.bits.weighted_bipred_flag);
2559 va_TraceMsg(trace_ctx, "\ttransquant_bypass_enabled_flag = %d\n", p->pic_fields.bits.transquant_bypass_enabled_flag);
2560 va_TraceMsg(trace_ctx, "\ttiles_enabled_flag = %d\n", p->pic_fields.bits.tiles_enabled_flag);
2561 va_TraceMsg(trace_ctx, "\tentropy_coding_sync_enabled_flag = %d\n", p->pic_fields.bits.entropy_coding_sync_enabled_flag);
2562 va_TraceMsg(trace_ctx, "\tloop_filter_across_tiles_enabled_flag = %d\n", p->pic_fields.bits.loop_filter_across_tiles_enabled_flag);
2563 va_TraceMsg(trace_ctx, "\tpps_loop_filter_across_slices_enabled_flag = %d\n", p->pic_fields.bits.pps_loop_filter_across_slices_enabled_flag);
2564 va_TraceMsg(trace_ctx, "\tscaling_list_data_present_flag = %d\n", p->pic_fields.bits.scaling_list_data_present_flag);
2565 va_TraceMsg(trace_ctx, "\tscreen_content_flag = %d\n", p->pic_fields.bits.screen_content_flag);
2566 va_TraceMsg(trace_ctx, "\tenable_gpu_weighted_prediction = %d\n", p->pic_fields.bits.enable_gpu_weighted_prediction);
2567 va_TraceMsg(trace_ctx, "\tno_output_of_prior_pics_flag = %d\n", p->pic_fields.bits.no_output_of_prior_pics_flag);
2568 va_TraceMsg(trace_ctx, "\treserved = %d\n", p->pic_fields.bits.reserved);
2573 static void va_TraceVAEncSliceParameterBufferHEVC(
2575 VAContextID context,
2579 unsigned int num_elements,
2583 VAEncSliceParameterBufferHEVC *p = (VAEncSliceParameterBufferHEVC *)data;
2585 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2590 va_TracePrint(trace_ctx, "\t--VAEncSliceParameterBufferHEVC\n");
2592 va_TraceMsg(trace_ctx, "\tslice_segment_address = %d\n", p->slice_segment_address);
2593 va_TraceMsg(trace_ctx, "\tnum_ctu_in_slice = %d\n", p->num_ctu_in_slice);
2594 va_TraceMsg(trace_ctx, "\tslice_type = %d\n", p->slice_type);
2595 va_TraceMsg(trace_ctx, "\tslice_pic_parameter_set_id = %d\n", p->slice_pic_parameter_set_id);
2596 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l0_active_minus1 = %d\n", p->num_ref_idx_l0_active_minus1);
2597 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l1_active_minus1 = %d\n", p->num_ref_idx_l1_active_minus1);
2599 for(i = 0; i < 15; i ++)
2601 va_TraceMsg(trace_ctx, "\tref_pic_list0[%d].picture_id = %d\n", i, p->ref_pic_list0[i].picture_id);
2602 va_TraceMsg(trace_ctx, "\tref_pic_list0[%d].pic_order_cnt = %d\n", i, p->ref_pic_list0[i].pic_order_cnt);
2603 va_TraceMsg(trace_ctx, "\tref_pic_list0[%d].flags = %d\n", i, p->ref_pic_list0[i].flags);
2604 va_TraceMsg(trace_ctx, "\tref_pic_list1[%d].picture_id = %d\n", i, p->ref_pic_list1[i].picture_id);
2605 va_TraceMsg(trace_ctx, "\tref_pic_list1[%d].pic_order_cnt = %d\n", i, p->ref_pic_list1[i].pic_order_cnt);
2606 va_TraceMsg(trace_ctx, "\tref_pic_list1[%d].flags = %d\n", i, p->ref_pic_list1[i].flags);
2609 va_TraceMsg(trace_ctx, "\tluma_log2_weight_denom = %d\n", p->luma_log2_weight_denom);
2610 va_TraceMsg(trace_ctx, "\tdelta_chroma_log2_weight_denom = %d\n", p->delta_chroma_log2_weight_denom);
2612 for(i = 0; i < 15; i ++)
2614 va_TraceMsg(trace_ctx, "\tdelta_luma_weight_l0[%d] = %d\n", i, p->delta_luma_weight_l0[i]);
2615 va_TraceMsg(trace_ctx, "\tdelta_luma_weight_l1[%d] = %d\n", i, p->delta_luma_weight_l1[i]);
2618 for(i = 0; i < 15; i ++)
2620 va_TraceMsg(trace_ctx, "\tluma_offset_l0[%d] = %d\n", i, p->luma_offset_l0[i]);
2621 va_TraceMsg(trace_ctx, "\tluma_offset_l1[%d] = %d\n", i, p->luma_offset_l1[i]);
2624 for(i = 0; i < 15; i ++)
2626 va_TraceMsg(trace_ctx, "\tdelta_chroma_weight_l0[%d][0] = %d\n", i, p->delta_chroma_weight_l0[i][0]);
2627 va_TraceMsg(trace_ctx, "\tdelta_chroma_weight_l0[%d][1] = %d\n", i, p->delta_chroma_weight_l0[i][1]);
2628 va_TraceMsg(trace_ctx, "\tdelta_chroma_weight_l1[%d][0] = %d\n", i, p->delta_chroma_weight_l1[i][0]);
2629 va_TraceMsg(trace_ctx, "\tdelta_chroma_weight_l1[%d][1] = %d\n", i, p->delta_chroma_weight_l1[i][1]);
2632 for(i = 0; i < 15; i ++)
2634 va_TraceMsg(trace_ctx, "\tchroma_offset_l0[%d][0] = %d\n", i, p->chroma_offset_l0[i][0]);
2635 va_TraceMsg(trace_ctx, "\tchroma_offset_l0[%d][1] = %d\n", i, p->chroma_offset_l0[i][1]);
2636 va_TraceMsg(trace_ctx, "\tchroma_offset_l1[%d][0] = %d\n", i, p->chroma_offset_l1[i][0]);
2637 va_TraceMsg(trace_ctx, "\tchroma_offset_l1[%d][1] = %d\n", i, p->chroma_offset_l1[i][1]);
2640 va_TraceMsg(trace_ctx, "\tmax_num_merge_cand = %d\n", p->max_num_merge_cand);
2641 va_TraceMsg(trace_ctx, "\tslice_qp_delta = %d\n", p->slice_qp_delta);
2642 va_TraceMsg(trace_ctx, "\tslice_cb_qp_offset = %d\n", p->slice_cb_qp_offset);
2643 va_TraceMsg(trace_ctx, "\tslice_cr_qp_offset = %d\n", p->slice_cr_qp_offset);
2644 va_TraceMsg(trace_ctx, "\tslice_beta_offset_div2 = %d\n", p->slice_beta_offset_div2);
2645 va_TraceMsg(trace_ctx, "\tslice_tc_offset_div2 = %d\n", p->slice_tc_offset_div2);
2646 va_TraceMsg(trace_ctx, "\tlast_slice_of_pic_flag = %d\n", p->slice_fields.bits.last_slice_of_pic_flag);
2647 va_TraceMsg(trace_ctx, "\tdependent_slice_segment_flag = %d\n", p->slice_fields.bits.dependent_slice_segment_flag);
2648 va_TraceMsg(trace_ctx, "\tcolour_plane_id = %d\n", p->slice_fields.bits.colour_plane_id);
2649 va_TraceMsg(trace_ctx, "\tslice_temporal_mvp_enabled_flag = %d\n", p->slice_fields.bits.slice_temporal_mvp_enabled_flag);
2650 va_TraceMsg(trace_ctx, "\tslice_sao_luma_flag = %d\n", p->slice_fields.bits.slice_sao_luma_flag);
2651 va_TraceMsg(trace_ctx, "\tslice_sao_chroma_flag = %d\n", p->slice_fields.bits.slice_sao_chroma_flag);
2652 va_TraceMsg(trace_ctx, "\tnum_ref_idx_active_override_flag = %d\n", p->slice_fields.bits.num_ref_idx_active_override_flag);
2653 va_TraceMsg(trace_ctx, "\tmvd_l1_zero_flag = %d\n", p->slice_fields.bits.mvd_l1_zero_flag);
2654 va_TraceMsg(trace_ctx, "\tcabac_init_flag = %d\n", p->slice_fields.bits.cabac_init_flag);
2655 va_TraceMsg(trace_ctx, "\tslice_deblocking_filter_disabled_flag = %d\n", p->slice_fields.bits.slice_deblocking_filter_disabled_flag);
2656 va_TraceMsg(trace_ctx, "\tslice_loop_filter_across_slices_enabled_flag = %d\n", p->slice_fields.bits.slice_loop_filter_across_slices_enabled_flag);
2657 va_TraceMsg(trace_ctx, "\tcollocated_from_l0_flag = %d\n", p->slice_fields.bits.collocated_from_l0_flag);
2662 static void va_TraceVAPictureParameterBufferH264(
2664 VAContextID context,
2668 unsigned int num_elements,
2672 VAPictureParameterBufferH264 *p = (VAPictureParameterBufferH264*)data;
2674 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2676 va_TraceMsg(trace_ctx, "\t--VAPictureParameterBufferH264\n");
2678 va_TraceMsg(trace_ctx, "\tCurrPic.picture_id = 0x%08x\n", p->CurrPic.picture_id);
2679 va_TraceMsg(trace_ctx, "\tCurrPic.frame_idx = %u\n", p->CurrPic.frame_idx);
2680 va_TraceMsg(trace_ctx, "\tCurrPic.flags = 0x%08x\n", p->CurrPic.flags);
2681 va_TraceMsg(trace_ctx, "\tCurrPic.TopFieldOrderCnt = %d\n", p->CurrPic.TopFieldOrderCnt);
2682 va_TraceMsg(trace_ctx, "\tCurrPic.BottomFieldOrderCnt = %d\n", p->CurrPic.BottomFieldOrderCnt);
2684 va_TraceMsg(trace_ctx, "\tReferenceFrames (TopFieldOrderCnt-BottomFieldOrderCnt-picture_id-frame_idx-flags:\n");
2685 for (i = 0; i < 16; i++)
2687 if ((p->ReferenceFrames[i].picture_id != VA_INVALID_SURFACE) &&
2688 ((p->ReferenceFrames[i].flags & VA_PICTURE_H264_INVALID) == 0)) {
2689 va_TraceMsg(trace_ctx, "\t\t%08d-%08d-0x%08x-%08u-0x%08x\n",
2690 p->ReferenceFrames[i].TopFieldOrderCnt,
2691 p->ReferenceFrames[i].BottomFieldOrderCnt,
2692 p->ReferenceFrames[i].picture_id,
2693 p->ReferenceFrames[i].frame_idx,
2694 p->ReferenceFrames[i].flags);
2698 va_TraceMsg(trace_ctx, "\tpicture_width_in_mbs_minus1 = %d\n", p->picture_width_in_mbs_minus1);
2699 va_TraceMsg(trace_ctx, "\tpicture_height_in_mbs_minus1 = %d\n", p->picture_height_in_mbs_minus1);
2700 va_TraceMsg(trace_ctx, "\tbit_depth_luma_minus8 = %d\n", p->bit_depth_luma_minus8);
2701 va_TraceMsg(trace_ctx, "\tbit_depth_chroma_minus8 = %d\n", p->bit_depth_chroma_minus8);
2702 va_TraceMsg(trace_ctx, "\tnum_ref_frames = %d\n", p->num_ref_frames);
2703 va_TraceMsg(trace_ctx, "\tseq fields = %d\n", p->seq_fields.value);
2704 va_TraceMsg(trace_ctx, "\tchroma_format_idc = %d\n", p->seq_fields.bits.chroma_format_idc);
2705 va_TraceMsg(trace_ctx, "\tresidual_colour_transform_flag = %d\n", p->seq_fields.bits.residual_colour_transform_flag);
2706 va_TraceMsg(trace_ctx, "\tframe_mbs_only_flag = %d\n", p->seq_fields.bits.frame_mbs_only_flag);
2707 va_TraceMsg(trace_ctx, "\tmb_adaptive_frame_field_flag = %d\n", p->seq_fields.bits.mb_adaptive_frame_field_flag);
2708 va_TraceMsg(trace_ctx, "\tdirect_8x8_inference_flag = %d\n", p->seq_fields.bits.direct_8x8_inference_flag);
2709 va_TraceMsg(trace_ctx, "\tMinLumaBiPredSize8x8 = %d\n", p->seq_fields.bits.MinLumaBiPredSize8x8);
2710 va_TraceMsg(trace_ctx, "\tpic_init_qp_minus26 = %d\n", p->pic_init_qp_minus26);
2711 va_TraceMsg(trace_ctx, "\tpic_init_qs_minus26 = %d\n", p->pic_init_qs_minus26);
2712 va_TraceMsg(trace_ctx, "\tchroma_qp_index_offset = %d\n", p->chroma_qp_index_offset);
2713 va_TraceMsg(trace_ctx, "\tsecond_chroma_qp_index_offset = %d\n", p->second_chroma_qp_index_offset);
2714 va_TraceMsg(trace_ctx, "\tpic_fields = 0x%03x\n", p->pic_fields.value);
2715 va_TraceFlagIfNotZero(trace_ctx, "\t\tentropy_coding_mode_flag", p->pic_fields.bits.entropy_coding_mode_flag);
2716 va_TraceFlagIfNotZero(trace_ctx, "\t\tweighted_pred_flag", p->pic_fields.bits.weighted_pred_flag);
2717 va_TraceFlagIfNotZero(trace_ctx, "\t\tweighted_bipred_idc", p->pic_fields.bits.weighted_bipred_idc);
2718 va_TraceFlagIfNotZero(trace_ctx, "\t\ttransform_8x8_mode_flag", p->pic_fields.bits.transform_8x8_mode_flag);
2719 va_TraceFlagIfNotZero(trace_ctx, "\t\tfield_pic_flag", p->pic_fields.bits.field_pic_flag);
2720 va_TraceFlagIfNotZero(trace_ctx, "\t\tconstrained_intra_pred_flag", p->pic_fields.bits.constrained_intra_pred_flag);
2721 va_TraceFlagIfNotZero(trace_ctx, "\t\tpic_order_present_flag", p->pic_fields.bits.pic_order_present_flag);
2722 va_TraceFlagIfNotZero(trace_ctx, "\t\tdeblocking_filter_control_present_flag", p->pic_fields.bits.deblocking_filter_control_present_flag);
2723 va_TraceFlagIfNotZero(trace_ctx, "\t\tredundant_pic_cnt_present_flag", p->pic_fields.bits.redundant_pic_cnt_present_flag);
2724 va_TraceFlagIfNotZero(trace_ctx, "\t\treference_pic_flag", p->pic_fields.bits.reference_pic_flag);
2725 va_TraceMsg(trace_ctx, "\tframe_num = %d\n", p->frame_num);
2726 va_TraceMsg(trace_ctx, NULL);
2731 static void va_TraceVASliceParameterBufferH264(
2733 VAContextID context,
2737 unsigned int num_elements,
2741 VASliceParameterBufferH264* p = (VASliceParameterBufferH264*)data;
2742 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2744 trace_ctx->trace_slice_no++;
2745 trace_ctx->trace_slice_size = p->slice_data_size;
2747 va_TraceMsg(trace_ctx, "\t--VASliceParameterBufferH264\n");
2748 va_TraceMsg(trace_ctx, "\tslice_data_size = %u\n", p->slice_data_size);
2749 va_TraceMsg(trace_ctx, "\tslice_data_offset = %u\n", p->slice_data_offset);
2750 va_TraceMsg(trace_ctx, "\tslice_data_flag = 0x%08x\n", p->slice_data_flag);
2751 va_TraceMsg(trace_ctx, "\tslice_data_bit_offset = %d\n", p->slice_data_bit_offset);
2752 va_TraceMsg(trace_ctx, "\tfirst_mb_in_slice = %d\n", p->first_mb_in_slice);
2753 va_TraceMsg(trace_ctx, "\tslice_type = %d\n", p->slice_type);
2754 va_TraceMsg(trace_ctx, "\tdirect_spatial_mv_pred_flag = %d\n", p->direct_spatial_mv_pred_flag);
2755 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l0_active_minus1 = %d\n", p->num_ref_idx_l0_active_minus1);
2756 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l1_active_minus1 = %d\n", p->num_ref_idx_l1_active_minus1);
2757 va_TraceMsg(trace_ctx, "\tcabac_init_idc = %d\n", p->cabac_init_idc);
2758 va_TraceMsg(trace_ctx, "\tslice_qp_delta = %d\n", p->slice_qp_delta);
2759 va_TraceMsg(trace_ctx, "\tdisable_deblocking_filter_idc = %d\n", p->disable_deblocking_filter_idc);
2760 va_TraceMsg(trace_ctx, "\tslice_alpha_c0_offset_div2 = %d\n", p->slice_alpha_c0_offset_div2);
2761 va_TraceMsg(trace_ctx, "\tslice_beta_offset_div2 = %d\n", p->slice_beta_offset_div2);
2763 va_TraceMsg(trace_ctx, "\tRefPicList0 =\n");
2764 for (i = 0; i < 32; i++) {
2765 if ((p->RefPicList0[i].picture_id != VA_INVALID_SURFACE) &&
2766 ((p->RefPicList0[i].flags & VA_PICTURE_H264_INVALID) == 0))
2767 va_TraceMsg(trace_ctx, "%08d-%08d-0x%08x-%08d-0x%08x\n", p->RefPicList0[i].TopFieldOrderCnt, p->RefPicList0[i].BottomFieldOrderCnt, p->RefPicList0[i].picture_id, p->RefPicList0[i].frame_idx, p->RefPicList0[i].flags);
2771 va_TraceMsg(trace_ctx, "\tRefPicList1 =\n");
2772 for (i = 0; i < 32; i++) {
2773 if ((p->RefPicList1[i].picture_id != VA_INVALID_SURFACE) &&
2774 ((p->RefPicList1[i].flags & VA_PICTURE_H264_INVALID) == 0))
2775 va_TraceMsg(trace_ctx, "%08d-%08d-0x%08x-%08d-0x%08x\n", p->RefPicList1[i].TopFieldOrderCnt, p->RefPicList1[i].BottomFieldOrderCnt, p->RefPicList1[i].picture_id, p->RefPicList1[i].frame_idx, p->RefPicList1[i].flags);
2780 va_TraceMsg(trace_ctx, "\tluma_log2_weight_denom = %d\n", p->luma_log2_weight_denom);
2781 va_TraceMsg(trace_ctx, "\tchroma_log2_weight_denom = %d\n", p->chroma_log2_weight_denom);
2782 va_TraceMsg(trace_ctx, "\tluma_weight_l0_flag = %d\n", p->luma_weight_l0_flag);
2784 for (i = 0; (i <= p->num_ref_idx_l0_active_minus1) && (i<32); i++) {
2785 va_TraceMsg(trace_ctx, "\t\t%d\t%d\n",
2786 p->luma_weight_l0[i],
2787 p->luma_offset_l0[i]);
2791 va_TraceMsg(trace_ctx, "\tchroma_weight_l0_flag = %d\n", p->chroma_weight_l0_flag);
2793 for (i = 0; (i <= p->num_ref_idx_l0_active_minus1) && (i<32); i++) {
2794 va_TraceMsg(trace_ctx, "\t\t%d\t%d\t%d\t%d\n",
2795 p->chroma_weight_l0[i][0],
2796 p->chroma_offset_l0[i][0],
2797 p->chroma_weight_l0[i][1],
2798 p->chroma_offset_l0[i][1]);
2802 va_TraceMsg(trace_ctx, "\tluma_weight_l1_flag = %d\n", p->luma_weight_l1_flag);
2804 for (i = 0; (i <= p->num_ref_idx_l1_active_minus1) && (i<32); i++) {
2805 va_TraceMsg(trace_ctx, "\t\t%d\t%d\n",
2806 p->luma_weight_l1[i],
2807 p->luma_offset_l1[i]);
2811 va_TraceMsg(trace_ctx, "\tchroma_weight_l1_flag = %d\n", p->chroma_weight_l1_flag);
2813 for (i = 0; (i <= p->num_ref_idx_l1_active_minus1) && (i<32); i++) {
2814 va_TraceMsg(trace_ctx, "\t\t%d\t%d\t%d\t%d\n",
2815 p->chroma_weight_l1[i][0],
2816 p->chroma_offset_l1[i][0],
2817 p->chroma_weight_l1[i][1],
2818 p->chroma_offset_l1[i][1]);
2821 va_TraceMsg(trace_ctx, NULL);
2824 static void va_TraceVAIQMatrixBufferH264(
2826 VAContextID context,
2830 unsigned int num_elements,
2835 VAIQMatrixBufferH264* p = (VAIQMatrixBufferH264* )data;
2838 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2840 if(trace_ctx->plog_file)
2841 fp = trace_ctx->plog_file->fp_log;
2843 va_TraceMsg(trace_ctx, "\t--VAIQMatrixBufferH264\n");
2845 va_TraceMsg(trace_ctx, "\tScalingList4x4[6][16]=\n");
2846 for (i = 0; i < 6; i++) {
2847 for (j = 0; j < 16; j++) {
2849 fprintf(fp, "\t%d", p->ScalingList4x4[i][j]);
2850 if ((j + 1) % 8 == 0)
2856 va_TraceMsg(trace_ctx, "\tScalingList8x8[2][64]=\n");
2857 for (i = 0; i < 2; i++) {
2858 for (j = 0; j < 64; j++) {
2860 fprintf(fp,"\t%d", p->ScalingList8x8[i][j]);
2861 if ((j + 1) % 8 == 0)
2867 va_TraceMsg(trace_ctx, NULL);
2872 static void va_TraceVAEncSequenceParameterBufferH264(
2874 VAContextID context,
2878 unsigned int num_elements,
2881 VAEncSequenceParameterBufferH264 *p = (VAEncSequenceParameterBufferH264 *)data;
2882 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2885 va_TraceMsg(trace_ctx, "\t--VAEncSequenceParameterBufferH264\n");
2887 va_TraceMsg(trace_ctx, "\tseq_parameter_set_id = %d\n", p->seq_parameter_set_id);
2888 va_TraceMsg(trace_ctx, "\tlevel_idc = %d\n", p->level_idc);
2889 va_TraceMsg(trace_ctx, "\tintra_period = %u\n", p->intra_period);
2890 va_TraceMsg(trace_ctx, "\tintra_idr_period = %u\n", p->intra_idr_period);
2891 va_TraceMsg(trace_ctx, "\tip_period = %u\n", p->ip_period);
2892 va_TraceMsg(trace_ctx, "\tbits_per_second = %u\n", p->bits_per_second);
2893 va_TraceMsg(trace_ctx, "\tmax_num_ref_frames = %u\n", p->max_num_ref_frames);
2894 va_TraceMsg(trace_ctx, "\tpicture_width_in_mbs = %d\n", p->picture_width_in_mbs);
2895 va_TraceMsg(trace_ctx, "\tpicture_height_in_mbs = %d\n", p->picture_height_in_mbs);
2896 va_TraceMsg(trace_ctx, "\tchroma_format_idc = %d\n", p->seq_fields.bits.chroma_format_idc);
2897 va_TraceMsg(trace_ctx, "\tframe_mbs_only_flag = %d\n", p->seq_fields.bits.frame_mbs_only_flag);
2898 va_TraceMsg(trace_ctx, "\tmb_adaptive_frame_field_flag = %d\n", p->seq_fields.bits.mb_adaptive_frame_field_flag);
2899 va_TraceMsg(trace_ctx, "\tseq_scaling_matrix_present_flag = %d\n", p->seq_fields.bits.seq_scaling_matrix_present_flag);
2900 va_TraceMsg(trace_ctx, "\tdirect_8x8_inference_flag = %d\n", p->seq_fields.bits.direct_8x8_inference_flag);
2901 va_TraceMsg(trace_ctx, "\tlog2_max_frame_num_minus4 = %d\n", p->seq_fields.bits.log2_max_frame_num_minus4);
2902 va_TraceMsg(trace_ctx, "\tpic_order_cnt_type = %d\n", p->seq_fields.bits.pic_order_cnt_type);
2903 va_TraceMsg(trace_ctx, "\tlog2_max_pic_order_cnt_lsb_minus4 = %d\n", p->seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4);
2904 va_TraceMsg(trace_ctx, "\tdelta_pic_order_always_zero_flag = %d\n", p->seq_fields.bits.delta_pic_order_always_zero_flag);
2905 va_TraceMsg(trace_ctx, "\tbit_depth_luma_minus8 = %d\n", p->bit_depth_luma_minus8);
2906 va_TraceMsg(trace_ctx, "\tbit_depth_chroma_minus8 = %d\n", p->bit_depth_chroma_minus8);
2907 va_TraceMsg(trace_ctx, "\tnum_ref_frames_in_pic_order_cnt_cycle = %d\n", p->num_ref_frames_in_pic_order_cnt_cycle);
2908 va_TraceMsg(trace_ctx, "\toffset_for_non_ref_pic = %d\n", p->offset_for_non_ref_pic);
2909 va_TraceMsg(trace_ctx, "\toffset_for_top_to_bottom_field = %d\n", p->offset_for_top_to_bottom_field);
2910 for(i = 0; (i < p->max_num_ref_frames) && (i < 32); ++i)
2911 va_TraceMsg(trace_ctx, "\toffset_for_ref_frame[%d] = %d\n", i, p->offset_for_ref_frame[i]);
2912 va_TraceMsg(trace_ctx, "\tframe_cropping_flag = %d\n", p->frame_cropping_flag);
2913 va_TraceMsg(trace_ctx, "\tframe_crop_left_offset = %u\n", p->frame_crop_left_offset);
2914 va_TraceMsg(trace_ctx, "\tframe_crop_right_offset = %u\n", p->frame_crop_right_offset);
2915 va_TraceMsg(trace_ctx, "\tframe_crop_top_offset = %u\n", p->frame_crop_top_offset);
2916 va_TraceMsg(trace_ctx, "\tframe_crop_bottom_offset = %u\n", p->frame_crop_bottom_offset);
2917 va_TraceMsg(trace_ctx, "\tvui_parameters_present_flag = %d\n", p->vui_parameters_present_flag);
2918 va_TraceMsg(trace_ctx, "\taspect_ratio_info_present_flag = %d\n", p->vui_fields.bits.aspect_ratio_info_present_flag);
2919 va_TraceMsg(trace_ctx, "\ttiming_info_present_flag = %d\n", p->vui_fields.bits.timing_info_present_flag);
2920 va_TraceMsg(trace_ctx, "\tbitstream_restriction_flag = %d\n", p->vui_fields.bits.bitstream_restriction_flag);
2921 va_TraceMsg(trace_ctx, "\tlog2_max_mv_length_horizontal = %d\n", p->vui_fields.bits.log2_max_mv_length_horizontal);
2922 va_TraceMsg(trace_ctx, "\tlog2_max_mv_length_vertical = %d\n", p->vui_fields.bits.log2_max_mv_length_vertical);
2923 va_TraceMsg(trace_ctx, "\taspect_ratio_idc = %d\n", p->aspect_ratio_idc);
2924 va_TraceMsg(trace_ctx, "\tsar_width = %u\n", p->sar_width);
2925 va_TraceMsg(trace_ctx, "\tsar_height = %u\n", p->sar_height);
2926 va_TraceMsg(trace_ctx, "\tnum_units_in_tick = %u\n", p->num_units_in_tick);
2927 va_TraceMsg(trace_ctx, "\ttime_scale = %u\n", p->time_scale);
2929 va_TraceMsg(trace_ctx, NULL);
2935 static void va_TraceVAEncPictureParameterBufferH264(
2937 VAContextID context,
2941 unsigned int num_elements,
2944 VAEncPictureParameterBufferH264 *p = (VAEncPictureParameterBufferH264 *)data;
2945 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2948 va_TraceMsg(trace_ctx, "\t--VAEncPictureParameterBufferH264\n");
2950 va_TraceMsg(trace_ctx, "\tCurrPic.picture_id = 0x%08x\n", p->CurrPic.picture_id);
2951 va_TraceMsg(trace_ctx, "\tCurrPic.frame_idx = %u\n", p->CurrPic.frame_idx);
2952 va_TraceMsg(trace_ctx, "\tCurrPic.flags = 0x%08x\n", p->CurrPic.flags);
2953 va_TraceMsg(trace_ctx, "\tCurrPic.TopFieldOrderCnt = %d\n", p->CurrPic.TopFieldOrderCnt);
2954 va_TraceMsg(trace_ctx, "\tCurrPic.BottomFieldOrderCnt = %d\n", p->CurrPic.BottomFieldOrderCnt);
2955 va_TraceMsg(trace_ctx, "\tReferenceFrames (TopFieldOrderCnt-BottomFieldOrderCnt-picture_id-frame_idx-flags):\n");
2956 for (i = 0; i < 16; i++)
2958 if ((p->ReferenceFrames[i].picture_id != VA_INVALID_SURFACE) &&
2959 ((p->ReferenceFrames[i].flags & VA_PICTURE_H264_INVALID) == 0)) {
2960 va_TraceMsg(trace_ctx, "\t\t%08d-%08d-0x%08x-%08u-0x%08x\n",
2961 p->ReferenceFrames[i].TopFieldOrderCnt,
2962 p->ReferenceFrames[i].BottomFieldOrderCnt,
2963 p->ReferenceFrames[i].picture_id,
2964 p->ReferenceFrames[i].frame_idx,
2965 p->ReferenceFrames[i].flags
2970 va_TraceMsg(trace_ctx, "\tcoded_buf = %08x\n", p->coded_buf);
2971 va_TraceMsg(trace_ctx, "\tpic_parameter_set_id = %d\n", p->pic_parameter_set_id);
2972 va_TraceMsg(trace_ctx, "\tseq_parameter_set_id = %d\n", p->seq_parameter_set_id);
2973 va_TraceMsg(trace_ctx, "\tlast_picture = 0x%08x\n", p->last_picture);
2974 va_TraceMsg(trace_ctx, "\tframe_num = %d\n", p->frame_num);
2975 va_TraceMsg(trace_ctx, "\tpic_init_qp = %d\n", p->pic_init_qp);
2976 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l0_active_minus1 = %d\n", p->num_ref_idx_l0_active_minus1);
2977 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l1_active_minus1 = %d\n", p->num_ref_idx_l1_active_minus1);
2978 va_TraceMsg(trace_ctx, "\tchroma_qp_index_offset = %d\n", p->chroma_qp_index_offset);
2979 va_TraceMsg(trace_ctx, "\tsecond_chroma_qp_index_offset = %d\n", p->second_chroma_qp_index_offset);
2980 va_TraceMsg(trace_ctx, "\tpic_fields = 0x%03x\n", p->pic_fields.value);
2981 va_TraceMsg(trace_ctx, "\tidr_pic_flag = %d\n", p->pic_fields.bits.idr_pic_flag);
2982 va_TraceMsg(trace_ctx, "\treference_pic_flag = %d\n", p->pic_fields.bits.reference_pic_flag);
2983 va_TraceMsg(trace_ctx, "\tentropy_coding_mode_flag = %d\n", p->pic_fields.bits.entropy_coding_mode_flag);
2984 va_TraceMsg(trace_ctx, "\tweighted_pred_flag = %d\n", p->pic_fields.bits.weighted_pred_flag);
2985 va_TraceMsg(trace_ctx, "\tweighted_bipred_idc = %d\n", p->pic_fields.bits.weighted_bipred_idc);
2986 va_TraceMsg(trace_ctx, "\tconstrained_intra_pred_flag = %d\n", p->pic_fields.bits.constrained_intra_pred_flag);
2987 va_TraceMsg(trace_ctx, "\ttransform_8x8_mode_flag = %d\n", p->pic_fields.bits.transform_8x8_mode_flag);
2988 va_TraceMsg(trace_ctx, "\tdeblocking_filter_control_present_flag = %d\n", p->pic_fields.bits.deblocking_filter_control_present_flag);
2989 va_TraceMsg(trace_ctx, "\tredundant_pic_cnt_present_flag = %d\n", p->pic_fields.bits.redundant_pic_cnt_present_flag);
2990 va_TraceMsg(trace_ctx, "\tpic_order_present_flag = %d\n", p->pic_fields.bits.pic_order_present_flag);
2991 va_TraceMsg(trace_ctx, "\tpic_scaling_matrix_present_flag = %d\n", p->pic_fields.bits.pic_scaling_matrix_present_flag);
2993 va_TraceMsg(trace_ctx, NULL);
2998 static void va_TraceVAEncSliceParameterBuffer(
3000 VAContextID context,
3004 unsigned int num_elements,
3007 VAEncSliceParameterBuffer* p = (VAEncSliceParameterBuffer*)data;
3008 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3010 va_TraceMsg(trace_ctx, "\t--VAEncSliceParameterBuffer\n");
3012 va_TraceMsg(trace_ctx, "\tstart_row_number = %d\n", p->start_row_number);
3013 va_TraceMsg(trace_ctx, "\tslice_height = %d\n", p->slice_height);
3014 va_TraceMsg(trace_ctx, "\tslice_flags.is_intra = %d\n", p->slice_flags.bits.is_intra);
3015 va_TraceMsg(trace_ctx, "\tslice_flags.disable_deblocking_filter_idc = %d\n", p->slice_flags.bits.disable_deblocking_filter_idc);
3016 va_TraceMsg(trace_ctx, "\tslice_flags.uses_long_term_ref = %d\n", p->slice_flags.bits.uses_long_term_ref);
3017 va_TraceMsg(trace_ctx, "\tslice_flags.is_long_term_ref = %d\n", p->slice_flags.bits.is_long_term_ref);
3018 va_TraceMsg(trace_ctx, NULL);
3023 static void va_TraceVAEncSliceParameterBufferH264(
3025 VAContextID context,
3029 unsigned int num_elements,
3032 VAEncSliceParameterBufferH264* p = (VAEncSliceParameterBufferH264*)data;
3033 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3039 va_TraceMsg(trace_ctx, "\t--VAEncSliceParameterBufferH264\n");
3040 va_TraceMsg(trace_ctx, "\tmacroblock_address = %u\n", p->macroblock_address);
3041 va_TraceMsg(trace_ctx, "\tnum_macroblocks = %u\n", p->num_macroblocks);
3042 va_TraceMsg(trace_ctx, "\tmacroblock_info = %08x\n", p->macroblock_info);
3043 va_TraceMsg(trace_ctx, "\tslice_type = %d\n", p->slice_type);
3044 va_TraceMsg(trace_ctx, "\tpic_parameter_set_id = %d\n", p->pic_parameter_set_id);
3045 va_TraceMsg(trace_ctx, "\tidr_pic_id = %d\n", p->idr_pic_id);
3046 va_TraceMsg(trace_ctx, "\tpic_order_cnt_lsb = %d\n", p->pic_order_cnt_lsb);
3047 va_TraceMsg(trace_ctx, "\tdelta_pic_order_cnt_bottom = %d\n", p->delta_pic_order_cnt_bottom);
3048 va_TraceMsg(trace_ctx, "\tdelta_pic_order_cnt[0] = %d\n", p->delta_pic_order_cnt[0]);
3049 va_TraceMsg(trace_ctx, "\tdelta_pic_order_cnt[1] = %d\n", p->delta_pic_order_cnt[1]);
3050 va_TraceMsg(trace_ctx, "\tdirect_spatial_mv_pred_flag = %d\n", p->direct_spatial_mv_pred_flag);
3051 va_TraceMsg(trace_ctx, "\tnum_ref_idx_active_override_flag = %d\n", p->num_ref_idx_active_override_flag);
3052 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l1_active_minus1 = %d\n", p->num_ref_idx_l1_active_minus1);
3053 va_TraceMsg(trace_ctx, "\tslice_beta_offset_div2 = %d\n", p->slice_beta_offset_div2);
3055 va_TraceMsg(trace_ctx, "\tRefPicList0 (TopFieldOrderCnt-BottomFieldOrderCnt-picture_id-frame_idx-flags):\n");
3059 for (i = 0; i < 32; i++) {
3060 if ((p->RefPicList0[i].picture_id != VA_INVALID_SURFACE) &&
3061 ((p->RefPicList0[i].flags & VA_PICTURE_H264_INVALID) == 0))
3062 va_TraceMsg(trace_ctx, "\t\t%08d-%08d-0x%08x-%08d-0x%08x\n",
3063 p->RefPicList0[i].TopFieldOrderCnt,
3064 p->RefPicList0[i].BottomFieldOrderCnt,
3065 p->RefPicList0[i].picture_id,
3066 p->RefPicList0[i].frame_idx,
3067 p->RefPicList0[i].flags);
3072 va_TraceMsg(trace_ctx, "\tRefPicList1 (TopFieldOrderCnt-BottomFieldOrderCnt-picture_id-frame_idx-flags):\n");
3073 for (i = 0; i < 32; i++) {
3074 if ((p->RefPicList1[i].picture_id != VA_INVALID_SURFACE) &&
3075 ((p->RefPicList1[i].flags & VA_PICTURE_H264_INVALID) == 0))
3076 va_TraceMsg(trace_ctx, "\t\t%08d-%08d-0x%08x-%08d-0x%08d\n",
3077 p->RefPicList1[i].TopFieldOrderCnt,
3078 p->RefPicList1[i].BottomFieldOrderCnt,
3079 p->RefPicList1[i].picture_id,
3080 p->RefPicList1[i].frame_idx,
3081 p->RefPicList1[i].flags
3087 va_TraceMsg(trace_ctx, "\tluma_log2_weight_denom = %d\n", p->luma_log2_weight_denom);
3088 va_TraceMsg(trace_ctx, "\tchroma_log2_weight_denom = %d\n", p->chroma_log2_weight_denom);
3089 va_TraceMsg(trace_ctx, "\tluma_weight_l0_flag = %d\n", p->luma_weight_l0_flag);
3090 if (p->luma_weight_l0_flag) {
3091 for (i = 0; (i <= p->num_ref_idx_l0_active_minus1) && (i<32); i++) {
3092 va_TraceMsg(trace_ctx, "\t\t%d\t%d\n",
3093 p->luma_weight_l0[i],
3094 p->luma_offset_l0[i]);
3098 va_TraceMsg(trace_ctx, "\tchroma_weight_l0_flag = %d\n", p->chroma_weight_l0_flag);
3099 if (p->chroma_weight_l0_flag) {
3100 for (i = 0; (i <= p->num_ref_idx_l0_active_minus1) && (i<32); i++) {
3101 va_TraceMsg(trace_ctx, "\t\t%d\t%d\t%d\t%d\n",
3102 p->chroma_weight_l0[i][0],
3103 p->chroma_offset_l0[i][0],
3104 p->chroma_weight_l0[i][1],
3105 p->chroma_offset_l0[i][1]);
3109 va_TraceMsg(trace_ctx, "\tluma_weight_l1_flag = %d\n", p->luma_weight_l1_flag);
3110 if (p->luma_weight_l1_flag) {
3111 for (i = 0; (i <= p->num_ref_idx_l1_active_minus1) && (i<32); i++) {
3112 va_TraceMsg(trace_ctx, "\t\t%d\t\t%d\n",
3113 p->luma_weight_l1[i],
3114 p->luma_offset_l1[i]);
3118 va_TraceMsg(trace_ctx, "\tchroma_weight_l1_flag = %d\n", p->chroma_weight_l1_flag);
3119 if (p->chroma_weight_l1_flag && p->num_ref_idx_l1_active_minus1 < 32) {
3120 for (i = 0; (i <= p->num_ref_idx_l1_active_minus1) && (i<32); i++) {
3121 va_TraceMsg(trace_ctx, "\t\t%d\t%d\t%d\t%d\n",
3122 p->chroma_weight_l1[i][0],
3123 p->chroma_offset_l1[i][0],
3124 p->chroma_weight_l1[i][1],
3125 p->chroma_offset_l1[i][1]);
3128 va_TraceMsg(trace_ctx, NULL);
3130 va_TraceMsg(trace_ctx, "\tcabac_init_idc = %d\n", p->cabac_init_idc);
3131 va_TraceMsg(trace_ctx, "\tslice_qp_delta = %d\n", p->slice_qp_delta);
3132 va_TraceMsg(trace_ctx, "\tdisable_deblocking_filter_idc = %d\n", p->disable_deblocking_filter_idc);
3133 va_TraceMsg(trace_ctx, "\tslice_alpha_c0_offset_div2 = %d\n", p->slice_alpha_c0_offset_div2);
3134 va_TraceMsg(trace_ctx, "\tslice_beta_offset_div2 = %d\n", p->slice_beta_offset_div2);
3135 va_TraceMsg(trace_ctx, NULL);
3141 static void va_TraceVAEncPackedHeaderParameterBufferType(
3143 VAContextID context,
3147 unsigned int num_elements,
3150 VAEncPackedHeaderParameterBuffer* p = (VAEncPackedHeaderParameterBuffer*)data;
3151 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3155 va_TraceMsg(trace_ctx, "\t--VAEncPackedHeaderParameterBuffer\n");
3156 va_TraceMsg(trace_ctx, "\ttype = 0x%08x\n", p->type);
3157 va_TraceMsg(trace_ctx, "\tbit_length = %d\n", p->bit_length);
3158 va_TraceMsg(trace_ctx, "\thas_emulation_bytes = %d\n", p->has_emulation_bytes);
3159 va_TraceMsg(trace_ctx, NULL);
3164 static void va_TraceVAEncMiscParameterBuffer(
3166 VAContextID context,
3170 unsigned int num_elements,
3173 VAEncMiscParameterBuffer* tmp = (VAEncMiscParameterBuffer*)data;
3174 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3176 switch (tmp->type) {
3177 case VAEncMiscParameterTypeFrameRate:
3179 VAEncMiscParameterFrameRate *p = (VAEncMiscParameterFrameRate *)tmp->data;
3180 va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterFrameRate\n");
3181 va_TraceMsg(trace_ctx, "\tframerate = %d\n", p->framerate);
3182 va_TraceMsg(trace_ctx, "\tframerate_flags.temporal_id = %d\n", p->framerate_flags.bits.temporal_id);
3185 case VAEncMiscParameterTypeRateControl:
3187 VAEncMiscParameterRateControl *p = (VAEncMiscParameterRateControl *)tmp->data;
3189 va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterRateControl\n");
3190 va_TraceMsg(trace_ctx, "\tbits_per_second = %d\n", p->bits_per_second);
3191 va_TraceMsg(trace_ctx, "\ttarget_percentage = %d\n", p->target_percentage);
3192 va_TraceMsg(trace_ctx, "\twindow_size = %d\n", p->window_size);
3193 va_TraceMsg(trace_ctx, "\tinitial_qp = %d\n", p->initial_qp);
3194 va_TraceMsg(trace_ctx, "\tmin_qp = %d\n", p->min_qp);
3195 va_TraceMsg(trace_ctx, "\tbasic_unit_size = %d\n", p->basic_unit_size);
3196 va_TraceMsg(trace_ctx, "\trc_flags.reset = %d \n", p->rc_flags.bits.reset);
3197 va_TraceMsg(trace_ctx, "\trc_flags.disable_frame_skip = %d\n", p->rc_flags.bits.disable_frame_skip);
3198 va_TraceMsg(trace_ctx, "\trc_flags.disable_bit_stuffing = %d\n", p->rc_flags.bits.disable_bit_stuffing);
3199 va_TraceMsg(trace_ctx, "\trc_flags.mb_rate_control = %d\n", p->rc_flags.bits.mb_rate_control);
3200 va_TraceMsg(trace_ctx, "\trc_flags.temporal_id = %d\n", p->rc_flags.bits.temporal_id);
3201 va_TraceMsg(trace_ctx, "\trc_flags.cfs_I_frames = %d\n", p->rc_flags.bits.cfs_I_frames);
3202 va_TraceMsg(trace_ctx, "\trc_flags.enable_parallel_brc = %d\n", p->rc_flags.bits.enable_parallel_brc);
3203 va_TraceMsg(trace_ctx, "\trc_flags.enable_dynamic_scaling = %d\n", p->rc_flags.bits.enable_dynamic_scaling);
3204 va_TraceMsg(trace_ctx, "\trc_flags.frame_tolerance_mode = %d\n", p->rc_flags.bits.frame_tolerance_mode);
3205 va_TraceMsg(trace_ctx, "\tICQ_quality_factor = %d\n", p->ICQ_quality_factor);
3206 va_TraceMsg(trace_ctx, "\tmax_qp = %d\n", p->max_qp);
3209 case VAEncMiscParameterTypeMaxSliceSize:
3211 VAEncMiscParameterMaxSliceSize *p = (VAEncMiscParameterMaxSliceSize *)tmp->data;
3213 va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterTypeMaxSliceSize\n");
3214 va_TraceMsg(trace_ctx, "\tmax_slice_size = %d\n", p->max_slice_size);
3217 case VAEncMiscParameterTypeAIR:
3219 VAEncMiscParameterAIR *p = (VAEncMiscParameterAIR *)tmp->data;
3221 va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterAIR\n");
3222 va_TraceMsg(trace_ctx, "\tair_num_mbs = %d\n", p->air_num_mbs);
3223 va_TraceMsg(trace_ctx, "\tair_threshold = %d\n", p->air_threshold);
3224 va_TraceMsg(trace_ctx, "\tair_auto = %d\n", p->air_auto);
3227 case VAEncMiscParameterTypeHRD:
3229 VAEncMiscParameterHRD *p = (VAEncMiscParameterHRD *)tmp->data;
3231 va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterHRD\n");
3232 va_TraceMsg(trace_ctx, "\tinitial_buffer_fullness = %d\n", p->initial_buffer_fullness);
3233 va_TraceMsg(trace_ctx, "\tbuffer_size = %d\n", p->buffer_size);
3236 case VAEncMiscParameterTypeMaxFrameSize:
3238 VAEncMiscParameterBufferMaxFrameSize *p = (VAEncMiscParameterBufferMaxFrameSize *)tmp->data;
3240 va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterTypeMaxFrameSize\n");
3241 va_TraceMsg(trace_ctx, "\tmax_frame_size = %d\n", p->max_frame_size);
3244 case VAEncMiscParameterTypeMultiPassFrameSize:
3247 VAEncMiscParameterBufferMultiPassFrameSize *p = (VAEncMiscParameterBufferMultiPassFrameSize *)tmp->data;
3249 va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterTypeMultiPassFrameSize\n");
3250 va_TraceMsg(trace_ctx, "\tmax_frame_size = %d\n", p->max_frame_size);
3251 va_TraceMsg(trace_ctx, "\tnum_passes = %d\n", p->num_passes);
3252 for(i = 0; i<p->num_passes; ++i)
3253 va_TraceMsg(trace_ctx, "\tdelta_qp[%d] = %d\n", i, p->delta_qp[i]);
3256 case VAEncMiscParameterTypeQualityLevel:
3258 VAEncMiscParameterBufferQualityLevel *p = (VAEncMiscParameterBufferQualityLevel *)tmp->data;
3260 va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterBufferQualityLevel\n");
3261 va_TraceMsg(trace_ctx, "\tquality_level = %d\n", p->quality_level);
3265 va_TraceMsg(trace_ctx, "Unknown VAEncMiscParameterBuffer(type = %d):\n", tmp->type);
3266 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, data);
3269 va_TraceMsg(trace_ctx, NULL);
3275 static void va_TraceVAPictureParameterBufferVC1(
3277 VAContextID context,
3281 unsigned int num_elements,
3285 VAPictureParameterBufferVC1* p = (VAPictureParameterBufferVC1*)data;
3286 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3288 va_TraceMsg(trace_ctx, "\t--VAPictureParameterBufferVC1\n");
3290 va_TraceMsg(trace_ctx, "\tforward_reference_picture = 0x%08x\n", p->forward_reference_picture);
3291 va_TraceMsg(trace_ctx, "\tbackward_reference_picture = 0x%08x\n", p->backward_reference_picture);
3292 va_TraceMsg(trace_ctx, "\tinloop_decoded_picture = 0x%08x\n", p->inloop_decoded_picture);
3294 va_TraceMsg(trace_ctx, "\tpulldown = %d\n", p->sequence_fields.bits.pulldown);
3295 va_TraceMsg(trace_ctx, "\tinterlace = %d\n", p->sequence_fields.bits.interlace);
3296 va_TraceMsg(trace_ctx, "\ttfcntrflag = %d\n", p->sequence_fields.bits.tfcntrflag);
3297 va_TraceMsg(trace_ctx, "\tfinterpflag = %d\n", p->sequence_fields.bits.finterpflag);
3298 va_TraceMsg(trace_ctx, "\tpsf = %d\n", p->sequence_fields.bits.psf);
3299 va_TraceMsg(trace_ctx, "\tmultires = %d\n", p->sequence_fields.bits.multires);
3300 va_TraceMsg(trace_ctx, "\toverlap = %d\n", p->sequence_fields.bits.overlap);
3301 va_TraceMsg(trace_ctx, "\tsyncmarker = %d\n", p->sequence_fields.bits.syncmarker);
3302 va_TraceMsg(trace_ctx, "\trangered = %d\n", p->sequence_fields.bits.rangered);
3303 va_TraceMsg(trace_ctx, "\tmax_b_frames = %d\n", p->sequence_fields.bits.max_b_frames);
3304 va_TraceMsg(trace_ctx, "\tprofile = %d\n", p->sequence_fields.bits.profile);
3305 va_TraceMsg(trace_ctx, "\tcoded_width = %d\n", p->coded_width);
3306 va_TraceMsg(trace_ctx, "\tcoded_height = %d\n", p->coded_height);
3307 va_TraceMsg(trace_ctx, "\tclosed_entry = %d\n", p->entrypoint_fields.bits.closed_entry);
3308 va_TraceMsg(trace_ctx, "\tbroken_link = %d\n", p->entrypoint_fields.bits.broken_link);
3309 va_TraceMsg(trace_ctx, "\tclosed_entry = %d\n", p->entrypoint_fields.bits.closed_entry);
3310 va_TraceMsg(trace_ctx, "\tpanscan_flag = %d\n", p->entrypoint_fields.bits.panscan_flag);
3311 va_TraceMsg(trace_ctx, "\tloopfilter = %d\n", p->entrypoint_fields.bits.loopfilter);
3312 va_TraceMsg(trace_ctx, "\tconditional_overlap_flag = %d\n", p->conditional_overlap_flag);
3313 va_TraceMsg(trace_ctx, "\tfast_uvmc_flag = %d\n", p->fast_uvmc_flag);
3314 va_TraceMsg(trace_ctx, "\trange_mapping_luma_flag = %d\n", p->range_mapping_fields.bits.luma_flag);
3315 va_TraceMsg(trace_ctx, "\trange_mapping_luma = %d\n", p->range_mapping_fields.bits.luma);
3316 va_TraceMsg(trace_ctx, "\trange_mapping_chroma_flag = %d\n", p->range_mapping_fields.bits.chroma_flag);
3317 va_TraceMsg(trace_ctx, "\trange_mapping_chroma = %d\n", p->range_mapping_fields.bits.chroma);
3318 va_TraceMsg(trace_ctx, "\tb_picture_fraction = %d\n", p->b_picture_fraction);
3319 va_TraceMsg(trace_ctx, "\tcbp_table = %d\n", p->cbp_table);
3320 va_TraceMsg(trace_ctx, "\tmb_mode_table = %d\n", p->mb_mode_table);
3321 va_TraceMsg(trace_ctx, "\trange_reduction_frame = %d\n", p->range_reduction_frame);
3322 va_TraceMsg(trace_ctx, "\trounding_control = %d\n", p->rounding_control);
3323 va_TraceMsg(trace_ctx, "\tpost_processing = %d\n", p->post_processing);
3324 va_TraceMsg(trace_ctx, "\tpicture_resolution_index = %d\n", p->picture_resolution_index);
3325 va_TraceMsg(trace_ctx, "\tluma_scale = %d\n", p->luma_scale);
3326 va_TraceMsg(trace_ctx, "\tluma_shift = %d\n", p->luma_shift);
3327 va_TraceMsg(trace_ctx, "\tpicture_type = %d\n", p->picture_fields.bits.picture_type);
3328 va_TraceMsg(trace_ctx, "\tframe_coding_mode = %d\n", p->picture_fields.bits.frame_coding_mode);
3329 va_TraceMsg(trace_ctx, "\ttop_field_first = %d\n", p->picture_fields.bits.top_field_first);
3330 va_TraceMsg(trace_ctx, "\tis_first_field = %d\n", p->picture_fields.bits.is_first_field);
3331 va_TraceMsg(trace_ctx, "\tintensity_compensation = %d\n", p->picture_fields.bits.intensity_compensation);
3332 va_TraceMsg(trace_ctx, "\tmv_type_mb = %d\n", p->raw_coding.flags.mv_type_mb);
3333 va_TraceMsg(trace_ctx, "\tdirect_mb = %d\n", p->raw_coding.flags.direct_mb);
3334 va_TraceMsg(trace_ctx, "\tskip_mb = %d\n", p->raw_coding.flags.skip_mb);
3335 va_TraceMsg(trace_ctx, "\tfield_tx = %d\n", p->raw_coding.flags.field_tx);
3336 va_TraceMsg(trace_ctx, "\tforward_mb = %d\n", p->raw_coding.flags.forward_mb);
3337 va_TraceMsg(trace_ctx, "\tac_pred = %d\n", p->raw_coding.flags.ac_pred);
3338 va_TraceMsg(trace_ctx, "\toverflags = %d\n", p->raw_coding.flags.overflags);
3339 va_TraceMsg(trace_ctx, "\tbp_mv_type_mb = %d\n", p->bitplane_present.flags.bp_mv_type_mb);
3340 va_TraceMsg(trace_ctx, "\tbp_direct_mb = %d\n", p->bitplane_present.flags.bp_direct_mb);
3341 va_TraceMsg(trace_ctx, "\tbp_skip_mb = %d\n", p->bitplane_present.flags.bp_skip_mb);
3342 va_TraceMsg(trace_ctx, "\tbp_field_tx = %d\n", p->bitplane_present.flags.bp_field_tx);
3343 va_TraceMsg(trace_ctx, "\tbp_forward_mb = %d\n", p->bitplane_present.flags.bp_forward_mb);
3344 va_TraceMsg(trace_ctx, "\tbp_ac_pred = %d\n", p->bitplane_present.flags.bp_ac_pred);
3345 va_TraceMsg(trace_ctx, "\tbp_overflags = %d\n", p->bitplane_present.flags.bp_overflags);
3346 va_TraceMsg(trace_ctx, "\treference_distance_flag = %d\n", p->reference_fields.bits.reference_distance_flag);
3347 va_TraceMsg(trace_ctx, "\treference_distance = %d\n", p->reference_fields.bits.reference_distance);
3348 va_TraceMsg(trace_ctx, "\tnum_reference_pictures = %d\n", p->reference_fields.bits.num_reference_pictures);
3349 va_TraceMsg(trace_ctx, "\treference_field_pic_indicator = %d\n", p->reference_fields.bits.reference_field_pic_indicator);
3350 va_TraceMsg(trace_ctx, "\tmv_mode = %d\n", p->mv_fields.bits.mv_mode);
3351 va_TraceMsg(trace_ctx, "\tmv_mode2 = %d\n", p->mv_fields.bits.mv_mode2);
3352 va_TraceMsg(trace_ctx, "\tmv_table = %d\n", p->mv_fields.bits.mv_table);
3353 va_TraceMsg(trace_ctx, "\ttwo_mv_block_pattern_table = %d\n", p->mv_fields.bits.two_mv_block_pattern_table);
3354 va_TraceMsg(trace_ctx, "\tfour_mv_switch = %d\n", p->mv_fields.bits.four_mv_switch);
3355 va_TraceMsg(trace_ctx, "\tfour_mv_block_pattern_table = %d\n", p->mv_fields.bits.four_mv_block_pattern_table);
3356 va_TraceMsg(trace_ctx, "\textended_mv_flag = %d\n", p->mv_fields.bits.extended_mv_flag);
3357 va_TraceMsg(trace_ctx, "\textended_mv_range = %d\n", p->mv_fields.bits.extended_mv_range);
3358 va_TraceMsg(trace_ctx, "\textended_dmv_flag = %d\n", p->mv_fields.bits.extended_dmv_flag);
3359 va_TraceMsg(trace_ctx, "\textended_dmv_range = %d\n", p->mv_fields.bits.extended_dmv_range);
3360 va_TraceMsg(trace_ctx, "\tdquant = %d\n", p->pic_quantizer_fields.bits.dquant);
3361 va_TraceMsg(trace_ctx, "\tquantizer = %d\n", p->pic_quantizer_fields.bits.quantizer);
3362 va_TraceMsg(trace_ctx, "\thalf_qp = %d\n", p->pic_quantizer_fields.bits.half_qp);
3363 va_TraceMsg(trace_ctx, "\tpic_quantizer_scale = %d\n", p->pic_quantizer_fields.bits.pic_quantizer_scale);
3364 va_TraceMsg(trace_ctx, "\tpic_quantizer_type = %d\n", p->pic_quantizer_fields.bits.pic_quantizer_type);
3365 va_TraceMsg(trace_ctx, "\tdq_frame = %d\n", p->pic_quantizer_fields.bits.dq_frame);
3366 va_TraceMsg(trace_ctx, "\tdq_profile = %d\n", p->pic_quantizer_fields.bits.dq_profile);
3367 va_TraceMsg(trace_ctx, "\tdq_sb_edge = %d\n", p->pic_quantizer_fields.bits.dq_sb_edge);
3368 va_TraceMsg(trace_ctx, "\tdq_db_edge = %d\n", p->pic_quantizer_fields.bits.dq_db_edge);
3369 va_TraceMsg(trace_ctx, "\tdq_binary_level = %d\n", p->pic_quantizer_fields.bits.dq_binary_level);
3370 va_TraceMsg(trace_ctx, "\talt_pic_quantizer = %d\n", p->pic_quantizer_fields.bits.alt_pic_quantizer);
3371 va_TraceMsg(trace_ctx, "\tvariable_sized_transform_flag = %d\n", p->transform_fields.bits.variable_sized_transform_flag);
3372 va_TraceMsg(trace_ctx, "\tmb_level_transform_type_flag = %d\n", p->transform_fields.bits.mb_level_transform_type_flag);
3373 va_TraceMsg(trace_ctx, "\tframe_level_transform_type = %d\n", p->transform_fields.bits.frame_level_transform_type);
3374 va_TraceMsg(trace_ctx, "\ttransform_ac_codingset_idx1 = %d\n", p->transform_fields.bits.transform_ac_codingset_idx1);
3375 va_TraceMsg(trace_ctx, "\ttransform_ac_codingset_idx2 = %d\n", p->transform_fields.bits.transform_ac_codingset_idx2);
3376 va_TraceMsg(trace_ctx, "\tintra_transform_dc_table = %d\n", p->transform_fields.bits.intra_transform_dc_table);
3377 va_TraceMsg(trace_ctx, NULL);
3380 static void va_TraceVASliceParameterBufferVC1(
3382 VAContextID context,
3386 unsigned int num_elements,
3390 VASliceParameterBufferVC1 *p = (VASliceParameterBufferVC1*)data;
3391 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3393 trace_ctx->trace_slice_no++;
3394 trace_ctx->trace_slice_size = p->slice_data_size;
3396 va_TraceMsg(trace_ctx, "\t--VASliceParameterBufferVC1\n");
3397 va_TraceMsg(trace_ctx, "\tslice_data_size = %d\n", p->slice_data_size);
3398 va_TraceMsg(trace_ctx, "\tslice_data_offset = %d\n", p->slice_data_offset);
3399 va_TraceMsg(trace_ctx, "\tslice_data_flag = %d\n", p->slice_data_flag);
3400 va_TraceMsg(trace_ctx, "\tmacroblock_offset = %d\n", p->macroblock_offset);
3401 va_TraceMsg(trace_ctx, "\tslice_vertical_position = %d\n", p->slice_vertical_position);
3402 va_TraceMsg(trace_ctx, NULL);
3405 static void va_TraceVAPictureParameterBufferVP8(
3407 VAContextID context,
3411 unsigned int num_elements,
3415 VAPictureParameterBufferVP8 *p = (VAPictureParameterBufferVP8 *)data;
3416 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3419 va_TraceMsg(trace_ctx, "\t--VAPictureParameterBufferVP8\n");
3421 va_TraceMsg(trace_ctx, "\tframe_width = %d\n", p->frame_width);
3422 va_TraceMsg(trace_ctx, "\tframe_height = %d\n", p->frame_height);
3423 va_TraceMsg(trace_ctx, "\tlast_ref_frame = %x\n", p->last_ref_frame);
3424 va_TraceMsg(trace_ctx, "\tgolden_ref_frame = %x\n", p->golden_ref_frame);
3425 va_TraceMsg(trace_ctx, "\talt_ref_frame = %x\n", p->alt_ref_frame);
3426 va_TraceMsg(trace_ctx, "\tout_of_loop_frame = %x\n", p->out_of_loop_frame);
3428 va_TraceMsg(trace_ctx, "\tkey_frame = %d\n", p->pic_fields.bits.key_frame);
3429 va_TraceMsg(trace_ctx, "\tversion = %d\n", p->pic_fields.bits.version);
3430 va_TraceMsg(trace_ctx, "\tsegmentation_enabled = %d\n", p->pic_fields.bits.segmentation_enabled);
3431 va_TraceMsg(trace_ctx, "\tupdate_mb_segmentation_map = %d\n", p->pic_fields.bits.update_mb_segmentation_map);
3432 va_TraceMsg(trace_ctx, "\tupdate_segment_feature_data = %d\n", p->pic_fields.bits.update_segment_feature_data);
3433 va_TraceMsg(trace_ctx, "\tfilter_type = %d\n", p->pic_fields.bits.filter_type);
3434 va_TraceMsg(trace_ctx, "\tsharpness_level = %d\n", p->pic_fields.bits.sharpness_level);
3435 va_TraceMsg(trace_ctx, "\tloop_filter_adj_enable = %d\n", p->pic_fields.bits.loop_filter_adj_enable);
3436 va_TraceMsg(trace_ctx, "\tmode_ref_lf_delta_update = %d\n", p->pic_fields.bits.mode_ref_lf_delta_update);
3437 va_TraceMsg(trace_ctx, "\tsign_bias_golden = %d\n", p->pic_fields.bits.sign_bias_golden);
3438 va_TraceMsg(trace_ctx, "\tsign_bias_alternate = %d\n", p->pic_fields.bits.sign_bias_alternate);
3439 va_TraceMsg(trace_ctx, "\tmb_no_coeff_skip = %d\n", p->pic_fields.bits.mb_no_coeff_skip);
3440 va_TraceMsg(trace_ctx, "\tloop_filter_disable = %d\n", p->pic_fields.bits.loop_filter_disable);
3442 va_TraceMsg(trace_ctx, "\tmb_segment_tree_probs: 0x%2x, 0x%2x, 0x%2x\n",
3443 p->mb_segment_tree_probs[0], p->mb_segment_tree_probs[1], p->mb_segment_tree_probs[2]);
3445 va_TraceMsg(trace_ctx, "\tloop_filter_level: %d, %d, %d, %d\n",
3446 p->loop_filter_level[0], p->loop_filter_level[1], p->loop_filter_level[2], p->loop_filter_level[3]);
3448 va_TraceMsg(trace_ctx, "\tloop_filter_deltas_ref_frame: %d, %d, %d, %d\n",
3449 p->loop_filter_deltas_ref_frame[0], p->loop_filter_deltas_ref_frame[1], p->loop_filter_deltas_ref_frame[2], p->loop_filter_deltas_ref_frame[3]);
3451 va_TraceMsg(trace_ctx, "\tloop_filter_deltas_mode: %d, %d, %d, %d\n",
3452 p->loop_filter_deltas_mode[0], p->loop_filter_deltas_mode[1], p->loop_filter_deltas_mode[2], p->loop_filter_deltas_mode[3]);
3454 va_TraceMsg(trace_ctx, "\tprob_skip_false = %2x\n", p->prob_skip_false);
3455 va_TraceMsg(trace_ctx, "\tprob_intra = %2x\n", p->prob_intra);
3456 va_TraceMsg(trace_ctx, "\tprob_last = %2x\n", p->prob_last);
3457 va_TraceMsg(trace_ctx, "\tprob_gf = %2x\n", p->prob_gf);
3459 va_TraceMsg(trace_ctx, "\ty_mode_probs: 0x%2x, 0x%2x, 0x%2x, 0x%2x\n",
3460 p->y_mode_probs[0], p->y_mode_probs[1], p->y_mode_probs[2], p->y_mode_probs[3]);
3462 va_TraceMsg(trace_ctx, "\tuv_mode_probs: 0x%2x, 0x%2x, 0x%2x\n",
3463 p->uv_mode_probs[0], p->uv_mode_probs[1], p->uv_mode_probs[2]);
3465 va_TraceMsg(trace_ctx, "\tmv_probs[2][19]:\n");
3466 for(i = 0; i<2; ++i) {
3467 memset(tmp, 0, sizeof tmp);
3468 for (j=0; j<19; j++)
3469 sprintf(tmp + strlen(tmp), "%2x ", p->mv_probs[i][j]);
3470 va_TraceMsg(trace_ctx,"\t\t[%d] = %s\n", i, tmp);
3473 va_TraceMsg(trace_ctx, "\tbool_coder_ctx: range = %02x, value = %02x, count = %d\n",
3474 p->bool_coder_ctx.range, p->bool_coder_ctx.value, p->bool_coder_ctx.count);
3476 va_TraceMsg(trace_ctx, NULL);
3481 static void va_TraceVASliceParameterBufferVP8(
3483 VAContextID context,
3487 unsigned int num_elements,
3490 VASliceParameterBufferVP8 *p = (VASliceParameterBufferVP8 *)data;
3491 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3494 va_TraceMsg(trace_ctx, "\t--VASliceParameterBufferVP8\n");
3496 va_TraceMsg(trace_ctx, "\tslice_data_size = %d\n", p->slice_data_size);
3497 va_TraceMsg(trace_ctx, "\tslice_data_offset = %d\n", p->slice_data_offset);
3498 va_TraceMsg(trace_ctx, "\tslice_data_flag = %d\n", p->slice_data_flag);
3499 va_TraceMsg(trace_ctx, "\tmacroblock_offset = %d\n", p->macroblock_offset);
3500 va_TraceMsg(trace_ctx, "\tnum_of_partitions = %d\n", p->num_of_partitions);
3502 for(i = 0; i<9; ++i)
3503 va_TraceMsg(trace_ctx, "\tpartition_size[%d] = %d\n", i, p->partition_size[i]);
3505 va_TraceMsg(trace_ctx, NULL);
3510 static void va_TraceVAIQMatrixBufferVP8(
3512 VAContextID context,
3516 unsigned int num_elements,
3520 VAIQMatrixBufferVP8 *p = (VAIQMatrixBufferVP8 *)data;
3521 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3524 va_TraceMsg(trace_ctx, "\t--VAIQMatrixBufferVP8\n");
3526 va_TraceMsg(trace_ctx, "\tquantization_index[4][6]=\n");
3527 for (i = 0; i < 4; i++) {
3528 memset(tmp, 0, sizeof tmp);
3529 for (j = 0; j < 6; j++)
3530 sprintf(tmp + strlen(tmp), "%4x, ", p->quantization_index[i][j]);
3531 va_TraceMsg(trace_ctx,"\t\t[%d] = %s\n", i, tmp);
3534 va_TraceMsg(trace_ctx, NULL);
3538 static void va_TraceVAProbabilityBufferVP8(
3540 VAContextID context,
3544 unsigned int num_elements,
3548 VAProbabilityDataBufferVP8 *p = (VAProbabilityDataBufferVP8 *)data;
3549 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3552 va_TraceMsg(trace_ctx, "\t--VAProbabilityDataBufferVP8\n");
3554 for (i = 0; i < 4; i++)
3555 for (j = 0; j < 8; j++) {
3556 memset(tmp, 0, sizeof tmp);
3558 for (l=0; l<11; l++)
3559 sprintf(tmp + strlen(tmp), "%2x, ", p->dct_coeff_probs[i][j][k][l]);
3560 va_TraceMsg(trace_ctx,"\t\t[%d, %d] = %s\n", i, j, tmp);
3563 va_TraceMsg(trace_ctx, NULL);
3568 static void va_TraceVAEncSequenceParameterBufferVP8(
3570 VAContextID context,
3574 unsigned int num_elements,
3577 VAEncSequenceParameterBufferVP8 *p = (VAEncSequenceParameterBufferVP8 *)data;
3578 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3581 va_TraceMsg(trace_ctx, "\t--VAEncSequenceParameterBufferVP8\n");
3583 va_TraceMsg(trace_ctx, "\tbits_per_second = %d\n", p->bits_per_second);
3584 va_TraceMsg(trace_ctx, "\terror_resilient = %d\n", p->error_resilient);
3585 va_TraceMsg(trace_ctx, "\tframe_height = %d\n", p->frame_height);
3586 va_TraceMsg(trace_ctx, "\tframe_width = %d\n", p->frame_width);
3587 va_TraceMsg(trace_ctx, "\tframe_height_scale = %d\n", p->frame_height_scale);
3588 va_TraceMsg(trace_ctx, "\tframe_width_scale = %d\n", p->frame_width_scale);
3589 va_TraceMsg(trace_ctx, "\tkf_auto = %d\n", p->kf_auto);
3590 va_TraceMsg(trace_ctx, "\tkf_max_dist = %d\n", p->kf_max_dist);
3591 va_TraceMsg(trace_ctx, "\tkf_min_dist = %d\n", p->kf_min_dist);
3592 va_TraceMsg(trace_ctx, "\tintra_period = %d\n", p->intra_period);
3594 for(i = 0; i<4; ++i)
3595 va_TraceMsg(trace_ctx, "\treference_frames[%d] = 0x%08x\n", i, p->reference_frames[i]);
3597 va_TraceMsg(trace_ctx, NULL);
3602 static void va_TraceVAEncSequenceParameterBufferVP9(
3604 VAContextID context,
3608 unsigned int num_elements,
3611 VAEncSequenceParameterBufferVP9 *p = (VAEncSequenceParameterBufferVP9 *)data;
3612 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3614 va_TraceMsg(trace_ctx, "\t--VAEncSequenceParameterBufferVP9\n");
3616 va_TraceMsg(trace_ctx, "\tmax_frame_height = %d\n", p->max_frame_height);
3617 va_TraceMsg(trace_ctx, "\tmax_frame_width = %d\n", p->max_frame_width);
3618 va_TraceMsg(trace_ctx, "\tkf_auto = %d\n", p->kf_auto);
3619 va_TraceMsg(trace_ctx, "\tkf_min_dist = %d\n", p->kf_min_dist);
3620 va_TraceMsg(trace_ctx, "\tkf_max_dist = %d\n", p->kf_max_dist);
3621 va_TraceMsg(trace_ctx, "\tbits_per_second = %d\n", p->bits_per_second);
3622 va_TraceMsg(trace_ctx, "\tintra_period = %d\n", p->intra_period);
3624 va_TraceMsg(trace_ctx, NULL);
3629 static void va_TraceVAPictureParameterBufferVP9(
3631 VAContextID context,
3635 unsigned int num_elements,
3638 VADecPictureParameterBufferVP9 *p = (VADecPictureParameterBufferVP9 *)data;
3639 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3642 va_TraceMsg(trace_ctx, "\t--VAPictureParameterBufferVP9\n");
3644 va_TraceMsg(trace_ctx, "\tframe_width = %d\n", p->frame_width);
3645 va_TraceMsg(trace_ctx, "\tframe_height = %d\n", p->frame_height);
3646 va_TraceMsg(trace_ctx, "\treference_frames[8] =\n");
3647 for (i = 0; i < 8; i++) {
3648 va_TraceMsg(trace_ctx, "\t\t0x%x\n", p->reference_frames[i]);
3650 va_TraceMsg(trace_ctx, "\tsubsampling_x = %d\n", p->pic_fields.bits.subsampling_x);
3651 va_TraceMsg(trace_ctx, "\tsubsampling_y = %d\n", p->pic_fields.bits.subsampling_y);
3652 va_TraceMsg(trace_ctx, "\tframe_type = %d\n", p->pic_fields.bits.frame_type);
3653 va_TraceMsg(trace_ctx, "\tshow_frame = %d\n", p->pic_fields.bits.show_frame);
3654 va_TraceMsg(trace_ctx, "\terror_resilient_mode = %d\n", p->pic_fields.bits.error_resilient_mode);
3655 va_TraceMsg(trace_ctx, "\tintra_only = %d\n", p->pic_fields.bits.intra_only);
3656 va_TraceMsg(trace_ctx, "\tallow_high_precision_mv = %d\n", p->pic_fields.bits.allow_high_precision_mv);
3657 va_TraceMsg(trace_ctx, "\tmcomp_filter_type = %d\n", p->pic_fields.bits.mcomp_filter_type);
3658 va_TraceMsg(trace_ctx, "\tframe_parallel_decoding_mode = %d\n", p->pic_fields.bits.frame_parallel_decoding_mode);
3659 va_TraceMsg(trace_ctx, "\treset_frame_context = %d\n", p->pic_fields.bits.reset_frame_context);
3660 va_TraceMsg(trace_ctx, "\trefresh_frame_context = %d\n", p->pic_fields.bits.refresh_frame_context);
3661 va_TraceMsg(trace_ctx, "\tframe_context_idx = %d\n", p->pic_fields.bits.frame_context_idx);
3662 va_TraceMsg(trace_ctx, "\tsegmentation_enabled = %d\n", p->pic_fields.bits.segmentation_enabled);
3663 va_TraceMsg(trace_ctx, "\tsegmentation_temporal_update = %d\n", p->pic_fields.bits.segmentation_temporal_update);
3664 va_TraceMsg(trace_ctx, "\tsegmentation_update_map = %d\n", p->pic_fields.bits.segmentation_update_map);
3665 va_TraceMsg(trace_ctx, "\tlast_ref_frame = %d\n", p->pic_fields.bits.last_ref_frame);
3666 va_TraceMsg(trace_ctx, "\tlast_ref_frame_sign_bias = %d\n", p->pic_fields.bits.last_ref_frame_sign_bias);
3667 va_TraceMsg(trace_ctx, "\tgolden_ref_frame = %d\n", p->pic_fields.bits.golden_ref_frame);
3668 va_TraceMsg(trace_ctx, "\tgolden_ref_frame_sign_bias = %d\n", p->pic_fields.bits.golden_ref_frame_sign_bias);
3669 va_TraceMsg(trace_ctx, "\talt_ref_frame = %d\n", p->pic_fields.bits.alt_ref_frame);
3670 va_TraceMsg(trace_ctx, "\talt_ref_frame_sign_bias = %d\n", p->pic_fields.bits.alt_ref_frame_sign_bias);
3671 va_TraceMsg(trace_ctx, "\tlossless_flag = %d\n", p->pic_fields.bits.lossless_flag);
3673 va_TraceMsg(trace_ctx, "\tfilter_level = %d\n", p->filter_level);
3674 va_TraceMsg(trace_ctx, "\tsharpness_level = %d\n", p->sharpness_level);
3675 va_TraceMsg(trace_ctx, "\tlog2_tile_rows = %d\n", p->log2_tile_rows);
3676 va_TraceMsg(trace_ctx, "\tlog2_tile_columns = %d\n", p->log2_tile_columns);
3677 va_TraceMsg(trace_ctx, "\tframe_header_length_in_bytes = %d\n", p->frame_header_length_in_bytes);
3678 va_TraceMsg(trace_ctx, "\tfirst_partition_size = %d\n", p->first_partition_size);
3680 va_TraceMsg(trace_ctx, "\tmb_segment_tree_probs[7]: [0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x]\n",
3681 p->mb_segment_tree_probs[0], p->mb_segment_tree_probs[1],
3682 p->mb_segment_tree_probs[2], p->mb_segment_tree_probs[3],
3683 p->mb_segment_tree_probs[4], p->mb_segment_tree_probs[5],
3684 p->mb_segment_tree_probs[6]);
3686 va_TraceMsg(trace_ctx, "\tsegment_pred_probs[3]: [0x%02x, 0x%02x, 0x%02x]\n", p->segment_pred_probs[0], p->segment_pred_probs[1], p->segment_pred_probs[2]);
3688 va_TraceMsg(trace_ctx, "\tprofile = %d\n", p->profile);
3690 va_TraceMsg(trace_ctx, NULL);
3695 static void va_TraceVAEncPictureParameterBufferVP8(
3697 VAContextID context,
3701 unsigned int num_elements,
3704 VAEncPictureParameterBufferVP8 *p = (VAEncPictureParameterBufferVP8 *)data;
3705 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3708 va_TraceMsg(trace_ctx, "\t--VAEncPictureParameterBufferVP8\n");
3709 va_TraceMsg(trace_ctx, "\treconstructed_frame = 0x%08x\n", p->reconstructed_frame);
3710 va_TraceMsg(trace_ctx, "\tref_last_frame = 0x%08x\n", p->ref_last_frame);
3711 va_TraceMsg(trace_ctx, "\tref_gf_frame = 0x%08x\n", p->ref_gf_frame);
3712 va_TraceMsg(trace_ctx, "\tref_arf_frame = 0x%08x\n", p->ref_arf_frame);
3713 va_TraceMsg(trace_ctx, "\tcoded_buf = 0x%08x\n", p->coded_buf);
3715 va_TraceMsg(trace_ctx, "\tref_flags.bits.force_kf = %d\n", p->ref_flags.bits.force_kf);
3716 va_TraceMsg(trace_ctx, "\tref_flags.bits.no_ref_last = %d\n", p->ref_flags.bits.no_ref_last);
3717 va_TraceMsg(trace_ctx, "\tref_flags.bits.no_ref_gf = %d\n", p->ref_flags.bits.no_ref_gf);
3718 va_TraceMsg(trace_ctx, "\tref_flags.bits.no_ref_arf = %d\n", p->ref_flags.bits.no_ref_arf);
3719 va_TraceMsg(trace_ctx, "\tref_flags.bits.no_ref_arf = 0x%08x\n", p->ref_flags.bits.reserved);
3721 va_TraceMsg(trace_ctx, "\tpic_flags.bits.frame_type = %d\n", p->pic_flags.bits.frame_type);
3722 va_TraceMsg(trace_ctx, "\tpic_flags.bits.version = %d\n", p->pic_flags.bits.version);
3723 va_TraceMsg(trace_ctx, "\tpic_flags.bits.show_frame = %d\n", p->pic_flags.bits.show_frame);
3724 va_TraceMsg(trace_ctx, "\tpic_flags.bits.color_space = %d\n", p->pic_flags.bits.color_space);
3725 va_TraceMsg(trace_ctx, "\tpic_flags.bits.recon_filter_type = %d\n", p->pic_flags.bits.recon_filter_type);
3726 va_TraceMsg(trace_ctx, "\tpic_flags.bits.loop_filter_type = %d\n", p->pic_flags.bits.loop_filter_type);
3727 va_TraceMsg(trace_ctx, "\tpic_flags.bits.auto_partitions = %d\n", p->pic_flags.bits.auto_partitions);
3728 va_TraceMsg(trace_ctx, "\tpic_flags.bits.num_token_partitions = %d\n", p->pic_flags.bits.num_token_partitions);
3729 va_TraceMsg(trace_ctx, "\tpic_flags.bits.clamping_type = %d\n", p->pic_flags.bits.clamping_type);
3730 va_TraceMsg(trace_ctx, "\tpic_flags.bits.segmentation_enabled = %d\n", p->pic_flags.bits.segmentation_enabled);
3731 va_TraceMsg(trace_ctx, "\tpic_flags.bits.update_mb_segmentation_map = %d\n", p->pic_flags.bits.update_mb_segmentation_map);
3732 va_TraceMsg(trace_ctx, "\tpic_flags.bits.update_segment_feature_data = %d\n", p->pic_flags.bits.update_segment_feature_data);
3733 va_TraceMsg(trace_ctx, "\tpic_flags.bits.loop_filter_adj_enable = %d\n", p->pic_flags.bits.loop_filter_adj_enable);
3734 va_TraceMsg(trace_ctx, "\tpic_flags.bits.refresh_entropy_probs = %d\n", p->pic_flags.bits.refresh_entropy_probs);
3735 va_TraceMsg(trace_ctx, "\tpic_flags.bits.refresh_golden_frame = %d\n", p->pic_flags.bits.refresh_golden_frame);
3736 va_TraceMsg(trace_ctx, "\tpic_flags.bits.refresh_alternate_frame = %d\n", p->pic_flags.bits.refresh_alternate_frame);
3737 va_TraceMsg(trace_ctx, "\tpic_flags.bits.refresh_last = %d\n", p->pic_flags.bits.refresh_last);
3738 va_TraceMsg(trace_ctx, "\tpic_flags.bits.copy_buffer_to_golden = %d\n", p->pic_flags.bits.copy_buffer_to_golden);
3739 va_TraceMsg(trace_ctx, "\tpic_flags.bits.copy_buffer_to_alternate = %d\n", p->pic_flags.bits.copy_buffer_to_alternate);
3741 va_TraceMsg(trace_ctx, "\tpic_flags.bits.sign_bias_golden = %d\n", p->pic_flags.bits.sign_bias_golden);
3742 va_TraceMsg(trace_ctx, "\tpic_flags.bits.sign_bias_alternate = %d\n", p->pic_flags.bits.sign_bias_alternate);
3743 va_TraceMsg(trace_ctx, "\tpic_flags.bits.mb_no_coeff_skip = %d\n", p->pic_flags.bits.mb_no_coeff_skip);
3744 va_TraceMsg(trace_ctx, "\tpic_flags.bits.forced_lf_adjustment = %d\n", p->pic_flags.bits.forced_lf_adjustment);
3745 va_TraceMsg(trace_ctx, "\tpic_flags.bits.reserved = %d\n", p->pic_flags.bits.reserved);
3748 va_TraceMsg(trace_ctx, "\tloop_filter_level[%d] = %d\n", i, p->loop_filter_level[i]);
3750 va_TraceMsg(trace_ctx, "\tref_lf_delta[%d] = %d\n", i, p->ref_lf_delta[i]);
3752 va_TraceMsg(trace_ctx, "\tmode_lf_delta[%d] = %d\n", i, p->mode_lf_delta[i]);
3754 va_TraceMsg(trace_ctx, "\tsharpness_level = %d\n", p->sharpness_level);
3755 va_TraceMsg(trace_ctx, "\tclamp_qindex_high = %d\n", p->clamp_qindex_high);
3756 va_TraceMsg(trace_ctx, "\tclamp_qindex_low = %d\n", p->clamp_qindex_low);
3758 va_TraceMsg(trace_ctx, NULL);
3763 static void va_TraceVAEncPictureParameterBufferVP9(
3765 VAContextID context,
3769 unsigned int num_elements,
3772 VAEncPictureParameterBufferVP9 *p = (VAEncPictureParameterBufferVP9 *)data;
3773 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3776 va_TraceMsg(trace_ctx, "\t--VAEncPictureParameterBufferVP9\n");
3777 va_TraceMsg(trace_ctx, "\tframe_width_src = %d\n", p->frame_width_src);
3778 va_TraceMsg(trace_ctx, "\tframe_height_src = %d\n", p->frame_height_src);
3779 va_TraceMsg(trace_ctx, "\tframe_width_dst = %d\n", p->frame_width_dst);
3780 va_TraceMsg(trace_ctx, "\tframe_height_dst = %d\n", p->frame_height_dst);
3781 va_TraceMsg(trace_ctx, "\treconstructed_frame = 0x%08x\n", p->reconstructed_frame);
3784 va_TraceMsg(trace_ctx, "\treference_frames[%d] = 0x%08x\n", i, p->reference_frames[i]);
3786 va_TraceMsg(trace_ctx, "\tcoded_buf = 0x%x\n", p->coded_buf);
3788 va_TraceMsg(trace_ctx, "\tref_flags.bits.force_kf = %d\n", p->ref_flags.bits.force_kf);
3789 va_TraceMsg(trace_ctx, "\tref_flags.bits.ref_frame_ctrl_l0 = %d\n", p->ref_flags.bits.ref_frame_ctrl_l0);
3790 va_TraceMsg(trace_ctx, "\tref_flags.bits.ref_frame_ctrl_l1 = %d\n", p->ref_flags.bits.ref_frame_ctrl_l1);
3791 va_TraceMsg(trace_ctx, "\tref_flags.bits.ref_last_idx = %d\n", p->ref_flags.bits.ref_last_idx);
3792 va_TraceMsg(trace_ctx, "\tref_flags.bits.ref_last_sign_bias = %d\n", p->ref_flags.bits.ref_last_sign_bias);
3793 va_TraceMsg(trace_ctx, "\tref_flags.bits.ref_gf_idx = %d\n", p->ref_flags.bits.ref_gf_idx);
3794 va_TraceMsg(trace_ctx, "\tref_flags.bits.ref_gf_sign_bias = %d\n", p->ref_flags.bits.ref_gf_sign_bias);
3795 va_TraceMsg(trace_ctx, "\tref_flags.bits.ref_arf_idx = %d\n", p->ref_flags.bits.ref_arf_idx);
3796 va_TraceMsg(trace_ctx, "\tref_flags.bits.ref_arf_sign_bias = %d\n", p->ref_flags.bits.ref_arf_sign_bias);
3797 va_TraceMsg(trace_ctx, "\tref_flags.bits.temporal_id = %d\n", p->ref_flags.bits.temporal_id);
3798 va_TraceMsg(trace_ctx, "\tref_flags.bits.reserved = %d\n", p->ref_flags.bits.reserved);
3800 va_TraceMsg(trace_ctx, "\tpic_flags.bits.frame_type = %d\n", p->pic_flags.bits.frame_type);
3801 va_TraceMsg(trace_ctx, "\tpic_flags.bits.show_frame = %d\n", p->pic_flags.bits.show_frame);
3802 va_TraceMsg(trace_ctx, "\tpic_flags.bits.error_resilient_mode = %d\n", p->pic_flags.bits.error_resilient_mode);
3803 va_TraceMsg(trace_ctx, "\tpic_flags.bits.intra_only = %d\n", p->pic_flags.bits.intra_only);
3804 va_TraceMsg(trace_ctx, "\tpic_flags.bits.allow_high_precision_mv = %d\n", p->pic_flags.bits.allow_high_precision_mv);
3806 va_TraceMsg(trace_ctx, "\tpic_flags.bits.mcomp_filter_type = %d\n", p->pic_flags.bits.mcomp_filter_type);
3807 va_TraceMsg(trace_ctx, "\tpic_flags.bits.frame_parallel_decoding_mode = %d\n", p->pic_flags.bits.frame_parallel_decoding_mode);
3808 va_TraceMsg(trace_ctx, "\tpic_flags.bits.reset_frame_context = %d\n", p->pic_flags.bits.reset_frame_context);
3809 va_TraceMsg(trace_ctx, "\tpic_flags.bits.refresh_frame_context = %d\n", p->pic_flags.bits.refresh_frame_context);
3810 va_TraceMsg(trace_ctx, "\tpic_flags.bits.frame_context_idx = %d\n", p->pic_flags.bits.frame_context_idx);
3811 va_TraceMsg(trace_ctx, "\tpic_flags.bits.segmentation_enabled = %d\n", p->pic_flags.bits.segmentation_enabled);
3812 va_TraceMsg(trace_ctx, "\tpic_flags.bits.segmentation_temporal_update = %d\n", p->pic_flags.bits.segmentation_temporal_update);
3813 va_TraceMsg(trace_ctx, "\tpic_flags.bits.segmentation_update_map = %d\n", p->pic_flags.bits.segmentation_update_map);
3814 va_TraceMsg(trace_ctx, "\tpic_flags.bits.lossless_mode = %d\n", p->pic_flags.bits.lossless_mode);
3815 va_TraceMsg(trace_ctx, "\tpic_flags.bits.comp_prediction_mode = %d\n", p->pic_flags.bits.comp_prediction_mode);
3816 va_TraceMsg(trace_ctx, "\tpic_flags.bits.auto_segmentation = %d\n", p->pic_flags.bits.auto_segmentation);
3817 va_TraceMsg(trace_ctx, "\tpic_flags.bits.super_frame_flag = %d\n", p->pic_flags.bits.super_frame_flag);
3818 va_TraceMsg(trace_ctx, "\tpic_flags.bits.reserved = %d\n", p->pic_flags.bits.reserved);
3820 va_TraceMsg(trace_ctx, "\trefresh_frame_flags = %d\n", p->refresh_frame_flags);
3821 va_TraceMsg(trace_ctx, "\tluma_ac_qindex = %d\n", p->luma_ac_qindex);
3822 va_TraceMsg(trace_ctx, "\tluma_dc_qindex_delta = %d\n", p->luma_dc_qindex_delta);
3823 va_TraceMsg(trace_ctx, "\tchroma_ac_qindex_delta = %d\n", p->chroma_ac_qindex_delta);
3824 va_TraceMsg(trace_ctx, "\tchroma_dc_qindex_delta = %d\n", p->chroma_dc_qindex_delta);
3825 va_TraceMsg(trace_ctx, "\tfilter_level = %d\n", p->filter_level);
3826 va_TraceMsg(trace_ctx, "\tsharpness_level = %d\n", p->sharpness_level);
3829 va_TraceMsg(trace_ctx, "\tref_lf_delta[%d] = %d\n", i, p->ref_lf_delta[i]);
3831 va_TraceMsg(trace_ctx, "\tmode_lf_delta[%d] = %d\n", i, p->mode_lf_delta[i]);
3834 va_TraceMsg(trace_ctx, "\tbit_offset_ref_lf_delta = %d\n", p->bit_offset_ref_lf_delta);
3835 va_TraceMsg(trace_ctx, "\tbit_offset_mode_lf_delta = %d\n", p->bit_offset_mode_lf_delta);
3836 va_TraceMsg(trace_ctx, "\tbit_offset_lf_level = %d\n", p->bit_offset_lf_level);
3837 va_TraceMsg(trace_ctx, "\tbit_offset_qindex = %d\n", p->bit_offset_qindex);
3838 va_TraceMsg(trace_ctx, "\tbit_offset_first_partition_size = %d\n", p->bit_offset_first_partition_size);
3839 va_TraceMsg(trace_ctx, "\tbit_offset_segmentation = %d\n", p->bit_offset_segmentation);
3840 va_TraceMsg(trace_ctx, "\tbit_size_segmentation = %d\n", p->bit_size_segmentation);
3841 va_TraceMsg(trace_ctx, "\tlog2_tile_rows = %d\n", p->log2_tile_rows);
3842 va_TraceMsg(trace_ctx, "\tlog2_tile_columns = %d\n", p->log2_tile_columns);
3843 va_TraceMsg(trace_ctx, "\tskip_frame_flag = %d\n", p->skip_frame_flag);
3844 va_TraceMsg(trace_ctx, "\tnumber_skip_frames = %d\n", p->number_skip_frames);
3845 va_TraceMsg(trace_ctx, "\tskip_frames_size = %d\n", p->skip_frames_size);
3847 va_TraceMsg(trace_ctx, NULL);
3852 static void va_TraceVASliceParameterBufferVP9(
3854 VAContextID context,
3858 unsigned int num_elements,
3862 VASliceParameterBufferVP9 *p = (VASliceParameterBufferVP9 *)data;
3863 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3866 va_TraceMsg(trace_ctx, "\t--VASliceParameterBufferVP9\n");
3868 va_TraceMsg(trace_ctx, "\tslice_data_size = %d\n", p->slice_data_size);
3869 va_TraceMsg(trace_ctx, "\tslice_data_offset = %d\n", p->slice_data_offset);
3870 va_TraceMsg(trace_ctx, "\tslice_data_flag = %d\n", p->slice_data_flag);
3872 for (i = 0; i < 8; i++) {
3873 VASegmentParameterVP9* seg = p->seg_param + i;
3874 va_TraceMsg(trace_ctx, "\tseg_param[%d] = \n", i);
3875 va_TraceMsg(trace_ctx, "\t\tsegment_reference_enabled = %d\n", seg->segment_flags.fields.segment_reference_enabled);
3876 va_TraceMsg(trace_ctx, "\t\tsegment_reference = %d\n", seg->segment_flags.fields.segment_reference);
3877 va_TraceMsg(trace_ctx, "\t\tsegment_reference_skipped = %d\n", seg->segment_flags.fields.segment_reference_skipped);
3878 va_TraceMsg(trace_ctx, "\t\tfilter_level[4][2] = \n");
3879 for (j = 0; j < 4; j++) {
3880 va_TraceMsg(trace_ctx, "\t\t\t[%3d, %3d]\n", seg->filter_level[j][0], seg->filter_level[j][1]);
3882 va_TraceMsg(trace_ctx, "\t\tluma_ac_quant_scale = %d\n", seg->luma_ac_quant_scale);
3883 va_TraceMsg(trace_ctx, "\t\tluma_dc_quant_scale = %d\n", seg->luma_dc_quant_scale);
3884 va_TraceMsg(trace_ctx, "\t\tchroma_ac_quant_scale = %d\n", seg->chroma_ac_quant_scale);
3885 va_TraceMsg(trace_ctx, "\t\tchroma_dc_quant_scale = %d\n", seg->chroma_dc_quant_scale);
3888 va_TraceMsg(trace_ctx, NULL);
3893 void va_TraceBeginPicture(
3895 VAContextID context,
3896 VASurfaceID render_target
3899 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3901 TRACE_FUNCNAME(idx);
3903 va_TraceMsg(trace_ctx, "\tcontext = 0x%08x\n", context);
3904 va_TraceMsg(trace_ctx, "\trender_targets = 0x%08x\n", render_target);
3905 va_TraceMsg(trace_ctx, "\tframe_count = #%d\n", trace_ctx->trace_frame_no);
3906 va_TraceMsg(trace_ctx, NULL);
3908 trace_ctx->trace_rendertarget = render_target; /* for surface data dump after vaEndPicture */
3910 trace_ctx->trace_frame_no++;
3911 trace_ctx->trace_slice_no = 0;
3914 static void va_TraceMPEG2Buf(
3916 VAContextID context,
3920 unsigned int num_elements,
3925 case VAPictureParameterBufferType:
3926 va_TraceVAPictureParameterBufferMPEG2(dpy, context, buffer, type, size, num_elements, pbuf);
3928 case VAIQMatrixBufferType:
3929 va_TraceVAIQMatrixBufferMPEG2(dpy, context, buffer, type, size, num_elements, pbuf);
3931 case VABitPlaneBufferType:
3932 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
3934 case VASliceGroupMapBufferType:
3935 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
3937 case VASliceParameterBufferType:
3938 va_TraceVASliceParameterBufferMPEG2(dpy, context, buffer, type, size, num_elements, pbuf);
3940 case VASliceDataBufferType:
3941 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
3943 case VAMacroblockParameterBufferType:
3944 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
3946 case VAResidualDataBufferType:
3947 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
3949 case VADeblockingParameterBufferType:
3950 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
3952 case VAImageBufferType:
3954 case VAProtectedSliceDataBufferType:
3955 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
3957 case VAEncCodedBufferType:
3959 case VAEncSequenceParameterBufferType:
3961 case VAEncPictureParameterBufferType:
3963 case VAEncSliceParameterBufferType:
3970 static void va_TraceVAEncSequenceParameterBufferH263(
3972 VAContextID context,
3976 unsigned int num_elements,
3979 VAEncSequenceParameterBufferH263 *p = (VAEncSequenceParameterBufferH263 *)data;
3980 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3982 va_TraceMsg(trace_ctx, "\t--VAEncSequenceParameterBufferH263\n");
3984 va_TraceMsg(trace_ctx, "\tintra_period = %d\n", p->intra_period);
3985 va_TraceMsg(trace_ctx, "\tbits_per_second = %d\n", p->bits_per_second);
3986 va_TraceMsg(trace_ctx, "\tframe_rate = %d\n", p->frame_rate);
3987 va_TraceMsg(trace_ctx, "\tinitial_qp = %d\n", p->initial_qp);
3988 va_TraceMsg(trace_ctx, "\tmin_qp = %d\n", p->min_qp);
3989 va_TraceMsg(trace_ctx, NULL);
3995 static void va_TraceVAEncPictureParameterBufferH263(
3997 VAContextID context,
4001 unsigned int num_elements,
4004 VAEncPictureParameterBufferH263 *p = (VAEncPictureParameterBufferH263 *)data;
4005 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4007 va_TraceMsg(trace_ctx, "\t--VAEncPictureParameterBufferH263\n");
4008 va_TraceMsg(trace_ctx, "\treference_picture = 0x%08x\n", p->reference_picture);
4009 va_TraceMsg(trace_ctx, "\treconstructed_picture = 0x%08x\n", p->reconstructed_picture);
4010 va_TraceMsg(trace_ctx, "\tcoded_buf = %08x\n", p->coded_buf);
4011 va_TraceMsg(trace_ctx, "\tpicture_width = %d\n", p->picture_width);
4012 va_TraceMsg(trace_ctx, "\tpicture_height = %d\n", p->picture_height);
4013 va_TraceMsg(trace_ctx, "\tpicture_type = 0x%08x\n", p->picture_type);
4014 va_TraceMsg(trace_ctx, NULL);
4019 static void va_TraceVAEncPictureParameterBufferJPEG(
4021 VAContextID context,
4025 unsigned int num_elements,
4028 VAEncPictureParameterBufferJPEG *p = (VAEncPictureParameterBufferJPEG *)data;
4031 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4033 va_TraceMsg(trace_ctx, "\t--VAEncPictureParameterBufferJPEG\n");
4034 va_TraceMsg(trace_ctx, "\treconstructed_picture = 0x%08x\n", p->reconstructed_picture);
4035 va_TraceMsg(trace_ctx, "\tcoded_buf = %08x\n", p->coded_buf);
4036 va_TraceMsg(trace_ctx, "\tpicture_width = %d\n", p->picture_width);
4037 va_TraceMsg(trace_ctx, "\tpicture_height = %d\n", p->picture_height);
4038 va_TraceMsg(trace_ctx, "\tpic_flags.bits.profile = %d\n", p->pic_flags.bits.profile);
4039 va_TraceMsg(trace_ctx, "\tpic_flags.bits.progressive = %d\n", p->pic_flags.bits.profile);
4040 va_TraceMsg(trace_ctx, "\tpic_flags.bits.huffman = %d\n", p->pic_flags.bits.huffman);
4041 va_TraceMsg(trace_ctx, "\tpic_flags.bits.interleaved = %d\n", p->pic_flags.bits.interleaved);
4042 va_TraceMsg(trace_ctx, "\tpic_flags.bits.differential = %d\n", p->pic_flags.bits.differential);
4043 va_TraceMsg(trace_ctx, "\tsample_bit_depth = %d\n", p->sample_bit_depth);
4044 va_TraceMsg(trace_ctx, "\tnum_scan = %d\n", p->num_scan);
4045 va_TraceMsg(trace_ctx, "\tnum_components = %d\n", p->num_components);
4046 for (i=0; i<p->num_components; i++)
4047 va_TraceMsg(trace_ctx, "\tcomponent_id[%d] = %d\n", i, p->component_id[i]);
4050 va_TraceMsg(trace_ctx, "\tquality = %d\n", p->quality);
4052 va_TraceMsg(trace_ctx, "\tquantiser_table_selector[] = %d %d %d %d\n",
4053 p->quantiser_table_selector[0],
4054 p->quantiser_table_selector[1],
4055 p->quantiser_table_selector[2],
4056 p->quantiser_table_selector[3]);
4058 va_TraceMsg(trace_ctx, NULL);
4063 static void va_TraceVAEncQMatrixBufferJPEG(
4065 VAContextID context,
4069 unsigned int num_elements,
4072 VAQMatrixBufferJPEG *p = (VAQMatrixBufferJPEG *)data;
4073 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4075 va_TraceMsg(trace_ctx, "\t--VAQMatrixBufferJPEG\n");
4076 va_TraceMsg(trace_ctx, "\tload_lum_quantiser_matrix = %d", p->load_lum_quantiser_matrix);
4077 if (p->load_lum_quantiser_matrix) {
4079 for (i = 0; i < 64; i++) {
4081 va_TraceMsg(trace_ctx, "\n\t");
4082 va_TraceMsg(trace_ctx, "\t0x%02x", p->lum_quantiser_matrix[i]);
4084 va_TraceMsg(trace_ctx, "\n");
4086 va_TraceMsg(trace_ctx, "\tload_chroma_quantiser_matrix = %08x\n", p->load_chroma_quantiser_matrix);
4087 if (p->load_chroma_quantiser_matrix) {
4089 for (i = 0; i < 64; i++) {
4091 va_TraceMsg(trace_ctx, "\n\t");
4092 va_TraceMsg(trace_ctx, "\t0x%02x", p->chroma_quantiser_matrix[i]);
4094 va_TraceMsg(trace_ctx, "\n");
4097 va_TraceMsg(trace_ctx, NULL);
4103 static void va_TraceVAEncSliceParameterBufferJPEG(
4105 VAContextID context,
4109 unsigned int num_elements,
4112 VAEncSliceParameterBufferJPEG *p = (VAEncSliceParameterBufferJPEG *)data;
4115 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4117 va_TraceMsg(trace_ctx, "\t--VAEncSliceParameterBufferJPEG\n");
4118 va_TraceMsg(trace_ctx, "\trestart_interval = 0x%04x\n", p->restart_interval);
4119 va_TraceMsg(trace_ctx, "\tnum_components = 0x%08x\n", p->num_components);
4120 for (i=0; i<4; i++) {
4121 va_TraceMsg(trace_ctx, "\tcomponents[%i] =\n ");
4122 va_TraceMsg(trace_ctx, "\t\tcomponent_selector = %d\n", p->components[i].component_selector);
4123 va_TraceMsg(trace_ctx, "\t\tdc_table_selector = %d\n", p->components[i].dc_table_selector);
4124 va_TraceMsg(trace_ctx, "\t\tac_table_selector = %d\n", p->components[i].ac_table_selector);
4127 va_TraceMsg(trace_ctx, NULL);
4133 static void va_TraceH263Buf(
4135 VAContextID context,
4139 unsigned int num_elements,
4144 case VAPictureParameterBufferType:/* print MPEG4 buffer */
4145 va_TraceVAPictureParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf);
4147 case VAIQMatrixBufferType:/* print MPEG4 buffer */
4148 va_TraceVAIQMatrixBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf);
4150 case VABitPlaneBufferType:/* print MPEG4 buffer */
4151 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4153 case VASliceGroupMapBufferType:
4155 case VASliceParameterBufferType:/* print MPEG4 buffer */
4156 va_TraceVASliceParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf);
4158 case VASliceDataBufferType:
4159 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4161 case VAMacroblockParameterBufferType:
4162 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4164 case VAResidualDataBufferType:
4165 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4167 case VADeblockingParameterBufferType:
4168 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4170 case VAImageBufferType:
4172 case VAProtectedSliceDataBufferType:
4173 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4175 case VAEncCodedBufferType:
4177 case VAEncSequenceParameterBufferType:
4178 va_TraceVAEncSequenceParameterBufferH263(dpy, context, buffer, type, size, num_elements, pbuf);
4180 case VAEncPictureParameterBufferType:
4181 va_TraceVAEncPictureParameterBufferH263(dpy, context, buffer, type, size, num_elements, pbuf);
4183 case VAEncSliceParameterBufferType:
4184 va_TraceVAEncSliceParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
4186 case VAEncPackedHeaderParameterBufferType:
4187 va_TraceVAEncPackedHeaderParameterBufferType(dpy, context, buffer, type, size, num_elements, pbuf);
4190 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4196 static void va_TraceJPEGBuf(
4198 VAContextID context,
4202 unsigned int num_elements,
4207 case VABitPlaneBufferType:
4208 case VASliceGroupMapBufferType:
4209 case VASliceDataBufferType:
4210 case VAMacroblockParameterBufferType:
4211 case VAResidualDataBufferType:
4212 case VADeblockingParameterBufferType:
4213 case VAImageBufferType:
4214 case VAProtectedSliceDataBufferType:
4215 case VAEncCodedBufferType:
4216 case VAEncSequenceParameterBufferType:
4217 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4219 case VAEncSliceParameterBufferType:
4220 va_TraceVAEncSliceParameterBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf);
4222 case VAPictureParameterBufferType:
4223 va_TraceVAPictureParameterBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf);
4225 case VAIQMatrixBufferType:
4226 va_TraceVAIQMatrixBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf);
4228 case VASliceParameterBufferType:
4229 va_TraceVASliceParameterBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf);
4231 case VAHuffmanTableBufferType:
4232 va_TraceVAHuffmanTableBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf);
4234 case VAEncPictureParameterBufferType:
4235 va_TraceVAEncPictureParameterBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf);
4237 case VAQMatrixBufferType:
4238 va_TraceVAEncQMatrixBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf);
4241 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4246 static void va_TraceMPEG4Buf(
4248 VAContextID context,
4252 unsigned int num_elements,
4257 case VAPictureParameterBufferType:
4258 va_TraceVAPictureParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf);
4260 case VAIQMatrixBufferType:
4261 va_TraceVAIQMatrixBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf);
4263 case VABitPlaneBufferType:
4264 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4266 case VASliceGroupMapBufferType:
4268 case VASliceParameterBufferType:
4269 va_TraceVASliceParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf);
4271 case VASliceDataBufferType:
4272 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4274 case VAMacroblockParameterBufferType:
4275 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4277 case VAResidualDataBufferType:
4278 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4280 case VADeblockingParameterBufferType:
4281 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4283 case VAImageBufferType:
4285 case VAProtectedSliceDataBufferType:
4286 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4288 case VAEncCodedBufferType:
4290 case VAEncSequenceParameterBufferType:
4291 va_TraceVAEncSequenceParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf);
4293 case VAEncPictureParameterBufferType:
4294 va_TraceVAEncPictureParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf);
4296 case VAEncSliceParameterBufferType:
4297 va_TraceVAEncSliceParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
4300 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4305 static void va_TraceHEVCBuf(
4307 VAContextID context,
4311 unsigned int num_elements,
4315 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4318 case VAPictureParameterBufferType:
4319 va_TraceVAPictureParameterBufferHEVC(dpy, context, buffer, type, size, num_elements, pbuf);
4321 case VASliceParameterBufferType:
4322 va_TraceVASliceParameterBufferHEVC(dpy, context, buffer, type, size, num_elements, pbuf);
4324 case VAIQMatrixBufferType:
4325 va_TraceVAIQMatrixBufferHEVC(dpy, context, buffer, type, size, num_elements, pbuf);
4327 case VAEncSequenceParameterBufferType:
4328 va_TraceVAEncSequenceParameterBufferHEVC(dpy, context, buffer, type, size, num_elements, pbuf);
4330 case VAEncPictureParameterBufferType:
4331 va_TraceVAEncPictureParameterBufferHEVC(dpy, context, buffer, type, size, num_elements, pbuf);
4333 case VAEncSliceParameterBufferType:
4334 va_TraceVAEncSliceParameterBufferHEVC(dpy, context, buffer, type, size, num_elements, pbuf);
4336 case VAEncMiscParameterBufferType:
4337 va_TraceVAEncMiscParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
4340 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4345 static void va_TraceH264Buf(
4347 VAContextID context,
4351 unsigned int num_elements,
4355 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4358 case VAPictureParameterBufferType:
4359 va_TraceVAPictureParameterBufferH264(dpy, context, buffer, type, size, num_elements, pbuf);
4361 case VAIQMatrixBufferType:
4362 va_TraceVAIQMatrixBufferH264(dpy, context, buffer, type, size, num_elements, pbuf);
4364 case VABitPlaneBufferType:
4365 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4367 case VASliceGroupMapBufferType:
4368 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4370 case VASliceParameterBufferType:
4371 va_TraceVASliceParameterBufferH264(dpy, context, buffer, type, size, num_elements, pbuf);
4373 case VASliceDataBufferType:
4374 va_TraceVABuffers(dpy, context, buffer, type, trace_ctx->trace_slice_size, num_elements, pbuf);
4376 case VAMacroblockParameterBufferType:
4377 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4379 case VAResidualDataBufferType:
4380 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4382 case VADeblockingParameterBufferType:
4383 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4385 case VAImageBufferType:
4387 case VAProtectedSliceDataBufferType:
4388 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4390 case VAEncCodedBufferType:
4392 case VAEncSequenceParameterBufferType:
4393 va_TraceVAEncSequenceParameterBufferH264(dpy, context, buffer, type, size, num_elements, pbuf);
4395 case VAEncPictureParameterBufferType:
4396 va_TraceVAEncPictureParameterBufferH264(dpy, context, buffer, type, size, num_elements, pbuf);
4398 case VAEncSliceParameterBufferType:
4399 if (size == sizeof(VAEncSliceParameterBuffer))
4400 va_TraceVAEncSliceParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
4402 va_TraceVAEncSliceParameterBufferH264(dpy, context, buffer, type, size, num_elements, pbuf);
4404 case VAEncPackedHeaderParameterBufferType:
4405 va_TraceVAEncPackedHeaderParameterBufferType(dpy, context, buffer, type, size, num_elements, pbuf);
4408 case VAEncMiscParameterBufferType:
4409 va_TraceVAEncMiscParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
4412 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4417 static void va_TraceVP8Buf(
4419 VAContextID context,
4423 unsigned int num_elements,
4427 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4430 case VAPictureParameterBufferType:
4431 va_TraceVAPictureParameterBufferVP8(dpy, context, buffer, type, size, num_elements, pbuf);
4433 case VAIQMatrixBufferType:
4434 va_TraceVAIQMatrixBufferVP8(dpy, context, buffer, type, size, num_elements, pbuf);
4436 case VAQMatrixBufferType:
4438 case VABitPlaneBufferType:
4440 case VASliceGroupMapBufferType:
4442 case VASliceParameterBufferType:
4443 va_TraceVASliceParameterBufferVP8(dpy, context, buffer, type, size, num_elements, pbuf);
4445 case VASliceDataBufferType:
4447 case VAProbabilityBufferType:
4448 va_TraceVAProbabilityBufferVP8(dpy, context, buffer, type, size, num_elements, pbuf);
4450 case VAMacroblockParameterBufferType:
4452 case VAResidualDataBufferType:
4454 case VADeblockingParameterBufferType:
4456 case VAImageBufferType:
4458 case VAProtectedSliceDataBufferType:
4460 case VAEncCodedBufferType:
4462 case VAEncSequenceParameterBufferType:
4463 va_TraceVAEncSequenceParameterBufferVP8(dpy, context, buffer, type, size, num_elements, pbuf);
4465 case VAEncPictureParameterBufferType:
4466 va_TraceVAEncPictureParameterBufferVP8(dpy, context, buffer, type, size, num_elements, pbuf);
4468 case VAEncSliceParameterBufferType:
4470 case VAEncPackedHeaderParameterBufferType:
4472 case VAEncMiscParameterBufferType:
4473 va_TraceVAEncMiscParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
4476 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4481 static void va_TraceVP9Buf(
4483 VAContextID context,
4487 unsigned int num_elements,
4491 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4494 case VAPictureParameterBufferType:
4495 va_TraceVAPictureParameterBufferVP9(dpy, context, buffer, type, size, num_elements, pbuf);
4497 case VAEncSequenceParameterBufferType:
4498 va_TraceVAEncSequenceParameterBufferVP9(dpy, context, buffer, type, size, num_elements, pbuf);
4500 case VAEncPictureParameterBufferType:
4501 va_TraceVAEncPictureParameterBufferVP9(dpy, context, buffer, type, size, num_elements, pbuf);
4503 case VASliceParameterBufferType:
4504 va_TraceVASliceParameterBufferVP9(dpy, context, buffer, type, size, num_elements, pbuf);
4506 case VAEncMiscParameterBufferType:
4507 va_TraceVAEncMiscParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
4510 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4515 static void va_TraceVC1Buf(
4517 VAContextID context,
4521 unsigned int num_elements,
4525 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4528 case VAPictureParameterBufferType:
4529 va_TraceVAPictureParameterBufferVC1(dpy, context, buffer, type, size, num_elements, pbuf);
4531 case VAIQMatrixBufferType:
4533 case VABitPlaneBufferType:
4534 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4536 case VASliceGroupMapBufferType:
4537 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4539 case VASliceParameterBufferType:
4540 va_TraceVASliceParameterBufferVC1(dpy, context, buffer, type, size, num_elements, pbuf);
4542 case VASliceDataBufferType:
4543 va_TraceVABuffers(dpy, context, buffer, type, trace_ctx->trace_slice_size, num_elements, pbuf);
4545 case VAMacroblockParameterBufferType:
4546 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4548 case VAResidualDataBufferType:
4549 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4551 case VADeblockingParameterBufferType:
4552 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4554 case VAImageBufferType:
4556 case VAProtectedSliceDataBufferType:
4557 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4559 case VAEncCodedBufferType:
4561 case VAEncSequenceParameterBufferType:
4562 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4564 case VAEncPictureParameterBufferType:
4565 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4567 case VAEncSliceParameterBufferType:
4568 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4571 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4577 va_TraceProcFilterParameterBufferDeinterlacing(
4579 VAContextID context,
4580 VAProcFilterParameterBufferBase *base
4583 VAProcFilterParameterBufferDeinterlacing *deint = (VAProcFilterParameterBufferDeinterlacing *)base;
4585 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4587 va_TraceMsg(trace_ctx, "\t type = %d\n", deint->type);
4588 va_TraceMsg(trace_ctx, "\t algorithm = %d\n", deint->algorithm);
4589 va_TraceMsg(trace_ctx, "\t flags = %d\n", deint->flags);
4593 va_TraceProcFilterParameterBufferColorBalance(
4595 VAContextID context,
4596 VAProcFilterParameterBufferBase *base
4599 VAProcFilterParameterBufferColorBalance *color_balance = (VAProcFilterParameterBufferColorBalance *)base;
4601 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4603 va_TraceMsg(trace_ctx, "\t type = %d\n", color_balance->type);
4604 va_TraceMsg(trace_ctx, "\t attrib = %d\n", color_balance->attrib);
4605 va_TraceMsg(trace_ctx, "\t value = %f\n", color_balance->value);
4609 va_TraceProcFilterParameterBufferBase(
4611 VAContextID context,
4612 VAProcFilterParameterBufferBase *base
4615 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4617 va_TraceMsg(trace_ctx, "\t type = %d\n", base->type);
4621 va_TraceProcFilterParameterBuffer(
4623 VAContextID context,
4624 VABufferID *filters,
4625 unsigned int num_filters
4630 unsigned int num_elements;
4631 VAProcFilterParameterBufferBase *base_filter = NULL;
4634 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4636 if (num_filters == 0 || filters == NULL) {
4637 va_TraceMsg(trace_ctx, "\t num_filters = %d\n", num_filters);
4638 va_TraceMsg(trace_ctx, "\t filters = %p\n", filters);
4642 va_TraceMsg(trace_ctx, "\t num_filters = %d\n", num_filters);
4644 /* get buffer type information */
4645 for (i = 0; i < num_filters; i++) {
4646 vaBufferInfo(dpy, context, filters[i], &type, &size, &num_elements);
4648 if (type != VAProcFilterParameterBufferType) {
4649 va_TraceMsg(trace_ctx, "\t filters[%d] = 0x%08x (INVALID)\n", i, filters[i]);
4652 va_TraceMsg(trace_ctx, "\t filters[%d] = 0x%08x\n", i, filters[i]);
4656 vaMapBuffer(dpy, filters[i], (void **)&base_filter);
4658 if (base_filter == NULL) {
4659 vaUnmapBuffer(dpy, filters[i]);
4663 switch (base_filter->type) {
4664 case VAProcFilterDeinterlacing:
4665 va_TraceProcFilterParameterBufferDeinterlacing(dpy,
4669 case VAProcFilterColorBalance:
4670 va_TraceProcFilterParameterBufferColorBalance(dpy,
4675 va_TraceProcFilterParameterBufferBase(dpy,
4681 vaUnmapBuffer(dpy, filters[i]);
4686 va_TraceVAProcPipelineParameterBuffer(
4688 VAContextID context,
4692 unsigned int num_elements,
4696 VAProcPipelineParameterBuffer *p = (VAProcPipelineParameterBuffer *)data;
4699 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4701 va_TraceMsg(trace_ctx, "\t--VAProcPipelineParameterBuffer\n");
4703 va_TraceMsg(trace_ctx, "\t surface = 0x%08x\n", p->surface);
4705 if (p->surface_region) {
4706 va_TraceMsg(trace_ctx, "\t surface_region\n");
4707 va_TraceMsg(trace_ctx, "\t x = %d\n", p->surface_region->x);
4708 va_TraceMsg(trace_ctx, "\t y = %d\n", p->surface_region->y);
4709 va_TraceMsg(trace_ctx, "\t width = %d\n", p->surface_region->width);
4710 va_TraceMsg(trace_ctx, "\t height = %d\n", p->surface_region->height);
4712 va_TraceMsg(trace_ctx, "\t surface_region = (NULL)\n");
4715 va_TraceMsg(trace_ctx, "\t surface_color_standard = %d\n", p->surface_color_standard);
4717 if (p->output_region) {
4718 va_TraceMsg(trace_ctx, "\t output_region\n");
4719 va_TraceMsg(trace_ctx, "\t x = %d\n", p->output_region->x);
4720 va_TraceMsg(trace_ctx, "\t y = %d\n", p->output_region->y);
4721 va_TraceMsg(trace_ctx, "\t width = %d\n", p->output_region->width);
4722 va_TraceMsg(trace_ctx, "\t height = %d\n", p->output_region->height);
4724 va_TraceMsg(trace_ctx, "\t output_region = (NULL)\n");
4727 va_TraceMsg(trace_ctx, "\t output_background_color = 0x%08x\n", p->output_background_color);
4728 va_TraceMsg(trace_ctx, "\t output_color_standard = %d\n", p->output_color_standard);
4729 va_TraceMsg(trace_ctx, "\t pipeline_flags = 0x%08x\n", p->pipeline_flags);
4730 va_TraceMsg(trace_ctx, "\t filter_flags = 0x%08x\n", p->filter_flags);
4732 va_TraceProcFilterParameterBuffer(dpy, context, p->filters, p->num_filters);
4734 va_TraceMsg(trace_ctx, "\t num_forward_references = 0x%08x\n", p->num_forward_references);
4736 if (p->num_forward_references) {
4737 va_TraceMsg(trace_ctx, "\t forward_references\n");
4739 if (p->forward_references) {
4740 /* only dump the first 5 forward references */
4741 for (i = 0; i < p->num_forward_references && i < 5; i++) {
4742 va_TraceMsg(trace_ctx, "\t forward_references[%d] = 0x%08x\n", i, p->forward_references[i]);
4745 for (i = 0; i < p->num_forward_references && i < 5; i++) {
4746 va_TraceMsg(trace_ctx, "\t forward_references[%d] = (NULL)\n", i);
4751 va_TraceMsg(trace_ctx, "\t num_backward_references = 0x%08x\n", p->num_backward_references);
4753 if (p->num_backward_references) {
4754 va_TraceMsg(trace_ctx, "\t backward_references\n");
4756 if (p->backward_references) {
4757 /* only dump the first 5 backward references */
4758 for (i = 0; i < p->num_backward_references && i < 5; i++) {
4759 va_TraceMsg(trace_ctx, "\t backward_references[%d] = 0x%08x\n", i, p->backward_references[i]);
4762 for (i = 0; i < p->num_backward_references && i < 5; i++) {
4763 va_TraceMsg(trace_ctx, "\t backward_references[%d] = (NULL)\n", i);
4768 /* FIXME: add other info later */
4770 va_TraceMsg(trace_ctx, NULL);
4776 VAContextID context,
4780 unsigned int num_elements,
4784 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4787 case VAProcPipelineParameterBufferType:
4788 va_TraceVAProcPipelineParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
4791 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4796 void va_TraceRenderPicture(
4798 VAContextID context,
4799 VABufferID *buffers,
4805 unsigned int num_elements;
4807 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4809 TRACE_FUNCNAME(idx);
4811 va_TraceMsg(trace_ctx, "\tcontext = 0x%08x\n", context);
4812 va_TraceMsg(trace_ctx, "\tnum_buffers = %d\n", num_buffers);
4813 if (buffers == NULL)
4816 for (i = 0; i < num_buffers; i++) {
4817 unsigned char *pbuf = NULL;
4820 /* get buffer type information */
4821 vaBufferInfo(dpy, context, buffers[i], &type, &size, &num_elements);
4823 va_TraceMsg(trace_ctx, "\t---------------------------\n");
4824 va_TraceMsg(trace_ctx, "\tbuffers[%d] = 0x%08x\n", i, buffers[i]);
4825 va_TraceMsg(trace_ctx, "\t type = %s\n", vaBufferTypeStr(type));
4826 va_TraceMsg(trace_ctx, "\t size = %d\n", size);
4827 va_TraceMsg(trace_ctx, "\t num_elements = %d\n", num_elements);
4829 vaMapBuffer(dpy, buffers[i], (void **)&pbuf);
4833 switch (trace_ctx->trace_profile) {
4834 case VAProfileMPEG2Simple:
4835 case VAProfileMPEG2Main:
4836 for (j=0; j<num_elements; j++) {
4837 va_TraceMsg(trace_ctx, "\telement[%d] =\n", j);
4838 va_TraceMPEG2Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4841 case VAProfileMPEG4Simple:
4842 case VAProfileMPEG4AdvancedSimple:
4843 case VAProfileMPEG4Main:
4844 for (j=0; j<num_elements; j++) {
4845 va_TraceMsg(trace_ctx, "\telement[%d] =\n", j);
4846 va_TraceMPEG4Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4849 case VAProfileH264Main:
4850 case VAProfileH264High:
4851 case VAProfileH264ConstrainedBaseline:
4852 for (j=0; j<num_elements; j++) {
4853 va_TraceMsg(trace_ctx, "\telement[%d] =\n", j);
4855 va_TraceH264Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4858 case VAProfileVC1Simple:
4859 case VAProfileVC1Main:
4860 case VAProfileVC1Advanced:
4861 for (j=0; j<num_elements; j++) {
4862 va_TraceMsg(trace_ctx, "\telement[%d] =\n", j);
4864 va_TraceVC1Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4867 case VAProfileH263Baseline:
4868 for (j=0; j<num_elements; j++) {
4869 va_TraceMsg(trace_ctx, "\telement[%d] =\n", j);
4871 va_TraceH263Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4874 case VAProfileJPEGBaseline:
4875 for (j=0; j<num_elements; j++) {
4876 va_TraceMsg(trace_ctx, "\telement[%d] =\n", j);
4878 va_TraceJPEGBuf (dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4883 for (j=0; j<num_elements; j++) {
4884 va_TraceMsg(trace_ctx, "\telement[%d] =\n", j);
4886 va_TraceNoneBuf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4890 case VAProfileVP8Version0_3:
4891 for (j=0; j<num_elements; j++) {
4892 va_TraceMsg(trace_ctx, "\telement[%d] =\n", j);
4894 va_TraceVP8Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4898 case VAProfileHEVCMain:
4899 case VAProfileHEVCMain10:
4900 for (j=0; j<num_elements; j++) {
4901 va_TraceMsg(trace_ctx, "\telement[%d] = ", j);
4903 va_TraceHEVCBuf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4906 case VAProfileVP9Profile0:
4907 for (j=0; j<num_elements; j++) {
4908 va_TraceMsg(trace_ctx, "\telement[%d] = \n", j);
4910 va_TraceVP9Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4917 vaUnmapBuffer(dpy, buffers[i]);
4920 va_TraceMsg(trace_ctx, NULL);
4923 void va_TraceEndPicture(
4925 VAContextID context,
4929 int encode, decode, jpeg;
4930 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4932 TRACE_FUNCNAME(idx);
4934 va_TraceMsg(trace_ctx, "\tcontext = 0x%08x\n", context);
4935 va_TraceMsg(trace_ctx, "\trender_targets = 0x%08x\n", trace_ctx->trace_rendertarget);
4937 /* avoid to create so many empty files */
4938 encode = (trace_ctx->trace_entrypoint == VAEntrypointEncSlice);
4939 decode = (trace_ctx->trace_entrypoint == VAEntrypointVLD);
4940 jpeg = (trace_ctx->trace_entrypoint == VAEntrypointEncPicture);
4942 /* trace encode source surface, can do it before HW completes rendering */
4943 if ((encode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_ENCODE))||
4944 (jpeg && (va_trace_flag & VA_TRACE_FLAG_SURFACE_JPEG)))
4945 va_TraceSurface(dpy, context);
4947 /* trace decoded surface, do it after HW completes rendering */
4948 if (decode && ((va_trace_flag & VA_TRACE_FLAG_SURFACE_DECODE))) {
4949 vaSyncSurface(dpy, trace_ctx->trace_rendertarget);
4950 va_TraceSurface(dpy, context);
4953 va_TraceMsg(trace_ctx, NULL);
4957 void va_TraceSyncSurface(
4959 VASurfaceID render_target
4962 DPY2TRACE_VIRCTX(dpy);
4964 TRACE_FUNCNAME(idx);
4966 va_TraceMsg(trace_ctx, "\trender_target = 0x%08x\n", render_target);
4967 va_TraceMsg(trace_ctx, NULL);
4969 DPY2TRACE_VIRCTX_EXIT(pva_trace);
4972 void va_TraceQuerySurfaceAttributes(
4975 VASurfaceAttrib *attrib_list,
4976 unsigned int *num_attribs
4979 DPY2TRACE_VIRCTX(dpy);
4981 TRACE_FUNCNAME(idx);
4982 va_TraceMsg(trace_ctx, "\tconfig = 0x%08x\n", config);
4983 va_TraceSurfaceAttributes(trace_ctx, attrib_list, num_attribs);
4985 va_TraceMsg(trace_ctx, NULL);
4987 DPY2TRACE_VIRCTX_EXIT(pva_trace);
4991 void va_TraceQuerySurfaceStatus(
4993 VASurfaceID render_target,
4994 VASurfaceStatus *status /* out */
4997 DPY2TRACE_VIRCTX(dpy);
4999 TRACE_FUNCNAME(idx);
5001 va_TraceMsg(trace_ctx, "\trender_target = 0x%08x\n", render_target);
5003 va_TraceMsg(trace_ctx, "\tstatus = 0x%08x\n", *status);
5004 va_TraceMsg(trace_ctx, NULL);
5006 DPY2TRACE_VIRCTX_EXIT(pva_trace);
5010 void va_TraceQuerySurfaceError(
5012 VASurfaceID surface,
5013 VAStatus error_status,
5014 void **error_info /*out*/
5017 DPY2TRACE_VIRCTX(dpy);
5019 TRACE_FUNCNAME(idx);
5020 va_TraceMsg(trace_ctx, "\tsurface = 0x%08x\n", surface);
5021 va_TraceMsg(trace_ctx, "\terror_status = 0x%08x\n", error_status);
5022 if (error_info && (error_status == VA_STATUS_ERROR_DECODING_ERROR)) {
5023 VASurfaceDecodeMBErrors *p = *error_info;
5024 while (p && (p->status != -1)) {
5025 va_TraceMsg(trace_ctx, "\t\tstatus = %d\n", p->status);
5026 va_TraceMsg(trace_ctx, "\t\tstart_mb = %d\n", p->start_mb);
5027 va_TraceMsg(trace_ctx, "\t\tend_mb = %d\n", p->end_mb);
5028 p++; /* next error record */
5031 va_TraceMsg(trace_ctx, NULL);
5033 DPY2TRACE_VIRCTX_EXIT(pva_trace);
5036 void va_TraceMaxNumDisplayAttributes (
5041 DPY2TRACE_VIRCTX(dpy);
5043 TRACE_FUNCNAME(idx);
5045 va_TraceMsg(trace_ctx, "\tmax_display_attributes = %d\n", number);
5046 va_TraceMsg(trace_ctx, NULL);
5048 DPY2TRACE_VIRCTX_EXIT(pva_trace);
5051 void va_TraceQueryDisplayAttributes (
5053 VADisplayAttribute *attr_list, /* out */
5054 int *num_attributes /* out */
5059 if (attr_list == NULL || num_attributes == NULL)
5062 DPY2TRACE_VIRCTX(dpy);
5064 TRACE_FUNCNAME(idx);
5065 va_TraceMsg(trace_ctx, "\tnum_attributes = %d\n", *num_attributes);
5067 for (i=0; i<*num_attributes; i++) {
5068 va_TraceMsg(trace_ctx, "\tattr_list[%d] =\n", i);
5069 va_TraceMsg(trace_ctx, "\t type = 0x%08x\n", attr_list[i].type);
5070 va_TraceMsg(trace_ctx, "\t min_value = %d\n", attr_list[i].min_value);
5071 va_TraceMsg(trace_ctx, "\t max_value = %d\n", attr_list[i].max_value);
5072 va_TraceMsg(trace_ctx, "\t value = %d\n", attr_list[i].value);
5073 va_TraceMsg(trace_ctx, "\t flags = %d\n", attr_list[i].flags);
5075 va_TraceMsg(trace_ctx, NULL);
5077 DPY2TRACE_VIRCTX_EXIT(pva_trace);
5081 static void va_TraceDisplayAttributes (
5082 struct trace_context *trace_ctx,
5083 VADisplayAttribute *attr_list,
5089 if (attr_list == NULL)
5092 va_TraceMsg(trace_ctx, "\tnum_attributes = %d\n", num_attributes);
5094 for (i=0; i<num_attributes; i++) {
5095 va_TraceMsg(trace_ctx, "\tattr_list[%d] =\n", i);
5096 va_TraceMsg(trace_ctx, "\t type = 0x%08x\n", attr_list[i].type);
5097 va_TraceMsg(trace_ctx, "\t min_value = %d\n", attr_list[i].min_value);
5098 va_TraceMsg(trace_ctx, "\t max_value = %d\n", attr_list[i].max_value);
5099 va_TraceMsg(trace_ctx, "\t value = %d\n", attr_list[i].value);
5100 va_TraceMsg(trace_ctx, "\t flags = %d\n", attr_list[i].flags);
5102 va_TraceMsg(trace_ctx, NULL);
5106 void va_TraceGetDisplayAttributes (
5108 VADisplayAttribute *attr_list,
5112 DPY2TRACE_VIRCTX(dpy);
5114 TRACE_FUNCNAME(idx);
5116 va_TraceDisplayAttributes (trace_ctx, attr_list, num_attributes);
5118 DPY2TRACE_VIRCTX_EXIT(pva_trace);
5121 void va_TraceSetDisplayAttributes (
5123 VADisplayAttribute *attr_list,
5127 DPY2TRACE_VIRCTX(dpy);
5129 TRACE_FUNCNAME(idx);
5131 va_TraceDisplayAttributes (trace_ctx, attr_list, num_attributes);
5133 DPY2TRACE_VIRCTX_EXIT(pva_trace);
5137 void va_TracePutSurface (
5139 VASurfaceID surface,
5140 void *draw, /* the target Drawable */
5143 unsigned short srcw,
5144 unsigned short srch,
5147 unsigned short destw,
5148 unsigned short desth,
5149 VARectangle *cliprects, /* client supplied clip list */
5150 unsigned int number_cliprects, /* number of clip rects in the clip list */
5151 unsigned int flags /* de-interlacing flags */
5154 DPY2TRACE_VIRCTX(dpy);
5156 TRACE_FUNCNAME(idx);
5158 va_TraceMsg(trace_ctx, "\tsurface = 0x%08x\n", surface);
5159 va_TraceMsg(trace_ctx, "\tdraw = 0x%08x\n", draw);
5160 va_TraceMsg(trace_ctx, "\tsrcx = %d\n", srcx);
5161 va_TraceMsg(trace_ctx, "\tsrcy = %d\n", srcy);
5162 va_TraceMsg(trace_ctx, "\tsrcw = %d\n", srcw);
5163 va_TraceMsg(trace_ctx, "\tsrch = %d\n", srch);
5164 va_TraceMsg(trace_ctx, "\tdestx = %d\n", destx);
5165 va_TraceMsg(trace_ctx, "\tdesty = %d\n", desty);
5166 va_TraceMsg(trace_ctx, "\tdestw = %d\n", destw);
5167 va_TraceMsg(trace_ctx, "\tdesth = %d\n", desth);
5168 va_TraceMsg(trace_ctx, "\tcliprects = 0x%08x\n", cliprects);
5169 va_TraceMsg(trace_ctx, "\tnumber_cliprects = %d\n", number_cliprects);
5170 va_TraceMsg(trace_ctx, "\tflags = 0x%08x\n", flags);
5171 va_TraceMsg(trace_ctx, NULL);
5173 DPY2TRACE_VIRCTX_EXIT(pva_trace);