[Libva] [PATCH v2 12/12] VP8 HWEnc: Take num_token_partitions as log2_num
Zhong Li
zhong.li at intel.com
Tue Jan 13 21:03:43 PST 2015
Signed-off-by: Zhong Li <zhong.li at intel.com>
---
src/gen8_mfc.c | 6 ++----
src/gen9_mfc.c | 6 ++----
src/i965_encoder_utils.c | 2 +-
3 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/src/gen8_mfc.c b/src/gen8_mfc.c
index 66e10cd..186e503 100644
--- a/src/gen8_mfc.c
+++ b/src/gen8_mfc.c
@@ -3606,9 +3606,7 @@ gen8_mfc_vp8_pic_state(VADriverContextP ctx,
VAQMatrixBufferVP8 *q_matrix = (VAQMatrixBufferVP8 *)encode_state->q_matrix->buffer;
int i, j, log2num;
- assert(pic_param->pic_flags.bits.num_token_partitions > 0);
- assert(pic_param->pic_flags.bits.num_token_partitions < 9);
- log2num = (int)log2(pic_param->pic_flags.bits.num_token_partitions);
+ log2num = pic_param->pic_flags.bits.num_token_partitions;
/*update mode and token probs*/
vp8_enc_state_update(mfc_context, q_matrix);
@@ -4051,7 +4049,7 @@ static void gen8_mfc_calc_vp8_coded_buffer_size(VADriverContextP ctx,
unsigned char is_intra_frame = !pic_param->pic_flags.bits.frame_type;
unsigned int *vp8_encoding_status, i, first_partition_bytes, token_partition_bytes, vp8_coded_bytes;
- int partition_num = 1 << (int)log2(pic_param->pic_flags.bits.num_token_partitions);
+ int partition_num = 1 << pic_param->pic_flags.bits.num_token_partitions;
first_partition_bytes = token_partition_bytes = vp8_coded_bytes = 0;
diff --git a/src/gen9_mfc.c b/src/gen9_mfc.c
index 4c926a3..5ac7c06 100644
--- a/src/gen9_mfc.c
+++ b/src/gen9_mfc.c
@@ -2756,9 +2756,7 @@ gen9_mfc_vp8_pic_state(VADriverContextP ctx,
VAQMatrixBufferVP8 *q_matrix = (VAQMatrixBufferVP8 *)encode_state->q_matrix->buffer;
int i, j, log2num;
- assert(pic_param->pic_flags.bits.num_token_partitions > 0);
- assert(pic_param->pic_flags.bits.num_token_partitions < 9);
- log2num = (int)log2(pic_param->pic_flags.bits.num_token_partitions);
+ log2num = pic_param->pic_flags.bits.num_token_partitions;
/*update mode and token probs*/
vp8_enc_state_update(mfc_context, q_matrix);
@@ -3201,7 +3199,7 @@ static void gen9_mfc_calc_vp8_coded_buffer_size(VADriverContextP ctx,
unsigned char is_intra_frame = !pic_param->pic_flags.bits.frame_type;
unsigned int *vp8_encoding_status, i, first_partition_bytes, token_partition_bytes, vp8_coded_bytes;
- int partition_num = 1 << (int)log2(pic_param->pic_flags.bits.num_token_partitions);
+ int partition_num = 1 << pic_param->pic_flags.bits.num_token_partitions;
first_partition_bytes = token_partition_bytes = vp8_coded_bytes = 0;
diff --git a/src/i965_encoder_utils.c b/src/i965_encoder_utils.c
index 8b9ed7c..8963a39 100644
--- a/src/i965_encoder_utils.c
+++ b/src/i965_encoder_utils.c
@@ -588,7 +588,7 @@ void binarize_vp8_frame_header(VAEncSequenceParameterBufferVP8 *seq_param,
avc_bitstream bs;
int i, j;
int is_intra_frame = !pic_param->pic_flags.bits.frame_type;
- int log2num = (int)log2(pic_param->pic_flags.bits.num_token_partitions);
+ int log2num = pic_param->pic_flags.bits.num_token_partitions;
/* modify picture paramters */
pic_param->pic_flags.bits.loop_filter_adj_enable = 1;
--
1.9.1
More information about the Libva
mailing list