diff options
author | Indrajit Das <[email protected]> | 2018-01-10 15:12:44 +0530 |
---|---|---|
committer | Christian König <[email protected]> | 2018-01-16 10:51:00 +0100 |
commit | f5277e84925b69b0bf01340122684becd45c1f7d (patch) | |
tree | 7b3fee8341769f5ed4db60ba91c14f4dcd61f296 | |
parent | 38dee62c9a0ced17fb1f25256f9da3b163a16f81 (diff) |
radeon/vcn: update quantiser matrices only when requested
Only update them when the pointers are valid.
Signed-off-by: Indrajit Das <[email protected]>
Reviewed-by: Christian König <[email protected]>
-rw-r--r-- | src/gallium/drivers/radeon/radeon_vcn_dec.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gallium/drivers/radeon/radeon_vcn_dec.c b/src/gallium/drivers/radeon/radeon_vcn_dec.c index 8be95382cc0..d51eb6e3949 100644 --- a/src/gallium/drivers/radeon/radeon_vcn_dec.c +++ b/src/gallium/drivers/radeon/radeon_vcn_dec.c @@ -498,12 +498,17 @@ static rvcn_dec_message_mpeg2_vld_t get_mpeg2_msg(struct radeon_decoder *dec, result.forward_ref_pic_idx = get_ref_pic_idx(dec, pic->ref[0]); result.backward_ref_pic_idx = get_ref_pic_idx(dec, pic->ref[1]); - result.load_intra_quantiser_matrix = 1; - result.load_nonintra_quantiser_matrix = 1; - - for (i = 0; i < 64; ++i) { - result.intra_quantiser_matrix[i] = pic->intra_matrix[zscan[i]]; - result.nonintra_quantiser_matrix[i] = pic->non_intra_matrix[zscan[i]]; + if(pic->intra_matrix) { + result.load_intra_quantiser_matrix = 1; + for (i = 0; i < 64; ++i) { + result.intra_quantiser_matrix[i] = pic->intra_matrix[zscan[i]]; + } + } + if(pic->non_intra_matrix) { + result.load_nonintra_quantiser_matrix = 1; + for (i = 0; i < 64; ++i) { + result.nonintra_quantiser_matrix[i] = pic->non_intra_matrix[zscan[i]]; + } } result.profile_and_level_indication = 0; |