summaryrefslogtreecommitdiff
path: root/va
diff options
context:
space:
mode:
authorJonathan Bian <jonathan.bian@intel.com>2013-05-24 15:36:58 -0700
committerXiang, Haihao <haihao.xiang@intel.com>2014-11-19 20:40:20 +0800
commit5214c868b28b1ccfd3c920e4215fdc1ff20d59bb (patch)
tree4a88809205cc6f1f4eb05bfc79b14f2b7d3564c7 /va
parentf9309a6f44b51bb2c463a6a16d3ccf3edc6e6c7a (diff)
downloadlibva-5214c868b28b1ccfd3c920e4215fdc1ff20d59bb.tar.gz
Extended existing JPEG encoding data structures and added configuration attribute for JPEG encoding.
It is the combination of 1d93d44 and 970064cf Signed-off-by: Jonathan Bian <jonathan.bian@intel.com> Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com> [Resovle conflicts & remove irrelevant attributes] Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Diffstat (limited to 'va')
-rwxr-xr-xva/Android.mk1
-rw-r--r--va/Makefile.am1
-rw-r--r--va/va.h47
-rw-r--r--va/va_enc_jpeg.h158
-rw-r--r--va/va_trace.c1
5 files changed, 188 insertions, 20 deletions
diff --git a/va/Android.mk b/va/Android.mk
index 6f2dfb7..323bf48 100755
--- a/va/Android.mk
+++ b/va/Android.mk
@@ -70,6 +70,7 @@ LOCAL_COPY_HEADERS := \
va_backend.h \
va_dec_jpeg.h \
va_drmcommon.h \
+ va_enc_jpeg.h \
va_enc_vp8.h \
va_version.h
diff --git a/va/Makefile.am b/va/Makefile.am
index 95f5dc7..1b1dbf3 100644
--- a/va/Makefile.am
+++ b/va/Makefile.am
@@ -46,6 +46,7 @@ libva_source_h = \
va_dec_vp8.h \
va_drmcommon.h \
va_enc_h264.h \
+ va_enc_jpeg.h \
va_enc_vp8.h \
va_enc_mpeg2.h \
va_tpi.h \
diff --git a/va/va.h b/va/va.h
index 01694a9..78567ba 100644
--- a/va/va.h
+++ b/va/va.h
@@ -390,6 +390,14 @@ typedef enum
*/
VAConfigAttribEncMacroblockInfo = 16,
/**
+ * \brief JPEG encoding attribute. Read-only.
+ *
+ * This attribute exposes a number of capabilities of the underlying
+ * JPEG implementation. The attribute value is partitioned into fields as defined in the
+ * VAConfigAttribValEncJPEG union.
+ */
+ VAConfigAttribEncJPEG = 20,
+ /**
* \brief Encoding quality range attribute. Read-only.
*
* This attribute conveys whether the driver supports different quality level settings
@@ -481,6 +489,25 @@ typedef struct _VAConfigAttrib {
#define VA_ENC_SLICE_STRUCTURE_ARBITRARY_MACROBLOCKS 0x00000002
/**@}*/
+/** \brief Attribute value for VAConfigAttribEncJPEG */
+typedef union _VAConfigAttribValEncJPEG {
+ struct {
+ /** \brief set to 1 for arithmatic coding. */
+ unsigned int arithmatic_coding_mode : 1;
+ /** \brief set to 1 for progressive dct. */
+ unsigned int progressive_dct_mode : 1;
+ /** \brief set to 1 for non-interleaved. */
+ unsigned int non_interleaved_mode : 1;
+ /** \brief set to 1 for differential. */
+ unsigned int differential_mode : 1;
+ unsigned int max_num_components : 3;
+ unsigned int max_num_scans : 4;
+ unsigned int max_num_huffman_tables : 3;
+ unsigned int max_num_quantization_tables : 3;
+ } bits;
+ unsigned int value;
+} VAConfigAttribValEncJPEG;
+
/**
* if an attribute is not applicable for a given
* profile/entrypoint pair, then set the value to the following
@@ -1122,26 +1149,6 @@ typedef struct _VASliceParameterBufferBase
unsigned int slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX definitions */
} VASliceParameterBufferBase;
-
-/****************************
- * JEPG data structure
- ***************************/
-typedef struct _VAQMatrixBufferJPEG
-{
- int load_lum_quantiser_matrix;
- int load_chroma_quantiser_matrix;
- unsigned char lum_quantiser_matrix[64];
- unsigned char chroma_quantiser_matrix[64];
-} VAQMatrixBufferJPEG;
-
-typedef struct _VAEncPictureParameterBufferJPEG
-{
- VASurfaceID reconstructed_picture;
- unsigned short picture_width;
- unsigned short picture_height;
- VABufferID coded_buf;
-} VAEncPictureParameterBufferJPEG;
-
#include <va/va_dec_jpeg.h>
/****************************
diff --git a/va/va_enc_jpeg.h b/va/va_enc_jpeg.h
new file mode 100644
index 0000000..be6b36e
--- /dev/null
+++ b/va/va_enc_jpeg.h
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2007-2013 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file va_enc_jpeg.h
+ * \brief JPEG encoding API
+ *
+ * This file contains the \ref api_enc_jpeg "JPEG encoding API".
+ */
+
+#ifndef VA_ENC_JPEG_H
+#define VA_ENC_JPEG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \defgroup api_enc_jpeg JPEG encoding API
+ *
+ * @{
+ */
+
+/**
+ * \brief JPEG Encoding Picture Parameter Buffer Structure
+ *
+ * This structure conveys picture level parameters.
+ *
+ */
+typedef struct _VAEncPictureParameterBufferJPEG
+{
+ /** \brief holds reconstructed picture. */
+ VASurfaceID reconstructed_picture;
+ /** \brief picture width. */
+ unsigned short picture_width;
+ /** \brief picture height. */
+ unsigned short picture_height;
+ /** \brief holds coded data. */
+ VABufferID coded_buf;
+
+ /**
+ * \brief pic_flags
+ *
+ */
+ union {
+ struct {
+ /**
+ * \brief profile:
+ * 0 - Baseline, 1 - Extended, 2 - Lossless, 3 - Hierarchical
+ */
+ unsigned int profile : 2;
+ /**
+ * \brief progressive:
+ * 0 - sequential, 1 - extended, 2 - progressive
+ */
+ unsigned int progressive : 1;
+ /**
+ * \brief huffman:
+ * 0 - arithmetic, 1 - huffman
+ */
+ unsigned int huffman : 1;
+ /**
+ * \brief interleaved:
+ * 0 - non interleaved, 1 - interleaved
+ */
+ unsigned int interleaved : 1;
+ /**
+ * \brief differential:
+ * 0 - non differential, 1 - differential
+ */
+ unsigned int differential : 1;
+ } bits;
+ unsigned int value;
+ } pic_flags;
+
+ /** \brief number of bits per sample. */
+ unsigned char sample_bit_depth;
+ /** \brief total number of scans in image. */
+ unsigned char num_scan;
+ /** \brief number of image components in frame. */
+ unsigned short num_components;
+ /** \brief Component identifier (Ci). */
+ unsigned char component_id[4];
+ /** \brief Quantization table selector (Tqi). */
+ unsigned char quantiser_table_selector[4];
+ /** \brief number from 1 to 100 that specifies quality of image. */
+ unsigned char quality;
+
+} VAEncPictureParameterBufferJPEG;
+
+
+/**
+ * \brief Slice parameter for JPEG encoding.
+ *
+ * This structure conveys slice (scan) level parameters.
+ *
+ */
+typedef struct _VAEncSliceParameterBufferJPEG {
+ /** \brief Restart interval definition (Ri). */
+ unsigned short restart_interval;
+ /** \brief number of image components in a scan. */
+ unsigned short num_components;
+ struct {
+ /** \brief Scan component selector (Csj). */
+ unsigned char component_selector;
+ /** \brief DC entropy coding table selector (Tdj). */
+ unsigned char dc_table_selector;
+ /** \brief AC entropy coding table selector (Taj). */
+ unsigned char ac_table_selector;
+ } components[4];
+} VAEncSliceParameterBufferJPEG;
+
+/**
+ * \brief Quantization table for JPEG encoding.
+ *
+ */
+typedef struct _VAQMatrixBufferJPEG
+{
+ /** \brief load luma quantization table. */
+ int load_lum_quantiser_matrix;
+ /** \brief load chroma quantization table. */
+ int load_chroma_quantiser_matrix;
+ /** \brief luma quantization table. */
+ unsigned char lum_quantiser_matrix[64];
+ /** \brief chroma quantization table. */
+ unsigned char chroma_quantiser_matrix[64];
+} VAQMatrixBufferJPEG;
+
+/**@}*/
+
+#include <va/va_dec_jpeg.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* VA_ENC_JPEG_H */
diff --git a/va/va_trace.c b/va/va_trace.c
index c95228a..5b00c55 100644
--- a/va/va_trace.c
+++ b/va/va_trace.c
@@ -30,6 +30,7 @@
#include "va_backend.h"
#include "va_trace.h"
#include "va_enc_h264.h"
+#include "va_enc_jpeg.h"
#include "va_dec_jpeg.h"
#include "va_dec_vp8.h"
#include "va_vpp.h"