#define SE_16BIT(x) if (x & 0x8000) x -= 0x10000;
-static int interplay_delta_table[] = {
+static const int interplay_delta_table[] = {
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23,
-static int dpcm_decode_init(AVCodecContext *avctx)
+static av_cold int dpcm_decode_init(AVCodecContext *avctx)
{
DPCMContext *s = avctx->priv_data;
int i;
break;
}
+ avctx->sample_fmt = SAMPLE_FMT_S16;
return 0;
}
return buf_size;
}
-#define DPCM_DECODER(id, name) \
+#define DPCM_DECODER(id, name, long_name_) \
AVCodec name ## _decoder = { \
#name, \
CODEC_TYPE_AUDIO, \
NULL, \
NULL, \
dpcm_decode_frame, \
+ .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
};
-DPCM_DECODER(CODEC_ID_INTERPLAY_DPCM, interplay_dpcm);
-DPCM_DECODER(CODEC_ID_ROQ_DPCM, roq_dpcm);
-DPCM_DECODER(CODEC_ID_SOL_DPCM, sol_dpcm);
-DPCM_DECODER(CODEC_ID_XAN_DPCM, xan_dpcm);
+DPCM_DECODER(CODEC_ID_INTERPLAY_DPCM, interplay_dpcm, "Interplay DPCM");
+DPCM_DECODER(CODEC_ID_ROQ_DPCM, roq_dpcm, "id RoQ DPCM");
+DPCM_DECODER(CODEC_ID_SOL_DPCM, sol_dpcm, "Sol DPCM");
+DPCM_DECODER(CODEC_ID_XAN_DPCM, xan_dpcm, "Xan DPCM");