*/
/**
- * @file libavcodec/mpeg12.c
+ * @file
* MPEG-1/2 decoder
*/
w= get_bits(&s->gb, 14);
skip_bits(&s->gb, 1); //marker
h= get_bits(&s->gb, 14);
- skip_bits(&s->gb, 1); //marker
+ // remaining 3 bits are zero padding
s1->pan_scan.width= 16*w;
s1->pan_scan.height=16*h;
}
/**
- * Handles slice ends.
+ * Handle slice ends.
* @return 1 if it seems to be the last slice
*/
static int slice_end(AVCodecContext *avctx, AVFrame *pict)
time_code_pictures, s->closed_gop, broken_link);
}
/**
- * Finds the end of the current frame in the bitstream.
+ * Find the end of the current frame in the bitstream.
* @return the position of the first byte of the next frame, or -1
*/
int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, AVCodecParserContext *s)
AVCodec mpeg1video_decoder = {
"mpeg1video",
- CODEC_TYPE_VIDEO,
+ AVMEDIA_TYPE_VIDEO,
CODEC_ID_MPEG1VIDEO,
sizeof(Mpeg1Context),
mpeg_decode_init,
mpeg_decode_frame,
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
.flush= flush,
+ .max_lowres= 3,
.long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"),
};
AVCodec mpeg2video_decoder = {
"mpeg2video",
- CODEC_TYPE_VIDEO,
+ AVMEDIA_TYPE_VIDEO,
CODEC_ID_MPEG2VIDEO,
sizeof(Mpeg1Context),
mpeg_decode_init,
mpeg_decode_frame,
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
.flush= flush,
+ .max_lowres= 3,
.long_name= NULL_IF_CONFIG_SMALL("MPEG-2 video"),
};
//legacy decoder
AVCodec mpegvideo_decoder = {
"mpegvideo",
- CODEC_TYPE_VIDEO,
+ AVMEDIA_TYPE_VIDEO,
CODEC_ID_MPEG2VIDEO,
sizeof(Mpeg1Context),
mpeg_decode_init,
mpeg_decode_frame,
CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
.flush= flush,
+ .max_lowres= 3,
.long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"),
};
AVCodec mpeg_xvmc_decoder = {
"mpegvideo_xvmc",
- CODEC_TYPE_VIDEO,
+ AVMEDIA_TYPE_VIDEO,
CODEC_ID_MPEG2VIDEO_XVMC,
sizeof(Mpeg1Context),
mpeg_mc_decode_init,
#if CONFIG_MPEG_VDPAU_DECODER
AVCodec mpeg_vdpau_decoder = {
"mpegvideo_vdpau",
- CODEC_TYPE_VIDEO,
+ AVMEDIA_TYPE_VIDEO,
CODEC_ID_MPEG2VIDEO,
sizeof(Mpeg1Context),
mpeg_decode_init,
#if CONFIG_MPEG1_VDPAU_DECODER
AVCodec mpeg1_vdpau_decoder = {
"mpeg1video_vdpau",
- CODEC_TYPE_VIDEO,
+ AVMEDIA_TYPE_VIDEO,
CODEC_ID_MPEG1VIDEO,
sizeof(Mpeg1Context),
mpeg_decode_init,