summaryrefslogtreecommitdiff
path: root/va
diff options
context:
space:
mode:
authorAustin Yuan <shengquan.yuan@intel.com>2013-05-22 11:02:34 +0800
committerbuildbot <buildbot@intel.com>2013-05-28 04:04:40 -0700
commit2efbafef6046e1d9372c58de2b0d7b03377c686c (patch)
tree8e745dbdae309f8d2f09969f61d5ba345bf6a9da /va
parent6044ab9a375eb73b08f45d87966652f98f918668 (diff)
downloadlibva-2efbafef6046e1d9372c58de2b0d7b03377c686c.tar.gz
rebase libva to latest staging
BZ: 109833 The rebase is trying to fix some "medium" KW issue, and bugs of vatrace to help dubugging Change-Id: Ibd9b86eb98d4a79f4452bee2dff7960d8d54ffd5 Signed-off-by: Austin Yuan <shengquan.yuan@intel.com> Reviewed-on: http://android.intel.com:8080/109154 Reviewed-by: Shi, PingX <pingx.shi@intel.com> Tested-by: Shi, PingX <pingx.shi@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'va')
-rwxr-xr-xva/va.c14
-rwxr-xr-xva/va.h17
-rwxr-xr-xva/va_trace.c103
-rwxr-xr-xva/va_trace.h14
-rw-r--r--va/va_vpp.h40
5 files changed, 157 insertions, 31 deletions
diff --git a/va/va.c b/va/va.c
index 919b498..0644ba6 100755
--- a/va/va.c
+++ b/va/va.c
@@ -800,15 +800,22 @@ VAStatus vaCreateBuffer (
)
{
VADriverContextP ctx;
+ VAStatus vaStatus;
+ int ret = 0;
+
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- int ret = 0;
VA_FOOL_FUNC(va_FoolCreateBuffer, dpy, context, type, size, num_elements, data, buf_id);
if (ret)
return VA_STATUS_SUCCESS;
- return ctx->vtable->vaCreateBuffer( ctx, context, type, size, num_elements, data, buf_id);
+ vaStatus = ctx->vtable->vaCreateBuffer( ctx, context, type, size, num_elements, data, buf_id);
+
+ VA_TRACE_LOG(va_TraceCreateBuffer,
+ dpy, context, type, size, num_elements, data, buf_id);
+
+ return vaStatus;
}
VAStatus vaBufferSetNumElements (
@@ -878,6 +885,9 @@ VAStatus vaDestroyBuffer (
ctx = CTX(dpy);
VA_FOOL_RETURN();
+
+ VA_TRACE_LOG(va_TraceDestroyBuffer,
+ dpy, buffer_id);
return ctx->vtable->vaDestroyBuffer( ctx, buffer_id );
}
diff --git a/va/va.h b/va/va.h
index 1d664ee..a80a526 100755
--- a/va/va.h
+++ b/va/va.h
@@ -406,15 +406,18 @@ typedef enum
*/
VAConfigAttribEncMacroblockInfo = 16,
/**
- * \brief Auto reconstructed/reference frame management. Read/Write.
+ * \brief Auto reference frame management. Read-Write.
*
- * This attribute determines whether the driver supports auto reconstructed
- * and reference management.
+ * This attribute determines whether the driver supports auto reference management
+ *
+ * If driver supports, and application sets it to true, application only needs to set scratch
+ * reference surfaces via VAPictureParameterBufferH264: ReferenceFrames. The scratch surfaces
+ * number is determined by the maximum number of RefPicList0 and RefPicList0 which can be queried from
+ * VAConfigAttribEncMaxRefFrames. Application doesn't need to set VAPictureParameterBufferH264:CurrPic
+ * and VAEncSliceParameterBufferH264:RefPicList. Driver will manage the reference frames internally
+ * and choose the best reference frames. Which scratch surface is used for reconstructed frame and which
+ * surfaces are used for reference frames will be fedback via VACodedBufferSegment
*
- * If driver supports, and application sets it to true, application doesn't need
- * to set the reconstructed/reference frames information in #VAEncMacroblockParameterBufferH264
- * and #VAEncSliceParameterBufferH264. Driver will manage the reference frames internally
- * and choose the best reference frames.
*/
VAConfigAttribEncAutoReference = 17,
/**@}*/
diff --git a/va/va_trace.c b/va/va_trace.c
index 2d390bc..6c8aa15 100755
--- a/va/va_trace.c
+++ b/va/va_trace.c
@@ -620,6 +620,61 @@ static char * buffer_type_to_string(int type)
}
}
+void va_TraceCreateBuffer (
+ VADisplay dpy,
+ VAContextID context, /* in */
+ VABufferType type, /* in */
+ unsigned int size, /* in */
+ unsigned int num_elements, /* in */
+ void *data, /* in */
+ VABufferID *buf_id /* out */
+)
+{
+ DPY2INDEX(dpy);
+
+ /* only trace CodedBuffer */
+ if (type != VAEncCodedBufferType)
+ return;
+
+ TRACE_FUNCNAME(idx);
+ va_TraceMsg(idx, "\tbuf_type=%s\n", buffer_type_to_string(type));
+ va_TraceMsg(idx, "\tbuf_id=0x%x\n", *buf_id);
+ va_TraceMsg(idx, "\tsize=%d\n", size);
+ va_TraceMsg(idx, "\tnum_elements=%d\n", num_elements);
+
+ va_TraceMsg(idx, NULL);
+}
+
+void va_TraceDestroyBuffer (
+ VADisplay dpy,
+ VABufferID buf_id /* in */
+)
+{
+ VABufferType type;
+ unsigned int size;
+ unsigned int num_elements;
+
+ VACodedBufferSegment *buf_list;
+ int i = 0;
+
+ DPY2INDEX(dpy);
+
+ vaBufferInfo(dpy, trace_context[idx].trace_context, buf_id, &type, &size, &num_elements);
+
+ /* only trace CodedBuffer */
+ if (type != VAEncCodedBufferType)
+ return;
+
+ TRACE_FUNCNAME(idx);
+ va_TraceMsg(idx, "\tbuf_type=%s\n", buffer_type_to_string(type));
+ va_TraceMsg(idx, "\tbuf_id=0x%x\n", buf_id);
+ va_TraceMsg(idx, "\tsize=%d\n", size);
+ va_TraceMsg(idx, "\tnum_elements=%d\n", num_elements);
+
+ va_TraceMsg(idx, NULL);
+}
+
+
void va_TraceMapBuffer (
VADisplay dpy,
VABufferID buf_id, /* in */
@@ -674,13 +729,13 @@ static void va_TraceVABuffers(
unsigned char check_sum = 0;
DPY2INDEX(dpy);
- va_TraceMsg(idx, "%s\n", buffer_type_to_string(type));
+ va_TraceMsg(idx, "%s", buffer_type_to_string(type));
for (i=0; i<size; i++) {
unsigned char value = p[i];
if ((trace_flag & VA_TRACE_FLAG_BUFDATA) && ((i%16) == 0))
- va_TraceMsg(idx, "\n0x%08x:", i);
+ va_TraceMsg(idx, "\n\t0x%08x:", i);
if (trace_flag & VA_TRACE_FLAG_BUFDATA)
va_TraceMsg(idx, " %02x", value);
@@ -688,7 +743,7 @@ static void va_TraceVABuffers(
check_sum ^= value;
}
- va_TraceMsg(idx, "\tchecksum = 0x%02x\n", check_sum & 0xff);
+ va_TraceMsg(idx, "\n\tchecksum = 0x%02x\n", check_sum & 0xff);
va_TraceMsg(idx, NULL);
return;
@@ -1586,6 +1641,31 @@ static void va_TraceVAEncSliceParameterBufferH264(
return;
}
+
+static void va_TraceVAEncPackedHeaderParameterBufferType(
+ VADisplay dpy,
+ VAContextID context,
+ VABufferID buffer,
+ VABufferType type,
+ unsigned int size,
+ unsigned int num_elements,
+ void *data)
+{
+ VAEncPackedHeaderParameterBuffer* p = (VAEncPackedHeaderParameterBuffer*)data;
+ DPY2INDEX(dpy);
+ int i;
+
+ if (!p)
+ return;
+ va_TraceMsg(idx, "VAEncPackedHeaderParameterBuffer\n");
+ va_TraceMsg(idx, "\ttype = 0x%08x\n", p->type);
+ va_TraceMsg(idx, "\tbit_length = %d\n", p->bit_length);
+ va_TraceMsg(idx, "\thas_emulation_bytes = %d\n", p->has_emulation_bytes);
+ va_TraceMsg(idx, NULL);
+
+ return;
+}
+
static void va_TraceVAEncMiscParameterBuffer(
VADisplay dpy,
VAContextID context,
@@ -1613,6 +1693,7 @@ static void va_TraceVAEncMiscParameterBuffer(
va_TraceMsg(idx, "VAEncMiscParameterRateControl\n");
va_TraceMsg(idx, "\tbits_per_second = %d\n", p->bits_per_second);
+ va_TraceMsg(idx, "\ttarget_percentage = %d\n", p->target_percentage);
va_TraceMsg(idx, "\twindow_size = %d\n", p->window_size);
va_TraceMsg(idx, "\tinitial_qp = %d\n", p->initial_qp);
va_TraceMsg(idx, "\tmin_qp = %d\n", p->min_qp);
@@ -1650,7 +1731,8 @@ static void va_TraceVAEncMiscParameterBuffer(
break;
}
default:
- va_TraceMsg(idx, "invalid VAEncMiscParameterBuffer type = %d\n", tmp->type);
+ va_TraceMsg(idx, "Unknown VAEncMiscParameterBuffer(type = %d):", tmp->type);
+ va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, data);
break;
}
va_TraceMsg(idx, NULL);
@@ -2036,6 +2118,9 @@ static void va_TraceH263Buf(
case VAEncSliceParameterBufferType:
va_TraceVAEncSliceParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
break;
+ case VAEncPackedHeaderParameterBufferType:
+ va_TraceVAEncPackedHeaderParameterBufferType(dpy, context, buffer, type, size, num_elements, pbuf);
+ break;
default:
va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf);
break;
@@ -2210,6 +2295,10 @@ static void va_TraceH264Buf(
else
va_TraceVAEncSliceParameterBufferH264(dpy, context, buffer, type, size, num_elements, pbuf);
break;
+ case VAEncPackedHeaderParameterBufferType:
+ va_TraceVAEncPackedHeaderParameterBufferType(dpy, context, buffer, type, size, num_elements, pbuf);
+ break;
+
case VAEncMiscParameterBufferType:
va_TraceVAEncMiscParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
break;
@@ -2317,7 +2406,6 @@ void va_TraceRenderPicture(
case VAProfileMPEG2Simple:
case VAProfileMPEG2Main:
for (j=0; j<num_elements; j++) {
- va_TraceMsg(idx, "\t---------------------------\n", j);
va_TraceMsg(idx, "\telement[%d] = ", j);
va_TraceMPEG2Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
}
@@ -2326,7 +2414,6 @@ void va_TraceRenderPicture(
case VAProfileMPEG4AdvancedSimple:
case VAProfileMPEG4Main:
for (j=0; j<num_elements; j++) {
- va_TraceMsg(idx, "\t---------------------------\n", j);
va_TraceMsg(idx, "\telement[%d] = ", j);
va_TraceMPEG4Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
}
@@ -2336,7 +2423,6 @@ void va_TraceRenderPicture(
case VAProfileH264High:
case VAProfileH264ConstrainedBaseline:
for (j=0; j<num_elements; j++) {
- va_TraceMsg(idx, "\t---------------------------\n", j);
va_TraceMsg(idx, "\telement[%d] = ", j);
va_TraceH264Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
@@ -2346,7 +2432,6 @@ void va_TraceRenderPicture(
case VAProfileVC1Main:
case VAProfileVC1Advanced:
for (j=0; j<num_elements; j++) {
- va_TraceMsg(idx, "\t---------------------------\n", j);
va_TraceMsg(idx, "\telement[%d] = ", j);
va_TraceVC1Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
@@ -2354,7 +2439,6 @@ void va_TraceRenderPicture(
break;
case VAProfileH263Baseline:
for (j=0; j<num_elements; j++) {
- va_TraceMsg(idx, "\t---------------------------\n", j);
va_TraceMsg(idx, "\telement[%d] = ", j);
va_TraceH263Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
@@ -2362,7 +2446,6 @@ void va_TraceRenderPicture(
break;
case VAProfileJPEGBaseline:
for (j=0; j<num_elements; j++) {
- va_TraceMsg(idx, "\t---------------------------\n", j);
va_TraceMsg(idx, "\telement[%d] = ", j);
va_TraceJPEGBuf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
diff --git a/va/va_trace.h b/va/va_trace.h
index f7af9b5..e712201 100755
--- a/va/va_trace.h
+++ b/va/va_trace.h
@@ -98,6 +98,20 @@ void va_TraceCreateContext(
VAContextID *context /* out */
);
+void va_TraceCreateBuffer (
+ VADisplay dpy,
+ VAContextID context, /* in */
+ VABufferType type, /* in */
+ unsigned int size, /* in */
+ unsigned int num_elements, /* in */
+ void *data, /* in */
+ VABufferID *buf_id /* out */
+);
+
+void va_TraceDestroyBuffer (
+ VADisplay dpy,
+ VABufferID buf_id /* in */
+);
void va_TraceMapBuffer (
VADisplay dpy,
diff --git a/va/va_vpp.h b/va/va_vpp.h
index 55ab978..427104d 100644
--- a/va/va_vpp.h
+++ b/va/va_vpp.h
@@ -791,18 +791,18 @@ typedef struct _VAProcFilterParamterBufferFrameRateConversion {
typedef struct _VAProcFilterParamterBufferTotalColorCorrection {
/** \brief filter type. Shall be set to #VAProcFilterTotalColorCorrection. */
VAProcFilterType type;
- /** \brief TCC Red Saturation (0-255). */
- unsigned int red;
- /** \brief TCC Green Saturation (0-255). */
- unsigned int green;
- /** \brief TCC Blue Saturation (0-255). */
- unsigned int blue;
- /** \brief TCC cyan Saturation (0-255). */
- unsigned int cyan;
- /** \brief TCC Magent Saturation (0-255).*/
- unsigned int magenta;
- /** \brief TCC Yello Saturation (0-255). */
- unsigned int yellow;
+ /** \brief TCC Red Saturation. */
+ float red;
+ /** \brief TCC Green Saturation. */
+ float green;
+ /** \brief TCC Blue Saturation. */
+ float blue;
+ /** \brief TCC cyan Saturation. */
+ float cyan;
+ /** \brief TCC Magenta Saturation. */
+ float magenta;
+ /** \brief TCC Yello Saturation. */
+ float yellow;
} VAProcFilterParameterBufferTotalColorCorrection;
/**
@@ -836,6 +836,22 @@ typedef struct _VAProcFilterCapColorStandard {
VAProcColorStandardType type;
} VAProcFilterCapColorStandard;
+/** \brief Capabilities specification for the Total Color Correction filter. */
+typedef struct _VAProcFilterCapTotalColorCorrection {
+ /** \brief Range of supported values for red saturation. */
+ VAProcFilterValueRange red_range;
+ /** \brief Range of supported values for green saturation. */
+ VAProcFilterValueRange green_range;
+ /** \brief Range of supported values for blue saturation. */
+ VAProcFilterValueRange blue_range;
+ /** \brief Range of supported values for cyan saturation. */
+ VAProcFilterValueRange cyan_range;
+ /** \brief Range of supported values for magenta saturation. */
+ VAProcFilterValueRange magenta_range;
+ /** \brief Range of supported values for yellow saturation. */
+ VAProcFilterValueRange yellow_range;
+} VAProcFilterCapTotalColorCorrection;
+
/**
* \brief Queries video processing filters.
*