hardware/intel/common/vaapi
Révision | c6da3489fba6d400dd89959cace9db8d25e6a6b6 (tree) |
---|---|
l'heure | 2018-05-18 17:35:35 |
Auteur | ottingerg <g.ottinger@gmx....> |
Commiter | Xiang, Haihao |
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.
@@ -1154,32 +1154,39 @@ intel_encoder_check_vp8_parameter(VADriverContextP ctx, | ||
1154 | 1154 | encode_state->coded_buf_object = obj_buffer; |
1155 | 1155 | |
1156 | 1156 | if (!is_key_frame) { |
1157 | - assert(pic_param->ref_last_frame != VA_INVALID_SURFACE); | |
1158 | - obj_surface = SURFACE(pic_param->ref_last_frame); | |
1159 | - assert(obj_surface && obj_surface->bo); | |
1160 | 1157 | |
1161 | - if (!obj_surface || !obj_surface->bo) | |
1162 | - goto error; | |
1158 | + if(!pic_param->ref_flags.bits.no_ref_last) { | |
1159 | + assert(pic_param->ref_last_frame != VA_INVALID_SURFACE); | |
1160 | + obj_surface = SURFACE(pic_param->ref_last_frame); | |
1161 | + assert(obj_surface && obj_surface->bo); | |
1163 | 1162 | |
1164 | - encode_state->reference_objects[i++] = obj_surface; | |
1163 | + if (!obj_surface || !obj_surface->bo) | |
1164 | + goto error; | |
1165 | 1165 | |
1166 | - assert(pic_param->ref_gf_frame != VA_INVALID_SURFACE); | |
1167 | - obj_surface = SURFACE(pic_param->ref_gf_frame); | |
1168 | - assert(obj_surface && obj_surface->bo); | |
1166 | + encode_state->reference_objects[i++] = obj_surface; | |
1167 | + } | |
1169 | 1168 | |
1170 | - if (!obj_surface || !obj_surface->bo) | |
1171 | - goto error; | |
1169 | + if(!pic_param->ref_flags.bits.no_ref_gf) { | |
1170 | + assert(pic_param->ref_gf_frame != VA_INVALID_SURFACE); | |
1171 | + obj_surface = SURFACE(pic_param->ref_gf_frame); | |
1172 | + assert(obj_surface && obj_surface->bo); | |
1172 | 1173 | |
1173 | - encode_state->reference_objects[i++] = obj_surface; | |
1174 | + if (!obj_surface || !obj_surface->bo) | |
1175 | + goto error; | |
1174 | 1176 | |
1175 | - assert(pic_param->ref_arf_frame != VA_INVALID_SURFACE); | |
1176 | - obj_surface = SURFACE(pic_param->ref_arf_frame); | |
1177 | - assert(obj_surface && obj_surface->bo); | |
1177 | + encode_state->reference_objects[i++] = obj_surface; | |
1178 | + } | |
1178 | 1179 | |
1179 | - if (!obj_surface || !obj_surface->bo) | |
1180 | - goto error; | |
1180 | + if(!pic_param->ref_flags.bits.no_ref_arf) { | |
1181 | + assert(pic_param->ref_arf_frame != VA_INVALID_SURFACE); | |
1182 | + obj_surface = SURFACE(pic_param->ref_arf_frame); | |
1183 | + assert(obj_surface && obj_surface->bo); | |
1181 | 1184 | |
1182 | - encode_state->reference_objects[i++] = obj_surface; | |
1185 | + if (!obj_surface || !obj_surface->bo) | |
1186 | + goto error; | |
1187 | + | |
1188 | + encode_state->reference_objects[i++] = obj_surface; | |
1189 | + } | |
1183 | 1190 | } |
1184 | 1191 | |
1185 | 1192 | for (; i < 16; i++) |