#include "h261.h"
#include "internal.h"
-#define H261_MBA_VLC_BITS 9
+#define H261_MBA_VLC_BITS 8
#define H261_MTYPE_VLC_BITS 6
#define H261_MV_VLC_BITS 7
#define H261_CBP_VLC_BITS 9
{
INIT_VLC_STATIC(&h261_mba_vlc, H261_MBA_VLC_BITS, 35,
ff_h261_mba_bits, 1, 1,
- ff_h261_mba_code, 1, 1, 662);
+ ff_h261_mba_code, 1, 1, 540);
INIT_VLC_STATIC(&h261_mtype_vlc, H261_MTYPE_VLC_BITS, 10,
ff_h261_mtype_bits, 1, 1,
ff_h261_mtype_code, 1, 1, 80);
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
h->gob_start_code_skipped = 0;
+ ff_mpv_idct_init(s);
ff_thread_once(&init_static_once, h261_decode_init_static);
retry:
init_get_bits(&s->gb, buf, buf_size * 8);
- if (!s->context_initialized)
- // we need the IDCT permutation for reading a custom matrix
- ff_mpv_idct_init(s);
-
ret = h261_decode_picture_header(h);
/* skip if the header was thrashed */
}
if (s->width != avctx->coded_width || s->height != avctx->coded_height) {
- ParseContext pc = s->parse_context; // FIXME move this demuxing hack to libavformat
- s->parse_context.buffer = 0;
ff_mpv_common_end(s);
- s->parse_context = pc;
}
if (!s->context_initialized) {
return 0;
}
-AVCodec ff_h261_decoder = {
+const AVCodec ff_h261_decoder = {
.name = "h261",
.long_name = NULL_IF_CONFIG_SMALL("H.261"),
.type = AVMEDIA_TYPE_VIDEO,
.close = h261_decode_end,
.decode = h261_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
- .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
.max_lowres = 3,
};