@@ -411,6 +411,7 @@ static void
411
411
gen9_hevc_enc_free_resources (struct encoder_vme_mfc_context * vme_context )
412
412
{
413
413
struct gen9_hevc_encoder_context * priv_ctx = NULL ;
414
+ int i ;
414
415
415
416
priv_ctx = (struct gen9_hevc_encoder_context * )vme_context -> private_enc_ctx ;
416
417
@@ -425,6 +426,8 @@ gen9_hevc_enc_free_resources(struct encoder_vme_mfc_context *vme_context)
425
426
i965_free_gpe_resource (& priv_ctx -> res_brc_constant_data_buffer );
426
427
427
428
i965_free_gpe_resource (& priv_ctx -> res_mb_code_surface );
429
+ i965_free_gpe_resource (& priv_ctx -> res_min_distortion_buffer );
430
+ i965_free_gpe_resource (& priv_ctx -> res_brc_mb_qp_buffer );
428
431
429
432
// free VME buffers
430
433
i965_free_gpe_resource (& priv_ctx -> res_flatness_check_surface );
@@ -446,6 +449,7 @@ gen9_hevc_enc_free_resources(struct encoder_vme_mfc_context *vme_context)
446
449
i965_free_gpe_resource (& priv_ctx -> res_mvp_index_buffer );
447
450
i965_free_gpe_resource (& priv_ctx -> res_roi_buffer );
448
451
i965_free_gpe_resource (& priv_ctx -> res_mb_statistics_buffer );
452
+ i965_free_gpe_resource (& priv_ctx -> res_slice_map_buffer );
449
453
450
454
if (priv_ctx -> scaled_2x_surface_obj ) {
451
455
i965_DestroySurfaces (priv_ctx -> ctx , & priv_ctx -> scaled_2x_surface_id , 1 );
@@ -462,6 +466,12 @@ gen9_hevc_enc_free_resources(struct encoder_vme_mfc_context *vme_context)
462
466
i965_free_gpe_resource (& priv_ctx -> sao_line_buffer );
463
467
i965_free_gpe_resource (& priv_ctx -> sao_tile_line_buffer );
464
468
i965_free_gpe_resource (& priv_ctx -> sao_tile_column_buffer );
469
+ i965_free_gpe_resource (& priv_ctx -> res_brc_pic_states_read_buffer );
470
+
471
+ for (i = 0 ; i < GEN9_MAX_MV_TEMPORAL_BUFFERS ; i ++ ) {
472
+ dri_bo_unreference (priv_ctx -> mv_temporal_buffer [i ].bo );
473
+ priv_ctx -> mv_temporal_buffer [i ].bo = NULL ;
474
+ }
465
475
466
476
priv_ctx -> res_inited = 0 ;
467
477
}
@@ -6315,9 +6325,8 @@ gen9_hevc_pak_add_pipe_buf_addr_state(VADriverContextP ctx,
6315
6325
OUT_BUFFER_MA_TARGET (NULL );
6316
6326
6317
6327
for (i = 0 ; i < GEN9_MAX_REF_SURFACES ; i ++ ) {
6318
- if (priv_ctx -> reference_surfaces [i ].obj_surface &&
6319
- priv_ctx -> reference_surfaces [i ].obj_surface -> bo ) {
6320
- bo = priv_ctx -> reference_surfaces [i ].obj_surface -> bo ;
6328
+ if (priv_ctx -> reference_surfaces [i ].obj_surface_bo ) {
6329
+ bo = priv_ctx -> reference_surfaces [i ].obj_surface_bo ;
6321
6330
6322
6331
OUT_BUFFER_NMA_REFERENCE (bo );
6323
6332
} else
@@ -6996,19 +7005,17 @@ gen9_hevc_pak_pipeline_prepare(VADriverContextP ctx,
6996
7005
priv_state = (struct gen9_hevc_encoder_state * )pak_context -> private_enc_state ;
6997
7006
pic_param = (VAEncPictureParameterBufferHEVC * )encode_state -> pic_param_ext -> buffer ;
6998
7007
6999
- if (priv_ctx -> uncompressed_picture_source .obj_surface &&
7000
- priv_ctx -> uncompressed_picture_source .obj_surface -> bo )
7001
- dri_bo_unreference (priv_ctx -> uncompressed_picture_source .obj_surface -> bo );
7008
+ dri_bo_unreference (priv_ctx -> uncompressed_picture_source .obj_surface_bo );
7002
7009
priv_ctx -> uncompressed_picture_source .obj_surface = encode_state -> input_yuv_object ;
7003
7010
priv_ctx -> uncompressed_picture_source .surface_id = encoder_context -> input_yuv_surface ;
7004
- dri_bo_reference (priv_ctx -> uncompressed_picture_source .obj_surface -> bo );
7011
+ priv_ctx -> uncompressed_picture_source .obj_surface_bo = encode_state -> input_yuv_object -> bo ;
7012
+ dri_bo_reference (priv_ctx -> uncompressed_picture_source .obj_surface_bo );
7005
7013
7006
- if (priv_ctx -> reconstructed_object .obj_surface &&
7007
- priv_ctx -> reconstructed_object .obj_surface -> bo )
7008
- dri_bo_unreference (priv_ctx -> reconstructed_object .obj_surface -> bo );
7014
+ dri_bo_unreference (priv_ctx -> reconstructed_object .obj_surface_bo );
7009
7015
priv_ctx -> reconstructed_object .obj_surface = encode_state -> reconstructed_object ;
7010
7016
priv_ctx -> reconstructed_object .surface_id = pic_param -> decoded_curr_pic .picture_id ;
7011
- dri_bo_reference (priv_ctx -> reconstructed_object .obj_surface -> bo );
7017
+ priv_ctx -> reconstructed_object .obj_surface_bo = encode_state -> reconstructed_object -> bo ;
7018
+ dri_bo_reference (priv_ctx -> reconstructed_object .obj_surface_bo );
7012
7019
7013
7020
surface_priv = (struct gen9_hevc_surface_priv * )encode_state -> reconstructed_object -> private_data ;
7014
7021
if (surface_priv ) {
@@ -7023,12 +7030,11 @@ gen9_hevc_pak_pipeline_prepare(VADriverContextP ctx,
7023
7030
for (i = 0 ; i < GEN9_MAX_REF_SURFACES ; i ++ ) {
7024
7031
obj_surface = encode_state -> reference_objects [i ];
7025
7032
if (obj_surface && obj_surface -> bo ) {
7026
- if (priv_ctx -> reference_surfaces [i ].obj_surface &&
7027
- priv_ctx -> reference_surfaces [i ].obj_surface -> bo )
7028
- dri_bo_unreference (priv_ctx -> reference_surfaces [i ].obj_surface -> bo );
7033
+ dri_bo_unreference (priv_ctx -> reference_surfaces [i ].obj_surface_bo );
7029
7034
priv_ctx -> reference_surfaces [i ].obj_surface = obj_surface ;
7030
7035
priv_ctx -> reference_surfaces [i ].surface_id = pic_param -> reference_frames [i ].picture_id ;
7031
- dri_bo_reference (obj_surface -> bo );
7036
+ priv_ctx -> reference_surfaces [i ].obj_surface_bo = obj_surface -> bo ;
7037
+ dri_bo_reference (priv_ctx -> reference_surfaces [i ].obj_surface_bo );
7032
7038
7033
7039
surface_priv = (struct gen9_hevc_surface_priv * ) obj_surface -> private_data ;
7034
7040
if (surface_priv ) {
@@ -7283,18 +7289,15 @@ gen9_hevc_pak_context_destroy(void *context)
7283
7289
dri_bo_unreference (priv_ctx -> indirect_pak_bse_object .bo );
7284
7290
priv_ctx -> indirect_pak_bse_object .bo = NULL ;
7285
7291
7286
- if (priv_ctx -> uncompressed_picture_source .obj_surface &&
7287
- priv_ctx -> uncompressed_picture_source .obj_surface -> bo )
7288
- i965_destroy_surface_storage (priv_ctx -> uncompressed_picture_source .obj_surface );
7292
+ dri_bo_unreference (priv_ctx -> uncompressed_picture_source .obj_surface_bo );
7293
+ priv_ctx -> uncompressed_picture_source .obj_surface_bo = NULL ;
7294
+ dri_bo_unreference (priv_ctx -> reconstructed_object .obj_surface_bo );
7295
+ priv_ctx -> reconstructed_object .obj_surface_bo = NULL ;
7289
7296
7290
- if (priv_ctx -> reconstructed_object .obj_surface &&
7291
- priv_ctx -> reconstructed_object .obj_surface -> bo )
7292
- i965_destroy_surface_storage (priv_ctx -> reconstructed_object .obj_surface );
7293
-
7294
- for (i = 0 ; i < GEN9_MAX_REF_SURFACES ; i ++ )
7295
- if (priv_ctx -> reference_surfaces [i ].obj_surface &&
7296
- priv_ctx -> reference_surfaces [i ].obj_surface -> bo )
7297
- i965_destroy_surface_storage (priv_ctx -> reference_surfaces [i ].obj_surface );
7297
+ for (i = 0 ; i < GEN9_MAX_REF_SURFACES ; i ++ ) {
7298
+ dri_bo_unreference (priv_ctx -> reference_surfaces [i ].obj_surface_bo );
7299
+ priv_ctx -> reference_surfaces [i ].obj_surface_bo = NULL ;
7300
+ }
7298
7301
}
7299
7302
7300
7303
#define STATUS_IMPLEMENTATION_START
0 commit comments