You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/mlpdec: update matrix encoding only if it changed
This commit is contained in:
@@ -73,6 +73,7 @@ typedef struct SubStream {
|
|||||||
uint64_t mask;
|
uint64_t mask;
|
||||||
/// The matrix encoding mode for this substream
|
/// The matrix encoding mode for this substream
|
||||||
enum AVMatrixEncoding matrix_encoding;
|
enum AVMatrixEncoding matrix_encoding;
|
||||||
|
enum AVMatrixEncoding prev_matrix_encoding;
|
||||||
|
|
||||||
/// Channel coding parameters for channels in the substream
|
/// Channel coding parameters for channels in the substream
|
||||||
ChannelParams channel_params[MAX_CHANNELS];
|
ChannelParams channel_params[MAX_CHANNELS];
|
||||||
@@ -1123,8 +1124,12 @@ static int output_data(MLPDecodeContext *m, unsigned int substr,
|
|||||||
is32);
|
is32);
|
||||||
|
|
||||||
/* Update matrix encoding side data */
|
/* Update matrix encoding side data */
|
||||||
if ((ret = ff_side_data_update_matrix_encoding(frame, s->matrix_encoding)) < 0)
|
if (s->matrix_encoding != s->prev_matrix_encoding) {
|
||||||
return ret;
|
if ((ret = ff_side_data_update_matrix_encoding(frame, s->matrix_encoding)) < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
s->prev_matrix_encoding = s->matrix_encoding;
|
||||||
|
}
|
||||||
|
|
||||||
*got_frame_ptr = 1;
|
*got_frame_ptr = 1;
|
||||||
|
|
||||||
@@ -1353,6 +1358,7 @@ static void mlp_decode_flush(AVCodecContext *avctx)
|
|||||||
SubStream *s = &m->substream[substr];
|
SubStream *s = &m->substream[substr];
|
||||||
|
|
||||||
s->lossless_check_data = 0xffffffff;
|
s->lossless_check_data = 0xffffffff;
|
||||||
|
s->prev_matrix_encoding = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user