#include "internal.h"
#include "aandcttab.h"
+#define CBP_VLC_BITS 9
+
typedef struct MV30Context {
GetBitContext gb;
}
}
-static inline void idct_1d(int *blk, int step)
+static inline void idct_1d(unsigned *blk, int step)
{
const unsigned t0 = blk[0 * step] + blk[4 * step];
const unsigned t1 = blk[0 * step] - blk[4 * step];
memset(coeffs, 0, nb_codes * sizeof(*coeffs));
for (int i = 0; i < nb_codes;) {
- int value = get_vlc2(gb, cbp_tab.table, cbp_tab.bits, 1);
-
- if (value < 0)
- return AVERROR_INVALIDDATA;
+ int value = get_vlc2(gb, cbp_tab.table, CBP_VLC_BITS, 1);
if (value > 0) {
int x = get_bits(gb, value);
return avpkt->size;
}
-static const uint16_t cbp_codes[] = {
- 0, 1, 4, 5, 6, 0xE, 0x1E, 0x3E, 0x7E, 0xFE, 0x1FE, 0x1FF,
-};
-
static const uint8_t cbp_bits[] = {
2, 2, 3, 3, 3, 4, 5, 6, 7, 8, 9, 9,
};
static av_cold void init_static_data(void)
{
- INIT_VLC_SPARSE_STATIC(&cbp_tab, 9, FF_ARRAY_ELEMS(cbp_bits),
- cbp_bits, 1, 1, cbp_codes, 2, 2, NULL, 0, 0, 512);
+ INIT_VLC_STATIC_FROM_LENGTHS(&cbp_tab, CBP_VLC_BITS, FF_ARRAY_ELEMS(cbp_bits),
+ cbp_bits, 1, NULL, 0, 0, 0, 0, 1 << CBP_VLC_BITS);
}
static av_cold int decode_init(AVCodecContext *avctx)
return 0;
}
-AVCodec ff_mv30_decoder = {
+const AVCodec ff_mv30_decoder = {
.name = "mv30",
.long_name = NULL_IF_CONFIG_SMALL("MidiVid 3.0"),
.type = AVMEDIA_TYPE_VIDEO,