@ -173,6 +173,14 @@ typedef struct MLPDecodeContext {
DECLARE_ALIGNED ( 32 , int32_t , sample_buffer ) [ MAX_BLOCKSIZE ] [ MAX_CHANNELS ] ;
MLPDSPContext dsp ;
int32_t ( * pack_output ) ( int32_t lossless_check_data ,
uint16_t blockpos ,
int32_t ( * sample_buffer ) [ MAX_CHANNELS ] ,
void * data ,
uint8_t * ch_assign ,
int8_t * output_shift ,
uint8_t max_matrix_channel ,
int is32 ) ;
} MLPDecodeContext ;
static const enum AVChannel thd_channel_order [ ] = {
@ -422,7 +430,7 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
m - > avctx - > sample_fmt = AV_SAMPLE_FMT_S32 ;
else
m - > avctx - > sample_fmt = AV_SAMPLE_FMT_S16 ;
m - > dsp . mlp_ pack_output = m - > dsp . mlp_select_pack_output ( m - > substream [ m - > max_decoded_substream ] . ch_assign ,
m - > pack_output = m - > dsp . mlp_select_pack_output ( m - > substream [ m - > max_decoded_substream ] . ch_assign ,
m - > substream [ m - > max_decoded_substream ] . output_shift ,
m - > substream [ m - > max_decoded_substream ] . max_matrix_channel ,
m - > avctx - > sample_fmt = = AV_SAMPLE_FMT_S32 ) ;
@ -663,7 +671,7 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
if ( substr = = m - > max_decoded_substream ) {
av_channel_layout_uninit ( & m - > avctx - > ch_layout ) ;
av_channel_layout_from_mask ( & m - > avctx - > ch_layout , s - > mask ) ;
m - > dsp . mlp_ pack_output = m - > dsp . mlp_select_pack_output ( s - > ch_assign ,
m - > pack_output = m - > dsp . mlp_select_pack_output ( s - > ch_assign ,
s - > output_shift ,
s - > max_matrix_channel ,
m - > avctx - > sample_fmt = = AV_SAMPLE_FMT_S32 ) ;
@ -925,7 +933,7 @@ static int read_decoding_params(MLPDecodeContext *m, GetBitContext *gbp,
}
}
if ( substr = = m - > max_decoded_substream )
m - > dsp . mlp_ pack_output = m - > dsp . mlp_select_pack_output ( s - > ch_assign ,
m - > pack_output = m - > dsp . mlp_select_pack_output ( s - > ch_assign ,
s - > output_shift ,
s - > max_matrix_channel ,
m - > avctx - > sample_fmt = = AV_SAMPLE_FMT_S32 ) ;
@ -1155,7 +1163,7 @@ static int output_data(MLPDecodeContext *m, unsigned int substr,
frame - > nb_samples = s - > blockpos ;
if ( ( ret = ff_get_buffer ( avctx , frame , 0 ) ) < 0 )
return ret ;
s - > lossless_check_data = m - > dsp . mlp_ pack_output( s - > lossless_check_data ,
s - > lossless_check_data = m - > pack_output ( s - > lossless_check_data ,
s - > blockpos ,
m - > sample_buffer ,
frame - > data [ 0 ] ,