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;
958 unsigned int pixel_byte;
960 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
962 if (!trace_ctx->trace_fp_surface)
965 va_TraceMsg(trace_ctx, "==========dump surface data in file %s\n", trace_ctx->trace_surface_fn);
967 va_TraceMsg(trace_ctx, NULL);
969 va_status = vaLockSurface(
971 trace_ctx->trace_rendertarget,
973 &luma_stride, &chroma_u_stride, &chroma_v_stride,
974 &luma_offset, &chroma_u_offset, &chroma_v_offset,
975 &buffer_name, &buffer);
977 if (va_status != VA_STATUS_SUCCESS) {
978 va_TraceMsg(trace_ctx, "Error:vaLockSurface failed\n");
982 va_TraceMsg(trace_ctx, "\tfourcc = 0x%08x\n", fourcc);
983 va_TraceMsg(trace_ctx, "\twidth = %d\n", trace_ctx->trace_frame_width);
984 va_TraceMsg(trace_ctx, "\theight = %d\n", trace_ctx->trace_frame_height);
985 va_TraceMsg(trace_ctx, "\tluma_stride = %d\n", luma_stride);
986 va_TraceMsg(trace_ctx, "\tchroma_u_stride = %d\n", chroma_u_stride);
987 va_TraceMsg(trace_ctx, "\tchroma_v_stride = %d\n", chroma_v_stride);
988 va_TraceMsg(trace_ctx, "\tluma_offset = %d\n", luma_offset);
989 va_TraceMsg(trace_ctx, "\tchroma_u_offset = %d\n", chroma_u_offset);
990 va_TraceMsg(trace_ctx, "\tchroma_v_offset = %d\n", chroma_v_offset);
992 if (buffer == NULL) {
993 va_TraceMsg(trace_ctx, "Error:vaLockSurface return NULL buffer\n");
994 va_TraceMsg(trace_ctx, NULL);
996 vaUnlockSurface(dpy, trace_ctx->trace_rendertarget);
999 va_TraceMsg(trace_ctx, "\tbuffer location = 0x%08x\n", buffer);
1000 va_TraceMsg(trace_ctx, NULL);
1002 Y_data = (unsigned char*)buffer;
1003 UV_data = (unsigned char*)buffer + chroma_u_offset;
1005 if (fourcc == VA_FOURCC_P010)
1010 tmp = Y_data + luma_stride * trace_ctx->trace_surface_yoff;
1012 for (i=0; i<trace_ctx->trace_surface_height; i++) {
1013 fwrite(tmp + trace_ctx->trace_surface_xoff,
1014 trace_ctx->trace_surface_width,
1015 pixel_byte, trace_ctx->trace_fp_surface);
1020 tmp = UV_data + chroma_u_stride * trace_ctx->trace_surface_yoff / 2;
1021 if (fourcc == VA_FOURCC_NV12 || fourcc == VA_FOURCC_P010) {
1022 for (i=0; i<trace_ctx->trace_surface_height/2; i++) {
1023 fwrite(tmp + trace_ctx->trace_surface_xoff,
1024 trace_ctx->trace_surface_width,
1025 pixel_byte, trace_ctx->trace_fp_surface);
1027 tmp += chroma_u_stride;
1031 fflush(trace_ctx->trace_fp_surface);
1033 vaUnlockSurface(dpy, trace_ctx->trace_rendertarget);
1035 va_TraceMsg(trace_ctx, NULL);
1039 void va_TraceInitialize (
1041 int *major_version, /* out */
1042 int *minor_version /* out */
1045 DPY2TRACE_VIRCTX(dpy);
1046 TRACE_FUNCNAME(idx);
1047 DPY2TRACE_VIRCTX_EXIT(pva_trace);
1050 void va_TraceTerminate (
1054 DPY2TRACE_VIRCTX(dpy);
1055 TRACE_FUNCNAME(idx);
1056 va_TraceMsg(trace_ctx, NULL);
1057 DPY2TRACE_VIRCTX_EXIT(pva_trace);
1061 void va_TraceCreateConfig(
1064 VAEntrypoint entrypoint,
1065 VAConfigAttrib *attrib_list,
1067 VAConfigID *config_id /* out */
1072 DPY2TRACE_VIRCTX(dpy);
1074 TRACE_FUNCNAME(idx);
1076 va_TraceMsg(trace_ctx, "\tprofile = %d\n", profile);
1077 va_TraceMsg(trace_ctx, "\tentrypoint = %d\n", entrypoint);
1078 va_TraceMsg(trace_ctx, "\tnum_attribs = %d\n", num_attribs);
1080 for (i = 0; i < num_attribs; i++) {
1081 va_TraceMsg(trace_ctx, "\t\tattrib_list[%d].type = 0x%08x\n", i, attrib_list[i].type);
1082 va_TraceMsg(trace_ctx, "\t\tattrib_list[%d].value = 0x%08x\n", i, attrib_list[i].value);
1085 va_TraceMsg(trace_ctx, NULL);
1087 add_trace_config_info(pva_trace, *config_id, profile, entrypoint);
1089 DPY2TRACE_VIRCTX_EXIT(pva_trace);
1092 void va_TraceDestroyConfig (
1094 VAConfigID config_id
1097 DPY2TRACE_VIRCTX(dpy);
1099 TRACE_FUNCNAME(idx);
1101 va_TraceMsg(trace_ctx, "\tconfig = 0x%08x\n", config_id);
1102 va_TraceMsg(trace_ctx, NULL);
1104 delete_trace_config_info(pva_trace, config_id);
1106 DPY2TRACE_VIRCTX_EXIT(pva_trace);
1109 static void va_TraceSurfaceAttributes(
1110 struct trace_context *trace_ctx,
1111 VASurfaceAttrib *attrib_list,
1112 unsigned int *num_attribs
1118 if (!attrib_list || !num_attribs)
1123 if (num > VASurfaceAttribCount)
1124 num = VASurfaceAttribCount;
1126 for (i=0; i<num; i++) {
1127 int type = p->value.type;
1129 va_TraceMsg(trace_ctx, "\tattrib_list[%i] =\n", i);
1131 va_TraceMsg(trace_ctx, "\t\ttype = %d\n", p->type);
1132 va_TraceMsg(trace_ctx, "\t\tflags = %d\n", p->flags);
1133 va_TraceMsg(trace_ctx, "\t\tvalue.type = %d\n", type);
1135 case VAGenericValueTypeInteger:
1136 va_TraceMsg(trace_ctx, "\t\tvalue.value.i = 0x%08x\n", p->value.value.i);
1138 case VAGenericValueTypeFloat:
1139 va_TraceMsg(trace_ctx, "\t\tvalue.value.f = %f\n", p->value.value.f);
1141 case VAGenericValueTypePointer:
1142 va_TraceMsg(trace_ctx, "\t\tvalue.value.p = %p\n", p->value.value.p);
1143 if ((p->type == VASurfaceAttribExternalBufferDescriptor) && p->value.value.p) {
1144 VASurfaceAttribExternalBuffers *tmp = (VASurfaceAttribExternalBuffers *) p->value.value.p;
1147 va_TraceMsg(trace_ctx, "\t\t--VASurfaceAttribExternalBufferDescriptor\n");
1148 va_TraceMsg(trace_ctx, "\t\t pixel_format=0x%08x\n", tmp->pixel_format);
1149 va_TraceMsg(trace_ctx, "\t\t width=%d\n", tmp->width);
1150 va_TraceMsg(trace_ctx, "\t\t height=%d\n", tmp->height);
1151 va_TraceMsg(trace_ctx, "\t\t data_size=%d\n", tmp->data_size);
1152 va_TraceMsg(trace_ctx, "\t\t num_planes=%d\n", tmp->num_planes);
1153 va_TraceMsg(trace_ctx, "\t\t pitches[4]=%d %d %d %d\n",
1154 tmp->pitches[0], tmp->pitches[1], tmp->pitches[2], tmp->pitches[3]);
1155 va_TraceMsg(trace_ctx, "\t\t offsets[4]=%d %d %d %d\n",
1156 tmp->offsets[0], tmp->offsets[1], tmp->offsets[2], tmp->offsets[3]);
1157 va_TraceMsg(trace_ctx, "\t\t flags=0x%08x\n", tmp->flags);
1158 va_TraceMsg(trace_ctx, "\t\t num_buffers=0x%08x\n", tmp->num_buffers);
1159 va_TraceMsg(trace_ctx, "\t\t buffers=%p\n", tmp->buffers);
1160 for (j = 0; j < tmp->num_buffers; j++) {
1161 va_TraceMsg(trace_ctx, "\t\t\tbuffers[%d]=%p\n", j, tmp->buffers[j]);
1165 case VAGenericValueTypeFunc:
1166 va_TraceMsg(trace_ctx, "\t\tvalue.value.fn = %p\n", p->value.value.fn);
1176 void va_TraceCreateSurfaces(
1182 VASurfaceID *surfaces, /* out */
1183 VASurfaceAttrib *attrib_list,
1184 unsigned int num_attribs
1188 DPY2TRACE_VIRCTX(dpy);
1190 TRACE_FUNCNAME(idx);
1192 va_TraceMsg(trace_ctx, "\twidth = %d\n", width);
1193 va_TraceMsg(trace_ctx, "\theight = %d\n", height);
1194 va_TraceMsg(trace_ctx, "\tformat = %d\n", format);
1195 va_TraceMsg(trace_ctx, "\tnum_surfaces = %d\n", num_surfaces);
1198 for (i = 0; i < num_surfaces; i++)
1199 va_TraceMsg(trace_ctx, "\t\tsurfaces[%d] = 0x%08x\n", i, surfaces[i]);
1202 va_TraceSurfaceAttributes(trace_ctx, attrib_list, &num_attribs);
1204 va_TraceMsg(trace_ctx, NULL);
1206 DPY2TRACE_VIRCTX_EXIT(pva_trace);
1209 void va_TraceDestroySurfaces(
1211 VASurfaceID *surface_list,
1216 DPY2TRACE_VIRCTX(dpy);
1218 TRACE_FUNCNAME(idx);
1221 for (i = 0; i < num_surfaces; i++)
1222 va_TraceMsg(trace_ctx, "\t\tsurfaces[%d] = 0x%08x\n", i, surface_list[i]);
1225 va_TraceMsg(trace_ctx, NULL);
1227 DPY2TRACE_VIRCTX_EXIT(pva_trace);
1231 static void internal_TraceUpdateContext (
1232 struct va_trace *pva_trace,
1234 struct trace_context *new_trace_ctx,
1235 VAContextID context,
1239 struct trace_context *trace_ctx = NULL;
1240 int i = 0, delete = 1;
1241 pid_t thd_id = syscall(__NR_gettid);
1243 if(tra_ctx_idx >= MAX_TRACE_CTX_NUM)
1246 LOCK_RESOURCE(pva_trace);
1248 trace_ctx = pva_trace->ptra_ctx[tra_ctx_idx];
1250 if(!new_trace_ctx &&
1251 trace_ctx->created_thd_id != thd_id
1256 pva_trace->context_num--;
1257 pva_trace->ptra_ctx[tra_ctx_idx] = NULL;
1262 new_trace_ctx->created_thd_id = thd_id;
1263 pva_trace->ptra_ctx[tra_ctx_idx] = new_trace_ctx;
1264 pva_trace->context_num++;
1267 UNLOCK_RESOURCE(pva_trace);
1269 if(trace_ctx && delete) {
1270 for(i = 0;i < MAX_TRACE_THREAD_NUM;i++)
1271 if(trace_ctx->plog_file_list[i])
1272 stop_tracing2log_file(pva_trace, trace_ctx->plog_file_list[i]);
1274 if(trace_ctx->trace_codedbuf_fn)
1275 free(trace_ctx->trace_codedbuf_fn);
1277 if(trace_ctx->trace_fp_codedbuf)
1278 fclose(trace_ctx->trace_fp_codedbuf);
1280 if(trace_ctx->trace_surface_fn)
1281 free(trace_ctx->trace_surface_fn);
1283 if(trace_ctx->trace_fp_surface)
1284 fclose(trace_ctx->trace_fp_surface);
1286 //delete_trace_all_context_buf(pva_trace, context);
1292 void va_TraceCreateContext(
1294 VAConfigID config_id,
1298 VASurfaceID *render_targets,
1299 int num_render_targets,
1300 VAContextID *context /* out */
1303 struct va_trace *pva_trace = NULL;
1304 struct trace_context *trace_ctx = NULL;
1306 int encode = 0, decode = 0, jpeg = 0;
1309 pva_trace = (struct va_trace *)(((VADisplayContextP)dpy)->vatrace);
1311 || *context == VA_INVALID_ID
1313 va_errorMessage(dpy, "Invalid context id 0x%08x\n",
1314 context == NULL ? 0 : (int)*context);
1318 LOCK_CONTEXT(pva_trace);
1320 tra_ctx_id = get_free_ctx_idx(pva_trace, *context);
1321 if(tra_ctx_id >= MAX_TRACE_CTX_NUM) {
1322 va_errorMessage(dpy, "Can't get trace context for ctx 0x%08x\n",
1328 trace_ctx = calloc(sizeof(struct trace_context), 1);
1329 if(trace_ctx == NULL) {
1330 va_errorMessage(dpy, "Allocate trace context failed for ctx 0x%08x\n",
1336 i = get_valid_config_idx(pva_trace, config_id);
1337 if(i >= MAX_TRACE_CTX_NUM) {
1338 va_errorMessage(dpy, "Can't get trace config id for ctx 0x%08x cfg %x\n",
1339 *context, config_id);
1343 trace_ctx->trace_profile = pva_trace->config_info[i].trace_profile;
1344 trace_ctx->trace_entrypoint = pva_trace->config_info[i].trace_entrypoint;
1346 if(va_trace_flag & VA_TRACE_FLAG_LOG) {
1347 trace_ctx->plog_file = start_tracing2log_file(pva_trace);
1348 if(!trace_ctx->plog_file) {
1349 va_errorMessage(dpy, "Can't get trace log file for ctx 0x%08x\n",
1355 va_infoMessage(dpy, "Save context 0x%08x into log file %s\n", *context,
1356 trace_ctx->plog_file->fn_log);
1358 trace_ctx->plog_file_list[0] = trace_ctx->plog_file;
1361 trace_ctx->trace_context = *context;
1362 TRACE_FUNCNAME(idx);
1363 va_TraceMsg(trace_ctx, "\tcontext = 0x%08x va_trace_flag 0x%x\n", *context, va_trace_flag);
1364 va_TraceMsg(trace_ctx, "\tprofile = %d entrypoint = %d\n", trace_ctx->trace_profile,
1365 trace_ctx->trace_entrypoint);
1366 va_TraceMsg(trace_ctx, "\tconfig = 0x%08x\n", config_id);
1367 va_TraceMsg(trace_ctx, "\twidth = %d\n", picture_width);
1368 va_TraceMsg(trace_ctx, "\theight = %d\n", picture_height);
1369 va_TraceMsg(trace_ctx, "\tflag = 0x%08x\n", flag);
1370 va_TraceMsg(trace_ctx, "\tnum_render_targets = %d\n", num_render_targets);
1371 if (render_targets) {
1372 for (i=0; i<num_render_targets; i++)
1373 va_TraceMsg(trace_ctx, "\t\trender_targets[%d] = 0x%08x\n", i, render_targets[i]);
1376 trace_ctx->trace_frame_no = 0;
1377 trace_ctx->trace_slice_no = 0;
1379 trace_ctx->trace_frame_width = picture_width;
1380 trace_ctx->trace_frame_height = picture_height;
1382 if (trace_ctx->trace_surface_width == 0)
1383 trace_ctx->trace_surface_width = picture_width;
1384 if (trace_ctx->trace_surface_height == 0)
1385 trace_ctx->trace_surface_height = picture_height;
1387 /* avoid to create so many empty files */
1388 encode = (trace_ctx->trace_entrypoint == VAEntrypointEncSlice);
1389 decode = (trace_ctx->trace_entrypoint == VAEntrypointVLD);
1390 jpeg = (trace_ctx->trace_entrypoint == VAEntrypointEncPicture);
1391 if ((encode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_ENCODE)) ||
1392 (decode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_DECODE)) ||
1393 (jpeg && (va_trace_flag & VA_TRACE_FLAG_SURFACE_JPEG))) {
1394 if(open_tracing_specil_file(pva_trace, trace_ctx, 1) < 0) {
1395 va_errorMessage(dpy, "Open surface fail failed for ctx 0x%08x\n", *context);
1397 va_trace_flag &= ~(VA_TRACE_FLAG_SURFACE);
1401 if (encode && (va_trace_flag & VA_TRACE_FLAG_CODEDBUF)) {
1402 if(open_tracing_specil_file(pva_trace, trace_ctx, 0) < 0) {
1403 va_errorMessage(dpy, "Open codedbuf fail failed for ctx 0x%08x\n", *context);
1405 va_trace_flag &= ~(VA_TRACE_FLAG_CODEDBUF);
1409 internal_TraceUpdateContext(pva_trace, tra_ctx_id, trace_ctx, *context, 0);
1411 UNLOCK_CONTEXT(pva_trace);
1415 internal_TraceUpdateContext(pva_trace, tra_ctx_id, NULL, *context, 1);
1417 UNLOCK_CONTEXT(pva_trace);
1423 void va_TraceDestroyContext (
1428 struct va_trace *pva_trace = NULL;
1429 struct trace_context *trace_ctx = NULL;
1432 pva_trace = (struct va_trace *)(((VADisplayContextP)dpy)->vatrace);
1437 LOCK_CONTEXT(pva_trace);
1439 ctx_id = get_valid_ctx_idx(pva_trace, context);
1440 if(ctx_id < MAX_TRACE_CTX_NUM) {
1441 trace_ctx = pva_trace->ptra_ctx[ctx_id];
1444 refresh_log_file(pva_trace, trace_ctx);
1446 internal_TraceUpdateContext(pva_trace,
1447 get_valid_ctx_idx(pva_trace, context),
1452 UNLOCK_CONTEXT(pva_trace);
1455 void va_TraceCreateMFContext (
1457 VAMFContextID *mf_context /* out */
1460 DPY2TRACECTX(dpy, VA_INVALID_ID, VA_INVALID_ID);
1461 TRACE_FUNCNAME(idx);
1463 va_TraceMsg(trace_ctx, "\tmf_context = 0x%08x\n", *mf_context);
1464 trace_ctx->trace_context = *mf_context;
1466 trace_ctx->trace_context = VA_INVALID_ID;
1469 void va_TraceMFAddContext (
1471 VAMFContextID mf_context,
1475 DPY2TRACECTX(dpy, mf_context, VA_INVALID_ID);
1477 TRACE_FUNCNAME(idx);
1478 va_TraceMsg(trace_ctx, "\tmf_context = 0x%08x\n", mf_context);
1479 va_TraceMsg(trace_ctx, "\tcontext = 0x%08x\n", context);
1482 void va_TraceMFReleaseContext (
1484 VAMFContextID mf_context,
1488 DPY2TRACECTX(dpy, mf_context, VA_INVALID_ID);
1490 TRACE_FUNCNAME(idx);
1491 va_TraceMsg(trace_ctx, "\tmf_context = 0x%08x\n", mf_context);
1492 va_TraceMsg(trace_ctx, "\tcontext = 0x%08x\n", context);
1495 void va_TraceMFSubmit (
1497 VAMFContextID mf_context,
1498 VAContextID *contexts,
1504 DPY2TRACECTX(dpy, mf_context, VA_INVALID_ID);
1506 TRACE_FUNCNAME(idx);
1507 va_TraceMsg(trace_ctx, "\tmf_context = 0x%08x\n", mf_context);
1509 for(i = 0; i < num_contexts; i++){
1510 va_TraceMsg(trace_ctx, "\t\tcontext[%d] = 0x%08x\n", i, contexts[i]);
1514 void va_TraceCreateBuffer (
1516 VAContextID context, /* in */
1517 VABufferType type, /* in */
1518 unsigned int size, /* in */
1519 unsigned int num_elements, /* in */
1520 void *data, /* in */
1521 VABufferID *buf_id /* out */
1524 if (!buf_id || *buf_id == VA_INVALID_ID)
1527 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1529 add_trace_buf_info(pva_trace, context, *buf_id);
1531 /* only trace CodedBuffer */
1532 if (type != VAEncCodedBufferType)
1535 TRACE_FUNCNAME(idx);
1536 va_TraceMsg(trace_ctx, "\tbuf_type=%s\n", vaBufferTypeStr(type));
1538 va_TraceMsg(trace_ctx, "\tbuf_id=0x%x\n", *buf_id);
1539 va_TraceMsg(trace_ctx, "\tsize=%u\n", size);
1540 va_TraceMsg(trace_ctx, "\tnum_elements=%u\n", num_elements);
1542 va_TraceMsg(trace_ctx, NULL);
1545 void va_TraceDestroyBuffer (
1547 VABufferID buf_id /* in */
1552 unsigned int num_elements;
1554 if (buf_id == VA_INVALID_ID)
1557 DPY2TRACECTX(dpy, VA_INVALID_ID, buf_id);
1559 vaBufferInfo(dpy, trace_ctx->trace_context, buf_id, &type, &size, &num_elements);
1561 delete_trace_buf_info(pva_trace, buf_id);
1563 /* only trace CodedBuffer */
1564 if (type != VAEncCodedBufferType)
1567 TRACE_FUNCNAME(idx);
1568 va_TraceMsg(trace_ctx, "\tbuf_type=%s\n", vaBufferTypeStr(type));
1569 va_TraceMsg(trace_ctx, "\tbuf_id=0x%x\n", buf_id);
1570 va_TraceMsg(trace_ctx, "\tsize=%u\n", size);
1571 va_TraceMsg(trace_ctx, "\tnum_elements=%u\n", num_elements);
1573 va_TraceMsg(trace_ctx, NULL);
1577 static void mem_put_le16(char *mem, unsigned int val)
1583 static void mem_put_le32(char *mem, unsigned int val)
1591 static void va_TraceCodedBufferIVFHeader(struct trace_context *trace_ctx, void **pbuf)
1593 VACodedBufferSegment *buf_list;
1594 unsigned int frame_length = 0;
1597 buf_list = (VACodedBufferSegment *)(*pbuf);
1599 if (ftell(trace_ctx->trace_fp_codedbuf) == 0) { /* write ivf header */
1604 mem_put_le16(header+4, 0); /* version */
1605 mem_put_le16(header+6, 32); /* headersize */
1606 mem_put_le32(header+8, 0x30385056); /* headersize */
1607 /* write width and height of the first rc_param to IVF file header */
1608 mem_put_le16(header+12, trace_ctx->trace_frame_width); /* width */
1609 mem_put_le16(header+14, trace_ctx->trace_frame_height); /* height */
1610 mem_put_le32(header+16, 30); /* rate */
1611 mem_put_le32(header+20, 1); /* scale */
1612 mem_put_le32(header+24, 0xffffffff); /* length */
1613 mem_put_le32(header+28, 0); /* unused */
1614 fwrite(header, 1, 32, trace_ctx->trace_fp_codedbuf);
1617 /* write frame header */
1618 while (buf_list != NULL) {
1619 frame_length += buf_list->size;
1620 buf_list = (VACodedBufferSegment *) buf_list->next;
1622 mem_put_le32(header, frame_length);
1623 mem_put_le32(header+4, trace_ctx->pts&0xFFFFFFFF);
1624 mem_put_le32(header+8, 0);
1625 fwrite(header, 1, 12, trace_ctx->trace_fp_codedbuf);
1628 fflush(trace_ctx->trace_fp_codedbuf);
1631 void va_TraceMapBuffer (
1633 VABufferID buf_id, /* in */
1634 void **pbuf /* out */
1639 unsigned int num_elements;
1641 VACodedBufferSegment *buf_list;
1644 DPY2TRACECTX(dpy, VA_INVALID_ID, buf_id);
1646 vaBufferInfo(dpy, trace_ctx->trace_context, buf_id, &type, &size, &num_elements);
1648 /* only trace CodedBuffer */
1649 if (type != VAEncCodedBufferType)
1652 TRACE_FUNCNAME(idx);
1653 va_TraceMsg(trace_ctx, "\tbuf_id=0x%x\n", buf_id);
1654 va_TraceMsg(trace_ctx, "\tbuf_type=%s\n", vaBufferTypeStr(type));
1655 if ((pbuf == NULL) || (*pbuf == NULL))
1658 if (trace_ctx->trace_profile == VAProfileVP8Version0_3) {
1659 va_TraceMsg(trace_ctx, "\tAdd IVF header information\n");
1660 va_TraceCodedBufferIVFHeader(trace_ctx, pbuf);
1663 buf_list = (VACodedBufferSegment *)(*pbuf);
1664 while (buf_list != NULL) {
1665 va_TraceMsg(trace_ctx, "\tCodedbuf[%d] =\n", i++);
1667 va_TraceMsg(trace_ctx, "\t size = %u\n", buf_list->size);
1668 va_TraceMsg(trace_ctx, "\t bit_offset = %u\n", buf_list->bit_offset);
1669 va_TraceMsg(trace_ctx, "\t status = 0x%08x\n", buf_list->status);
1670 va_TraceMsg(trace_ctx, "\t reserved = 0x%08x\n", buf_list->reserved);
1671 va_TraceMsg(trace_ctx, "\t buf = 0x%08x\n", buf_list->buf);
1673 if (trace_ctx->trace_fp_codedbuf) {
1674 va_TraceMsg(trace_ctx, "\tDump the content to file\n");
1675 fwrite(buf_list->buf, buf_list->size, 1, trace_ctx->trace_fp_codedbuf);
1677 fflush(trace_ctx->trace_fp_codedbuf);
1680 buf_list = buf_list->next;
1682 va_TraceMsg(trace_ctx, NULL);
1685 static void va_TraceVABuffers(
1687 VAContextID context,
1691 unsigned int num_elements,
1696 unsigned char *p = pbuf;
1699 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1701 va_TracePrint(trace_ctx, "--%s\n", vaBufferTypeStr(type));
1703 if(trace_ctx->plog_file)
1704 fp = trace_ctx->plog_file->fp_log;
1706 if ((va_trace_flag & VA_TRACE_FLAG_BUFDATA) && fp) {
1707 for (i=0; i<size; i++) {
1708 unsigned char value = p[i];
1711 fprintf(fp, "\t\t0x%04x:", i);
1712 else if ((i%16) == 0)
1713 fprintf(fp, "\n\t\t0x%04x:", i);
1715 fprintf(fp, " %02x", value);
1720 va_TraceMsg(trace_ctx, NULL);
1726 static void va_TraceVAPictureParameterBufferMPEG2(
1728 VAContextID context,
1732 unsigned int num_elements,
1735 VAPictureParameterBufferMPEG2 *p=(VAPictureParameterBufferMPEG2 *)data;
1736 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1738 va_TraceMsg(trace_ctx,"VAPictureParameterBufferMPEG2\n");
1740 va_TraceMsg(trace_ctx,"\thorizontal size= %d\n", p->horizontal_size);
1741 va_TraceMsg(trace_ctx,"\tvertical size= %d\n", p->vertical_size);
1742 va_TraceMsg(trace_ctx,"\tforward reference picture= %d\n", p->forward_reference_picture);
1743 va_TraceMsg(trace_ctx,"\tbackward reference picture= %d\n", p->backward_reference_picture);
1744 va_TraceMsg(trace_ctx,"\tpicture coding type= %d\n", p->picture_coding_type);
1745 va_TraceMsg(trace_ctx,"\tf mode= %d\n", p->f_code);
1747 va_TraceMsg(trace_ctx,"\tpicture coding extension = %d\n", p->picture_coding_extension.value);
1748 va_TraceMsg(trace_ctx,"\tintra_dc_precision= %d\n", p->picture_coding_extension.bits.intra_dc_precision);
1749 va_TraceMsg(trace_ctx,"\tpicture_structure= %d\n", p->picture_coding_extension.bits.picture_structure);
1750 va_TraceMsg(trace_ctx,"\ttop_field_first= %d\n", p->picture_coding_extension.bits.top_field_first);
1751 va_TraceMsg(trace_ctx,"\tframe_pred_frame_dct= %d\n", p->picture_coding_extension.bits.frame_pred_frame_dct);
1752 va_TraceMsg(trace_ctx,"\tconcealment_motion_vectors= %d\n", p->picture_coding_extension.bits.concealment_motion_vectors);
1753 va_TraceMsg(trace_ctx,"\tq_scale_type= %d\n", p->picture_coding_extension.bits.q_scale_type);
1754 va_TraceMsg(trace_ctx,"\tintra_vlc_format= %d\n", p->picture_coding_extension.bits.intra_vlc_format);
1755 va_TraceMsg(trace_ctx,"\talternate_scan= %d\n", p->picture_coding_extension.bits.alternate_scan);
1756 va_TraceMsg(trace_ctx,"\trepeat_first_field= %d\n", p->picture_coding_extension.bits.repeat_first_field);
1757 va_TraceMsg(trace_ctx,"\tprogressive_frame= %d\n", p->picture_coding_extension.bits.progressive_frame);
1758 va_TraceMsg(trace_ctx,"\tis_first_field= %d\n", p->picture_coding_extension.bits.is_first_field);
1759 va_TraceMsg(trace_ctx, NULL);
1765 static void va_TraceVAIQMatrixBufferMPEG2(
1767 VAContextID context,
1771 unsigned int num_elements,
1774 VAIQMatrixBufferMPEG2 *p=(VAIQMatrixBufferMPEG2 *)data;
1775 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1777 va_TraceMsg(trace_ctx,"VAIQMatrixBufferMPEG2\n");
1779 va_TraceMsg(trace_ctx,"\tload_intra_quantiser_matrix = %d\n", p->load_intra_quantiser_matrix);
1780 va_TraceMsg(trace_ctx,"\tload_non_intra_quantiser_matrix = %d\n", p->load_non_intra_quantiser_matrix);
1781 va_TraceMsg(trace_ctx,"\tload_chroma_intra_quantiser_matrix = %d\n", p->load_chroma_intra_quantiser_matrix);
1782 va_TraceMsg(trace_ctx,"\tload_chroma_non_intra_quantiser_matrix = %d\n", p->load_chroma_non_intra_quantiser_matrix);
1783 va_TraceMsg(trace_ctx,"\tintra_quantiser_matrix = %d\n", p->intra_quantiser_matrix);
1784 va_TraceMsg(trace_ctx,"\tnon_intra_quantiser_matrix = %d\n", p->non_intra_quantiser_matrix);
1785 va_TraceMsg(trace_ctx,"\tchroma_intra_quantiser_matrix = %d\n", p->chroma_intra_quantiser_matrix);
1786 va_TraceMsg(trace_ctx,"\tchroma_non_intra_quantiser_matrix = %d\n", p->chroma_non_intra_quantiser_matrix);
1787 va_TraceMsg(trace_ctx, NULL);
1793 static void va_TraceVASliceParameterBufferMPEG2(
1795 VAContextID context,
1799 unsigned int num_elements,
1802 VASliceParameterBufferMPEG2 *p=(VASliceParameterBufferMPEG2 *)data;
1804 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1806 trace_ctx->trace_slice_no++;
1808 trace_ctx->trace_slice_size = p->slice_data_size;
1810 va_TraceMsg(trace_ctx,"VASliceParameterBufferMPEG2\n");
1812 va_TraceMsg(trace_ctx,"\tslice_data_size = %d\n", p->slice_data_size);
1813 va_TraceMsg(trace_ctx,"\tslice_data_offset = %d\n", p->slice_data_offset);
1814 va_TraceMsg(trace_ctx,"\tslice_data_flag = %d\n", p->slice_data_flag);
1815 va_TraceMsg(trace_ctx,"\tmacroblock_offset = %d\n", p->macroblock_offset);
1816 va_TraceMsg(trace_ctx,"\tslice_horizontal_position = %d\n", p->slice_horizontal_position);
1817 va_TraceMsg(trace_ctx,"\tslice_vertical_position = %d\n", p->slice_vertical_position);
1818 va_TraceMsg(trace_ctx,"\tquantiser_scale_code = %d\n", p->quantiser_scale_code);
1819 va_TraceMsg(trace_ctx,"\tintra_slice_flag = %d\n", p->intra_slice_flag);
1820 va_TraceMsg(trace_ctx, NULL);
1825 static void va_TraceVAPictureParameterBufferJPEG(
1827 VAContextID context,
1831 unsigned int num_elements,
1835 VAPictureParameterBufferJPEGBaseline *p=(VAPictureParameterBufferJPEGBaseline *)data;
1836 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1838 va_TraceMsg(trace_ctx,"*VAPictureParameterBufferJPEG\n");
1839 va_TraceMsg(trace_ctx,"\tpicture_width = %u\n", p->picture_width);
1840 va_TraceMsg(trace_ctx,"\tpicture_height = %u\n", p->picture_height);
1841 va_TraceMsg(trace_ctx,"\tcomponents = \n");
1842 for (i = 0; i < p->num_components && i < 255; ++i) {
1843 va_TraceMsg(trace_ctx,"\t\t[%d] component_id = %u\n", i, p->components[i].component_id);
1844 va_TraceMsg(trace_ctx,"\t\t[%d] h_sampling_factor = %u\n", i, p->components[i].h_sampling_factor);
1845 va_TraceMsg(trace_ctx,"\t\t[%d] v_sampling_factor = %u\n", i, p->components[i].v_sampling_factor);
1846 va_TraceMsg(trace_ctx,"\t\t[%d] quantiser_table_selector = %u\n", i, p->components[i].quantiser_table_selector);
1850 static void va_TraceVAIQMatrixBufferJPEG(
1852 VAContextID context,
1856 unsigned int num_elements,
1860 static char tmp[1024];
1861 VAIQMatrixBufferJPEGBaseline *p=(VAIQMatrixBufferJPEGBaseline *)data;
1862 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1863 va_TraceMsg(trace_ctx,"*VAIQMatrixParameterBufferJPEG\n");
1864 va_TraceMsg(trace_ctx,"\tload_quantiser_table =\n");
1865 for (i = 0; i < 4; ++i) {
1866 va_TraceMsg(trace_ctx,"\t\t[%d] = %u\n", i, p->load_quantiser_table[i]);
1868 va_TraceMsg(trace_ctx,"\tquantiser_table =\n");
1869 for (i = 0; i < 4; ++i) {
1870 memset(tmp, 0, sizeof tmp);
1871 for (j = 0; j < 64; ++j) {
1872 sprintf(tmp + strlen(tmp), "%u ", p->quantiser_table[i][j]);
1874 va_TraceMsg(trace_ctx,"\t\t[%d] = %s\n", i, tmp);
1878 static void va_TraceVASliceParameterBufferJPEG(
1880 VAContextID context,
1884 unsigned int num_elements,
1888 VASliceParameterBufferJPEGBaseline *p=(VASliceParameterBufferJPEGBaseline *)data;
1889 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1890 va_TraceMsg(trace_ctx,"*VASliceParameterBufferJPEG\n");
1891 va_TraceMsg(trace_ctx,"\tslice_data_size = %u\n", p->slice_data_size);
1892 va_TraceMsg(trace_ctx,"\tslice_data_offset = %u\n", p->slice_data_offset);
1893 va_TraceMsg(trace_ctx,"\tslice_data_flag = %u\n", p->slice_data_flag);
1894 va_TraceMsg(trace_ctx,"\tslice_horizontal_position = %u\n", p->slice_horizontal_position);
1895 va_TraceMsg(trace_ctx,"\tslice_vertical_position = %u\n", p->slice_vertical_position);
1896 va_TraceMsg(trace_ctx,"\tcomponents = \n");
1897 for (i = 0; i < p->num_components && i < 4; ++i) {
1898 va_TraceMsg(trace_ctx,"\t\t[%d] component_selector = %u\n", i, p->components[i].component_selector);
1899 va_TraceMsg(trace_ctx,"\t\t[%d] dc_table_selector = %u\n", i, p->components[i].dc_table_selector);
1900 va_TraceMsg(trace_ctx,"\t\t[%d] ac_table_selector = %u\n", i, p->components[i].ac_table_selector);
1902 va_TraceMsg(trace_ctx,"\trestart_interval = %u\n", p->restart_interval);
1903 va_TraceMsg(trace_ctx,"\tnum_mcus = %u\n", p->num_mcus);
1906 static void va_TraceVAHuffmanTableBufferJPEG(
1908 VAContextID context,
1912 unsigned int num_elements,
1916 static char tmp[1024];
1917 VAHuffmanTableBufferJPEGBaseline *p=(VAHuffmanTableBufferJPEGBaseline *)data;
1918 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1919 va_TraceMsg(trace_ctx,"*VAHuffmanTableBufferJPEG\n");
1921 for (i = 0; i < 2; ++i) {
1922 va_TraceMsg(trace_ctx,"\tload_huffman_table[%d] =%u\n", i, p->load_huffman_table[i]);
1923 va_TraceMsg(trace_ctx,"\thuffman_table[%d] =\n", i);
1924 memset(tmp, 0, sizeof tmp);
1925 for (j = 0; j < 16; ++j) {
1926 sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].num_dc_codes[j]);
1928 va_TraceMsg(trace_ctx,"\t\tnum_dc_codes =%s\n", tmp);
1929 memset(tmp, 0, sizeof tmp);
1930 for (j = 0; j < 12; ++j) {
1931 sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].dc_values[j]);
1933 va_TraceMsg(trace_ctx,"\t\tdc_values =%s\n", tmp);
1934 memset(tmp, 0, sizeof tmp);
1935 for (j = 0; j < 16; ++j) {
1936 sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].num_ac_codes[j]);
1938 va_TraceMsg(trace_ctx,"\t\tnum_ac_codes =%s\n", tmp);
1939 memset(tmp, 0, sizeof tmp);
1940 for (j = 0; j < 162; ++j) {
1941 sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].ac_values[j]);
1943 va_TraceMsg(trace_ctx,"\t\tac_values =%s\n", tmp);
1944 memset(tmp, 0, sizeof tmp);
1945 for (j = 0; j < 2; ++j) {
1946 sprintf(tmp + strlen(tmp), "%u ", p->huffman_table[i].pad[j]);
1948 va_TraceMsg(trace_ctx,"\t\tpad =%s\n", tmp);
1952 static void va_TraceVAPictureParameterBufferMPEG4(
1954 VAContextID context,
1958 unsigned int num_elements,
1962 VAPictureParameterBufferMPEG4 *p=(VAPictureParameterBufferMPEG4 *)data;
1964 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
1966 va_TraceMsg(trace_ctx,"*VAPictureParameterBufferMPEG4\n");
1967 va_TraceMsg(trace_ctx,"\tvop_width = %d\n", p->vop_width);
1968 va_TraceMsg(trace_ctx,"\tvop_height = %d\n", p->vop_height);
1969 va_TraceMsg(trace_ctx,"\tforward_reference_picture = %d\n", p->forward_reference_picture);
1970 va_TraceMsg(trace_ctx,"\tbackward_reference_picture = %d\n", p->backward_reference_picture);
1971 va_TraceMsg(trace_ctx,"\tvol_fields value = %d\n", p->vol_fields.value);
1972 va_TraceMsg(trace_ctx,"\tshort_video_header= %d\n", p->vol_fields.bits.short_video_header);
1973 va_TraceMsg(trace_ctx,"\tchroma_format= %d\n", p->vol_fields.bits.chroma_format);
1974 va_TraceMsg(trace_ctx,"\tinterlaced= %d\n", p->vol_fields.bits.interlaced);
1975 va_TraceMsg(trace_ctx,"\tobmc_disable= %d\n", p->vol_fields.bits.obmc_disable);
1976 va_TraceMsg(trace_ctx,"\tsprite_enable= %d\n", p->vol_fields.bits.sprite_enable);
1977 va_TraceMsg(trace_ctx,"\tsprite_warping_accuracy= %d\n", p->vol_fields.bits.sprite_warping_accuracy);
1978 va_TraceMsg(trace_ctx,"\tquant_type= %d\n", p->vol_fields.bits.quant_type);
1979 va_TraceMsg(trace_ctx,"\tquarter_sample= %d\n", p->vol_fields.bits.quarter_sample);
1980 va_TraceMsg(trace_ctx,"\tdata_partitioned= %d\n", p->vol_fields.bits.data_partitioned);
1981 va_TraceMsg(trace_ctx,"\treversible_vlc= %d\n", p->vol_fields.bits.reversible_vlc);
1982 va_TraceMsg(trace_ctx,"\tresync_marker_disable= %d\n", p->vol_fields.bits.resync_marker_disable);
1983 va_TraceMsg(trace_ctx,"\tno_of_sprite_warping_points = %d\n", p->no_of_sprite_warping_points);
1984 va_TraceMsg(trace_ctx,"\tsprite_trajectory_du =");
1986 va_TraceMsg(trace_ctx,"\t%d", p->sprite_trajectory_du[i]);
1988 va_TraceMsg(trace_ctx,"\n");
1989 va_TraceMsg(trace_ctx,"\tsprite_trajectory_dv =");
1991 va_TraceMsg(trace_ctx,"\t%d", p->sprite_trajectory_dv[i]);
1992 va_TraceMsg(trace_ctx,"\n");
1993 va_TraceMsg(trace_ctx,"\tvop_fields value = %d\n", p->vop_fields.value);
1994 va_TraceMsg(trace_ctx,"\tvop_coding_type= %d\n", p->vop_fields.bits.vop_coding_type);
1995 va_TraceMsg(trace_ctx,"\tbackward_reference_vop_coding_type= %d\n", p->vop_fields.bits.backward_reference_vop_coding_type);
1996 va_TraceMsg(trace_ctx,"\tvop_rounding_type= %d\n", p->vop_fields.bits.vop_rounding_type);
1997 va_TraceMsg(trace_ctx,"\tintra_dc_vlc_thr= %d\n", p->vop_fields.bits.intra_dc_vlc_thr);
1998 va_TraceMsg(trace_ctx,"\ttop_field_first= %d\n", p->vop_fields.bits.top_field_first);
1999 va_TraceMsg(trace_ctx,"\talternate_vertical_scan_flag= %d\n", p->vop_fields.bits.alternate_vertical_scan_flag);
2000 va_TraceMsg(trace_ctx,"\tvop_fcode_forward = %d\n", p->vop_fcode_forward);
2001 va_TraceMsg(trace_ctx,"\tvop_fcode_backward = %d\n", p->vop_fcode_backward);
2002 va_TraceMsg(trace_ctx,"\tnum_gobs_in_vop = %d\n", p->num_gobs_in_vop);
2003 va_TraceMsg(trace_ctx,"\tnum_macroblocks_in_gob = %d\n", p->num_macroblocks_in_gob);
2004 va_TraceMsg(trace_ctx,"\tTRB = %d\n", p->TRB);
2005 va_TraceMsg(trace_ctx,"\tTRD = %d\n", p->TRD);
2006 va_TraceMsg(trace_ctx, NULL);
2012 static void va_TraceVAIQMatrixBufferMPEG4(
2014 VAContextID context,
2018 unsigned int num_elements,
2022 VAIQMatrixBufferMPEG4 *p=(VAIQMatrixBufferMPEG4 *)data;
2023 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2025 va_TraceMsg(trace_ctx,"VAIQMatrixBufferMPEG4\n");
2027 va_TraceMsg(trace_ctx,"\tload_intra_quant_mat = %d\n", p->load_intra_quant_mat);
2028 va_TraceMsg(trace_ctx,"\tload_non_intra_quant_mat = %d\n", p->load_non_intra_quant_mat);
2029 va_TraceMsg(trace_ctx,"\tintra_quant_mat =\n");
2031 va_TraceMsg(trace_ctx,"\t\t%d\n", p->intra_quant_mat[i]);
2033 va_TraceMsg(trace_ctx,"\tnon_intra_quant_mat =\n");
2035 va_TraceMsg(trace_ctx,"\t\t%d\n", p->non_intra_quant_mat[i]);
2036 va_TraceMsg(trace_ctx, NULL);
2041 static void va_TraceVAEncSequenceParameterBufferMPEG4(
2043 VAContextID context,
2047 unsigned int num_elements,
2050 VAEncSequenceParameterBufferMPEG4 *p = (VAEncSequenceParameterBufferMPEG4 *)data;
2051 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2053 va_TraceMsg(trace_ctx, "\t--VAEncSequenceParameterBufferMPEG4\n");
2055 va_TraceMsg(trace_ctx, "\tprofile_and_level_indication = %d\n", p->profile_and_level_indication);
2056 va_TraceMsg(trace_ctx, "\tintra_period = %d\n", p->intra_period);
2057 va_TraceMsg(trace_ctx, "\tvideo_object_layer_width = %d\n", p->video_object_layer_width);
2058 va_TraceMsg(trace_ctx, "\tvideo_object_layer_height = %d\n", p->video_object_layer_height);
2059 va_TraceMsg(trace_ctx, "\tvop_time_increment_resolution = %d\n", p->vop_time_increment_resolution);
2060 va_TraceMsg(trace_ctx, "\tfixed_vop_rate = %d\n", p->fixed_vop_rate);
2061 va_TraceMsg(trace_ctx, "\tfixed_vop_time_increment = %d\n", p->fixed_vop_time_increment);
2062 va_TraceMsg(trace_ctx, "\tbits_per_second = %d\n", p->bits_per_second);
2063 va_TraceMsg(trace_ctx, "\tframe_rate = %d\n", p->frame_rate);
2064 va_TraceMsg(trace_ctx, "\tinitial_qp = %d\n", p->initial_qp);
2065 va_TraceMsg(trace_ctx, "\tmin_qp = %d\n", p->min_qp);
2066 va_TraceMsg(trace_ctx, NULL);
2071 static void va_TraceVAEncPictureParameterBufferMPEG4(
2073 VAContextID context,
2077 unsigned int num_elements,
2080 VAEncPictureParameterBufferMPEG4 *p = (VAEncPictureParameterBufferMPEG4 *)data;
2081 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2083 va_TraceMsg(trace_ctx, "\t--VAEncPictureParameterBufferMPEG4\n");
2084 va_TraceMsg(trace_ctx, "\treference_picture = 0x%08x\n", p->reference_picture);
2085 va_TraceMsg(trace_ctx, "\treconstructed_picture = 0x%08x\n", p->reconstructed_picture);
2086 va_TraceMsg(trace_ctx, "\tcoded_buf = 0x%08x\n", p->coded_buf);
2087 va_TraceMsg(trace_ctx, "\tpicture_width = %d\n", p->picture_width);
2088 va_TraceMsg(trace_ctx, "\tpicture_height = %d\n", p->picture_height);
2089 va_TraceMsg(trace_ctx, "\tmodulo_time_base = %d\n", p->modulo_time_base);
2090 va_TraceMsg(trace_ctx, "\tvop_time_increment = %d\n", p->vop_time_increment);
2091 va_TraceMsg(trace_ctx, "\tpicture_type = %d\n", p->picture_type);
2092 va_TraceMsg(trace_ctx, NULL);
2098 static void va_TraceVASliceParameterBufferMPEG4(
2100 VAContextID context,
2104 unsigned int num_elements,
2107 VASliceParameterBufferMPEG4 *p=(VASliceParameterBufferMPEG4 *)data;
2109 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2111 trace_ctx->trace_slice_no++;
2113 trace_ctx->trace_slice_size = p->slice_data_size;
2115 va_TraceMsg(trace_ctx,"VASliceParameterBufferMPEG4\n");
2117 va_TraceMsg(trace_ctx,"\tslice_data_size = %d\n", p->slice_data_size);
2118 va_TraceMsg(trace_ctx,"\tslice_data_offset = %d\n", p->slice_data_offset);
2119 va_TraceMsg(trace_ctx,"\tslice_data_flag = %d\n", p->slice_data_flag);
2120 va_TraceMsg(trace_ctx,"\tmacroblock_offset = %d\n", p->macroblock_offset);
2121 va_TraceMsg(trace_ctx,"\tmacroblock_number = %d\n", p->macroblock_number);
2122 va_TraceMsg(trace_ctx,"\tquant_scale = %d\n", p->quant_scale);
2123 va_TraceMsg(trace_ctx, NULL);
2129 static inline void va_TraceFlagIfNotZero(
2130 struct trace_context *trace_ctx,
2131 const char *name, /* in */
2132 unsigned int flag /* in */
2136 va_TraceMsg(trace_ctx, "%s = %x\n", name, flag);
2141 static void va_TraceVAPictureParameterBufferHEVC(
2143 VAContextID context,
2147 unsigned int num_elements,
2151 VAPictureParameterBufferHEVC *p = (VAPictureParameterBufferHEVC*)data;
2153 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2155 va_TracePrint(trace_ctx, "VAPictureParameterBufferHEVC\n");
2157 va_TraceMsg(trace_ctx, "\tCurrPic.picture_id = 0x%08x\n", p->CurrPic.picture_id);
2158 va_TraceMsg(trace_ctx, "\tCurrPic.frame_idx = %d\n", p->CurrPic.pic_order_cnt);
2159 va_TraceMsg(trace_ctx, "\tCurrPic.flags = %d\n", p->CurrPic.flags);
2161 va_TraceMsg(trace_ctx, "\tReferenceFrames (TopFieldOrderCnt-BottomFieldOrderCnt-picture_id-frame_idx-flags:\n");
2162 for (i = 0; i < 15; i++)
2164 if ((p->ReferenceFrames[i].picture_id != VA_INVALID_SURFACE) &&
2165 ((p->ReferenceFrames[i].flags & VA_PICTURE_HEVC_INVALID) == 0)) {
2166 va_TraceMsg(trace_ctx, "\t\t%08d-%08d-0x%08x\n",
2167 p->ReferenceFrames[i].picture_id,
2168 p->ReferenceFrames[i].pic_order_cnt,
2169 p->ReferenceFrames[i].flags);
2171 va_TraceMsg(trace_ctx, "\t\tinv-inv-inv-inv-inv\n");
2173 va_TraceMsg(trace_ctx, "\n");
2175 va_TraceMsg(trace_ctx, "\tpic_width_in_luma_samples = %d\n", p->pic_width_in_luma_samples);
2176 va_TraceMsg(trace_ctx, "\tpic_height_in_luma_samples = %d\n", p->pic_height_in_luma_samples);
2177 va_TraceMsg(trace_ctx, "\tpic_fields = %d\n", p->pic_fields.value);
2179 va_TraceMsg(trace_ctx, "\tchroma_format_idc = %d\n", p->pic_fields.bits.chroma_format_idc);
2180 va_TraceMsg(trace_ctx, "\tseparate_colour_plane_flag = %d\n", p->pic_fields.bits.separate_colour_plane_flag);
2181 va_TraceMsg(trace_ctx, "\tpcm_enabled_flag = %d\n", p->pic_fields.bits.pcm_enabled_flag);
2182 va_TraceMsg(trace_ctx, "\tscaling_list_enabled_flag = %d\n", p->pic_fields.bits.scaling_list_enabled_flag);
2183 va_TraceMsg(trace_ctx, "\ttransform_skip_enabled_flag = %d\n", p->pic_fields.bits.transform_skip_enabled_flag);
2184 va_TraceMsg(trace_ctx, "\tamp_enabled_flag = %d\n", p->pic_fields.bits.amp_enabled_flag);
2185 va_TraceMsg(trace_ctx, "\tstrong_intra_smoothing_enabled_flag = %d\n", p->pic_fields.bits.strong_intra_smoothing_enabled_flag);
2186 va_TraceMsg(trace_ctx, "\tsign_data_hiding_enabled_flag = %d\n", p->pic_fields.bits.sign_data_hiding_enabled_flag);
2187 va_TraceMsg(trace_ctx, "\tconstrained_intra_pred_flag = %d\n", p->pic_fields.bits.constrained_intra_pred_flag);
2188 va_TraceMsg(trace_ctx, "\tcu_qp_delta_enabled_flag = %d\n", p->pic_fields.bits.cu_qp_delta_enabled_flag);
2189 va_TraceMsg(trace_ctx, "\tweighted_pred_flag = %d\n", p->pic_fields.bits.weighted_pred_flag);
2190 va_TraceMsg(trace_ctx, "\tweighted_bipred_flag = %d\n", p->pic_fields.bits.weighted_bipred_flag);
2191 va_TraceMsg(trace_ctx, "\ttransquant_bypass_enabled_flag = %d\n", p->pic_fields.bits.transquant_bypass_enabled_flag);
2192 va_TraceMsg(trace_ctx, "\ttiles_enabled_flag = %d\n", p->pic_fields.bits.tiles_enabled_flag);
2193 va_TraceMsg(trace_ctx, "\tentropy_coding_sync_enabled_flag = %d\n", p->pic_fields.bits.entropy_coding_sync_enabled_flag);
2194 va_TraceMsg(trace_ctx, "\tpps_loop_filter_across_slices_enabled_flag = %d\n", p->pic_fields.bits.pps_loop_filter_across_slices_enabled_flag);
2195 va_TraceMsg(trace_ctx, "\tloop_filter_across_tiles_enabled_flag = %d\n", p->pic_fields.bits.loop_filter_across_tiles_enabled_flag);
2196 va_TraceMsg(trace_ctx, "\tpcm_loop_filter_disabled_flag = %d\n", p->pic_fields.bits.pcm_loop_filter_disabled_flag);
2197 va_TraceMsg(trace_ctx, "\tNoPicReorderingFlag = %d\n", p->pic_fields.bits.NoPicReorderingFlag);
2198 va_TraceMsg(trace_ctx, "\tNoBiPredFlag = %d\n", p->pic_fields.bits.NoBiPredFlag);
2199 va_TraceMsg(trace_ctx, "\tReservedBits = %d\n", p->pic_fields.bits.ReservedBits);
2201 va_TraceMsg(trace_ctx, "\tsps_max_dec_pic_buffering_minus1 = %d\n", p->sps_max_dec_pic_buffering_minus1);
2202 va_TraceMsg(trace_ctx, "\tbit_depth_luma_minus8 = %d\n", p->bit_depth_luma_minus8);
2203 va_TraceMsg(trace_ctx, "\tbit_depth_chroma_minus8 = %d\n", p->bit_depth_chroma_minus8);
2204 va_TraceMsg(trace_ctx, "\tpcm_sample_bit_depth_luma_minus1 = %d\n", p->pcm_sample_bit_depth_luma_minus1);
2205 va_TraceMsg(trace_ctx, "\tpcm_sample_bit_depth_chroma_minus1 = %d\n", p->pcm_sample_bit_depth_chroma_minus1);
2206 va_TraceMsg(trace_ctx, "\tlog2_min_luma_coding_block_size_minus3 = %d\n", p->log2_min_luma_coding_block_size_minus3);
2207 va_TraceMsg(trace_ctx, "\tlog2_diff_max_min_luma_coding_block_size = %d\n", p->log2_diff_max_min_luma_coding_block_size);
2208 va_TraceMsg(trace_ctx, "\tlog2_min_transform_block_size_minus2 = %d\n", p->log2_min_transform_block_size_minus2);
2209 va_TraceMsg(trace_ctx, "\tlog2_diff_max_min_transform_block_size = %d\n", p->log2_diff_max_min_transform_block_size);
2210 va_TraceMsg(trace_ctx, "\tlog2_min_pcm_luma_coding_block_size_minus3 = %d\n", p->log2_min_pcm_luma_coding_block_size_minus3);
2211 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);
2212 va_TraceMsg(trace_ctx, "\tmax_transform_hierarchy_depth_intra = %d\n", p->max_transform_hierarchy_depth_intra);
2213 va_TraceMsg(trace_ctx, "\tmax_transform_hierarchy_depth_inter = %d\n", p->max_transform_hierarchy_depth_inter);
2214 va_TraceMsg(trace_ctx, "\tinit_qp_minus26 = %d\n", p->init_qp_minus26);
2215 va_TraceMsg(trace_ctx, "\tdiff_cu_qp_delta_depth = %d\n", p->diff_cu_qp_delta_depth);
2216 va_TraceMsg(trace_ctx, "\tpps_cb_qp_offset = %d\n", p->pps_cb_qp_offset);
2217 va_TraceMsg(trace_ctx, "\tpps_cr_qp_offset = %d\n", p->pps_cr_qp_offset);
2218 va_TraceMsg(trace_ctx, "\tlog2_parallel_merge_level_minus2 = %d\n", p->log2_parallel_merge_level_minus2);
2219 va_TraceMsg(trace_ctx, "\tnum_tile_columns_minus1 = %d\n", p->num_tile_columns_minus1);
2220 va_TraceMsg(trace_ctx, "\tnum_tile_rows_minus1 = %d\n", p->num_tile_rows_minus1);
2222 va_TraceMsg(trace_ctx, "\tcolumn_width_minus1[19]=\n");
2223 va_TraceMsg(trace_ctx, "");
2224 for (i = 0; i < 19; i++) {
2225 va_TracePrint(trace_ctx, "\t%d", p->column_width_minus1[i]);
2226 if ((i + 1) % 8 == 0)
2229 va_TracePrint(trace_ctx, "\n");
2230 va_TraceMsg(trace_ctx, "\trow_height_minus1[21]=\n");
2231 va_TraceMsg(trace_ctx, "");
2232 for (i = 0; i < 21; i++) {
2233 va_TracePrint(trace_ctx, "\t%d", p->row_height_minus1[i]);
2234 if ((i + 1) % 8 == 0)
2237 va_TracePrint(trace_ctx, "\n");
2239 va_TraceMsg(trace_ctx, "\tslice_parsing_fields = %d\n", p->slice_parsing_fields.value);
2240 va_TraceMsg(trace_ctx, "\tlists_modification_present_flag = %d\n", p->slice_parsing_fields.bits.lists_modification_present_flag);
2241 va_TraceMsg(trace_ctx, "\tlong_term_ref_pics_present_flag = %d\n", p->slice_parsing_fields.bits.long_term_ref_pics_present_flag);
2242 va_TraceMsg(trace_ctx, "\tsps_temporal_mvp_enabled_flag = %d\n", p->slice_parsing_fields.bits.sps_temporal_mvp_enabled_flag);
2243 va_TraceMsg(trace_ctx, "\tcabac_init_present_flag = %d\n", p->slice_parsing_fields.bits.cabac_init_present_flag);
2244 va_TraceMsg(trace_ctx, "\toutput_flag_present_flag = %d\n", p->slice_parsing_fields.bits.output_flag_present_flag);
2245 va_TraceMsg(trace_ctx, "\tdependent_slice_segments_enabled_flag = %d\n", p->slice_parsing_fields.bits.dependent_slice_segments_enabled_flag);
2246 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);
2247 va_TraceMsg(trace_ctx, "\tsample_adaptive_offset_enabled_flag = %d\n", p->slice_parsing_fields.bits.sample_adaptive_offset_enabled_flag);
2248 va_TraceMsg(trace_ctx, "\tdeblocking_filter_override_enabled_flag = %d\n", p->slice_parsing_fields.bits.deblocking_filter_override_enabled_flag);
2249 va_TraceMsg(trace_ctx, "\tpps_disable_deblocking_filter_flag = %d\n", p->slice_parsing_fields.bits.pps_disable_deblocking_filter_flag);
2250 va_TraceMsg(trace_ctx, "\tslice_segment_header_extension_present_flag = %d\n", p->slice_parsing_fields.bits.slice_segment_header_extension_present_flag);
2251 va_TraceMsg(trace_ctx, "\tRapPicFlag = %d\n", p->slice_parsing_fields.bits.RapPicFlag);
2252 va_TraceMsg(trace_ctx, "\tIdrPicFlag = %d\n", p->slice_parsing_fields.bits.IdrPicFlag);
2253 va_TraceMsg(trace_ctx, "\tIntraPicFlag = %d\n", p->slice_parsing_fields.bits.IntraPicFlag);
2254 va_TraceMsg(trace_ctx, "\tReservedBits = %d\n", p->slice_parsing_fields.bits.ReservedBits);
2256 va_TraceMsg(trace_ctx, "\tlog2_max_pic_order_cnt_lsb_minus4 = %d\n", p->log2_max_pic_order_cnt_lsb_minus4);
2257 va_TraceMsg(trace_ctx, "\tnum_short_term_ref_pic_sets = %d\n", p->num_short_term_ref_pic_sets);
2258 va_TraceMsg(trace_ctx, "\tnum_long_term_ref_pic_sps = %d\n", p->num_long_term_ref_pic_sps);
2259 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l0_default_active_minus1 = %d\n", p->num_ref_idx_l0_default_active_minus1);
2260 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l1_default_active_minus1 = %d\n", p->num_ref_idx_l1_default_active_minus1);
2261 va_TraceMsg(trace_ctx, "\tpps_beta_offset_div2 = %d\n", p->pps_beta_offset_div2);
2262 va_TraceMsg(trace_ctx, "\tpps_tc_offset_div2 = %d\n", p->pps_tc_offset_div2);
2263 va_TraceMsg(trace_ctx, "\tnum_extra_slice_header_bits = %d\n", p->num_extra_slice_header_bits);
2264 va_TraceMsg(trace_ctx, "\tst_rps_bits = %d\n", p->st_rps_bits);
2269 static void va_TraceVASliceParameterBufferHEVC(
2271 VAContextID context,
2275 unsigned int num_elements,
2279 VASliceParameterBufferHEVC* p = (VASliceParameterBufferHEVC*)data;
2281 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2283 trace_ctx->trace_slice_no++;
2284 trace_ctx->trace_slice_size = p->slice_data_size;
2286 va_TracePrint(trace_ctx, "VASliceParameterBufferHEVC\n");
2287 va_TraceMsg(trace_ctx, "\tslice_data_size = %d\n", p->slice_data_size);
2288 va_TraceMsg(trace_ctx, "\tslice_data_offset = %d\n", p->slice_data_offset);
2289 va_TraceMsg(trace_ctx, "\tslice_data_flag = %d\n", p->slice_data_flag);
2290 va_TraceMsg(trace_ctx, "\tslice_data_byte_offset = %d\n", p->slice_data_byte_offset);
2291 va_TraceMsg(trace_ctx, "\tslice_segment_address = %d\n", p->slice_segment_address);
2293 va_TraceMsg(trace_ctx, "\tRefPicList[2][15]=\n");
2294 va_TraceMsg(trace_ctx, "");
2295 for (i = 0; i < 2; i++) {
2296 for (j = 0; j < 15; j++) {
2297 va_TracePrint(trace_ctx, "\t%d", p->RefPicList[i][j]);
2298 if ((j + 1) % 8 == 0)
2304 va_TracePrint(trace_ctx, "\tLongSliceFlags.value = %d\n", p->LongSliceFlags.value);
2305 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.LastSliceOfPic = %d\n", p->LongSliceFlags.fields.LastSliceOfPic);
2306 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.dependent_slice_segment_flag = %d\n", p->LongSliceFlags.fields.dependent_slice_segment_flag);
2307 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.slice_type = %d\n", p->LongSliceFlags.fields.slice_type);
2308 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.color_plane_id = %d\n", p->LongSliceFlags.fields.color_plane_id);
2309 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.slice_sao_luma_flag = %d\n", p->LongSliceFlags.fields.slice_sao_luma_flag);
2310 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.slice_sao_chroma_flag = %d\n", p->LongSliceFlags.fields.slice_sao_chroma_flag);
2311 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.mvd_l1_zero_flag = %d\n", p->LongSliceFlags.fields.mvd_l1_zero_flag);
2312 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.cabac_init_flag = %d\n", p->LongSliceFlags.fields.cabac_init_flag);
2313 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.slice_temporal_mvp_enabled_flag = %d\n", p->LongSliceFlags.fields.slice_temporal_mvp_enabled_flag);
2314 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.slice_deblocking_filter_disabled_flag = %d\n", p->LongSliceFlags.fields.slice_deblocking_filter_disabled_flag);
2315 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.collocated_from_l0_flag = %d\n", p->LongSliceFlags.fields.collocated_from_l0_flag);
2316 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);
2317 va_TraceMsg(trace_ctx, "\tLongSliceFlags.fields.reserved = %d\n", p->LongSliceFlags.fields.reserved);
2319 va_TraceMsg(trace_ctx, "\tcollocated_ref_idx = %d\n", p->collocated_ref_idx);
2321 va_TraceMsg(trace_ctx, "\tslice_qp_delta = %d\n", p->slice_qp_delta);
2322 va_TraceMsg(trace_ctx, "\tslice_cb_qp_offset = %d\n", p->slice_cb_qp_offset);
2323 va_TraceMsg(trace_ctx, "\tslice_cr_qp_offset = %d\n", p->slice_cr_qp_offset);
2324 va_TraceMsg(trace_ctx, "\tslice_beta_offset_div2 = %d\n", p->slice_beta_offset_div2);
2325 va_TraceMsg(trace_ctx, "\tslice_tc_offset_div2 = %d\n", p->slice_tc_offset_div2);
2326 va_TraceMsg(trace_ctx, "\tluma_log2_weight_denom = %d\n", p->luma_log2_weight_denom);
2327 va_TraceMsg(trace_ctx, "\tdelta_chroma_log2_weight_denom = %d\n", p->delta_chroma_log2_weight_denom);
2329 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l0_active_minus1 = %d\n", p->num_ref_idx_l0_active_minus1);
2330 for (i = 0; i <= p->num_ref_idx_l0_active_minus1; i++) {
2331 va_TraceMsg(trace_ctx, "\t% d ", p->delta_luma_weight_l0[i]);
2332 va_TracePrint(trace_ctx, "\t% d ", p->luma_offset_l0[i]);
2333 va_TracePrint(trace_ctx, "\t% d ", p->delta_chroma_weight_l0[i][0]);
2334 va_TracePrint(trace_ctx, "\t% d ", p->delta_chroma_weight_l0[i][1]);
2335 va_TracePrint(trace_ctx, "\t% d ", p->ChromaOffsetL0[i][0]);
2336 va_TracePrint(trace_ctx, "\t% d ", p->ChromaOffsetL0[i][1]);
2337 va_TracePrint(trace_ctx, "\n");
2340 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l1_active_minus1 = %d\n", p->num_ref_idx_l1_active_minus1);
2341 for (i = 0; i <= p->num_ref_idx_l1_active_minus1; i++) {
2342 va_TraceMsg(trace_ctx, "\t% d ", p->delta_luma_weight_l1[i]);
2343 va_TracePrint(trace_ctx, "\t% d ", p->luma_offset_l1[i]);
2344 va_TracePrint(trace_ctx, "\t% d ", p->delta_chroma_weight_l1[i][0]);
2345 va_TracePrint(trace_ctx, "\t% d ", p->delta_chroma_weight_l1[i][1]);
2346 va_TracePrint(trace_ctx, "\t% d ", p->ChromaOffsetL1[i][0]);
2347 va_TracePrint(trace_ctx, "\t% d ", p->ChromaOffsetL1[i][1]);
2348 va_TracePrint(trace_ctx, "\n");
2351 va_TraceMsg(trace_ctx, "\tfive_minus_max_num_merge_cand = %d\n", p->five_minus_max_num_merge_cand);
2353 va_TraceMsg(trace_ctx, NULL);
2356 static void va_TraceVAIQMatrixBufferHEVC(
2358 VAContextID context,
2362 unsigned int num_elements,
2367 VAIQMatrixBufferHEVC* p = (VAIQMatrixBufferHEVC* )data;
2369 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2371 va_TracePrint(trace_ctx, "VAIQMatrixBufferHEVC\n");
2373 va_TraceMsg(trace_ctx, "\tScalingList4x4[6][16]=\n");
2374 va_TraceMsg(trace_ctx, "");
2375 for (i = 0; i < 6; i++) {
2376 for (j = 0; j < 16; j++) {
2377 va_TracePrint(trace_ctx, "\t%d\t", p->ScalingList4x4[i][j]);
2378 if ((j + 1) % 8 == 0)
2383 va_TracePrint(trace_ctx, "\tScalingList8x8[6][64]=\n");
2384 va_TraceMsg(trace_ctx, "");
2385 for (i = 0; i < 6; i++) {
2386 for (j = 0; j < 64; j++) {
2387 va_TracePrint(trace_ctx, "\t%d", p->ScalingList8x8[i][j]);
2388 if ((j + 1) % 8 == 0)
2393 va_TracePrint(trace_ctx, "\tScalingList16x16[6][64]=\n");
2394 va_TraceMsg(trace_ctx, "");
2395 for (i = 0; i < 6; i++) {
2396 for (j = 0; j < 64; j++) {
2397 va_TracePrint(trace_ctx, "\t%d", p->ScalingList16x16[i][j]);
2398 if ((j + 1) % 8 == 0)
2403 va_TracePrint(trace_ctx, "\tScalingList32x32[2][64]=\n");
2404 va_TraceMsg(trace_ctx, "");
2405 for (i = 0; i < 2; i++) {
2406 for (j = 0; j < 64; j++) {
2407 va_TracePrint(trace_ctx, "\t%d", p->ScalingList32x32[i][j]);
2408 if ((j + 1) % 8 == 0)
2413 va_TracePrint(trace_ctx, "\tScalingListDC16x16[6]=\n");
2414 va_TraceMsg(trace_ctx, "");
2415 for (j = 0; j < 6; j++) {
2416 va_TracePrint(trace_ctx, "\t%d", p->ScalingListDC16x16[j]);
2418 va_TracePrint(trace_ctx, "\n");
2419 va_TraceMsg(trace_ctx, "\tScalingListDC32x32[2]=\n");
2420 va_TraceMsg(trace_ctx, "");
2421 for (j = 0; j < 2; j++) {
2422 va_TracePrint(trace_ctx, "\t%d", p->ScalingListDC32x32[j]);
2424 va_TracePrint(trace_ctx, "\n");
2426 va_TraceMsg(trace_ctx, NULL);
2429 static void va_TraceVAEncSequenceParameterBufferHEVC(
2431 VAContextID context,
2435 unsigned int num_elements,
2438 VAEncSequenceParameterBufferHEVC *p = (VAEncSequenceParameterBufferHEVC *)data;
2440 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2445 va_TracePrint(trace_ctx, "\t--VAEncSequenceParameterBufferHEVC\n");
2447 va_TraceMsg(trace_ctx, "\tgeneral_profile_idc = %d\n", p->general_profile_idc);
2448 va_TraceMsg(trace_ctx, "\tgeneral_level_idc = %d\n", p->general_level_idc);
2449 va_TraceMsg(trace_ctx, "\tgeneral_tier_flag = %d\n", p->general_tier_flag);
2450 va_TraceMsg(trace_ctx, "\tintra_period = %d\n", p->intra_period);
2451 va_TraceMsg(trace_ctx, "\tintra_idr_period = %d\n", p->intra_idr_period);
2452 va_TraceMsg(trace_ctx, "\tip_period = %d\n", p->ip_period);
2453 va_TraceMsg(trace_ctx, "\tbits_per_second = %d\n", p->bits_per_second);
2454 va_TraceMsg(trace_ctx, "\tpic_width_in_luma_samples = %d\n", p->pic_width_in_luma_samples);
2455 va_TraceMsg(trace_ctx, "\tpic_height_in_luma_samples = %d\n", p->pic_height_in_luma_samples);
2456 va_TraceMsg(trace_ctx, "\tchroma_format_idc = %d\n", p->seq_fields.bits.chroma_format_idc);
2457 va_TraceMsg(trace_ctx, "\tseparate_colour_plane_flag = %d\n", p->seq_fields.bits.separate_colour_plane_flag);
2458 va_TraceMsg(trace_ctx, "\tbit_depth_luma_minus8 = %d\n", p->seq_fields.bits.bit_depth_luma_minus8);
2459 va_TraceMsg(trace_ctx, "\tbit_depth_chroma_minus8 = %d\n", p->seq_fields.bits.bit_depth_chroma_minus8);
2460 va_TraceMsg(trace_ctx, "\tscaling_list_enabled_flag = %d\n", p->seq_fields.bits.scaling_list_enabled_flag);
2461 va_TraceMsg(trace_ctx, "\tstrong_intra_smoothing_enabled_flag = %d\n", p->seq_fields.bits.strong_intra_smoothing_enabled_flag);
2462 va_TraceMsg(trace_ctx, "\tamp_enabled_flag = %d\n", p->seq_fields.bits.amp_enabled_flag);
2463 va_TraceMsg(trace_ctx, "\tsample_adaptive_offset_enabled_flag = %d\n", p->seq_fields.bits.sample_adaptive_offset_enabled_flag);
2464 va_TraceMsg(trace_ctx, "\tpcm_enabled_flag = %d\n", p->seq_fields.bits.pcm_enabled_flag);
2465 va_TraceMsg(trace_ctx, "\tpcm_loop_filter_disabled_flag = %d\n", p->seq_fields.bits.pcm_loop_filter_disabled_flag);
2466 va_TraceMsg(trace_ctx, "\tsps_temporal_mvp_enabled_flag = %d\n", p->seq_fields.bits.sps_temporal_mvp_enabled_flag);
2467 va_TraceMsg(trace_ctx, "\treserved_bits = %d\n", p->seq_fields.bits.reserved_bits);
2468 va_TraceMsg(trace_ctx, "\tlog2_min_luma_coding_block_size_minus3 = %d\n", p->log2_min_luma_coding_block_size_minus3);
2469 va_TraceMsg(trace_ctx, "\tlog2_diff_max_min_luma_coding_block_size = %d\n", p->log2_diff_max_min_luma_coding_block_size);
2470 va_TraceMsg(trace_ctx, "\tlog2_min_transform_block_size_minus2 = %d\n", p->log2_min_transform_block_size_minus2);
2471 va_TraceMsg(trace_ctx, "\tlog2_diff_max_min_transform_block_size = %d\n", p->log2_diff_max_min_transform_block_size);
2472 va_TraceMsg(trace_ctx, "\tmax_transform_hierarchy_depth_inter = %d\n", p->max_transform_hierarchy_depth_inter);
2473 va_TraceMsg(trace_ctx, "\tmax_transform_hierarchy_depth_intra = %d\n", p->max_transform_hierarchy_depth_intra);
2474 va_TraceMsg(trace_ctx, "\tpcm_sample_bit_depth_luma_minus1 = %d\n", p->pcm_sample_bit_depth_luma_minus1);
2475 va_TraceMsg(trace_ctx, "\tpcm_sample_bit_depth_chroma_minus1 = %d\n", p->pcm_sample_bit_depth_chroma_minus1);
2476 va_TraceMsg(trace_ctx, "\tlog2_min_pcm_luma_coding_block_size_minus3 = %d\n", p->log2_min_pcm_luma_coding_block_size_minus3);
2477 va_TraceMsg(trace_ctx, "\tlog2_max_pcm_luma_coding_block_size_minus3 = %d\n", p->log2_max_pcm_luma_coding_block_size_minus3);
2478 va_TraceMsg(trace_ctx, "\tvui_parameters_present_flag = %d\n", p->vui_parameters_present_flag);
2479 va_TraceMsg(trace_ctx, "\taspect_ratio_info_present_flag = %d\n", p->vui_fields.bits.aspect_ratio_info_present_flag);
2480 va_TraceMsg(trace_ctx, "\tneutral_chroma_indication_flag = %d\n", p->vui_fields.bits.neutral_chroma_indication_flag);
2481 va_TraceMsg(trace_ctx, "\tfield_seq_flag = %d\n", p->vui_fields.bits.field_seq_flag);
2482 va_TraceMsg(trace_ctx, "\tvui_timing_info_present_flag = %d\n", p->vui_fields.bits.vui_timing_info_present_flag);
2483 va_TraceMsg(trace_ctx, "\tbitstream_restriction_flag = %d\n", p->vui_fields.bits.bitstream_restriction_flag);
2484 va_TraceMsg(trace_ctx, "\ttiles_fixed_structure_flag = %d\n", p->vui_fields.bits.tiles_fixed_structure_flag);
2485 va_TraceMsg(trace_ctx, "\tmotion_vectors_over_pic_boundaries_flag = %d\n", p->vui_fields.bits.motion_vectors_over_pic_boundaries_flag);
2486 va_TraceMsg(trace_ctx, "\trestricted_ref_pic_lists_flag = %d\n", p->vui_fields.bits.restricted_ref_pic_lists_flag);
2487 va_TraceMsg(trace_ctx, "\tlog2_max_mv_length_horizontal = %d\n", p->vui_fields.bits.log2_max_mv_length_horizontal);
2488 va_TraceMsg(trace_ctx, "\tlog2_max_mv_length_vertical = %d\n", p->vui_fields.bits.log2_max_mv_length_vertical);
2489 va_TraceMsg(trace_ctx, "\taspect_ratio_idc = %d\n", p->aspect_ratio_idc);
2490 va_TraceMsg(trace_ctx, "\tsar_width = %d\n", p->sar_width);
2491 va_TraceMsg(trace_ctx, "\tsar_height = %d\n", p->sar_height);
2492 va_TraceMsg(trace_ctx, "\tvui_num_units_in_tick = %d\n", p->vui_num_units_in_tick);
2493 va_TraceMsg(trace_ctx, "\tvui_time_scale = %d\n", p->vui_time_scale);
2494 va_TraceMsg(trace_ctx, "\tmin_spatial_segmentation_idc = %d\n", p->min_spatial_segmentation_idc);
2495 va_TraceMsg(trace_ctx, "\tmax_bytes_per_pic_denom = %d\n", p->max_bytes_per_pic_denom);
2496 va_TraceMsg(trace_ctx, "\tmax_bits_per_min_cu_denom = %d\n", p->max_bits_per_min_cu_denom);
2501 static void va_TraceVAEncPictureParameterBufferHEVC(
2503 VAContextID context,
2507 unsigned int num_elements,
2511 VAEncPictureParameterBufferHEVC *p = (VAEncPictureParameterBufferHEVC *)data;
2513 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2518 va_TracePrint(trace_ctx, "\t--VAEncPictureParameterBufferHEVC\n");
2520 va_TraceMsg(trace_ctx, "\tdecoded_curr_pic.picture_id = %d\n", p->decoded_curr_pic.picture_id);
2521 va_TraceMsg(trace_ctx, "\tdecoded_curr_pic.pic_order_cnt = %d\n", p->decoded_curr_pic.pic_order_cnt);
2522 va_TraceMsg(trace_ctx, "\tdecoded_curr_pic.flags = %d\n", p->decoded_curr_pic.flags);
2524 for(i = 0; i < 15; i ++)
2526 va_TraceMsg(trace_ctx, "\treference_frames[%d].picture_id = %d\n", i, p->reference_frames[i].picture_id);
2527 va_TraceMsg(trace_ctx, "\treference_frames[%d].pic_order_cnt = %d\n", i, p->reference_frames[i].pic_order_cnt);
2528 va_TraceMsg(trace_ctx, "\treference_frames[%d].flags = %d\n", i, p->reference_frames[i].flags);
2531 va_TraceMsg(trace_ctx, "\tcoded_buf = %d\n", p->coded_buf);
2532 va_TraceMsg(trace_ctx, "\tcollocated_ref_pic_index = %d\n", p->collocated_ref_pic_index);
2533 va_TraceMsg(trace_ctx, "\tlast_picture = %d\n", p->last_picture);
2534 va_TraceMsg(trace_ctx, "\tpic_init_qp = %d\n", p->pic_init_qp);
2535 va_TraceMsg(trace_ctx, "\tdiff_cu_qp_delta_depth = %d\n", p->diff_cu_qp_delta_depth);
2536 va_TraceMsg(trace_ctx, "\tpps_cb_qp_offset = %d\n", p->pps_cb_qp_offset);
2537 va_TraceMsg(trace_ctx, "\tpps_cr_qp_offset = %d\n", p->pps_cr_qp_offset);
2538 va_TraceMsg(trace_ctx, "\tnum_tile_columns_minus1 = %d\n", p->num_tile_columns_minus1);
2539 va_TraceMsg(trace_ctx, "\tnum_tile_rows_minus1 = %d\n", p->num_tile_rows_minus1);
2541 for(i = 0; i < 19; i ++)
2543 va_TraceMsg(trace_ctx, "\tcolumn_width_minus1[%d] = %d\n", i, p->column_width_minus1[i]);
2546 for(i = 0; i < 21; i ++)
2548 va_TraceMsg(trace_ctx, "\trow_height_minus1[%d] = %d\n", i, p->row_height_minus1[i]);
2551 va_TraceMsg(trace_ctx, "\tlog2_parallel_merge_level_minus2 = %d\n", p->log2_parallel_merge_level_minus2);
2552 va_TraceMsg(trace_ctx, "\tctu_max_bitsize_allowed = %d\n", p->ctu_max_bitsize_allowed);
2553 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l0_default_active_minus1 = %d\n", p->num_ref_idx_l0_default_active_minus1);
2554 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l1_default_active_minus1 = %d\n", p->num_ref_idx_l1_default_active_minus1);
2555 va_TraceMsg(trace_ctx, "\tslice_pic_parameter_set_id = %d\n", p->slice_pic_parameter_set_id);
2556 va_TraceMsg(trace_ctx, "\tnal_unit_type = %d\n", p->nal_unit_type);
2557 va_TraceMsg(trace_ctx, "\tidr_pic_flag = %d\n", p->pic_fields.bits.idr_pic_flag);
2558 va_TraceMsg(trace_ctx, "\tcoding_type = %d\n", p->pic_fields.bits.coding_type);
2559 va_TraceMsg(trace_ctx, "\treference_pic_flag = %d\n", p->pic_fields.bits.reference_pic_flag);
2560 va_TraceMsg(trace_ctx, "\tdependent_slice_segments_enabled_flag = %d\n", p->pic_fields.bits.dependent_slice_segments_enabled_flag);
2561 va_TraceMsg(trace_ctx, "\tsign_data_hiding_enabled_flag = %d\n", p->pic_fields.bits.sign_data_hiding_enabled_flag);
2562 va_TraceMsg(trace_ctx, "\tconstrained_intra_pred_flag = %d\n", p->pic_fields.bits.constrained_intra_pred_flag);
2563 va_TraceMsg(trace_ctx, "\ttransform_skip_enabled_flag = %d\n", p->pic_fields.bits.transform_skip_enabled_flag);
2564 va_TraceMsg(trace_ctx, "\tcu_qp_delta_enabled_flag = %d\n", p->pic_fields.bits.cu_qp_delta_enabled_flag);
2565 va_TraceMsg(trace_ctx, "\tweighted_pred_flag = %d\n", p->pic_fields.bits.weighted_pred_flag);
2566 va_TraceMsg(trace_ctx, "\tweighted_bipred_flag = %d\n", p->pic_fields.bits.weighted_bipred_flag);
2567 va_TraceMsg(trace_ctx, "\ttransquant_bypass_enabled_flag = %d\n", p->pic_fields.bits.transquant_bypass_enabled_flag);
2568 va_TraceMsg(trace_ctx, "\ttiles_enabled_flag = %d\n", p->pic_fields.bits.tiles_enabled_flag);
2569 va_TraceMsg(trace_ctx, "\tentropy_coding_sync_enabled_flag = %d\n", p->pic_fields.bits.entropy_coding_sync_enabled_flag);
2570 va_TraceMsg(trace_ctx, "\tloop_filter_across_tiles_enabled_flag = %d\n", p->pic_fields.bits.loop_filter_across_tiles_enabled_flag);
2571 va_TraceMsg(trace_ctx, "\tpps_loop_filter_across_slices_enabled_flag = %d\n", p->pic_fields.bits.pps_loop_filter_across_slices_enabled_flag);
2572 va_TraceMsg(trace_ctx, "\tscaling_list_data_present_flag = %d\n", p->pic_fields.bits.scaling_list_data_present_flag);
2573 va_TraceMsg(trace_ctx, "\tscreen_content_flag = %d\n", p->pic_fields.bits.screen_content_flag);
2574 va_TraceMsg(trace_ctx, "\tenable_gpu_weighted_prediction = %d\n", p->pic_fields.bits.enable_gpu_weighted_prediction);
2575 va_TraceMsg(trace_ctx, "\tno_output_of_prior_pics_flag = %d\n", p->pic_fields.bits.no_output_of_prior_pics_flag);
2576 va_TraceMsg(trace_ctx, "\treserved = %d\n", p->pic_fields.bits.reserved);
2581 static void va_TraceVAEncSliceParameterBufferHEVC(
2583 VAContextID context,
2587 unsigned int num_elements,
2591 VAEncSliceParameterBufferHEVC *p = (VAEncSliceParameterBufferHEVC *)data;
2593 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2598 va_TracePrint(trace_ctx, "\t--VAEncSliceParameterBufferHEVC\n");
2600 va_TraceMsg(trace_ctx, "\tslice_segment_address = %d\n", p->slice_segment_address);
2601 va_TraceMsg(trace_ctx, "\tnum_ctu_in_slice = %d\n", p->num_ctu_in_slice);
2602 va_TraceMsg(trace_ctx, "\tslice_type = %d\n", p->slice_type);
2603 va_TraceMsg(trace_ctx, "\tslice_pic_parameter_set_id = %d\n", p->slice_pic_parameter_set_id);
2604 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l0_active_minus1 = %d\n", p->num_ref_idx_l0_active_minus1);
2605 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l1_active_minus1 = %d\n", p->num_ref_idx_l1_active_minus1);
2607 for(i = 0; i < 15; i ++)
2609 va_TraceMsg(trace_ctx, "\tref_pic_list0[%d].picture_id = %d\n", i, p->ref_pic_list0[i].picture_id);
2610 va_TraceMsg(trace_ctx, "\tref_pic_list0[%d].pic_order_cnt = %d\n", i, p->ref_pic_list0[i].pic_order_cnt);
2611 va_TraceMsg(trace_ctx, "\tref_pic_list0[%d].flags = %d\n", i, p->ref_pic_list0[i].flags);
2612 va_TraceMsg(trace_ctx, "\tref_pic_list1[%d].picture_id = %d\n", i, p->ref_pic_list1[i].picture_id);
2613 va_TraceMsg(trace_ctx, "\tref_pic_list1[%d].pic_order_cnt = %d\n", i, p->ref_pic_list1[i].pic_order_cnt);
2614 va_TraceMsg(trace_ctx, "\tref_pic_list1[%d].flags = %d\n", i, p->ref_pic_list1[i].flags);
2617 va_TraceMsg(trace_ctx, "\tluma_log2_weight_denom = %d\n", p->luma_log2_weight_denom);
2618 va_TraceMsg(trace_ctx, "\tdelta_chroma_log2_weight_denom = %d\n", p->delta_chroma_log2_weight_denom);
2620 for(i = 0; i < 15; i ++)
2622 va_TraceMsg(trace_ctx, "\tdelta_luma_weight_l0[%d] = %d\n", i, p->delta_luma_weight_l0[i]);
2623 va_TraceMsg(trace_ctx, "\tdelta_luma_weight_l1[%d] = %d\n", i, p->delta_luma_weight_l1[i]);
2626 for(i = 0; i < 15; i ++)
2628 va_TraceMsg(trace_ctx, "\tluma_offset_l0[%d] = %d\n", i, p->luma_offset_l0[i]);
2629 va_TraceMsg(trace_ctx, "\tluma_offset_l1[%d] = %d\n", i, p->luma_offset_l1[i]);
2632 for(i = 0; i < 15; i ++)
2634 va_TraceMsg(trace_ctx, "\tdelta_chroma_weight_l0[%d][0] = %d\n", i, p->delta_chroma_weight_l0[i][0]);
2635 va_TraceMsg(trace_ctx, "\tdelta_chroma_weight_l0[%d][1] = %d\n", i, p->delta_chroma_weight_l0[i][1]);
2636 va_TraceMsg(trace_ctx, "\tdelta_chroma_weight_l1[%d][0] = %d\n", i, p->delta_chroma_weight_l1[i][0]);
2637 va_TraceMsg(trace_ctx, "\tdelta_chroma_weight_l1[%d][1] = %d\n", i, p->delta_chroma_weight_l1[i][1]);
2640 for(i = 0; i < 15; i ++)
2642 va_TraceMsg(trace_ctx, "\tchroma_offset_l0[%d][0] = %d\n", i, p->chroma_offset_l0[i][0]);
2643 va_TraceMsg(trace_ctx, "\tchroma_offset_l0[%d][1] = %d\n", i, p->chroma_offset_l0[i][1]);
2644 va_TraceMsg(trace_ctx, "\tchroma_offset_l1[%d][0] = %d\n", i, p->chroma_offset_l1[i][0]);
2645 va_TraceMsg(trace_ctx, "\tchroma_offset_l1[%d][1] = %d\n", i, p->chroma_offset_l1[i][1]);
2648 va_TraceMsg(trace_ctx, "\tmax_num_merge_cand = %d\n", p->max_num_merge_cand);
2649 va_TraceMsg(trace_ctx, "\tslice_qp_delta = %d\n", p->slice_qp_delta);
2650 va_TraceMsg(trace_ctx, "\tslice_cb_qp_offset = %d\n", p->slice_cb_qp_offset);
2651 va_TraceMsg(trace_ctx, "\tslice_cr_qp_offset = %d\n", p->slice_cr_qp_offset);
2652 va_TraceMsg(trace_ctx, "\tslice_beta_offset_div2 = %d\n", p->slice_beta_offset_div2);
2653 va_TraceMsg(trace_ctx, "\tslice_tc_offset_div2 = %d\n", p->slice_tc_offset_div2);
2654 va_TraceMsg(trace_ctx, "\tlast_slice_of_pic_flag = %d\n", p->slice_fields.bits.last_slice_of_pic_flag);
2655 va_TraceMsg(trace_ctx, "\tdependent_slice_segment_flag = %d\n", p->slice_fields.bits.dependent_slice_segment_flag);
2656 va_TraceMsg(trace_ctx, "\tcolour_plane_id = %d\n", p->slice_fields.bits.colour_plane_id);
2657 va_TraceMsg(trace_ctx, "\tslice_temporal_mvp_enabled_flag = %d\n", p->slice_fields.bits.slice_temporal_mvp_enabled_flag);
2658 va_TraceMsg(trace_ctx, "\tslice_sao_luma_flag = %d\n", p->slice_fields.bits.slice_sao_luma_flag);
2659 va_TraceMsg(trace_ctx, "\tslice_sao_chroma_flag = %d\n", p->slice_fields.bits.slice_sao_chroma_flag);
2660 va_TraceMsg(trace_ctx, "\tnum_ref_idx_active_override_flag = %d\n", p->slice_fields.bits.num_ref_idx_active_override_flag);
2661 va_TraceMsg(trace_ctx, "\tmvd_l1_zero_flag = %d\n", p->slice_fields.bits.mvd_l1_zero_flag);
2662 va_TraceMsg(trace_ctx, "\tcabac_init_flag = %d\n", p->slice_fields.bits.cabac_init_flag);
2663 va_TraceMsg(trace_ctx, "\tslice_deblocking_filter_disabled_flag = %d\n", p->slice_fields.bits.slice_deblocking_filter_disabled_flag);
2664 va_TraceMsg(trace_ctx, "\tslice_loop_filter_across_slices_enabled_flag = %d\n", p->slice_fields.bits.slice_loop_filter_across_slices_enabled_flag);
2665 va_TraceMsg(trace_ctx, "\tcollocated_from_l0_flag = %d\n", p->slice_fields.bits.collocated_from_l0_flag);
2670 static void va_TraceVAPictureParameterBufferH264(
2672 VAContextID context,
2676 unsigned int num_elements,
2680 VAPictureParameterBufferH264 *p = (VAPictureParameterBufferH264*)data;
2682 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2684 va_TraceMsg(trace_ctx, "\t--VAPictureParameterBufferH264\n");
2686 va_TraceMsg(trace_ctx, "\tCurrPic.picture_id = 0x%08x\n", p->CurrPic.picture_id);
2687 va_TraceMsg(trace_ctx, "\tCurrPic.frame_idx = %u\n", p->CurrPic.frame_idx);
2688 va_TraceMsg(trace_ctx, "\tCurrPic.flags = 0x%08x\n", p->CurrPic.flags);
2689 va_TraceMsg(trace_ctx, "\tCurrPic.TopFieldOrderCnt = %d\n", p->CurrPic.TopFieldOrderCnt);
2690 va_TraceMsg(trace_ctx, "\tCurrPic.BottomFieldOrderCnt = %d\n", p->CurrPic.BottomFieldOrderCnt);
2692 va_TraceMsg(trace_ctx, "\tReferenceFrames (TopFieldOrderCnt-BottomFieldOrderCnt-picture_id-frame_idx-flags:\n");
2693 for (i = 0; i < 16; i++)
2695 if ((p->ReferenceFrames[i].picture_id != VA_INVALID_SURFACE) &&
2696 ((p->ReferenceFrames[i].flags & VA_PICTURE_H264_INVALID) == 0)) {
2697 va_TraceMsg(trace_ctx, "\t\t%08d-%08d-0x%08x-%08u-0x%08x\n",
2698 p->ReferenceFrames[i].TopFieldOrderCnt,
2699 p->ReferenceFrames[i].BottomFieldOrderCnt,
2700 p->ReferenceFrames[i].picture_id,
2701 p->ReferenceFrames[i].frame_idx,
2702 p->ReferenceFrames[i].flags);
2706 va_TraceMsg(trace_ctx, "\tpicture_width_in_mbs_minus1 = %d\n", p->picture_width_in_mbs_minus1);
2707 va_TraceMsg(trace_ctx, "\tpicture_height_in_mbs_minus1 = %d\n", p->picture_height_in_mbs_minus1);
2708 va_TraceMsg(trace_ctx, "\tbit_depth_luma_minus8 = %d\n", p->bit_depth_luma_minus8);
2709 va_TraceMsg(trace_ctx, "\tbit_depth_chroma_minus8 = %d\n", p->bit_depth_chroma_minus8);
2710 va_TraceMsg(trace_ctx, "\tnum_ref_frames = %d\n", p->num_ref_frames);
2711 va_TraceMsg(trace_ctx, "\tseq fields = %d\n", p->seq_fields.value);
2712 va_TraceMsg(trace_ctx, "\tchroma_format_idc = %d\n", p->seq_fields.bits.chroma_format_idc);
2713 va_TraceMsg(trace_ctx, "\tresidual_colour_transform_flag = %d\n", p->seq_fields.bits.residual_colour_transform_flag);
2714 va_TraceMsg(trace_ctx, "\tframe_mbs_only_flag = %d\n", p->seq_fields.bits.frame_mbs_only_flag);
2715 va_TraceMsg(trace_ctx, "\tmb_adaptive_frame_field_flag = %d\n", p->seq_fields.bits.mb_adaptive_frame_field_flag);
2716 va_TraceMsg(trace_ctx, "\tdirect_8x8_inference_flag = %d\n", p->seq_fields.bits.direct_8x8_inference_flag);
2717 va_TraceMsg(trace_ctx, "\tMinLumaBiPredSize8x8 = %d\n", p->seq_fields.bits.MinLumaBiPredSize8x8);
2718 va_TraceMsg(trace_ctx, "\tpic_init_qp_minus26 = %d\n", p->pic_init_qp_minus26);
2719 va_TraceMsg(trace_ctx, "\tpic_init_qs_minus26 = %d\n", p->pic_init_qs_minus26);
2720 va_TraceMsg(trace_ctx, "\tchroma_qp_index_offset = %d\n", p->chroma_qp_index_offset);
2721 va_TraceMsg(trace_ctx, "\tsecond_chroma_qp_index_offset = %d\n", p->second_chroma_qp_index_offset);
2722 va_TraceMsg(trace_ctx, "\tpic_fields = 0x%03x\n", p->pic_fields.value);
2723 va_TraceFlagIfNotZero(trace_ctx, "\t\tentropy_coding_mode_flag", p->pic_fields.bits.entropy_coding_mode_flag);
2724 va_TraceFlagIfNotZero(trace_ctx, "\t\tweighted_pred_flag", p->pic_fields.bits.weighted_pred_flag);
2725 va_TraceFlagIfNotZero(trace_ctx, "\t\tweighted_bipred_idc", p->pic_fields.bits.weighted_bipred_idc);
2726 va_TraceFlagIfNotZero(trace_ctx, "\t\ttransform_8x8_mode_flag", p->pic_fields.bits.transform_8x8_mode_flag);
2727 va_TraceFlagIfNotZero(trace_ctx, "\t\tfield_pic_flag", p->pic_fields.bits.field_pic_flag);
2728 va_TraceFlagIfNotZero(trace_ctx, "\t\tconstrained_intra_pred_flag", p->pic_fields.bits.constrained_intra_pred_flag);
2729 va_TraceFlagIfNotZero(trace_ctx, "\t\tpic_order_present_flag", p->pic_fields.bits.pic_order_present_flag);
2730 va_TraceFlagIfNotZero(trace_ctx, "\t\tdeblocking_filter_control_present_flag", p->pic_fields.bits.deblocking_filter_control_present_flag);
2731 va_TraceFlagIfNotZero(trace_ctx, "\t\tredundant_pic_cnt_present_flag", p->pic_fields.bits.redundant_pic_cnt_present_flag);
2732 va_TraceFlagIfNotZero(trace_ctx, "\t\treference_pic_flag", p->pic_fields.bits.reference_pic_flag);
2733 va_TraceMsg(trace_ctx, "\tframe_num = %d\n", p->frame_num);
2734 va_TraceMsg(trace_ctx, NULL);
2739 static void va_TraceVASliceParameterBufferH264(
2741 VAContextID context,
2745 unsigned int num_elements,
2749 VASliceParameterBufferH264* p = (VASliceParameterBufferH264*)data;
2750 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2752 trace_ctx->trace_slice_no++;
2753 trace_ctx->trace_slice_size = p->slice_data_size;
2755 va_TraceMsg(trace_ctx, "\t--VASliceParameterBufferH264\n");
2756 va_TraceMsg(trace_ctx, "\tslice_data_size = %u\n", p->slice_data_size);
2757 va_TraceMsg(trace_ctx, "\tslice_data_offset = %u\n", p->slice_data_offset);
2758 va_TraceMsg(trace_ctx, "\tslice_data_flag = 0x%08x\n", p->slice_data_flag);
2759 va_TraceMsg(trace_ctx, "\tslice_data_bit_offset = %d\n", p->slice_data_bit_offset);
2760 va_TraceMsg(trace_ctx, "\tfirst_mb_in_slice = %d\n", p->first_mb_in_slice);
2761 va_TraceMsg(trace_ctx, "\tslice_type = %d\n", p->slice_type);
2762 va_TraceMsg(trace_ctx, "\tdirect_spatial_mv_pred_flag = %d\n", p->direct_spatial_mv_pred_flag);
2763 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l0_active_minus1 = %d\n", p->num_ref_idx_l0_active_minus1);
2764 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l1_active_minus1 = %d\n", p->num_ref_idx_l1_active_minus1);
2765 va_TraceMsg(trace_ctx, "\tcabac_init_idc = %d\n", p->cabac_init_idc);
2766 va_TraceMsg(trace_ctx, "\tslice_qp_delta = %d\n", p->slice_qp_delta);
2767 va_TraceMsg(trace_ctx, "\tdisable_deblocking_filter_idc = %d\n", p->disable_deblocking_filter_idc);
2768 va_TraceMsg(trace_ctx, "\tslice_alpha_c0_offset_div2 = %d\n", p->slice_alpha_c0_offset_div2);
2769 va_TraceMsg(trace_ctx, "\tslice_beta_offset_div2 = %d\n", p->slice_beta_offset_div2);
2771 va_TraceMsg(trace_ctx, "\tRefPicList0 =\n");
2772 for (i = 0; i < 32; i++) {
2773 if ((p->RefPicList0[i].picture_id != VA_INVALID_SURFACE) &&
2774 ((p->RefPicList0[i].flags & VA_PICTURE_H264_INVALID) == 0))
2775 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);
2779 va_TraceMsg(trace_ctx, "\tRefPicList1 =\n");
2780 for (i = 0; i < 32; i++) {
2781 if ((p->RefPicList1[i].picture_id != VA_INVALID_SURFACE) &&
2782 ((p->RefPicList1[i].flags & VA_PICTURE_H264_INVALID) == 0))
2783 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);
2788 va_TraceMsg(trace_ctx, "\tluma_log2_weight_denom = %d\n", p->luma_log2_weight_denom);
2789 va_TraceMsg(trace_ctx, "\tchroma_log2_weight_denom = %d\n", p->chroma_log2_weight_denom);
2790 va_TraceMsg(trace_ctx, "\tluma_weight_l0_flag = %d\n", p->luma_weight_l0_flag);
2792 for (i = 0; (i <= p->num_ref_idx_l0_active_minus1) && (i<32); i++) {
2793 va_TraceMsg(trace_ctx, "\t\t%d\t%d\n",
2794 p->luma_weight_l0[i],
2795 p->luma_offset_l0[i]);
2799 va_TraceMsg(trace_ctx, "\tchroma_weight_l0_flag = %d\n", p->chroma_weight_l0_flag);
2801 for (i = 0; (i <= p->num_ref_idx_l0_active_minus1) && (i<32); i++) {
2802 va_TraceMsg(trace_ctx, "\t\t%d\t%d\t%d\t%d\n",
2803 p->chroma_weight_l0[i][0],
2804 p->chroma_offset_l0[i][0],
2805 p->chroma_weight_l0[i][1],
2806 p->chroma_offset_l0[i][1]);
2810 va_TraceMsg(trace_ctx, "\tluma_weight_l1_flag = %d\n", p->luma_weight_l1_flag);
2812 for (i = 0; (i <= p->num_ref_idx_l1_active_minus1) && (i<32); i++) {
2813 va_TraceMsg(trace_ctx, "\t\t%d\t%d\n",
2814 p->luma_weight_l1[i],
2815 p->luma_offset_l1[i]);
2819 va_TraceMsg(trace_ctx, "\tchroma_weight_l1_flag = %d\n", p->chroma_weight_l1_flag);
2821 for (i = 0; (i <= p->num_ref_idx_l1_active_minus1) && (i<32); i++) {
2822 va_TraceMsg(trace_ctx, "\t\t%d\t%d\t%d\t%d\n",
2823 p->chroma_weight_l1[i][0],
2824 p->chroma_offset_l1[i][0],
2825 p->chroma_weight_l1[i][1],
2826 p->chroma_offset_l1[i][1]);
2829 va_TraceMsg(trace_ctx, NULL);
2832 static void va_TraceVAIQMatrixBufferH264(
2834 VAContextID context,
2838 unsigned int num_elements,
2843 VAIQMatrixBufferH264* p = (VAIQMatrixBufferH264* )data;
2846 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2848 if(trace_ctx->plog_file)
2849 fp = trace_ctx->plog_file->fp_log;
2851 va_TraceMsg(trace_ctx, "\t--VAIQMatrixBufferH264\n");
2853 va_TraceMsg(trace_ctx, "\tScalingList4x4[6][16]=\n");
2854 for (i = 0; i < 6; i++) {
2855 for (j = 0; j < 16; j++) {
2857 fprintf(fp, "\t%d", p->ScalingList4x4[i][j]);
2858 if ((j + 1) % 8 == 0)
2864 va_TraceMsg(trace_ctx, "\tScalingList8x8[2][64]=\n");
2865 for (i = 0; i < 2; i++) {
2866 for (j = 0; j < 64; j++) {
2868 fprintf(fp,"\t%d", p->ScalingList8x8[i][j]);
2869 if ((j + 1) % 8 == 0)
2875 va_TraceMsg(trace_ctx, NULL);
2880 static void va_TraceVAEncSequenceParameterBufferH264(
2882 VAContextID context,
2886 unsigned int num_elements,
2889 VAEncSequenceParameterBufferH264 *p = (VAEncSequenceParameterBufferH264 *)data;
2890 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2893 va_TraceMsg(trace_ctx, "\t--VAEncSequenceParameterBufferH264\n");
2895 va_TraceMsg(trace_ctx, "\tseq_parameter_set_id = %d\n", p->seq_parameter_set_id);
2896 va_TraceMsg(trace_ctx, "\tlevel_idc = %d\n", p->level_idc);
2897 va_TraceMsg(trace_ctx, "\tintra_period = %u\n", p->intra_period);
2898 va_TraceMsg(trace_ctx, "\tintra_idr_period = %u\n", p->intra_idr_period);
2899 va_TraceMsg(trace_ctx, "\tip_period = %u\n", p->ip_period);
2900 va_TraceMsg(trace_ctx, "\tbits_per_second = %u\n", p->bits_per_second);
2901 va_TraceMsg(trace_ctx, "\tmax_num_ref_frames = %u\n", p->max_num_ref_frames);
2902 va_TraceMsg(trace_ctx, "\tpicture_width_in_mbs = %d\n", p->picture_width_in_mbs);
2903 va_TraceMsg(trace_ctx, "\tpicture_height_in_mbs = %d\n", p->picture_height_in_mbs);
2904 va_TraceMsg(trace_ctx, "\tchroma_format_idc = %d\n", p->seq_fields.bits.chroma_format_idc);
2905 va_TraceMsg(trace_ctx, "\tframe_mbs_only_flag = %d\n", p->seq_fields.bits.frame_mbs_only_flag);
2906 va_TraceMsg(trace_ctx, "\tmb_adaptive_frame_field_flag = %d\n", p->seq_fields.bits.mb_adaptive_frame_field_flag);
2907 va_TraceMsg(trace_ctx, "\tseq_scaling_matrix_present_flag = %d\n", p->seq_fields.bits.seq_scaling_matrix_present_flag);
2908 va_TraceMsg(trace_ctx, "\tdirect_8x8_inference_flag = %d\n", p->seq_fields.bits.direct_8x8_inference_flag);
2909 va_TraceMsg(trace_ctx, "\tlog2_max_frame_num_minus4 = %d\n", p->seq_fields.bits.log2_max_frame_num_minus4);
2910 va_TraceMsg(trace_ctx, "\tpic_order_cnt_type = %d\n", p->seq_fields.bits.pic_order_cnt_type);
2911 va_TraceMsg(trace_ctx, "\tlog2_max_pic_order_cnt_lsb_minus4 = %d\n", p->seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4);
2912 va_TraceMsg(trace_ctx, "\tdelta_pic_order_always_zero_flag = %d\n", p->seq_fields.bits.delta_pic_order_always_zero_flag);
2913 va_TraceMsg(trace_ctx, "\tbit_depth_luma_minus8 = %d\n", p->bit_depth_luma_minus8);
2914 va_TraceMsg(trace_ctx, "\tbit_depth_chroma_minus8 = %d\n", p->bit_depth_chroma_minus8);
2915 va_TraceMsg(trace_ctx, "\tnum_ref_frames_in_pic_order_cnt_cycle = %d\n", p->num_ref_frames_in_pic_order_cnt_cycle);
2916 va_TraceMsg(trace_ctx, "\toffset_for_non_ref_pic = %d\n", p->offset_for_non_ref_pic);
2917 va_TraceMsg(trace_ctx, "\toffset_for_top_to_bottom_field = %d\n", p->offset_for_top_to_bottom_field);
2918 for(i = 0; (i < p->max_num_ref_frames) && (i < 32); ++i)
2919 va_TraceMsg(trace_ctx, "\toffset_for_ref_frame[%d] = %d\n", i, p->offset_for_ref_frame[i]);
2920 va_TraceMsg(trace_ctx, "\tframe_cropping_flag = %d\n", p->frame_cropping_flag);
2921 va_TraceMsg(trace_ctx, "\tframe_crop_left_offset = %u\n", p->frame_crop_left_offset);
2922 va_TraceMsg(trace_ctx, "\tframe_crop_right_offset = %u\n", p->frame_crop_right_offset);
2923 va_TraceMsg(trace_ctx, "\tframe_crop_top_offset = %u\n", p->frame_crop_top_offset);
2924 va_TraceMsg(trace_ctx, "\tframe_crop_bottom_offset = %u\n", p->frame_crop_bottom_offset);
2925 va_TraceMsg(trace_ctx, "\tvui_parameters_present_flag = %d\n", p->vui_parameters_present_flag);
2926 va_TraceMsg(trace_ctx, "\taspect_ratio_info_present_flag = %d\n", p->vui_fields.bits.aspect_ratio_info_present_flag);
2927 va_TraceMsg(trace_ctx, "\ttiming_info_present_flag = %d\n", p->vui_fields.bits.timing_info_present_flag);
2928 va_TraceMsg(trace_ctx, "\tbitstream_restriction_flag = %d\n", p->vui_fields.bits.bitstream_restriction_flag);
2929 va_TraceMsg(trace_ctx, "\tlog2_max_mv_length_horizontal = %d\n", p->vui_fields.bits.log2_max_mv_length_horizontal);
2930 va_TraceMsg(trace_ctx, "\tlog2_max_mv_length_vertical = %d\n", p->vui_fields.bits.log2_max_mv_length_vertical);
2931 va_TraceMsg(trace_ctx, "\taspect_ratio_idc = %d\n", p->aspect_ratio_idc);
2932 va_TraceMsg(trace_ctx, "\tsar_width = %u\n", p->sar_width);
2933 va_TraceMsg(trace_ctx, "\tsar_height = %u\n", p->sar_height);
2934 va_TraceMsg(trace_ctx, "\tnum_units_in_tick = %u\n", p->num_units_in_tick);
2935 va_TraceMsg(trace_ctx, "\ttime_scale = %u\n", p->time_scale);
2937 va_TraceMsg(trace_ctx, NULL);
2943 static void va_TraceVAEncPictureParameterBufferH264(
2945 VAContextID context,
2949 unsigned int num_elements,
2952 VAEncPictureParameterBufferH264 *p = (VAEncPictureParameterBufferH264 *)data;
2953 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
2956 va_TraceMsg(trace_ctx, "\t--VAEncPictureParameterBufferH264\n");
2958 va_TraceMsg(trace_ctx, "\tCurrPic.picture_id = 0x%08x\n", p->CurrPic.picture_id);
2959 va_TraceMsg(trace_ctx, "\tCurrPic.frame_idx = %u\n", p->CurrPic.frame_idx);
2960 va_TraceMsg(trace_ctx, "\tCurrPic.flags = 0x%08x\n", p->CurrPic.flags);
2961 va_TraceMsg(trace_ctx, "\tCurrPic.TopFieldOrderCnt = %d\n", p->CurrPic.TopFieldOrderCnt);
2962 va_TraceMsg(trace_ctx, "\tCurrPic.BottomFieldOrderCnt = %d\n", p->CurrPic.BottomFieldOrderCnt);
2963 va_TraceMsg(trace_ctx, "\tReferenceFrames (TopFieldOrderCnt-BottomFieldOrderCnt-picture_id-frame_idx-flags):\n");
2964 for (i = 0; i < 16; i++)
2966 if ((p->ReferenceFrames[i].picture_id != VA_INVALID_SURFACE) &&
2967 ((p->ReferenceFrames[i].flags & VA_PICTURE_H264_INVALID) == 0)) {
2968 va_TraceMsg(trace_ctx, "\t\t%08d-%08d-0x%08x-%08u-0x%08x\n",
2969 p->ReferenceFrames[i].TopFieldOrderCnt,
2970 p->ReferenceFrames[i].BottomFieldOrderCnt,
2971 p->ReferenceFrames[i].picture_id,
2972 p->ReferenceFrames[i].frame_idx,
2973 p->ReferenceFrames[i].flags
2978 va_TraceMsg(trace_ctx, "\tcoded_buf = %08x\n", p->coded_buf);
2979 va_TraceMsg(trace_ctx, "\tpic_parameter_set_id = %d\n", p->pic_parameter_set_id);
2980 va_TraceMsg(trace_ctx, "\tseq_parameter_set_id = %d\n", p->seq_parameter_set_id);
2981 va_TraceMsg(trace_ctx, "\tlast_picture = 0x%08x\n", p->last_picture);
2982 va_TraceMsg(trace_ctx, "\tframe_num = %d\n", p->frame_num);
2983 va_TraceMsg(trace_ctx, "\tpic_init_qp = %d\n", p->pic_init_qp);
2984 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l0_active_minus1 = %d\n", p->num_ref_idx_l0_active_minus1);
2985 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l1_active_minus1 = %d\n", p->num_ref_idx_l1_active_minus1);
2986 va_TraceMsg(trace_ctx, "\tchroma_qp_index_offset = %d\n", p->chroma_qp_index_offset);
2987 va_TraceMsg(trace_ctx, "\tsecond_chroma_qp_index_offset = %d\n", p->second_chroma_qp_index_offset);
2988 va_TraceMsg(trace_ctx, "\tpic_fields = 0x%03x\n", p->pic_fields.value);
2989 va_TraceMsg(trace_ctx, "\tidr_pic_flag = %d\n", p->pic_fields.bits.idr_pic_flag);
2990 va_TraceMsg(trace_ctx, "\treference_pic_flag = %d\n", p->pic_fields.bits.reference_pic_flag);
2991 va_TraceMsg(trace_ctx, "\tentropy_coding_mode_flag = %d\n", p->pic_fields.bits.entropy_coding_mode_flag);
2992 va_TraceMsg(trace_ctx, "\tweighted_pred_flag = %d\n", p->pic_fields.bits.weighted_pred_flag);
2993 va_TraceMsg(trace_ctx, "\tweighted_bipred_idc = %d\n", p->pic_fields.bits.weighted_bipred_idc);
2994 va_TraceMsg(trace_ctx, "\tconstrained_intra_pred_flag = %d\n", p->pic_fields.bits.constrained_intra_pred_flag);
2995 va_TraceMsg(trace_ctx, "\ttransform_8x8_mode_flag = %d\n", p->pic_fields.bits.transform_8x8_mode_flag);
2996 va_TraceMsg(trace_ctx, "\tdeblocking_filter_control_present_flag = %d\n", p->pic_fields.bits.deblocking_filter_control_present_flag);
2997 va_TraceMsg(trace_ctx, "\tredundant_pic_cnt_present_flag = %d\n", p->pic_fields.bits.redundant_pic_cnt_present_flag);
2998 va_TraceMsg(trace_ctx, "\tpic_order_present_flag = %d\n", p->pic_fields.bits.pic_order_present_flag);
2999 va_TraceMsg(trace_ctx, "\tpic_scaling_matrix_present_flag = %d\n", p->pic_fields.bits.pic_scaling_matrix_present_flag);
3001 va_TraceMsg(trace_ctx, NULL);
3006 static void va_TraceVAEncSliceParameterBuffer(
3008 VAContextID context,
3012 unsigned int num_elements,
3015 VAEncSliceParameterBuffer* p = (VAEncSliceParameterBuffer*)data;
3016 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3018 va_TraceMsg(trace_ctx, "\t--VAEncSliceParameterBuffer\n");
3020 va_TraceMsg(trace_ctx, "\tstart_row_number = %d\n", p->start_row_number);
3021 va_TraceMsg(trace_ctx, "\tslice_height = %d\n", p->slice_height);
3022 va_TraceMsg(trace_ctx, "\tslice_flags.is_intra = %d\n", p->slice_flags.bits.is_intra);
3023 va_TraceMsg(trace_ctx, "\tslice_flags.disable_deblocking_filter_idc = %d\n", p->slice_flags.bits.disable_deblocking_filter_idc);
3024 va_TraceMsg(trace_ctx, "\tslice_flags.uses_long_term_ref = %d\n", p->slice_flags.bits.uses_long_term_ref);
3025 va_TraceMsg(trace_ctx, "\tslice_flags.is_long_term_ref = %d\n", p->slice_flags.bits.is_long_term_ref);
3026 va_TraceMsg(trace_ctx, NULL);
3031 static void va_TraceVAEncSliceParameterBufferH264(
3033 VAContextID context,
3037 unsigned int num_elements,
3040 VAEncSliceParameterBufferH264* p = (VAEncSliceParameterBufferH264*)data;
3041 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3047 va_TraceMsg(trace_ctx, "\t--VAEncSliceParameterBufferH264\n");
3048 va_TraceMsg(trace_ctx, "\tmacroblock_address = %u\n", p->macroblock_address);
3049 va_TraceMsg(trace_ctx, "\tnum_macroblocks = %u\n", p->num_macroblocks);
3050 va_TraceMsg(trace_ctx, "\tmacroblock_info = %08x\n", p->macroblock_info);
3051 va_TraceMsg(trace_ctx, "\tslice_type = %d\n", p->slice_type);
3052 va_TraceMsg(trace_ctx, "\tpic_parameter_set_id = %d\n", p->pic_parameter_set_id);
3053 va_TraceMsg(trace_ctx, "\tidr_pic_id = %d\n", p->idr_pic_id);
3054 va_TraceMsg(trace_ctx, "\tpic_order_cnt_lsb = %d\n", p->pic_order_cnt_lsb);
3055 va_TraceMsg(trace_ctx, "\tdelta_pic_order_cnt_bottom = %d\n", p->delta_pic_order_cnt_bottom);
3056 va_TraceMsg(trace_ctx, "\tdelta_pic_order_cnt[0] = %d\n", p->delta_pic_order_cnt[0]);
3057 va_TraceMsg(trace_ctx, "\tdelta_pic_order_cnt[1] = %d\n", p->delta_pic_order_cnt[1]);
3058 va_TraceMsg(trace_ctx, "\tdirect_spatial_mv_pred_flag = %d\n", p->direct_spatial_mv_pred_flag);
3059 va_TraceMsg(trace_ctx, "\tnum_ref_idx_active_override_flag = %d\n", p->num_ref_idx_active_override_flag);
3060 va_TraceMsg(trace_ctx, "\tnum_ref_idx_l1_active_minus1 = %d\n", p->num_ref_idx_l1_active_minus1);
3061 va_TraceMsg(trace_ctx, "\tslice_beta_offset_div2 = %d\n", p->slice_beta_offset_div2);
3063 va_TraceMsg(trace_ctx, "\tRefPicList0 (TopFieldOrderCnt-BottomFieldOrderCnt-picture_id-frame_idx-flags):\n");
3067 for (i = 0; i < 32; i++) {
3068 if ((p->RefPicList0[i].picture_id != VA_INVALID_SURFACE) &&
3069 ((p->RefPicList0[i].flags & VA_PICTURE_H264_INVALID) == 0))
3070 va_TraceMsg(trace_ctx, "\t\t%08d-%08d-0x%08x-%08d-0x%08x\n",
3071 p->RefPicList0[i].TopFieldOrderCnt,
3072 p->RefPicList0[i].BottomFieldOrderCnt,
3073 p->RefPicList0[i].picture_id,
3074 p->RefPicList0[i].frame_idx,
3075 p->RefPicList0[i].flags);
3080 va_TraceMsg(trace_ctx, "\tRefPicList1 (TopFieldOrderCnt-BottomFieldOrderCnt-picture_id-frame_idx-flags):\n");
3081 for (i = 0; i < 32; i++) {
3082 if ((p->RefPicList1[i].picture_id != VA_INVALID_SURFACE) &&
3083 ((p->RefPicList1[i].flags & VA_PICTURE_H264_INVALID) == 0))
3084 va_TraceMsg(trace_ctx, "\t\t%08d-%08d-0x%08x-%08d-0x%08d\n",
3085 p->RefPicList1[i].TopFieldOrderCnt,
3086 p->RefPicList1[i].BottomFieldOrderCnt,
3087 p->RefPicList1[i].picture_id,
3088 p->RefPicList1[i].frame_idx,
3089 p->RefPicList1[i].flags
3095 va_TraceMsg(trace_ctx, "\tluma_log2_weight_denom = %d\n", p->luma_log2_weight_denom);
3096 va_TraceMsg(trace_ctx, "\tchroma_log2_weight_denom = %d\n", p->chroma_log2_weight_denom);
3097 va_TraceMsg(trace_ctx, "\tluma_weight_l0_flag = %d\n", p->luma_weight_l0_flag);
3098 if (p->luma_weight_l0_flag) {
3099 for (i = 0; (i <= p->num_ref_idx_l0_active_minus1) && (i<32); i++) {
3100 va_TraceMsg(trace_ctx, "\t\t%d\t%d\n",
3101 p->luma_weight_l0[i],
3102 p->luma_offset_l0[i]);
3106 va_TraceMsg(trace_ctx, "\tchroma_weight_l0_flag = %d\n", p->chroma_weight_l0_flag);
3107 if (p->chroma_weight_l0_flag) {
3108 for (i = 0; (i <= p->num_ref_idx_l0_active_minus1) && (i<32); i++) {
3109 va_TraceMsg(trace_ctx, "\t\t%d\t%d\t%d\t%d\n",
3110 p->chroma_weight_l0[i][0],
3111 p->chroma_offset_l0[i][0],
3112 p->chroma_weight_l0[i][1],
3113 p->chroma_offset_l0[i][1]);
3117 va_TraceMsg(trace_ctx, "\tluma_weight_l1_flag = %d\n", p->luma_weight_l1_flag);
3118 if (p->luma_weight_l1_flag) {
3119 for (i = 0; (i <= p->num_ref_idx_l1_active_minus1) && (i<32); i++) {
3120 va_TraceMsg(trace_ctx, "\t\t%d\t\t%d\n",
3121 p->luma_weight_l1[i],
3122 p->luma_offset_l1[i]);
3126 va_TraceMsg(trace_ctx, "\tchroma_weight_l1_flag = %d\n", p->chroma_weight_l1_flag);
3127 if (p->chroma_weight_l1_flag && p->num_ref_idx_l1_active_minus1 < 32) {
3128 for (i = 0; (i <= p->num_ref_idx_l1_active_minus1) && (i<32); i++) {
3129 va_TraceMsg(trace_ctx, "\t\t%d\t%d\t%d\t%d\n",
3130 p->chroma_weight_l1[i][0],
3131 p->chroma_offset_l1[i][0],
3132 p->chroma_weight_l1[i][1],
3133 p->chroma_offset_l1[i][1]);
3136 va_TraceMsg(trace_ctx, NULL);
3138 va_TraceMsg(trace_ctx, "\tcabac_init_idc = %d\n", p->cabac_init_idc);
3139 va_TraceMsg(trace_ctx, "\tslice_qp_delta = %d\n", p->slice_qp_delta);
3140 va_TraceMsg(trace_ctx, "\tdisable_deblocking_filter_idc = %d\n", p->disable_deblocking_filter_idc);
3141 va_TraceMsg(trace_ctx, "\tslice_alpha_c0_offset_div2 = %d\n", p->slice_alpha_c0_offset_div2);
3142 va_TraceMsg(trace_ctx, "\tslice_beta_offset_div2 = %d\n", p->slice_beta_offset_div2);
3143 va_TraceMsg(trace_ctx, NULL);
3149 static void va_TraceVAEncPackedHeaderParameterBufferType(
3151 VAContextID context,
3155 unsigned int num_elements,
3158 VAEncPackedHeaderParameterBuffer* p = (VAEncPackedHeaderParameterBuffer*)data;
3159 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3163 va_TraceMsg(trace_ctx, "\t--VAEncPackedHeaderParameterBuffer\n");
3164 va_TraceMsg(trace_ctx, "\ttype = 0x%08x\n", p->type);
3165 va_TraceMsg(trace_ctx, "\tbit_length = %d\n", p->bit_length);
3166 va_TraceMsg(trace_ctx, "\thas_emulation_bytes = %d\n", p->has_emulation_bytes);
3167 va_TraceMsg(trace_ctx, NULL);
3172 static void va_TraceVAEncMiscParameterBuffer(
3174 VAContextID context,
3178 unsigned int num_elements,
3181 VAEncMiscParameterBuffer* tmp = (VAEncMiscParameterBuffer*)data;
3182 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3184 switch (tmp->type) {
3185 case VAEncMiscParameterTypeFrameRate:
3187 VAEncMiscParameterFrameRate *p = (VAEncMiscParameterFrameRate *)tmp->data;
3188 va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterFrameRate\n");
3189 va_TraceMsg(trace_ctx, "\tframerate = %d\n", p->framerate);
3190 va_TraceMsg(trace_ctx, "\tframerate_flags.temporal_id = %d\n", p->framerate_flags.bits.temporal_id);
3193 case VAEncMiscParameterTypeRateControl:
3195 VAEncMiscParameterRateControl *p = (VAEncMiscParameterRateControl *)tmp->data;
3197 va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterRateControl\n");
3198 va_TraceMsg(trace_ctx, "\tbits_per_second = %d\n", p->bits_per_second);
3199 va_TraceMsg(trace_ctx, "\ttarget_percentage = %d\n", p->target_percentage);
3200 va_TraceMsg(trace_ctx, "\twindow_size = %d\n", p->window_size);
3201 va_TraceMsg(trace_ctx, "\tinitial_qp = %d\n", p->initial_qp);
3202 va_TraceMsg(trace_ctx, "\tmin_qp = %d\n", p->min_qp);
3203 va_TraceMsg(trace_ctx, "\tbasic_unit_size = %d\n", p->basic_unit_size);
3204 va_TraceMsg(trace_ctx, "\trc_flags.reset = %d \n", p->rc_flags.bits.reset);
3205 va_TraceMsg(trace_ctx, "\trc_flags.disable_frame_skip = %d\n", p->rc_flags.bits.disable_frame_skip);
3206 va_TraceMsg(trace_ctx, "\trc_flags.disable_bit_stuffing = %d\n", p->rc_flags.bits.disable_bit_stuffing);
3207 va_TraceMsg(trace_ctx, "\trc_flags.mb_rate_control = %d\n", p->rc_flags.bits.mb_rate_control);
3208 va_TraceMsg(trace_ctx, "\trc_flags.temporal_id = %d\n", p->rc_flags.bits.temporal_id);
3209 va_TraceMsg(trace_ctx, "\trc_flags.cfs_I_frames = %d\n", p->rc_flags.bits.cfs_I_frames);
3210 va_TraceMsg(trace_ctx, "\trc_flags.enable_parallel_brc = %d\n", p->rc_flags.bits.enable_parallel_brc);
3211 va_TraceMsg(trace_ctx, "\trc_flags.enable_dynamic_scaling = %d\n", p->rc_flags.bits.enable_dynamic_scaling);
3212 va_TraceMsg(trace_ctx, "\trc_flags.frame_tolerance_mode = %d\n", p->rc_flags.bits.frame_tolerance_mode);
3213 va_TraceMsg(trace_ctx, "\tICQ_quality_factor = %d\n", p->ICQ_quality_factor);
3214 va_TraceMsg(trace_ctx, "\tmax_qp = %d\n", p->max_qp);
3217 case VAEncMiscParameterTypeMaxSliceSize:
3219 VAEncMiscParameterMaxSliceSize *p = (VAEncMiscParameterMaxSliceSize *)tmp->data;
3221 va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterTypeMaxSliceSize\n");
3222 va_TraceMsg(trace_ctx, "\tmax_slice_size = %d\n", p->max_slice_size);
3225 case VAEncMiscParameterTypeAIR:
3227 VAEncMiscParameterAIR *p = (VAEncMiscParameterAIR *)tmp->data;
3229 va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterAIR\n");
3230 va_TraceMsg(trace_ctx, "\tair_num_mbs = %d\n", p->air_num_mbs);
3231 va_TraceMsg(trace_ctx, "\tair_threshold = %d\n", p->air_threshold);
3232 va_TraceMsg(trace_ctx, "\tair_auto = %d\n", p->air_auto);
3235 case VAEncMiscParameterTypeHRD:
3237 VAEncMiscParameterHRD *p = (VAEncMiscParameterHRD *)tmp->data;
3239 va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterHRD\n");
3240 va_TraceMsg(trace_ctx, "\tinitial_buffer_fullness = %d\n", p->initial_buffer_fullness);
3241 va_TraceMsg(trace_ctx, "\tbuffer_size = %d\n", p->buffer_size);
3244 case VAEncMiscParameterTypeMaxFrameSize:
3246 VAEncMiscParameterBufferMaxFrameSize *p = (VAEncMiscParameterBufferMaxFrameSize *)tmp->data;
3248 va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterTypeMaxFrameSize\n");
3249 va_TraceMsg(trace_ctx, "\tmax_frame_size = %d\n", p->max_frame_size);
3252 case VAEncMiscParameterTypeMultiPassFrameSize:
3255 VAEncMiscParameterBufferMultiPassFrameSize *p = (VAEncMiscParameterBufferMultiPassFrameSize *)tmp->data;
3257 va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterTypeMultiPassFrameSize\n");
3258 va_TraceMsg(trace_ctx, "\tmax_frame_size = %d\n", p->max_frame_size);
3259 va_TraceMsg(trace_ctx, "\tnum_passes = %d\n", p->num_passes);
3260 for(i = 0; i<p->num_passes; ++i)
3261 va_TraceMsg(trace_ctx, "\tdelta_qp[%d] = %d\n", i, p->delta_qp[i]);
3264 case VAEncMiscParameterTypeQualityLevel:
3266 VAEncMiscParameterBufferQualityLevel *p = (VAEncMiscParameterBufferQualityLevel *)tmp->data;
3268 va_TraceMsg(trace_ctx, "\t--VAEncMiscParameterBufferQualityLevel\n");
3269 va_TraceMsg(trace_ctx, "\tquality_level = %d\n", p->quality_level);
3273 va_TraceMsg(trace_ctx, "Unknown VAEncMiscParameterBuffer(type = %d):\n", tmp->type);
3274 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, data);
3277 va_TraceMsg(trace_ctx, NULL);
3283 static void va_TraceVAPictureParameterBufferVC1(
3285 VAContextID context,
3289 unsigned int num_elements,
3293 VAPictureParameterBufferVC1* p = (VAPictureParameterBufferVC1*)data;
3294 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3296 va_TraceMsg(trace_ctx, "\t--VAPictureParameterBufferVC1\n");
3298 va_TraceMsg(trace_ctx, "\tforward_reference_picture = 0x%08x\n", p->forward_reference_picture);
3299 va_TraceMsg(trace_ctx, "\tbackward_reference_picture = 0x%08x\n", p->backward_reference_picture);
3300 va_TraceMsg(trace_ctx, "\tinloop_decoded_picture = 0x%08x\n", p->inloop_decoded_picture);
3302 va_TraceMsg(trace_ctx, "\tpulldown = %d\n", p->sequence_fields.bits.pulldown);
3303 va_TraceMsg(trace_ctx, "\tinterlace = %d\n", p->sequence_fields.bits.interlace);
3304 va_TraceMsg(trace_ctx, "\ttfcntrflag = %d\n", p->sequence_fields.bits.tfcntrflag);
3305 va_TraceMsg(trace_ctx, "\tfinterpflag = %d\n", p->sequence_fields.bits.finterpflag);
3306 va_TraceMsg(trace_ctx, "\tpsf = %d\n", p->sequence_fields.bits.psf);
3307 va_TraceMsg(trace_ctx, "\tmultires = %d\n", p->sequence_fields.bits.multires);
3308 va_TraceMsg(trace_ctx, "\toverlap = %d\n", p->sequence_fields.bits.overlap);
3309 va_TraceMsg(trace_ctx, "\tsyncmarker = %d\n", p->sequence_fields.bits.syncmarker);
3310 va_TraceMsg(trace_ctx, "\trangered = %d\n", p->sequence_fields.bits.rangered);
3311 va_TraceMsg(trace_ctx, "\tmax_b_frames = %d\n", p->sequence_fields.bits.max_b_frames);
3312 va_TraceMsg(trace_ctx, "\tprofile = %d\n", p->sequence_fields.bits.profile);
3313 va_TraceMsg(trace_ctx, "\tcoded_width = %d\n", p->coded_width);
3314 va_TraceMsg(trace_ctx, "\tcoded_height = %d\n", p->coded_height);
3315 va_TraceMsg(trace_ctx, "\tclosed_entry = %d\n", p->entrypoint_fields.bits.closed_entry);
3316 va_TraceMsg(trace_ctx, "\tbroken_link = %d\n", p->entrypoint_fields.bits.broken_link);
3317 va_TraceMsg(trace_ctx, "\tclosed_entry = %d\n", p->entrypoint_fields.bits.closed_entry);
3318 va_TraceMsg(trace_ctx, "\tpanscan_flag = %d\n", p->entrypoint_fields.bits.panscan_flag);
3319 va_TraceMsg(trace_ctx, "\tloopfilter = %d\n", p->entrypoint_fields.bits.loopfilter);
3320 va_TraceMsg(trace_ctx, "\tconditional_overlap_flag = %d\n", p->conditional_overlap_flag);
3321 va_TraceMsg(trace_ctx, "\tfast_uvmc_flag = %d\n", p->fast_uvmc_flag);
3322 va_TraceMsg(trace_ctx, "\trange_mapping_luma_flag = %d\n", p->range_mapping_fields.bits.luma_flag);
3323 va_TraceMsg(trace_ctx, "\trange_mapping_luma = %d\n", p->range_mapping_fields.bits.luma);
3324 va_TraceMsg(trace_ctx, "\trange_mapping_chroma_flag = %d\n", p->range_mapping_fields.bits.chroma_flag);
3325 va_TraceMsg(trace_ctx, "\trange_mapping_chroma = %d\n", p->range_mapping_fields.bits.chroma);
3326 va_TraceMsg(trace_ctx, "\tb_picture_fraction = %d\n", p->b_picture_fraction);
3327 va_TraceMsg(trace_ctx, "\tcbp_table = %d\n", p->cbp_table);
3328 va_TraceMsg(trace_ctx, "\tmb_mode_table = %d\n", p->mb_mode_table);
3329 va_TraceMsg(trace_ctx, "\trange_reduction_frame = %d\n", p->range_reduction_frame);
3330 va_TraceMsg(trace_ctx, "\trounding_control = %d\n", p->rounding_control);
3331 va_TraceMsg(trace_ctx, "\tpost_processing = %d\n", p->post_processing);
3332 va_TraceMsg(trace_ctx, "\tpicture_resolution_index = %d\n", p->picture_resolution_index);
3333 va_TraceMsg(trace_ctx, "\tluma_scale = %d\n", p->luma_scale);
3334 va_TraceMsg(trace_ctx, "\tluma_shift = %d\n", p->luma_shift);
3335 va_TraceMsg(trace_ctx, "\tpicture_type = %d\n", p->picture_fields.bits.picture_type);
3336 va_TraceMsg(trace_ctx, "\tframe_coding_mode = %d\n", p->picture_fields.bits.frame_coding_mode);
3337 va_TraceMsg(trace_ctx, "\ttop_field_first = %d\n", p->picture_fields.bits.top_field_first);
3338 va_TraceMsg(trace_ctx, "\tis_first_field = %d\n", p->picture_fields.bits.is_first_field);
3339 va_TraceMsg(trace_ctx, "\tintensity_compensation = %d\n", p->picture_fields.bits.intensity_compensation);
3340 va_TraceMsg(trace_ctx, "\tmv_type_mb = %d\n", p->raw_coding.flags.mv_type_mb);
3341 va_TraceMsg(trace_ctx, "\tdirect_mb = %d\n", p->raw_coding.flags.direct_mb);
3342 va_TraceMsg(trace_ctx, "\tskip_mb = %d\n", p->raw_coding.flags.skip_mb);
3343 va_TraceMsg(trace_ctx, "\tfield_tx = %d\n", p->raw_coding.flags.field_tx);
3344 va_TraceMsg(trace_ctx, "\tforward_mb = %d\n", p->raw_coding.flags.forward_mb);
3345 va_TraceMsg(trace_ctx, "\tac_pred = %d\n", p->raw_coding.flags.ac_pred);
3346 va_TraceMsg(trace_ctx, "\toverflags = %d\n", p->raw_coding.flags.overflags);
3347 va_TraceMsg(trace_ctx, "\tbp_mv_type_mb = %d\n", p->bitplane_present.flags.bp_mv_type_mb);
3348 va_TraceMsg(trace_ctx, "\tbp_direct_mb = %d\n", p->bitplane_present.flags.bp_direct_mb);
3349 va_TraceMsg(trace_ctx, "\tbp_skip_mb = %d\n", p->bitplane_present.flags.bp_skip_mb);
3350 va_TraceMsg(trace_ctx, "\tbp_field_tx = %d\n", p->bitplane_present.flags.bp_field_tx);
3351 va_TraceMsg(trace_ctx, "\tbp_forward_mb = %d\n", p->bitplane_present.flags.bp_forward_mb);
3352 va_TraceMsg(trace_ctx, "\tbp_ac_pred = %d\n", p->bitplane_present.flags.bp_ac_pred);
3353 va_TraceMsg(trace_ctx, "\tbp_overflags = %d\n", p->bitplane_present.flags.bp_overflags);
3354 va_TraceMsg(trace_ctx, "\treference_distance_flag = %d\n", p->reference_fields.bits.reference_distance_flag);
3355 va_TraceMsg(trace_ctx, "\treference_distance = %d\n", p->reference_fields.bits.reference_distance);
3356 va_TraceMsg(trace_ctx, "\tnum_reference_pictures = %d\n", p->reference_fields.bits.num_reference_pictures);
3357 va_TraceMsg(trace_ctx, "\treference_field_pic_indicator = %d\n", p->reference_fields.bits.reference_field_pic_indicator);
3358 va_TraceMsg(trace_ctx, "\tmv_mode = %d\n", p->mv_fields.bits.mv_mode);
3359 va_TraceMsg(trace_ctx, "\tmv_mode2 = %d\n", p->mv_fields.bits.mv_mode2);
3360 va_TraceMsg(trace_ctx, "\tmv_table = %d\n", p->mv_fields.bits.mv_table);
3361 va_TraceMsg(trace_ctx, "\ttwo_mv_block_pattern_table = %d\n", p->mv_fields.bits.two_mv_block_pattern_table);
3362 va_TraceMsg(trace_ctx, "\tfour_mv_switch = %d\n", p->mv_fields.bits.four_mv_switch);
3363 va_TraceMsg(trace_ctx, "\tfour_mv_block_pattern_table = %d\n", p->mv_fields.bits.four_mv_block_pattern_table);
3364 va_TraceMsg(trace_ctx, "\textended_mv_flag = %d\n", p->mv_fields.bits.extended_mv_flag);
3365 va_TraceMsg(trace_ctx, "\textended_mv_range = %d\n", p->mv_fields.bits.extended_mv_range);
3366 va_TraceMsg(trace_ctx, "\textended_dmv_flag = %d\n", p->mv_fields.bits.extended_dmv_flag);
3367 va_TraceMsg(trace_ctx, "\textended_dmv_range = %d\n", p->mv_fields.bits.extended_dmv_range);
3368 va_TraceMsg(trace_ctx, "\tdquant = %d\n", p->pic_quantizer_fields.bits.dquant);
3369 va_TraceMsg(trace_ctx, "\tquantizer = %d\n", p->pic_quantizer_fields.bits.quantizer);
3370 va_TraceMsg(trace_ctx, "\thalf_qp = %d\n", p->pic_quantizer_fields.bits.half_qp);
3371 va_TraceMsg(trace_ctx, "\tpic_quantizer_scale = %d\n", p->pic_quantizer_fields.bits.pic_quantizer_scale);
3372 va_TraceMsg(trace_ctx, "\tpic_quantizer_type = %d\n", p->pic_quantizer_fields.bits.pic_quantizer_type);
3373 va_TraceMsg(trace_ctx, "\tdq_frame = %d\n", p->pic_quantizer_fields.bits.dq_frame);
3374 va_TraceMsg(trace_ctx, "\tdq_profile = %d\n", p->pic_quantizer_fields.bits.dq_profile);
3375 va_TraceMsg(trace_ctx, "\tdq_sb_edge = %d\n", p->pic_quantizer_fields.bits.dq_sb_edge);
3376 va_TraceMsg(trace_ctx, "\tdq_db_edge = %d\n", p->pic_quantizer_fields.bits.dq_db_edge);
3377 va_TraceMsg(trace_ctx, "\tdq_binary_level = %d\n", p->pic_quantizer_fields.bits.dq_binary_level);
3378 va_TraceMsg(trace_ctx, "\talt_pic_quantizer = %d\n", p->pic_quantizer_fields.bits.alt_pic_quantizer);
3379 va_TraceMsg(trace_ctx, "\tvariable_sized_transform_flag = %d\n", p->transform_fields.bits.variable_sized_transform_flag);
3380 va_TraceMsg(trace_ctx, "\tmb_level_transform_type_flag = %d\n", p->transform_fields.bits.mb_level_transform_type_flag);
3381 va_TraceMsg(trace_ctx, "\tframe_level_transform_type = %d\n", p->transform_fields.bits.frame_level_transform_type);
3382 va_TraceMsg(trace_ctx, "\ttransform_ac_codingset_idx1 = %d\n", p->transform_fields.bits.transform_ac_codingset_idx1);
3383 va_TraceMsg(trace_ctx, "\ttransform_ac_codingset_idx2 = %d\n", p->transform_fields.bits.transform_ac_codingset_idx2);
3384 va_TraceMsg(trace_ctx, "\tintra_transform_dc_table = %d\n", p->transform_fields.bits.intra_transform_dc_table);
3385 va_TraceMsg(trace_ctx, NULL);
3388 static void va_TraceVASliceParameterBufferVC1(
3390 VAContextID context,
3394 unsigned int num_elements,
3398 VASliceParameterBufferVC1 *p = (VASliceParameterBufferVC1*)data;
3399 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3401 trace_ctx->trace_slice_no++;
3402 trace_ctx->trace_slice_size = p->slice_data_size;
3404 va_TraceMsg(trace_ctx, "\t--VASliceParameterBufferVC1\n");
3405 va_TraceMsg(trace_ctx, "\tslice_data_size = %d\n", p->slice_data_size);
3406 va_TraceMsg(trace_ctx, "\tslice_data_offset = %d\n", p->slice_data_offset);
3407 va_TraceMsg(trace_ctx, "\tslice_data_flag = %d\n", p->slice_data_flag);
3408 va_TraceMsg(trace_ctx, "\tmacroblock_offset = %d\n", p->macroblock_offset);
3409 va_TraceMsg(trace_ctx, "\tslice_vertical_position = %d\n", p->slice_vertical_position);
3410 va_TraceMsg(trace_ctx, NULL);
3413 static void va_TraceVAPictureParameterBufferVP8(
3415 VAContextID context,
3419 unsigned int num_elements,
3423 VAPictureParameterBufferVP8 *p = (VAPictureParameterBufferVP8 *)data;
3424 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3427 va_TraceMsg(trace_ctx, "\t--VAPictureParameterBufferVP8\n");
3429 va_TraceMsg(trace_ctx, "\tframe_width = %d\n", p->frame_width);
3430 va_TraceMsg(trace_ctx, "\tframe_height = %d\n", p->frame_height);
3431 va_TraceMsg(trace_ctx, "\tlast_ref_frame = %x\n", p->last_ref_frame);
3432 va_TraceMsg(trace_ctx, "\tgolden_ref_frame = %x\n", p->golden_ref_frame);
3433 va_TraceMsg(trace_ctx, "\talt_ref_frame = %x\n", p->alt_ref_frame);
3434 va_TraceMsg(trace_ctx, "\tout_of_loop_frame = %x\n", p->out_of_loop_frame);
3436 va_TraceMsg(trace_ctx, "\tkey_frame = %d\n", p->pic_fields.bits.key_frame);
3437 va_TraceMsg(trace_ctx, "\tversion = %d\n", p->pic_fields.bits.version);
3438 va_TraceMsg(trace_ctx, "\tsegmentation_enabled = %d\n", p->pic_fields.bits.segmentation_enabled);
3439 va_TraceMsg(trace_ctx, "\tupdate_mb_segmentation_map = %d\n", p->pic_fields.bits.update_mb_segmentation_map);
3440 va_TraceMsg(trace_ctx, "\tupdate_segment_feature_data = %d\n", p->pic_fields.bits.update_segment_feature_data);
3441 va_TraceMsg(trace_ctx, "\tfilter_type = %d\n", p->pic_fields.bits.filter_type);
3442 va_TraceMsg(trace_ctx, "\tsharpness_level = %d\n", p->pic_fields.bits.sharpness_level);
3443 va_TraceMsg(trace_ctx, "\tloop_filter_adj_enable = %d\n", p->pic_fields.bits.loop_filter_adj_enable);
3444 va_TraceMsg(trace_ctx, "\tmode_ref_lf_delta_update = %d\n", p->pic_fields.bits.mode_ref_lf_delta_update);
3445 va_TraceMsg(trace_ctx, "\tsign_bias_golden = %d\n", p->pic_fields.bits.sign_bias_golden);
3446 va_TraceMsg(trace_ctx, "\tsign_bias_alternate = %d\n", p->pic_fields.bits.sign_bias_alternate);
3447 va_TraceMsg(trace_ctx, "\tmb_no_coeff_skip = %d\n", p->pic_fields.bits.mb_no_coeff_skip);
3448 va_TraceMsg(trace_ctx, "\tloop_filter_disable = %d\n", p->pic_fields.bits.loop_filter_disable);
3450 va_TraceMsg(trace_ctx, "\tmb_segment_tree_probs: 0x%2x, 0x%2x, 0x%2x\n",
3451 p->mb_segment_tree_probs[0], p->mb_segment_tree_probs[1], p->mb_segment_tree_probs[2]);
3453 va_TraceMsg(trace_ctx, "\tloop_filter_level: %d, %d, %d, %d\n",
3454 p->loop_filter_level[0], p->loop_filter_level[1], p->loop_filter_level[2], p->loop_filter_level[3]);
3456 va_TraceMsg(trace_ctx, "\tloop_filter_deltas_ref_frame: %d, %d, %d, %d\n",
3457 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]);
3459 va_TraceMsg(trace_ctx, "\tloop_filter_deltas_mode: %d, %d, %d, %d\n",
3460 p->loop_filter_deltas_mode[0], p->loop_filter_deltas_mode[1], p->loop_filter_deltas_mode[2], p->loop_filter_deltas_mode[3]);
3462 va_TraceMsg(trace_ctx, "\tprob_skip_false = %2x\n", p->prob_skip_false);
3463 va_TraceMsg(trace_ctx, "\tprob_intra = %2x\n", p->prob_intra);
3464 va_TraceMsg(trace_ctx, "\tprob_last = %2x\n", p->prob_last);
3465 va_TraceMsg(trace_ctx, "\tprob_gf = %2x\n", p->prob_gf);
3467 va_TraceMsg(trace_ctx, "\ty_mode_probs: 0x%2x, 0x%2x, 0x%2x, 0x%2x\n",
3468 p->y_mode_probs[0], p->y_mode_probs[1], p->y_mode_probs[2], p->y_mode_probs[3]);
3470 va_TraceMsg(trace_ctx, "\tuv_mode_probs: 0x%2x, 0x%2x, 0x%2x\n",
3471 p->uv_mode_probs[0], p->uv_mode_probs[1], p->uv_mode_probs[2]);
3473 va_TraceMsg(trace_ctx, "\tmv_probs[2][19]:\n");
3474 for(i = 0; i<2; ++i) {
3475 memset(tmp, 0, sizeof tmp);
3476 for (j=0; j<19; j++)
3477 sprintf(tmp + strlen(tmp), "%2x ", p->mv_probs[i][j]);
3478 va_TraceMsg(trace_ctx,"\t\t[%d] = %s\n", i, tmp);
3481 va_TraceMsg(trace_ctx, "\tbool_coder_ctx: range = %02x, value = %02x, count = %d\n",
3482 p->bool_coder_ctx.range, p->bool_coder_ctx.value, p->bool_coder_ctx.count);
3484 va_TraceMsg(trace_ctx, NULL);
3489 static void va_TraceVASliceParameterBufferVP8(
3491 VAContextID context,
3495 unsigned int num_elements,
3498 VASliceParameterBufferVP8 *p = (VASliceParameterBufferVP8 *)data;
3499 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3502 va_TraceMsg(trace_ctx, "\t--VASliceParameterBufferVP8\n");
3504 va_TraceMsg(trace_ctx, "\tslice_data_size = %d\n", p->slice_data_size);
3505 va_TraceMsg(trace_ctx, "\tslice_data_offset = %d\n", p->slice_data_offset);
3506 va_TraceMsg(trace_ctx, "\tslice_data_flag = %d\n", p->slice_data_flag);
3507 va_TraceMsg(trace_ctx, "\tmacroblock_offset = %d\n", p->macroblock_offset);
3508 va_TraceMsg(trace_ctx, "\tnum_of_partitions = %d\n", p->num_of_partitions);
3510 for(i = 0; i<9; ++i)
3511 va_TraceMsg(trace_ctx, "\tpartition_size[%d] = %d\n", i, p->partition_size[i]);
3513 va_TraceMsg(trace_ctx, NULL);
3518 static void va_TraceVAIQMatrixBufferVP8(
3520 VAContextID context,
3524 unsigned int num_elements,
3528 VAIQMatrixBufferVP8 *p = (VAIQMatrixBufferVP8 *)data;
3529 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3532 va_TraceMsg(trace_ctx, "\t--VAIQMatrixBufferVP8\n");
3534 va_TraceMsg(trace_ctx, "\tquantization_index[4][6]=\n");
3535 for (i = 0; i < 4; i++) {
3536 memset(tmp, 0, sizeof tmp);
3537 for (j = 0; j < 6; j++)
3538 sprintf(tmp + strlen(tmp), "%4x, ", p->quantization_index[i][j]);
3539 va_TraceMsg(trace_ctx,"\t\t[%d] = %s\n", i, tmp);
3542 va_TraceMsg(trace_ctx, NULL);
3546 static void va_TraceVAProbabilityBufferVP8(
3548 VAContextID context,
3552 unsigned int num_elements,
3556 VAProbabilityDataBufferVP8 *p = (VAProbabilityDataBufferVP8 *)data;
3557 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3560 va_TraceMsg(trace_ctx, "\t--VAProbabilityDataBufferVP8\n");
3562 for (i = 0; i < 4; i++)
3563 for (j = 0; j < 8; j++) {
3564 memset(tmp, 0, sizeof tmp);
3566 for (l=0; l<11; l++)
3567 sprintf(tmp + strlen(tmp), "%2x, ", p->dct_coeff_probs[i][j][k][l]);
3568 va_TraceMsg(trace_ctx,"\t\t[%d, %d] = %s\n", i, j, tmp);
3571 va_TraceMsg(trace_ctx, NULL);
3576 static void va_TraceVAEncSequenceParameterBufferVP8(
3578 VAContextID context,
3582 unsigned int num_elements,
3585 VAEncSequenceParameterBufferVP8 *p = (VAEncSequenceParameterBufferVP8 *)data;
3586 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3589 va_TraceMsg(trace_ctx, "\t--VAEncSequenceParameterBufferVP8\n");
3591 va_TraceMsg(trace_ctx, "\tbits_per_second = %d\n", p->bits_per_second);
3592 va_TraceMsg(trace_ctx, "\terror_resilient = %d\n", p->error_resilient);
3593 va_TraceMsg(trace_ctx, "\tframe_height = %d\n", p->frame_height);
3594 va_TraceMsg(trace_ctx, "\tframe_width = %d\n", p->frame_width);
3595 va_TraceMsg(trace_ctx, "\tframe_height_scale = %d\n", p->frame_height_scale);
3596 va_TraceMsg(trace_ctx, "\tframe_width_scale = %d\n", p->frame_width_scale);
3597 va_TraceMsg(trace_ctx, "\tkf_auto = %d\n", p->kf_auto);
3598 va_TraceMsg(trace_ctx, "\tkf_max_dist = %d\n", p->kf_max_dist);
3599 va_TraceMsg(trace_ctx, "\tkf_min_dist = %d\n", p->kf_min_dist);
3600 va_TraceMsg(trace_ctx, "\tintra_period = %d\n", p->intra_period);
3602 for(i = 0; i<4; ++i)
3603 va_TraceMsg(trace_ctx, "\treference_frames[%d] = 0x%08x\n", i, p->reference_frames[i]);
3605 va_TraceMsg(trace_ctx, NULL);
3610 static void va_TraceVAEncSequenceParameterBufferVP9(
3612 VAContextID context,
3616 unsigned int num_elements,
3619 VAEncSequenceParameterBufferVP9 *p = (VAEncSequenceParameterBufferVP9 *)data;
3620 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3622 va_TraceMsg(trace_ctx, "\t--VAEncSequenceParameterBufferVP9\n");
3624 va_TraceMsg(trace_ctx, "\tmax_frame_height = %d\n", p->max_frame_height);
3625 va_TraceMsg(trace_ctx, "\tmax_frame_width = %d\n", p->max_frame_width);
3626 va_TraceMsg(trace_ctx, "\tkf_auto = %d\n", p->kf_auto);
3627 va_TraceMsg(trace_ctx, "\tkf_min_dist = %d\n", p->kf_min_dist);
3628 va_TraceMsg(trace_ctx, "\tkf_max_dist = %d\n", p->kf_max_dist);
3629 va_TraceMsg(trace_ctx, "\tbits_per_second = %d\n", p->bits_per_second);
3630 va_TraceMsg(trace_ctx, "\tintra_period = %d\n", p->intra_period);
3632 va_TraceMsg(trace_ctx, NULL);
3637 static void va_TraceVAPictureParameterBufferVP9(
3639 VAContextID context,
3643 unsigned int num_elements,
3646 VADecPictureParameterBufferVP9 *p = (VADecPictureParameterBufferVP9 *)data;
3647 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3650 va_TraceMsg(trace_ctx, "\t--VAPictureParameterBufferVP9\n");
3652 va_TraceMsg(trace_ctx, "\tframe_width = %d\n", p->frame_width);
3653 va_TraceMsg(trace_ctx, "\tframe_height = %d\n", p->frame_height);
3654 va_TraceMsg(trace_ctx, "\treference_frames[8] =\n");
3655 for (i = 0; i < 8; i++) {
3656 va_TraceMsg(trace_ctx, "\t\t0x%x\n", p->reference_frames[i]);
3658 va_TraceMsg(trace_ctx, "\tsubsampling_x = %d\n", p->pic_fields.bits.subsampling_x);
3659 va_TraceMsg(trace_ctx, "\tsubsampling_y = %d\n", p->pic_fields.bits.subsampling_y);
3660 va_TraceMsg(trace_ctx, "\tframe_type = %d\n", p->pic_fields.bits.frame_type);
3661 va_TraceMsg(trace_ctx, "\tshow_frame = %d\n", p->pic_fields.bits.show_frame);
3662 va_TraceMsg(trace_ctx, "\terror_resilient_mode = %d\n", p->pic_fields.bits.error_resilient_mode);
3663 va_TraceMsg(trace_ctx, "\tintra_only = %d\n", p->pic_fields.bits.intra_only);
3664 va_TraceMsg(trace_ctx, "\tallow_high_precision_mv = %d\n", p->pic_fields.bits.allow_high_precision_mv);
3665 va_TraceMsg(trace_ctx, "\tmcomp_filter_type = %d\n", p->pic_fields.bits.mcomp_filter_type);
3666 va_TraceMsg(trace_ctx, "\tframe_parallel_decoding_mode = %d\n", p->pic_fields.bits.frame_parallel_decoding_mode);
3667 va_TraceMsg(trace_ctx, "\treset_frame_context = %d\n", p->pic_fields.bits.reset_frame_context);
3668 va_TraceMsg(trace_ctx, "\trefresh_frame_context = %d\n", p->pic_fields.bits.refresh_frame_context);
3669 va_TraceMsg(trace_ctx, "\tframe_context_idx = %d\n", p->pic_fields.bits.frame_context_idx);
3670 va_TraceMsg(trace_ctx, "\tsegmentation_enabled = %d\n", p->pic_fields.bits.segmentation_enabled);
3671 va_TraceMsg(trace_ctx, "\tsegmentation_temporal_update = %d\n", p->pic_fields.bits.segmentation_temporal_update);
3672 va_TraceMsg(trace_ctx, "\tsegmentation_update_map = %d\n", p->pic_fields.bits.segmentation_update_map);
3673 va_TraceMsg(trace_ctx, "\tlast_ref_frame = %d\n", p->pic_fields.bits.last_ref_frame);
3674 va_TraceMsg(trace_ctx, "\tlast_ref_frame_sign_bias = %d\n", p->pic_fields.bits.last_ref_frame_sign_bias);
3675 va_TraceMsg(trace_ctx, "\tgolden_ref_frame = %d\n", p->pic_fields.bits.golden_ref_frame);
3676 va_TraceMsg(trace_ctx, "\tgolden_ref_frame_sign_bias = %d\n", p->pic_fields.bits.golden_ref_frame_sign_bias);
3677 va_TraceMsg(trace_ctx, "\talt_ref_frame = %d\n", p->pic_fields.bits.alt_ref_frame);
3678 va_TraceMsg(trace_ctx, "\talt_ref_frame_sign_bias = %d\n", p->pic_fields.bits.alt_ref_frame_sign_bias);
3679 va_TraceMsg(trace_ctx, "\tlossless_flag = %d\n", p->pic_fields.bits.lossless_flag);
3681 va_TraceMsg(trace_ctx, "\tfilter_level = %d\n", p->filter_level);
3682 va_TraceMsg(trace_ctx, "\tsharpness_level = %d\n", p->sharpness_level);
3683 va_TraceMsg(trace_ctx, "\tlog2_tile_rows = %d\n", p->log2_tile_rows);
3684 va_TraceMsg(trace_ctx, "\tlog2_tile_columns = %d\n", p->log2_tile_columns);
3685 va_TraceMsg(trace_ctx, "\tframe_header_length_in_bytes = %d\n", p->frame_header_length_in_bytes);
3686 va_TraceMsg(trace_ctx, "\tfirst_partition_size = %d\n", p->first_partition_size);
3688 va_TraceMsg(trace_ctx, "\tmb_segment_tree_probs[7]: [0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x]\n",
3689 p->mb_segment_tree_probs[0], p->mb_segment_tree_probs[1],
3690 p->mb_segment_tree_probs[2], p->mb_segment_tree_probs[3],
3691 p->mb_segment_tree_probs[4], p->mb_segment_tree_probs[5],
3692 p->mb_segment_tree_probs[6]);
3694 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]);
3696 va_TraceMsg(trace_ctx, "\tprofile = %d\n", p->profile);
3698 va_TraceMsg(trace_ctx, NULL);
3703 static void va_TraceVAEncPictureParameterBufferVP8(
3705 VAContextID context,
3709 unsigned int num_elements,
3712 VAEncPictureParameterBufferVP8 *p = (VAEncPictureParameterBufferVP8 *)data;
3713 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3716 va_TraceMsg(trace_ctx, "\t--VAEncPictureParameterBufferVP8\n");
3717 va_TraceMsg(trace_ctx, "\treconstructed_frame = 0x%08x\n", p->reconstructed_frame);
3718 va_TraceMsg(trace_ctx, "\tref_last_frame = 0x%08x\n", p->ref_last_frame);
3719 va_TraceMsg(trace_ctx, "\tref_gf_frame = 0x%08x\n", p->ref_gf_frame);
3720 va_TraceMsg(trace_ctx, "\tref_arf_frame = 0x%08x\n", p->ref_arf_frame);
3721 va_TraceMsg(trace_ctx, "\tcoded_buf = 0x%08x\n", p->coded_buf);
3723 va_TraceMsg(trace_ctx, "\tref_flags.bits.force_kf = %d\n", p->ref_flags.bits.force_kf);
3724 va_TraceMsg(trace_ctx, "\tref_flags.bits.no_ref_last = %d\n", p->ref_flags.bits.no_ref_last);
3725 va_TraceMsg(trace_ctx, "\tref_flags.bits.no_ref_gf = %d\n", p->ref_flags.bits.no_ref_gf);
3726 va_TraceMsg(trace_ctx, "\tref_flags.bits.no_ref_arf = %d\n", p->ref_flags.bits.no_ref_arf);
3727 va_TraceMsg(trace_ctx, "\tref_flags.bits.no_ref_arf = 0x%08x\n", p->ref_flags.bits.reserved);
3729 va_TraceMsg(trace_ctx, "\tpic_flags.bits.frame_type = %d\n", p->pic_flags.bits.frame_type);
3730 va_TraceMsg(trace_ctx, "\tpic_flags.bits.version = %d\n", p->pic_flags.bits.version);
3731 va_TraceMsg(trace_ctx, "\tpic_flags.bits.show_frame = %d\n", p->pic_flags.bits.show_frame);
3732 va_TraceMsg(trace_ctx, "\tpic_flags.bits.color_space = %d\n", p->pic_flags.bits.color_space);
3733 va_TraceMsg(trace_ctx, "\tpic_flags.bits.recon_filter_type = %d\n", p->pic_flags.bits.recon_filter_type);
3734 va_TraceMsg(trace_ctx, "\tpic_flags.bits.loop_filter_type = %d\n", p->pic_flags.bits.loop_filter_type);
3735 va_TraceMsg(trace_ctx, "\tpic_flags.bits.auto_partitions = %d\n", p->pic_flags.bits.auto_partitions);
3736 va_TraceMsg(trace_ctx, "\tpic_flags.bits.num_token_partitions = %d\n", p->pic_flags.bits.num_token_partitions);
3737 va_TraceMsg(trace_ctx, "\tpic_flags.bits.clamping_type = %d\n", p->pic_flags.bits.clamping_type);
3738 va_TraceMsg(trace_ctx, "\tpic_flags.bits.segmentation_enabled = %d\n", p->pic_flags.bits.segmentation_enabled);
3739 va_TraceMsg(trace_ctx, "\tpic_flags.bits.update_mb_segmentation_map = %d\n", p->pic_flags.bits.update_mb_segmentation_map);
3740 va_TraceMsg(trace_ctx, "\tpic_flags.bits.update_segment_feature_data = %d\n", p->pic_flags.bits.update_segment_feature_data);
3741 va_TraceMsg(trace_ctx, "\tpic_flags.bits.loop_filter_adj_enable = %d\n", p->pic_flags.bits.loop_filter_adj_enable);
3742 va_TraceMsg(trace_ctx, "\tpic_flags.bits.refresh_entropy_probs = %d\n", p->pic_flags.bits.refresh_entropy_probs);
3743 va_TraceMsg(trace_ctx, "\tpic_flags.bits.refresh_golden_frame = %d\n", p->pic_flags.bits.refresh_golden_frame);
3744 va_TraceMsg(trace_ctx, "\tpic_flags.bits.refresh_alternate_frame = %d\n", p->pic_flags.bits.refresh_alternate_frame);
3745 va_TraceMsg(trace_ctx, "\tpic_flags.bits.refresh_last = %d\n", p->pic_flags.bits.refresh_last);
3746 va_TraceMsg(trace_ctx, "\tpic_flags.bits.copy_buffer_to_golden = %d\n", p->pic_flags.bits.copy_buffer_to_golden);
3747 va_TraceMsg(trace_ctx, "\tpic_flags.bits.copy_buffer_to_alternate = %d\n", p->pic_flags.bits.copy_buffer_to_alternate);
3749 va_TraceMsg(trace_ctx, "\tpic_flags.bits.sign_bias_golden = %d\n", p->pic_flags.bits.sign_bias_golden);
3750 va_TraceMsg(trace_ctx, "\tpic_flags.bits.sign_bias_alternate = %d\n", p->pic_flags.bits.sign_bias_alternate);
3751 va_TraceMsg(trace_ctx, "\tpic_flags.bits.mb_no_coeff_skip = %d\n", p->pic_flags.bits.mb_no_coeff_skip);
3752 va_TraceMsg(trace_ctx, "\tpic_flags.bits.forced_lf_adjustment = %d\n", p->pic_flags.bits.forced_lf_adjustment);
3753 va_TraceMsg(trace_ctx, "\tpic_flags.bits.reserved = %d\n", p->pic_flags.bits.reserved);
3756 va_TraceMsg(trace_ctx, "\tloop_filter_level[%d] = %d\n", i, p->loop_filter_level[i]);
3758 va_TraceMsg(trace_ctx, "\tref_lf_delta[%d] = %d\n", i, p->ref_lf_delta[i]);
3760 va_TraceMsg(trace_ctx, "\tmode_lf_delta[%d] = %d\n", i, p->mode_lf_delta[i]);
3762 va_TraceMsg(trace_ctx, "\tsharpness_level = %d\n", p->sharpness_level);
3763 va_TraceMsg(trace_ctx, "\tclamp_qindex_high = %d\n", p->clamp_qindex_high);
3764 va_TraceMsg(trace_ctx, "\tclamp_qindex_low = %d\n", p->clamp_qindex_low);
3766 va_TraceMsg(trace_ctx, NULL);
3771 static void va_TraceVAEncPictureParameterBufferVP9(
3773 VAContextID context,
3777 unsigned int num_elements,
3780 VAEncPictureParameterBufferVP9 *p = (VAEncPictureParameterBufferVP9 *)data;
3781 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3784 va_TraceMsg(trace_ctx, "\t--VAEncPictureParameterBufferVP9\n");
3785 va_TraceMsg(trace_ctx, "\tframe_width_src = %d\n", p->frame_width_src);
3786 va_TraceMsg(trace_ctx, "\tframe_height_src = %d\n", p->frame_height_src);
3787 va_TraceMsg(trace_ctx, "\tframe_width_dst = %d\n", p->frame_width_dst);
3788 va_TraceMsg(trace_ctx, "\tframe_height_dst = %d\n", p->frame_height_dst);
3789 va_TraceMsg(trace_ctx, "\treconstructed_frame = 0x%08x\n", p->reconstructed_frame);
3792 va_TraceMsg(trace_ctx, "\treference_frames[%d] = 0x%08x\n", i, p->reference_frames[i]);
3794 va_TraceMsg(trace_ctx, "\tcoded_buf = 0x%x\n", p->coded_buf);
3796 va_TraceMsg(trace_ctx, "\tref_flags.bits.force_kf = %d\n", p->ref_flags.bits.force_kf);
3797 va_TraceMsg(trace_ctx, "\tref_flags.bits.ref_frame_ctrl_l0 = %d\n", p->ref_flags.bits.ref_frame_ctrl_l0);
3798 va_TraceMsg(trace_ctx, "\tref_flags.bits.ref_frame_ctrl_l1 = %d\n", p->ref_flags.bits.ref_frame_ctrl_l1);
3799 va_TraceMsg(trace_ctx, "\tref_flags.bits.ref_last_idx = %d\n", p->ref_flags.bits.ref_last_idx);
3800 va_TraceMsg(trace_ctx, "\tref_flags.bits.ref_last_sign_bias = %d\n", p->ref_flags.bits.ref_last_sign_bias);
3801 va_TraceMsg(trace_ctx, "\tref_flags.bits.ref_gf_idx = %d\n", p->ref_flags.bits.ref_gf_idx);
3802 va_TraceMsg(trace_ctx, "\tref_flags.bits.ref_gf_sign_bias = %d\n", p->ref_flags.bits.ref_gf_sign_bias);
3803 va_TraceMsg(trace_ctx, "\tref_flags.bits.ref_arf_idx = %d\n", p->ref_flags.bits.ref_arf_idx);
3804 va_TraceMsg(trace_ctx, "\tref_flags.bits.ref_arf_sign_bias = %d\n", p->ref_flags.bits.ref_arf_sign_bias);
3805 va_TraceMsg(trace_ctx, "\tref_flags.bits.temporal_id = %d\n", p->ref_flags.bits.temporal_id);
3806 va_TraceMsg(trace_ctx, "\tref_flags.bits.reserved = %d\n", p->ref_flags.bits.reserved);
3808 va_TraceMsg(trace_ctx, "\tpic_flags.bits.frame_type = %d\n", p->pic_flags.bits.frame_type);
3809 va_TraceMsg(trace_ctx, "\tpic_flags.bits.show_frame = %d\n", p->pic_flags.bits.show_frame);
3810 va_TraceMsg(trace_ctx, "\tpic_flags.bits.error_resilient_mode = %d\n", p->pic_flags.bits.error_resilient_mode);
3811 va_TraceMsg(trace_ctx, "\tpic_flags.bits.intra_only = %d\n", p->pic_flags.bits.intra_only);
3812 va_TraceMsg(trace_ctx, "\tpic_flags.bits.allow_high_precision_mv = %d\n", p->pic_flags.bits.allow_high_precision_mv);
3814 va_TraceMsg(trace_ctx, "\tpic_flags.bits.mcomp_filter_type = %d\n", p->pic_flags.bits.mcomp_filter_type);
3815 va_TraceMsg(trace_ctx, "\tpic_flags.bits.frame_parallel_decoding_mode = %d\n", p->pic_flags.bits.frame_parallel_decoding_mode);
3816 va_TraceMsg(trace_ctx, "\tpic_flags.bits.reset_frame_context = %d\n", p->pic_flags.bits.reset_frame_context);
3817 va_TraceMsg(trace_ctx, "\tpic_flags.bits.refresh_frame_context = %d\n", p->pic_flags.bits.refresh_frame_context);
3818 va_TraceMsg(trace_ctx, "\tpic_flags.bits.frame_context_idx = %d\n", p->pic_flags.bits.frame_context_idx);
3819 va_TraceMsg(trace_ctx, "\tpic_flags.bits.segmentation_enabled = %d\n", p->pic_flags.bits.segmentation_enabled);
3820 va_TraceMsg(trace_ctx, "\tpic_flags.bits.segmentation_temporal_update = %d\n", p->pic_flags.bits.segmentation_temporal_update);
3821 va_TraceMsg(trace_ctx, "\tpic_flags.bits.segmentation_update_map = %d\n", p->pic_flags.bits.segmentation_update_map);
3822 va_TraceMsg(trace_ctx, "\tpic_flags.bits.lossless_mode = %d\n", p->pic_flags.bits.lossless_mode);
3823 va_TraceMsg(trace_ctx, "\tpic_flags.bits.comp_prediction_mode = %d\n", p->pic_flags.bits.comp_prediction_mode);
3824 va_TraceMsg(trace_ctx, "\tpic_flags.bits.auto_segmentation = %d\n", p->pic_flags.bits.auto_segmentation);
3825 va_TraceMsg(trace_ctx, "\tpic_flags.bits.super_frame_flag = %d\n", p->pic_flags.bits.super_frame_flag);
3826 va_TraceMsg(trace_ctx, "\tpic_flags.bits.reserved = %d\n", p->pic_flags.bits.reserved);
3828 va_TraceMsg(trace_ctx, "\trefresh_frame_flags = %d\n", p->refresh_frame_flags);
3829 va_TraceMsg(trace_ctx, "\tluma_ac_qindex = %d\n", p->luma_ac_qindex);
3830 va_TraceMsg(trace_ctx, "\tluma_dc_qindex_delta = %d\n", p->luma_dc_qindex_delta);
3831 va_TraceMsg(trace_ctx, "\tchroma_ac_qindex_delta = %d\n", p->chroma_ac_qindex_delta);
3832 va_TraceMsg(trace_ctx, "\tchroma_dc_qindex_delta = %d\n", p->chroma_dc_qindex_delta);
3833 va_TraceMsg(trace_ctx, "\tfilter_level = %d\n", p->filter_level);
3834 va_TraceMsg(trace_ctx, "\tsharpness_level = %d\n", p->sharpness_level);
3837 va_TraceMsg(trace_ctx, "\tref_lf_delta[%d] = %d\n", i, p->ref_lf_delta[i]);
3839 va_TraceMsg(trace_ctx, "\tmode_lf_delta[%d] = %d\n", i, p->mode_lf_delta[i]);
3842 va_TraceMsg(trace_ctx, "\tbit_offset_ref_lf_delta = %d\n", p->bit_offset_ref_lf_delta);
3843 va_TraceMsg(trace_ctx, "\tbit_offset_mode_lf_delta = %d\n", p->bit_offset_mode_lf_delta);
3844 va_TraceMsg(trace_ctx, "\tbit_offset_lf_level = %d\n", p->bit_offset_lf_level);
3845 va_TraceMsg(trace_ctx, "\tbit_offset_qindex = %d\n", p->bit_offset_qindex);
3846 va_TraceMsg(trace_ctx, "\tbit_offset_first_partition_size = %d\n", p->bit_offset_first_partition_size);
3847 va_TraceMsg(trace_ctx, "\tbit_offset_segmentation = %d\n", p->bit_offset_segmentation);
3848 va_TraceMsg(trace_ctx, "\tbit_size_segmentation = %d\n", p->bit_size_segmentation);
3849 va_TraceMsg(trace_ctx, "\tlog2_tile_rows = %d\n", p->log2_tile_rows);
3850 va_TraceMsg(trace_ctx, "\tlog2_tile_columns = %d\n", p->log2_tile_columns);
3851 va_TraceMsg(trace_ctx, "\tskip_frame_flag = %d\n", p->skip_frame_flag);
3852 va_TraceMsg(trace_ctx, "\tnumber_skip_frames = %d\n", p->number_skip_frames);
3853 va_TraceMsg(trace_ctx, "\tskip_frames_size = %d\n", p->skip_frames_size);
3855 va_TraceMsg(trace_ctx, NULL);
3860 static void va_TraceVASliceParameterBufferVP9(
3862 VAContextID context,
3866 unsigned int num_elements,
3870 VASliceParameterBufferVP9 *p = (VASliceParameterBufferVP9 *)data;
3871 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3874 va_TraceMsg(trace_ctx, "\t--VASliceParameterBufferVP9\n");
3876 va_TraceMsg(trace_ctx, "\tslice_data_size = %d\n", p->slice_data_size);
3877 va_TraceMsg(trace_ctx, "\tslice_data_offset = %d\n", p->slice_data_offset);
3878 va_TraceMsg(trace_ctx, "\tslice_data_flag = %d\n", p->slice_data_flag);
3880 for (i = 0; i < 8; i++) {
3881 VASegmentParameterVP9* seg = p->seg_param + i;
3882 va_TraceMsg(trace_ctx, "\tseg_param[%d] = \n", i);
3883 va_TraceMsg(trace_ctx, "\t\tsegment_reference_enabled = %d\n", seg->segment_flags.fields.segment_reference_enabled);
3884 va_TraceMsg(trace_ctx, "\t\tsegment_reference = %d\n", seg->segment_flags.fields.segment_reference);
3885 va_TraceMsg(trace_ctx, "\t\tsegment_reference_skipped = %d\n", seg->segment_flags.fields.segment_reference_skipped);
3886 va_TraceMsg(trace_ctx, "\t\tfilter_level[4][2] = \n");
3887 for (j = 0; j < 4; j++) {
3888 va_TraceMsg(trace_ctx, "\t\t\t[%3d, %3d]\n", seg->filter_level[j][0], seg->filter_level[j][1]);
3890 va_TraceMsg(trace_ctx, "\t\tluma_ac_quant_scale = %d\n", seg->luma_ac_quant_scale);
3891 va_TraceMsg(trace_ctx, "\t\tluma_dc_quant_scale = %d\n", seg->luma_dc_quant_scale);
3892 va_TraceMsg(trace_ctx, "\t\tchroma_ac_quant_scale = %d\n", seg->chroma_ac_quant_scale);
3893 va_TraceMsg(trace_ctx, "\t\tchroma_dc_quant_scale = %d\n", seg->chroma_dc_quant_scale);
3896 va_TraceMsg(trace_ctx, NULL);
3901 void va_TraceBeginPicture(
3903 VAContextID context,
3904 VASurfaceID render_target
3907 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3909 TRACE_FUNCNAME(idx);
3911 va_TraceMsg(trace_ctx, "\tcontext = 0x%08x\n", context);
3912 va_TraceMsg(trace_ctx, "\trender_targets = 0x%08x\n", render_target);
3913 va_TraceMsg(trace_ctx, "\tframe_count = #%d\n", trace_ctx->trace_frame_no);
3914 va_TraceMsg(trace_ctx, NULL);
3916 trace_ctx->trace_rendertarget = render_target; /* for surface data dump after vaEndPicture */
3918 trace_ctx->trace_frame_no++;
3919 trace_ctx->trace_slice_no = 0;
3922 static void va_TraceMPEG2Buf(
3924 VAContextID context,
3928 unsigned int num_elements,
3933 case VAPictureParameterBufferType:
3934 va_TraceVAPictureParameterBufferMPEG2(dpy, context, buffer, type, size, num_elements, pbuf);
3936 case VAIQMatrixBufferType:
3937 va_TraceVAIQMatrixBufferMPEG2(dpy, context, buffer, type, size, num_elements, pbuf);
3939 case VABitPlaneBufferType:
3940 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
3942 case VASliceGroupMapBufferType:
3943 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
3945 case VASliceParameterBufferType:
3946 va_TraceVASliceParameterBufferMPEG2(dpy, context, buffer, type, size, num_elements, pbuf);
3948 case VASliceDataBufferType:
3949 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
3951 case VAMacroblockParameterBufferType:
3952 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
3954 case VAResidualDataBufferType:
3955 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
3957 case VADeblockingParameterBufferType:
3958 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
3960 case VAImageBufferType:
3962 case VAProtectedSliceDataBufferType:
3963 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
3965 case VAEncCodedBufferType:
3967 case VAEncSequenceParameterBufferType:
3969 case VAEncPictureParameterBufferType:
3971 case VAEncSliceParameterBufferType:
3978 static void va_TraceVAEncSequenceParameterBufferH263(
3980 VAContextID context,
3984 unsigned int num_elements,
3987 VAEncSequenceParameterBufferH263 *p = (VAEncSequenceParameterBufferH263 *)data;
3988 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
3990 va_TraceMsg(trace_ctx, "\t--VAEncSequenceParameterBufferH263\n");
3992 va_TraceMsg(trace_ctx, "\tintra_period = %d\n", p->intra_period);
3993 va_TraceMsg(trace_ctx, "\tbits_per_second = %d\n", p->bits_per_second);
3994 va_TraceMsg(trace_ctx, "\tframe_rate = %d\n", p->frame_rate);
3995 va_TraceMsg(trace_ctx, "\tinitial_qp = %d\n", p->initial_qp);
3996 va_TraceMsg(trace_ctx, "\tmin_qp = %d\n", p->min_qp);
3997 va_TraceMsg(trace_ctx, NULL);
4003 static void va_TraceVAEncPictureParameterBufferH263(
4005 VAContextID context,
4009 unsigned int num_elements,
4012 VAEncPictureParameterBufferH263 *p = (VAEncPictureParameterBufferH263 *)data;
4013 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4015 va_TraceMsg(trace_ctx, "\t--VAEncPictureParameterBufferH263\n");
4016 va_TraceMsg(trace_ctx, "\treference_picture = 0x%08x\n", p->reference_picture);
4017 va_TraceMsg(trace_ctx, "\treconstructed_picture = 0x%08x\n", p->reconstructed_picture);
4018 va_TraceMsg(trace_ctx, "\tcoded_buf = %08x\n", p->coded_buf);
4019 va_TraceMsg(trace_ctx, "\tpicture_width = %d\n", p->picture_width);
4020 va_TraceMsg(trace_ctx, "\tpicture_height = %d\n", p->picture_height);
4021 va_TraceMsg(trace_ctx, "\tpicture_type = 0x%08x\n", p->picture_type);
4022 va_TraceMsg(trace_ctx, NULL);
4027 static void va_TraceVAEncPictureParameterBufferJPEG(
4029 VAContextID context,
4033 unsigned int num_elements,
4036 VAEncPictureParameterBufferJPEG *p = (VAEncPictureParameterBufferJPEG *)data;
4039 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4041 va_TraceMsg(trace_ctx, "\t--VAEncPictureParameterBufferJPEG\n");
4042 va_TraceMsg(trace_ctx, "\treconstructed_picture = 0x%08x\n", p->reconstructed_picture);
4043 va_TraceMsg(trace_ctx, "\tcoded_buf = %08x\n", p->coded_buf);
4044 va_TraceMsg(trace_ctx, "\tpicture_width = %d\n", p->picture_width);
4045 va_TraceMsg(trace_ctx, "\tpicture_height = %d\n", p->picture_height);
4046 va_TraceMsg(trace_ctx, "\tpic_flags.bits.profile = %d\n", p->pic_flags.bits.profile);
4047 va_TraceMsg(trace_ctx, "\tpic_flags.bits.progressive = %d\n", p->pic_flags.bits.profile);
4048 va_TraceMsg(trace_ctx, "\tpic_flags.bits.huffman = %d\n", p->pic_flags.bits.huffman);
4049 va_TraceMsg(trace_ctx, "\tpic_flags.bits.interleaved = %d\n", p->pic_flags.bits.interleaved);
4050 va_TraceMsg(trace_ctx, "\tpic_flags.bits.differential = %d\n", p->pic_flags.bits.differential);
4051 va_TraceMsg(trace_ctx, "\tsample_bit_depth = %d\n", p->sample_bit_depth);
4052 va_TraceMsg(trace_ctx, "\tnum_scan = %d\n", p->num_scan);
4053 va_TraceMsg(trace_ctx, "\tnum_components = %d\n", p->num_components);
4054 for (i=0; i<p->num_components; i++)
4055 va_TraceMsg(trace_ctx, "\tcomponent_id[%d] = %d\n", i, p->component_id[i]);
4058 va_TraceMsg(trace_ctx, "\tquality = %d\n", p->quality);
4060 va_TraceMsg(trace_ctx, "\tquantiser_table_selector[] = %d %d %d %d\n",
4061 p->quantiser_table_selector[0],
4062 p->quantiser_table_selector[1],
4063 p->quantiser_table_selector[2],
4064 p->quantiser_table_selector[3]);
4066 va_TraceMsg(trace_ctx, NULL);
4071 static void va_TraceVAEncQMatrixBufferJPEG(
4073 VAContextID context,
4077 unsigned int num_elements,
4080 VAQMatrixBufferJPEG *p = (VAQMatrixBufferJPEG *)data;
4081 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4083 va_TraceMsg(trace_ctx, "\t--VAQMatrixBufferJPEG\n");
4084 va_TraceMsg(trace_ctx, "\tload_lum_quantiser_matrix = %d", p->load_lum_quantiser_matrix);
4085 if (p->load_lum_quantiser_matrix) {
4087 for (i = 0; i < 64; i++) {
4089 va_TraceMsg(trace_ctx, "\n\t");
4090 va_TraceMsg(trace_ctx, "\t0x%02x", p->lum_quantiser_matrix[i]);
4092 va_TraceMsg(trace_ctx, "\n");
4094 va_TraceMsg(trace_ctx, "\tload_chroma_quantiser_matrix = %08x\n", p->load_chroma_quantiser_matrix);
4095 if (p->load_chroma_quantiser_matrix) {
4097 for (i = 0; i < 64; i++) {
4099 va_TraceMsg(trace_ctx, "\n\t");
4100 va_TraceMsg(trace_ctx, "\t0x%02x", p->chroma_quantiser_matrix[i]);
4102 va_TraceMsg(trace_ctx, "\n");
4105 va_TraceMsg(trace_ctx, NULL);
4111 static void va_TraceVAEncSliceParameterBufferJPEG(
4113 VAContextID context,
4117 unsigned int num_elements,
4120 VAEncSliceParameterBufferJPEG *p = (VAEncSliceParameterBufferJPEG *)data;
4123 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4125 va_TraceMsg(trace_ctx, "\t--VAEncSliceParameterBufferJPEG\n");
4126 va_TraceMsg(trace_ctx, "\trestart_interval = 0x%04x\n", p->restart_interval);
4127 va_TraceMsg(trace_ctx, "\tnum_components = 0x%08x\n", p->num_components);
4128 for (i=0; i<4; i++) {
4129 va_TraceMsg(trace_ctx, "\tcomponents[%i] =\n ");
4130 va_TraceMsg(trace_ctx, "\t\tcomponent_selector = %d\n", p->components[i].component_selector);
4131 va_TraceMsg(trace_ctx, "\t\tdc_table_selector = %d\n", p->components[i].dc_table_selector);
4132 va_TraceMsg(trace_ctx, "\t\tac_table_selector = %d\n", p->components[i].ac_table_selector);
4135 va_TraceMsg(trace_ctx, NULL);
4141 static void va_TraceH263Buf(
4143 VAContextID context,
4147 unsigned int num_elements,
4152 case VAPictureParameterBufferType:/* print MPEG4 buffer */
4153 va_TraceVAPictureParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf);
4155 case VAIQMatrixBufferType:/* print MPEG4 buffer */
4156 va_TraceVAIQMatrixBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf);
4158 case VABitPlaneBufferType:/* print MPEG4 buffer */
4159 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4161 case VASliceGroupMapBufferType:
4163 case VASliceParameterBufferType:/* print MPEG4 buffer */
4164 va_TraceVASliceParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf);
4166 case VASliceDataBufferType:
4167 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4169 case VAMacroblockParameterBufferType:
4170 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4172 case VAResidualDataBufferType:
4173 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4175 case VADeblockingParameterBufferType:
4176 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4178 case VAImageBufferType:
4180 case VAProtectedSliceDataBufferType:
4181 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4183 case VAEncCodedBufferType:
4185 case VAEncSequenceParameterBufferType:
4186 va_TraceVAEncSequenceParameterBufferH263(dpy, context, buffer, type, size, num_elements, pbuf);
4188 case VAEncPictureParameterBufferType:
4189 va_TraceVAEncPictureParameterBufferH263(dpy, context, buffer, type, size, num_elements, pbuf);
4191 case VAEncSliceParameterBufferType:
4192 va_TraceVAEncSliceParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
4194 case VAEncPackedHeaderParameterBufferType:
4195 va_TraceVAEncPackedHeaderParameterBufferType(dpy, context, buffer, type, size, num_elements, pbuf);
4198 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4204 static void va_TraceJPEGBuf(
4206 VAContextID context,
4210 unsigned int num_elements,
4215 case VABitPlaneBufferType:
4216 case VASliceGroupMapBufferType:
4217 case VASliceDataBufferType:
4218 case VAMacroblockParameterBufferType:
4219 case VAResidualDataBufferType:
4220 case VADeblockingParameterBufferType:
4221 case VAImageBufferType:
4222 case VAProtectedSliceDataBufferType:
4223 case VAEncCodedBufferType:
4224 case VAEncSequenceParameterBufferType:
4225 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4227 case VAEncSliceParameterBufferType:
4228 va_TraceVAEncSliceParameterBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf);
4230 case VAPictureParameterBufferType:
4231 va_TraceVAPictureParameterBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf);
4233 case VAIQMatrixBufferType:
4234 va_TraceVAIQMatrixBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf);
4236 case VASliceParameterBufferType:
4237 va_TraceVASliceParameterBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf);
4239 case VAHuffmanTableBufferType:
4240 va_TraceVAHuffmanTableBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf);
4242 case VAEncPictureParameterBufferType:
4243 va_TraceVAEncPictureParameterBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf);
4245 case VAQMatrixBufferType:
4246 va_TraceVAEncQMatrixBufferJPEG(dpy, context, buffer, type, size, num_elements, pbuf);
4249 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4254 static void va_TraceMPEG4Buf(
4256 VAContextID context,
4260 unsigned int num_elements,
4265 case VAPictureParameterBufferType:
4266 va_TraceVAPictureParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf);
4268 case VAIQMatrixBufferType:
4269 va_TraceVAIQMatrixBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf);
4271 case VABitPlaneBufferType:
4272 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4274 case VASliceGroupMapBufferType:
4276 case VASliceParameterBufferType:
4277 va_TraceVASliceParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf);
4279 case VASliceDataBufferType:
4280 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4282 case VAMacroblockParameterBufferType:
4283 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4285 case VAResidualDataBufferType:
4286 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4288 case VADeblockingParameterBufferType:
4289 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4291 case VAImageBufferType:
4293 case VAProtectedSliceDataBufferType:
4294 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4296 case VAEncCodedBufferType:
4298 case VAEncSequenceParameterBufferType:
4299 va_TraceVAEncSequenceParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf);
4301 case VAEncPictureParameterBufferType:
4302 va_TraceVAEncPictureParameterBufferMPEG4(dpy, context, buffer, type, size, num_elements, pbuf);
4304 case VAEncSliceParameterBufferType:
4305 va_TraceVAEncSliceParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
4308 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4313 static void va_TraceHEVCBuf(
4315 VAContextID context,
4319 unsigned int num_elements,
4323 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4326 case VAPictureParameterBufferType:
4327 va_TraceVAPictureParameterBufferHEVC(dpy, context, buffer, type, size, num_elements, pbuf);
4329 case VASliceParameterBufferType:
4330 va_TraceVASliceParameterBufferHEVC(dpy, context, buffer, type, size, num_elements, pbuf);
4332 case VAIQMatrixBufferType:
4333 va_TraceVAIQMatrixBufferHEVC(dpy, context, buffer, type, size, num_elements, pbuf);
4335 case VAEncSequenceParameterBufferType:
4336 va_TraceVAEncSequenceParameterBufferHEVC(dpy, context, buffer, type, size, num_elements, pbuf);
4338 case VAEncPictureParameterBufferType:
4339 va_TraceVAEncPictureParameterBufferHEVC(dpy, context, buffer, type, size, num_elements, pbuf);
4341 case VAEncSliceParameterBufferType:
4342 va_TraceVAEncSliceParameterBufferHEVC(dpy, context, buffer, type, size, num_elements, pbuf);
4344 case VAEncMiscParameterBufferType:
4345 va_TraceVAEncMiscParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
4348 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4353 static void va_TraceH264Buf(
4355 VAContextID context,
4359 unsigned int num_elements,
4363 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4366 case VAPictureParameterBufferType:
4367 va_TraceVAPictureParameterBufferH264(dpy, context, buffer, type, size, num_elements, pbuf);
4369 case VAIQMatrixBufferType:
4370 va_TraceVAIQMatrixBufferH264(dpy, context, buffer, type, size, num_elements, pbuf);
4372 case VABitPlaneBufferType:
4373 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4375 case VASliceGroupMapBufferType:
4376 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4378 case VASliceParameterBufferType:
4379 va_TraceVASliceParameterBufferH264(dpy, context, buffer, type, size, num_elements, pbuf);
4381 case VASliceDataBufferType:
4382 va_TraceVABuffers(dpy, context, buffer, type, trace_ctx->trace_slice_size, num_elements, pbuf);
4384 case VAMacroblockParameterBufferType:
4385 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4387 case VAResidualDataBufferType:
4388 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4390 case VADeblockingParameterBufferType:
4391 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4393 case VAImageBufferType:
4395 case VAProtectedSliceDataBufferType:
4396 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4398 case VAEncCodedBufferType:
4400 case VAEncSequenceParameterBufferType:
4401 va_TraceVAEncSequenceParameterBufferH264(dpy, context, buffer, type, size, num_elements, pbuf);
4403 case VAEncPictureParameterBufferType:
4404 va_TraceVAEncPictureParameterBufferH264(dpy, context, buffer, type, size, num_elements, pbuf);
4406 case VAEncSliceParameterBufferType:
4407 if (size == sizeof(VAEncSliceParameterBuffer))
4408 va_TraceVAEncSliceParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
4410 va_TraceVAEncSliceParameterBufferH264(dpy, context, buffer, type, size, num_elements, pbuf);
4412 case VAEncPackedHeaderParameterBufferType:
4413 va_TraceVAEncPackedHeaderParameterBufferType(dpy, context, buffer, type, size, num_elements, pbuf);
4416 case VAEncMiscParameterBufferType:
4417 va_TraceVAEncMiscParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
4420 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4425 static void va_TraceVP8Buf(
4427 VAContextID context,
4431 unsigned int num_elements,
4435 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4438 case VAPictureParameterBufferType:
4439 va_TraceVAPictureParameterBufferVP8(dpy, context, buffer, type, size, num_elements, pbuf);
4441 case VAIQMatrixBufferType:
4442 va_TraceVAIQMatrixBufferVP8(dpy, context, buffer, type, size, num_elements, pbuf);
4444 case VAQMatrixBufferType:
4446 case VABitPlaneBufferType:
4448 case VASliceGroupMapBufferType:
4450 case VASliceParameterBufferType:
4451 va_TraceVASliceParameterBufferVP8(dpy, context, buffer, type, size, num_elements, pbuf);
4453 case VASliceDataBufferType:
4455 case VAProbabilityBufferType:
4456 va_TraceVAProbabilityBufferVP8(dpy, context, buffer, type, size, num_elements, pbuf);
4458 case VAMacroblockParameterBufferType:
4460 case VAResidualDataBufferType:
4462 case VADeblockingParameterBufferType:
4464 case VAImageBufferType:
4466 case VAProtectedSliceDataBufferType:
4468 case VAEncCodedBufferType:
4470 case VAEncSequenceParameterBufferType:
4471 va_TraceVAEncSequenceParameterBufferVP8(dpy, context, buffer, type, size, num_elements, pbuf);
4473 case VAEncPictureParameterBufferType:
4474 va_TraceVAEncPictureParameterBufferVP8(dpy, context, buffer, type, size, num_elements, pbuf);
4476 case VAEncSliceParameterBufferType:
4478 case VAEncPackedHeaderParameterBufferType:
4480 case VAEncMiscParameterBufferType:
4481 va_TraceVAEncMiscParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
4484 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4489 static void va_TraceVP9Buf(
4491 VAContextID context,
4495 unsigned int num_elements,
4499 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4502 case VAPictureParameterBufferType:
4503 va_TraceVAPictureParameterBufferVP9(dpy, context, buffer, type, size, num_elements, pbuf);
4505 case VAEncSequenceParameterBufferType:
4506 va_TraceVAEncSequenceParameterBufferVP9(dpy, context, buffer, type, size, num_elements, pbuf);
4508 case VAEncPictureParameterBufferType:
4509 va_TraceVAEncPictureParameterBufferVP9(dpy, context, buffer, type, size, num_elements, pbuf);
4511 case VASliceParameterBufferType:
4512 va_TraceVASliceParameterBufferVP9(dpy, context, buffer, type, size, num_elements, pbuf);
4514 case VAEncMiscParameterBufferType:
4515 va_TraceVAEncMiscParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
4518 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4523 static void va_TraceVC1Buf(
4525 VAContextID context,
4529 unsigned int num_elements,
4533 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4536 case VAPictureParameterBufferType:
4537 va_TraceVAPictureParameterBufferVC1(dpy, context, buffer, type, size, num_elements, pbuf);
4539 case VAIQMatrixBufferType:
4541 case VABitPlaneBufferType:
4542 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4544 case VASliceGroupMapBufferType:
4545 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4547 case VASliceParameterBufferType:
4548 va_TraceVASliceParameterBufferVC1(dpy, context, buffer, type, size, num_elements, pbuf);
4550 case VASliceDataBufferType:
4551 va_TraceVABuffers(dpy, context, buffer, type, trace_ctx->trace_slice_size, num_elements, pbuf);
4553 case VAMacroblockParameterBufferType:
4554 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4556 case VAResidualDataBufferType:
4557 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4559 case VADeblockingParameterBufferType:
4560 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4562 case VAImageBufferType:
4564 case VAProtectedSliceDataBufferType:
4565 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4567 case VAEncCodedBufferType:
4569 case VAEncSequenceParameterBufferType:
4570 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4572 case VAEncPictureParameterBufferType:
4573 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4575 case VAEncSliceParameterBufferType:
4576 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4579 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4585 va_TraceProcFilterParameterBufferDeinterlacing(
4587 VAContextID context,
4588 VAProcFilterParameterBufferBase *base
4591 VAProcFilterParameterBufferDeinterlacing *deint = (VAProcFilterParameterBufferDeinterlacing *)base;
4593 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4595 va_TraceMsg(trace_ctx, "\t type = %d\n", deint->type);
4596 va_TraceMsg(trace_ctx, "\t algorithm = %d\n", deint->algorithm);
4597 va_TraceMsg(trace_ctx, "\t flags = %d\n", deint->flags);
4601 va_TraceProcFilterParameterBufferColorBalance(
4603 VAContextID context,
4604 VAProcFilterParameterBufferBase *base
4607 VAProcFilterParameterBufferColorBalance *color_balance = (VAProcFilterParameterBufferColorBalance *)base;
4609 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4611 va_TraceMsg(trace_ctx, "\t type = %d\n", color_balance->type);
4612 va_TraceMsg(trace_ctx, "\t attrib = %d\n", color_balance->attrib);
4613 va_TraceMsg(trace_ctx, "\t value = %f\n", color_balance->value);
4617 va_TraceProcFilterParameterBufferBase(
4619 VAContextID context,
4620 VAProcFilterParameterBufferBase *base
4623 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4625 va_TraceMsg(trace_ctx, "\t type = %d\n", base->type);
4629 va_TraceProcFilterParameterBuffer(
4631 VAContextID context,
4632 VABufferID *filters,
4633 unsigned int num_filters
4638 unsigned int num_elements;
4639 VAProcFilterParameterBufferBase *base_filter = NULL;
4642 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4644 if (num_filters == 0 || filters == NULL) {
4645 va_TraceMsg(trace_ctx, "\t num_filters = %d\n", num_filters);
4646 va_TraceMsg(trace_ctx, "\t filters = %p\n", filters);
4650 va_TraceMsg(trace_ctx, "\t num_filters = %d\n", num_filters);
4652 /* get buffer type information */
4653 for (i = 0; i < num_filters; i++) {
4654 vaBufferInfo(dpy, context, filters[i], &type, &size, &num_elements);
4656 if (type != VAProcFilterParameterBufferType) {
4657 va_TraceMsg(trace_ctx, "\t filters[%d] = 0x%08x (INVALID)\n", i, filters[i]);
4660 va_TraceMsg(trace_ctx, "\t filters[%d] = 0x%08x\n", i, filters[i]);
4664 vaMapBuffer(dpy, filters[i], (void **)&base_filter);
4666 if (base_filter == NULL) {
4667 vaUnmapBuffer(dpy, filters[i]);
4671 switch (base_filter->type) {
4672 case VAProcFilterDeinterlacing:
4673 va_TraceProcFilterParameterBufferDeinterlacing(dpy,
4677 case VAProcFilterColorBalance:
4678 va_TraceProcFilterParameterBufferColorBalance(dpy,
4683 va_TraceProcFilterParameterBufferBase(dpy,
4689 vaUnmapBuffer(dpy, filters[i]);
4694 va_TraceVAProcPipelineParameterBuffer(
4696 VAContextID context,
4700 unsigned int num_elements,
4704 VAProcPipelineParameterBuffer *p = (VAProcPipelineParameterBuffer *)data;
4707 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4709 va_TraceMsg(trace_ctx, "\t--VAProcPipelineParameterBuffer\n");
4711 va_TraceMsg(trace_ctx, "\t surface = 0x%08x\n", p->surface);
4713 if (p->surface_region) {
4714 va_TraceMsg(trace_ctx, "\t surface_region\n");
4715 va_TraceMsg(trace_ctx, "\t x = %d\n", p->surface_region->x);
4716 va_TraceMsg(trace_ctx, "\t y = %d\n", p->surface_region->y);
4717 va_TraceMsg(trace_ctx, "\t width = %d\n", p->surface_region->width);
4718 va_TraceMsg(trace_ctx, "\t height = %d\n", p->surface_region->height);
4720 va_TraceMsg(trace_ctx, "\t surface_region = (NULL)\n");
4723 va_TraceMsg(trace_ctx, "\t surface_color_standard = %d\n", p->surface_color_standard);
4725 if (p->output_region) {
4726 va_TraceMsg(trace_ctx, "\t output_region\n");
4727 va_TraceMsg(trace_ctx, "\t x = %d\n", p->output_region->x);
4728 va_TraceMsg(trace_ctx, "\t y = %d\n", p->output_region->y);
4729 va_TraceMsg(trace_ctx, "\t width = %d\n", p->output_region->width);
4730 va_TraceMsg(trace_ctx, "\t height = %d\n", p->output_region->height);
4732 va_TraceMsg(trace_ctx, "\t output_region = (NULL)\n");
4735 va_TraceMsg(trace_ctx, "\t output_background_color = 0x%08x\n", p->output_background_color);
4736 va_TraceMsg(trace_ctx, "\t output_color_standard = %d\n", p->output_color_standard);
4737 va_TraceMsg(trace_ctx, "\t pipeline_flags = 0x%08x\n", p->pipeline_flags);
4738 va_TraceMsg(trace_ctx, "\t filter_flags = 0x%08x\n", p->filter_flags);
4740 va_TraceProcFilterParameterBuffer(dpy, context, p->filters, p->num_filters);
4742 va_TraceMsg(trace_ctx, "\t num_forward_references = 0x%08x\n", p->num_forward_references);
4744 if (p->num_forward_references) {
4745 va_TraceMsg(trace_ctx, "\t forward_references\n");
4747 if (p->forward_references) {
4748 /* only dump the first 5 forward references */
4749 for (i = 0; i < p->num_forward_references && i < 5; i++) {
4750 va_TraceMsg(trace_ctx, "\t forward_references[%d] = 0x%08x\n", i, p->forward_references[i]);
4753 for (i = 0; i < p->num_forward_references && i < 5; i++) {
4754 va_TraceMsg(trace_ctx, "\t forward_references[%d] = (NULL)\n", i);
4759 va_TraceMsg(trace_ctx, "\t num_backward_references = 0x%08x\n", p->num_backward_references);
4761 if (p->num_backward_references) {
4762 va_TraceMsg(trace_ctx, "\t backward_references\n");
4764 if (p->backward_references) {
4765 /* only dump the first 5 backward references */
4766 for (i = 0; i < p->num_backward_references && i < 5; i++) {
4767 va_TraceMsg(trace_ctx, "\t backward_references[%d] = 0x%08x\n", i, p->backward_references[i]);
4770 for (i = 0; i < p->num_backward_references && i < 5; i++) {
4771 va_TraceMsg(trace_ctx, "\t backward_references[%d] = (NULL)\n", i);
4776 /* FIXME: add other info later */
4778 va_TraceMsg(trace_ctx, NULL);
4784 VAContextID context,
4788 unsigned int num_elements,
4792 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4795 case VAProcPipelineParameterBufferType:
4796 va_TraceVAProcPipelineParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
4799 va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
4804 void va_TraceRenderPicture(
4806 VAContextID context,
4807 VABufferID *buffers,
4813 unsigned int num_elements;
4815 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4817 TRACE_FUNCNAME(idx);
4819 va_TraceMsg(trace_ctx, "\tcontext = 0x%08x\n", context);
4820 va_TraceMsg(trace_ctx, "\tnum_buffers = %d\n", num_buffers);
4821 if (buffers == NULL)
4824 for (i = 0; i < num_buffers; i++) {
4825 unsigned char *pbuf = NULL;
4828 /* get buffer type information */
4829 vaBufferInfo(dpy, context, buffers[i], &type, &size, &num_elements);
4831 va_TraceMsg(trace_ctx, "\t---------------------------\n");
4832 va_TraceMsg(trace_ctx, "\tbuffers[%d] = 0x%08x\n", i, buffers[i]);
4833 va_TraceMsg(trace_ctx, "\t type = %s\n", vaBufferTypeStr(type));
4834 va_TraceMsg(trace_ctx, "\t size = %d\n", size);
4835 va_TraceMsg(trace_ctx, "\t num_elements = %d\n", num_elements);
4837 vaMapBuffer(dpy, buffers[i], (void **)&pbuf);
4841 switch (trace_ctx->trace_profile) {
4842 case VAProfileMPEG2Simple:
4843 case VAProfileMPEG2Main:
4844 for (j=0; j<num_elements; j++) {
4845 va_TraceMsg(trace_ctx, "\telement[%d] =\n", j);
4846 va_TraceMPEG2Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4849 case VAProfileMPEG4Simple:
4850 case VAProfileMPEG4AdvancedSimple:
4851 case VAProfileMPEG4Main:
4852 for (j=0; j<num_elements; j++) {
4853 va_TraceMsg(trace_ctx, "\telement[%d] =\n", j);
4854 va_TraceMPEG4Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4857 case VAProfileH264Main:
4858 case VAProfileH264High:
4859 case VAProfileH264ConstrainedBaseline:
4860 for (j=0; j<num_elements; j++) {
4861 va_TraceMsg(trace_ctx, "\telement[%d] =\n", j);
4863 va_TraceH264Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4866 case VAProfileVC1Simple:
4867 case VAProfileVC1Main:
4868 case VAProfileVC1Advanced:
4869 for (j=0; j<num_elements; j++) {
4870 va_TraceMsg(trace_ctx, "\telement[%d] =\n", j);
4872 va_TraceVC1Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4875 case VAProfileH263Baseline:
4876 for (j=0; j<num_elements; j++) {
4877 va_TraceMsg(trace_ctx, "\telement[%d] =\n", j);
4879 va_TraceH263Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4882 case VAProfileJPEGBaseline:
4883 for (j=0; j<num_elements; j++) {
4884 va_TraceMsg(trace_ctx, "\telement[%d] =\n", j);
4886 va_TraceJPEGBuf (dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4891 for (j=0; j<num_elements; j++) {
4892 va_TraceMsg(trace_ctx, "\telement[%d] =\n", j);
4894 va_TraceNoneBuf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4898 case VAProfileVP8Version0_3:
4899 for (j=0; j<num_elements; j++) {
4900 va_TraceMsg(trace_ctx, "\telement[%d] =\n", j);
4902 va_TraceVP8Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4906 case VAProfileHEVCMain:
4907 case VAProfileHEVCMain10:
4908 for (j=0; j<num_elements; j++) {
4909 va_TraceMsg(trace_ctx, "\telement[%d] = ", j);
4911 va_TraceHEVCBuf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4914 case VAProfileVP9Profile0:
4915 for (j=0; j<num_elements; j++) {
4916 va_TraceMsg(trace_ctx, "\telement[%d] = \n", j);
4918 va_TraceVP9Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
4925 vaUnmapBuffer(dpy, buffers[i]);
4928 va_TraceMsg(trace_ctx, NULL);
4931 void va_TraceEndPicture(
4933 VAContextID context,
4937 int encode, decode, jpeg;
4938 DPY2TRACECTX(dpy, context, VA_INVALID_ID);
4940 TRACE_FUNCNAME(idx);
4942 va_TraceMsg(trace_ctx, "\tcontext = 0x%08x\n", context);
4943 va_TraceMsg(trace_ctx, "\trender_targets = 0x%08x\n", trace_ctx->trace_rendertarget);
4945 /* avoid to create so many empty files */
4946 encode = (trace_ctx->trace_entrypoint == VAEntrypointEncSlice);
4947 decode = (trace_ctx->trace_entrypoint == VAEntrypointVLD);
4948 jpeg = (trace_ctx->trace_entrypoint == VAEntrypointEncPicture);
4950 /* trace encode source surface, can do it before HW completes rendering */
4951 if ((encode && (va_trace_flag & VA_TRACE_FLAG_SURFACE_ENCODE))||
4952 (jpeg && (va_trace_flag & VA_TRACE_FLAG_SURFACE_JPEG)))
4953 va_TraceSurface(dpy, context);
4955 /* trace decoded surface, do it after HW completes rendering */
4956 if (decode && ((va_trace_flag & VA_TRACE_FLAG_SURFACE_DECODE))) {
4957 vaSyncSurface(dpy, trace_ctx->trace_rendertarget);
4958 va_TraceSurface(dpy, context);
4961 va_TraceMsg(trace_ctx, NULL);
4965 void va_TraceSyncSurface(
4967 VASurfaceID render_target
4970 DPY2TRACE_VIRCTX(dpy);
4972 TRACE_FUNCNAME(idx);
4974 va_TraceMsg(trace_ctx, "\trender_target = 0x%08x\n", render_target);
4975 va_TraceMsg(trace_ctx, NULL);
4977 DPY2TRACE_VIRCTX_EXIT(pva_trace);
4980 void va_TraceQuerySurfaceAttributes(
4983 VASurfaceAttrib *attrib_list,
4984 unsigned int *num_attribs
4987 DPY2TRACE_VIRCTX(dpy);
4989 TRACE_FUNCNAME(idx);
4990 va_TraceMsg(trace_ctx, "\tconfig = 0x%08x\n", config);
4991 va_TraceSurfaceAttributes(trace_ctx, attrib_list, num_attribs);
4993 va_TraceMsg(trace_ctx, NULL);
4995 DPY2TRACE_VIRCTX_EXIT(pva_trace);
4999 void va_TraceQuerySurfaceStatus(
5001 VASurfaceID render_target,
5002 VASurfaceStatus *status /* out */
5005 DPY2TRACE_VIRCTX(dpy);
5007 TRACE_FUNCNAME(idx);
5009 va_TraceMsg(trace_ctx, "\trender_target = 0x%08x\n", render_target);
5011 va_TraceMsg(trace_ctx, "\tstatus = 0x%08x\n", *status);
5012 va_TraceMsg(trace_ctx, NULL);
5014 DPY2TRACE_VIRCTX_EXIT(pva_trace);
5018 void va_TraceQuerySurfaceError(
5020 VASurfaceID surface,
5021 VAStatus error_status,
5022 void **error_info /*out*/
5025 DPY2TRACE_VIRCTX(dpy);
5027 TRACE_FUNCNAME(idx);
5028 va_TraceMsg(trace_ctx, "\tsurface = 0x%08x\n", surface);
5029 va_TraceMsg(trace_ctx, "\terror_status = 0x%08x\n", error_status);
5030 if (error_info && (error_status == VA_STATUS_ERROR_DECODING_ERROR)) {
5031 VASurfaceDecodeMBErrors *p = *error_info;
5032 while (p && (p->status != -1)) {
5033 va_TraceMsg(trace_ctx, "\t\tstatus = %d\n", p->status);
5034 va_TraceMsg(trace_ctx, "\t\tstart_mb = %d\n", p->start_mb);
5035 va_TraceMsg(trace_ctx, "\t\tend_mb = %d\n", p->end_mb);
5036 p++; /* next error record */
5039 va_TraceMsg(trace_ctx, NULL);
5041 DPY2TRACE_VIRCTX_EXIT(pva_trace);
5044 void va_TraceMaxNumDisplayAttributes (
5049 DPY2TRACE_VIRCTX(dpy);
5051 TRACE_FUNCNAME(idx);
5053 va_TraceMsg(trace_ctx, "\tmax_display_attributes = %d\n", number);
5054 va_TraceMsg(trace_ctx, NULL);
5056 DPY2TRACE_VIRCTX_EXIT(pva_trace);
5059 void va_TraceQueryDisplayAttributes (
5061 VADisplayAttribute *attr_list, /* out */
5062 int *num_attributes /* out */
5067 if (attr_list == NULL || num_attributes == NULL)
5070 DPY2TRACE_VIRCTX(dpy);
5072 TRACE_FUNCNAME(idx);
5073 va_TraceMsg(trace_ctx, "\tnum_attributes = %d\n", *num_attributes);
5075 for (i=0; i<*num_attributes; i++) {
5076 va_TraceMsg(trace_ctx, "\tattr_list[%d] =\n", i);
5077 va_TraceMsg(trace_ctx, "\t type = 0x%08x\n", attr_list[i].type);
5078 va_TraceMsg(trace_ctx, "\t min_value = %d\n", attr_list[i].min_value);
5079 va_TraceMsg(trace_ctx, "\t max_value = %d\n", attr_list[i].max_value);
5080 va_TraceMsg(trace_ctx, "\t value = %d\n", attr_list[i].value);
5081 va_TraceMsg(trace_ctx, "\t flags = %d\n", attr_list[i].flags);
5083 va_TraceMsg(trace_ctx, NULL);
5085 DPY2TRACE_VIRCTX_EXIT(pva_trace);
5089 static void va_TraceDisplayAttributes (
5090 struct trace_context *trace_ctx,
5091 VADisplayAttribute *attr_list,
5097 if (attr_list == NULL)
5100 va_TraceMsg(trace_ctx, "\tnum_attributes = %d\n", num_attributes);
5102 for (i=0; i<num_attributes; i++) {
5103 va_TraceMsg(trace_ctx, "\tattr_list[%d] =\n", i);
5104 va_TraceMsg(trace_ctx, "\t type = 0x%08x\n", attr_list[i].type);
5105 va_TraceMsg(trace_ctx, "\t min_value = %d\n", attr_list[i].min_value);
5106 va_TraceMsg(trace_ctx, "\t max_value = %d\n", attr_list[i].max_value);
5107 va_TraceMsg(trace_ctx, "\t value = %d\n", attr_list[i].value);
5108 va_TraceMsg(trace_ctx, "\t flags = %d\n", attr_list[i].flags);
5110 va_TraceMsg(trace_ctx, NULL);
5114 void va_TraceGetDisplayAttributes (
5116 VADisplayAttribute *attr_list,
5120 DPY2TRACE_VIRCTX(dpy);
5122 TRACE_FUNCNAME(idx);
5124 va_TraceDisplayAttributes (trace_ctx, attr_list, num_attributes);
5126 DPY2TRACE_VIRCTX_EXIT(pva_trace);
5129 void va_TraceSetDisplayAttributes (
5131 VADisplayAttribute *attr_list,
5135 DPY2TRACE_VIRCTX(dpy);
5137 TRACE_FUNCNAME(idx);
5139 va_TraceDisplayAttributes (trace_ctx, attr_list, num_attributes);
5141 DPY2TRACE_VIRCTX_EXIT(pva_trace);
5145 void va_TracePutSurface (
5147 VASurfaceID surface,
5148 void *draw, /* the target Drawable */
5151 unsigned short srcw,
5152 unsigned short srch,
5155 unsigned short destw,
5156 unsigned short desth,
5157 VARectangle *cliprects, /* client supplied clip list */
5158 unsigned int number_cliprects, /* number of clip rects in the clip list */
5159 unsigned int flags /* de-interlacing flags */
5162 DPY2TRACE_VIRCTX(dpy);
5164 TRACE_FUNCNAME(idx);
5166 va_TraceMsg(trace_ctx, "\tsurface = 0x%08x\n", surface);
5167 va_TraceMsg(trace_ctx, "\tdraw = 0x%08x\n", draw);
5168 va_TraceMsg(trace_ctx, "\tsrcx = %d\n", srcx);
5169 va_TraceMsg(trace_ctx, "\tsrcy = %d\n", srcy);
5170 va_TraceMsg(trace_ctx, "\tsrcw = %d\n", srcw);
5171 va_TraceMsg(trace_ctx, "\tsrch = %d\n", srch);
5172 va_TraceMsg(trace_ctx, "\tdestx = %d\n", destx);
5173 va_TraceMsg(trace_ctx, "\tdesty = %d\n", desty);
5174 va_TraceMsg(trace_ctx, "\tdestw = %d\n", destw);
5175 va_TraceMsg(trace_ctx, "\tdesth = %d\n", desth);
5176 va_TraceMsg(trace_ctx, "\tcliprects = 0x%08x\n", cliprects);
5177 va_TraceMsg(trace_ctx, "\tnumber_cliprects = %d\n", number_cliprects);
5178 va_TraceMsg(trace_ctx, "\tflags = 0x%08x\n", flags);
5179 va_TraceMsg(trace_ctx, NULL);
5181 DPY2TRACE_VIRCTX_EXIT(pva_trace);