summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorottingerg <g.ottinger@gmx.at>2018-05-11 09:54:31 +0200
committerXiang, Haihao <haihao.xiang@intel.com>2018-05-18 16:35:35 +0800
commitc6da3489fba6d400dd89959cace9db8d25e6a6b6 (patch)
treeb79eac6307844f056fb1f88f55cda1821afaf295
parent40b15a5c6c0103c23a5db810aef27cf75d0b6723 (diff)
downloadlibva-intel-driver-c6da3489fba6d400dd89959cace9db8d25e6a6b6.tar.gz
vp8 encoder parameter check - do not check for ref frames if no no_ref_X flag is set
In VP8 encoding not always all reference frames (last, golden, altref) are provided. This is indicated with the flags ref_flags.bits.no_ref_last, ref_flags.bits.no_ref_gf and ref_flags.bits.no_ref_arf in VAEncPictureParameterBufferVP8. While checking picture parameters, make sure that assert errors concerning invalid reference frame only occure if no_ref_X is not set.
-rw-r--r--src/i965_encoder.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/src/i965_encoder.c b/src/i965_encoder.c
index 3aab36c0..8cfdfe59 100644
--- a/src/i965_encoder.c
+++ b/src/i965_encoder.c
@@ -1154,32 +1154,39 @@ intel_encoder_check_vp8_parameter(VADriverContextP ctx,
encode_state->coded_buf_object = obj_buffer;
if (!is_key_frame) {
- assert(pic_param->ref_last_frame != VA_INVALID_SURFACE);
- obj_surface = SURFACE(pic_param->ref_last_frame);
- assert(obj_surface && obj_surface->bo);
- if (!obj_surface || !obj_surface->bo)
- goto error;
+ if(!pic_param->ref_flags.bits.no_ref_last) {
+ assert(pic_param->ref_last_frame != VA_INVALID_SURFACE);
+ obj_surface = SURFACE(pic_param->ref_last_frame);
+ assert(obj_surface && obj_surface->bo);
- encode_state->reference_objects[i++] = obj_surface;
+ if (!obj_surface || !obj_surface->bo)
+ goto error;
- assert(pic_param->ref_gf_frame != VA_INVALID_SURFACE);
- obj_surface = SURFACE(pic_param->ref_gf_frame);
- assert(obj_surface && obj_surface->bo);
+ encode_state->reference_objects[i++] = obj_surface;
+ }
- if (!obj_surface || !obj_surface->bo)
- goto error;
+ if(!pic_param->ref_flags.bits.no_ref_gf) {
+ assert(pic_param->ref_gf_frame != VA_INVALID_SURFACE);
+ obj_surface = SURFACE(pic_param->ref_gf_frame);
+ assert(obj_surface && obj_surface->bo);
- encode_state->reference_objects[i++] = obj_surface;
+ if (!obj_surface || !obj_surface->bo)
+ goto error;
- assert(pic_param->ref_arf_frame != VA_INVALID_SURFACE);
- obj_surface = SURFACE(pic_param->ref_arf_frame);
- assert(obj_surface && obj_surface->bo);
+ encode_state->reference_objects[i++] = obj_surface;
+ }
- if (!obj_surface || !obj_surface->bo)
- goto error;
+ if(!pic_param->ref_flags.bits.no_ref_arf) {
+ assert(pic_param->ref_arf_frame != VA_INVALID_SURFACE);
+ obj_surface = SURFACE(pic_param->ref_arf_frame);
+ assert(obj_surface && obj_surface->bo);
- encode_state->reference_objects[i++] = obj_surface;
+ if (!obj_surface || !obj_surface->bo)
+ goto error;
+
+ encode_state->reference_objects[i++] = obj_surface;
+ }
}
for (; i < 16; i++)