diff options
author | Austin Yuan <shengquan.yuan@intel.com> | 2012-12-05 13:45:32 +0800 |
---|---|---|
committer | cactus <cactus@intel.com> | 2012-12-17 18:24:08 -0800 |
commit | 3ba486105912b27b566ccf65e2729231aa3f8a31 (patch) | |
tree | 9e7e3419e281374d648e556998fb2647bc0894ca /va | |
parent | acfa7dac15694df7f2e2514005bec5621a00f414 (diff) | |
download | libva-3ba486105912b27b566ccf65e2729231aa3f8a31.tar.gz |
[PORT FROM MAIN]dump rc infor and add vp8 encode support
BZ: 72756
1) Dump basic_unit_size/rc_flags of VAEncMiscRateControlParameter
2) Add VP8 encode header file
3) Add VAConfigAttribEncAutoReference
Change-Id: If2f22b6ed815435f2741cdfa6b5706c6b2b7a8a5
Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
Reviewed-on: http://android.intel.com:8080/81250
Reviewed-by: Ding, Haitao <haitao.ding@intel.com>
Tested-by: Ding, Haitao <haitao.ding@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: cactus <cactus@intel.com>
Diffstat (limited to 'va')
-rwxr-xr-x | va/Android.mk | 1 | ||||
-rw-r--r-- | va/Makefile.am | 1 | ||||
-rwxr-xr-x | va/va.h | 12 | ||||
-rw-r--r-- | va/va_enc_vp8.h | 138 | ||||
-rwxr-xr-x | va/va_trace.c | 4 |
5 files changed, 156 insertions, 0 deletions
diff --git a/va/Android.mk b/va/Android.mk index 3f9c24c..a6df318 100755 --- a/va/Android.mk +++ b/va/Android.mk @@ -53,6 +53,7 @@ LOCAL_COPY_HEADERS := \ va_version.h \ va_enc.h \ va_enc_h264.h \ + va_enc_vp8.h \ va_backend.h \ x11/va_dricommon.h \ va_vpp.h \ diff --git a/va/Makefile.am b/va/Makefile.am index 8919c47..8d4f31a 100644 --- a/va/Makefile.am +++ b/va/Makefile.am @@ -49,6 +49,7 @@ libva_source_h = \ va_dummy.h \ va_enc.h \ va_enc_h264.h \ + va_enc_vp8.h \ va_tpi.h \ va_version.h \ va_vpp.h \ @@ -391,6 +391,18 @@ typedef enum * through VAEncSliceParameterBufferH264::macroblock_info. */ VAConfigAttribEncMacroblockInfo = 16, + /** + * \brief Auto reconstructed/reference frame management. Read/Write. + * + * This attribute determines whether the driver supports auto reconstructed + * and reference management. + * + * 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, /**@}*/ VAConfigAttribTypeMax diff --git a/va/va_enc_vp8.h b/va/va_enc_vp8.h new file mode 100644 index 0000000..51b2c4b --- /dev/null +++ b/va/va_enc_vp8.h @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2007-2012 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_vp8.h + * \brief VP8 encoding API + * + * This file contains the \ref api_enc_vp8 "VP8 encoding API". + */ + +#ifndef VA_ENC_VP8_H +#define VA_ENC_VP8_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup api_enc_vp8 VP8 encoding API + * + * @{ + */ + +/** + * \brief VP8 Encoding Sequence Parameter Buffer Structure + * + * This structure conveys sequence level parameters. + * + */ +typedef struct _VAEncSequenceParameterBufferVP8 +{ + /* profile */ + unsigned int profile; + /* frame width in pixels */ + unsigned int frame_width; + /* frame height in pixels */ + unsigned int frame_height; + /* frame rate */ + unsigned int frame_rate; + /* whether to enable error resilience features */ + unsigned int error_resilient; + /* number of token partitions */ + unsigned int num_token_partitions; + /* auto keyframe placement, non-zero means enable auto keyframe placement */ + unsigned int kf_auto; + /* keyframe minimum interval */ + unsigned int kf_min_dist; + /* keyframe maximum interval */ + unsigned int kf_max_dist; + + /* quality setting, equivalent to VP8E_SET_CPUUSED */ + unsigned int quality_setting; + + /* RC related fields. RC modes are set with VAConfigAttribRateControl */ + /* For VP8, CBR implies HRD conformance and VBR implies no HRD conformance */ + + /* target bit-rate */ + unsigned int bits_per_second; + /* min QP */ + unsigned int min_qp; + /* max QP */ + unsigned int max_qp; + /* RC undershoot percentage */ + unsigned int rc_undershoot; + /* RC overshoot percentage */ + unsigned int rc_overshoot; + /* HRD buffer size */ + unsigned int hrd_buf_size; + /* HRD buffer initial fullness */ + unsigned int hrd_buf_initial_fullness; + /* HRD buffer optimal fullness */ + unsigned int hrd_buf_optimal_fullness; + +} VAEncSequenceParameterBufferVP8; + +/** + * \brief VP8 Encoding Picture Parameter Buffer Structure + * + * This structure conveys picture level parameters. + * + */ +typedef struct _VAEncPictureParameterBufferVP8 +{ + /* specifies the "last" reference frame */ + VASurfaceID last_ref_frame; + /* specifies the "golden" reference frame */ + VASurfaceID golden_ref_frame; + /* specifies the "alternate" referrence frame */ + VASurfaceID alt_ref_frame; + /* surface to store reconstructed frame */ + VASurfaceID reconstructed_frame; + /* buffer to store coded data */ + VABufferID coded_buf; + + union { + struct { + /* force this frame to be a keyframe */ + unsigned int force_kf : 1; + /* don't reference the last frame */ + unsigned int no_ref_last : 1; + /* don't reference the golden frame */ + unsigned int no_ref_gf : 1; + /* don't reference the alternate reference frame */ + unsigned int no_ref_arf : 1; + } bits; + unsigned int value; + } pic_flags; + +} VAEncPictureParameterBufferVP8; + +/**@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* VA_ENC_VP8_H */ diff --git a/va/va_trace.c b/va/va_trace.c index e21c5a9..b06c400 100755 --- a/va/va_trace.c +++ b/va/va_trace.c @@ -1457,6 +1457,10 @@ static void va_TraceVAEncMiscParameterBuffer( 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); + va_TraceMsg(idx, "\tbasic_unit_size = %d\n", p->basic_unit_size); + va_TraceMsg(idx, "\trc_flags.reset = %d \n", p->rc_flags.bits.reset); + va_TraceMsg(idx, "\trc_flags.disable_frame_skip = %d\n", p->rc_flags.bits.disable_frame_skip); + va_TraceMsg(idx, "\trc_flags.disable_bit_stuffing = %d\n", p->rc_flags.bits.disable_bit_stuffing); break; } case VAEncMiscParameterTypeMaxSliceSize: |