avcodec/mlpenc: simplify strange pointer initializations

This commit is contained in:
Paul B Mahol 2021-09-07 18:03:16 +02:00
parent 7ebeef6aff
commit 1cbd4b00b1
1 changed files with 4 additions and 12 deletions

View File

@ -1970,12 +1970,8 @@ static void set_major_params(MLPEncodeContext *ctx)
RestartHeader *rh = ctx->cur_restart_header; RestartHeader *rh = ctx->cur_restart_header;
uint8_t max_huff_lsbs = 0; uint8_t max_huff_lsbs = 0;
uint8_t max_output_bits = 0; uint8_t max_output_bits = 0;
DecodingParams *seq_dp = (DecodingParams *) ctx->decoding_params+ DecodingParams *seq_dp = ctx->decoding_params + ctx->seq_offset[0] * ctx->avctx->channels;
(ctx->restart_intervals - 1)*(ctx->sequence_size)*(ctx->avctx->channels) + ChannelParams *seq_cp = ctx->channel_params + ctx->seq_offset[0] * ctx->avctx->channels;
(ctx->seq_offset[ctx->restart_intervals - 1])*(ctx->avctx->channels);
ChannelParams *seq_cp = (ChannelParams *) ctx->channel_params +
(ctx->restart_intervals - 1)*(ctx->sequence_size)*(ctx->avctx->channels) +
(ctx->seq_offset[ctx->restart_intervals - 1])*(ctx->avctx->channels);
for (unsigned int index = 0; index < ctx->seq_size[ctx->restart_intervals-1]; index++) { for (unsigned int index = 0; index < ctx->seq_size[ctx->restart_intervals-1]; index++) {
memcpy(&ctx->major_decoding_params[index], seq_dp + index, sizeof(DecodingParams)); memcpy(&ctx->major_decoding_params[index], seq_dp + index, sizeof(DecodingParams));
@ -2160,13 +2156,9 @@ input_and_return:
ctx->number_of_frames = ctx->next_major_number_of_frames; ctx->number_of_frames = ctx->next_major_number_of_frames;
ctx->number_of_subblocks = ctx->next_major_number_of_frames + 1; ctx->number_of_subblocks = ctx->next_major_number_of_frames + 1;
ctx->seq_channel_params = (ChannelParams *) ctx->channel_params + ctx->seq_channel_params = ctx->channel_params + ctx->seq_offset[seq_index] * ctx->avctx->channels;
(ctx->frame_index / ctx->min_restart_interval)*(ctx->sequence_size)*(ctx->avctx->channels) +
(ctx->seq_offset[seq_index])*(ctx->avctx->channels);
ctx->seq_decoding_params = (DecodingParams *) ctx->decoding_params + ctx->seq_decoding_params = ctx->decoding_params + ctx->seq_offset[seq_index];
(ctx->frame_index / ctx->min_restart_interval)*(ctx->sequence_size) +
(ctx->seq_offset[seq_index]);
number_of_samples = avctx->frame_size * ctx->number_of_frames; number_of_samples = avctx->frame_size * ctx->number_of_frames;
ctx->number_of_samples = number_of_samples; ctx->number_of_samples = number_of_samples;