Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the max slice number definition error in hevc encoder #193

Merged
merged 1 commit into from
Jun 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/gen9_hevc_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -3927,15 +3927,15 @@ gen9_hevc_set_control_region(VADriverContextP ctx,
unsigned int offset_to_the_region_start[16];
unsigned short temp_data[32][32];
int is_arbitrary_slices = 0;
int slice_start_y[NUM_SLICES + 1];
int slice_start_y[I965_MAX_NUM_SLICE + 1];
int max_height;
int k = 0, i = 0;

vme_context = (struct encoder_vme_mfc_context *)encoder_context->vme_context;
priv_ctx = (struct gen9_hevc_encoder_context *)vme_context->private_enc_ctx;
priv_state = (struct gen9_hevc_encoder_state *)vme_context->private_enc_state;

memset(slice_start_y, 0, sizeof(int) * (NUM_SLICES + 1));
memset(slice_start_y, 0, sizeof(int) * (I965_MAX_NUM_SLICE + 1));
memset(region_start_table, 0, sizeof(region_start_table));
memset(temp_data, 0, sizeof(temp_data));
memset(offset_to_the_region_start, 0, sizeof(offset_to_the_region_start));
Expand Down Expand Up @@ -7041,7 +7041,7 @@ gen9_hevc_pak_pipeline_prepare(VADriverContextP ctx,
if (!priv_ctx->res_pak_slice_batch_buffer)
return VA_STATUS_ERROR_ALLOCATION_FAILED;

for (i = 0; i < NUM_SLICES; i++) {
for (i = 0; i < I965_MAX_NUM_SLICE; i++) {
priv_state->slice_batch_offset[i] = 0;
priv_state->slice_start_lcu[i] = 0;
}
Expand Down
4 changes: 2 additions & 2 deletions src/gen9_hevc_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,8 @@ struct gen9_hevc_encoder_state {
int pak_obj_size;
int cu_record_size;
int pic_state_size;
int slice_batch_offset[NUM_SLICES];
int slice_start_lcu[NUM_SLICES];
int slice_batch_offset[I965_MAX_NUM_SLICE];
int slice_start_lcu[I965_MAX_NUM_SLICE];

struct hevc_encode_status_buffer status_buffer;
enum HEVC_TU_MODE tu_mode;
Expand Down