static inline int uses_vdpau(AVCodecContext *avctx) {
return avctx->pix_fmt == AV_PIX_FMT_VDPAU_MPEG1 || avctx->pix_fmt == AV_PIX_FMT_VDPAU_MPEG2;
}
static inline int uses_vdpau(AVCodecContext *avctx) {
return avctx->pix_fmt == AV_PIX_FMT_VDPAU_MPEG1 || avctx->pix_fmt == AV_PIX_FMT_VDPAU_MPEG2;
}
static void setup_hwaccel_for_pixfmt(AVCodecContext *avctx)
{
// until then pix_fmt may be changed right after codec init
static void setup_hwaccel_for_pixfmt(AVCodecContext *avctx)
{
// until then pix_fmt may be changed right after codec init
case 1: avctx->chroma_sample_location = AVCHROMA_LOC_LEFT; break;
case 2:
case 3: avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT; break;
case 1: avctx->chroma_sample_location = AVCHROMA_LOC_LEFT; break;
case 2:
case 3: avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT; break;
s->avctx->level = get_bits(&s->gb, 4);
s->progressive_sequence = get_bits1(&s->gb); /* progressive_sequence */
s->chroma_format = get_bits(&s->gb, 2); /* chroma_format 1=420, 2=422, 3=444 */
s->avctx->level = get_bits(&s->gb, 4);
s->progressive_sequence = get_bits1(&s->gb); /* progressive_sequence */
s->chroma_format = get_bits(&s->gb, 2); /* chroma_format 1=420, 2=422, 3=444 */
horiz_size_ext = get_bits(&s->gb, 2);
vert_size_ext = get_bits(&s->gb, 2);
s->width |= (horiz_size_ext << 12);
s->height |= (vert_size_ext << 12);
bit_rate_ext = get_bits(&s->gb, 12); /* XXX: handle it */
horiz_size_ext = get_bits(&s->gb, 2);
vert_size_ext = get_bits(&s->gb, 2);
s->width |= (horiz_size_ext << 12);
s->height |= (vert_size_ext << 12);
bit_rate_ext = get_bits(&s->gb, 12); /* XXX: handle it */
check_marker(&s->gb, "after bit rate extension");
s->avctx->rc_buffer_size += get_bits(&s->gb, 8) * 1024 * 16 << 10;
check_marker(&s->gb, "after bit rate extension");
s->avctx->rc_buffer_size += get_bits(&s->gb, 8) * 1024 * 16 << 10;
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_DEBUG,
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_DEBUG,
- "profile: %d, level: %d ps: %d cf:%d vbv buffer: %d, bitrate:%d\n",
+ "profile: %d, level: %d ps: %d cf:%d vbv buffer: %d, bitrate:%"PRId64"\n",
s->avctx->profile, s->avctx->level, s->progressive_sequence, s->chroma_format,
s->avctx->rc_buffer_size, s->bit_rate);
}
s->avctx->profile, s->avctx->level, s->progressive_sequence, s->chroma_format,
s->avctx->rc_buffer_size, s->bit_rate);
}
av_log(avctx, AV_LOG_ERROR,
"hardware accelerator failed to decode first field\n");
av_log(avctx, AV_LOG_ERROR,
"hardware accelerator failed to decode first field\n");
av_log(avctx, AV_LOG_ERROR,
"hardware accelerator failed to decode picture\n");
av_log(avctx, AV_LOG_ERROR,
"hardware accelerator failed to decode picture\n");
if (check_marker(&s->gb, "in sequence header") == 0) {
return AVERROR_INVALIDDATA;
}
if (check_marker(&s->gb, "in sequence header") == 0) {
return AVERROR_INVALIDDATA;
}
/* We set MPEG-2 parameters so that it emulates MPEG-1. */
s->progressive_sequence = 1;
s->progressive_frame = 1;
/* We set MPEG-2 parameters so that it emulates MPEG-1. */
s->progressive_sequence = 1;
s->progressive_frame = 1;
- av_log(s->avctx, AV_LOG_DEBUG, "vbv buffer: %d, bitrate:%d, aspect_ratio_info: %d \n",
+ av_log(s->avctx, AV_LOG_DEBUG, "vbv buffer: %d, bitrate:%"PRId64", aspect_ratio_info: %d \n",
if ((CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER)
&& uses_vdpau(avctx))
ff_vdpau_mpeg_picture_complete(s2, buf, buf_size, s->slice_count);
if ((CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER)
&& uses_vdpau(avctx))
ff_vdpau_mpeg_picture_complete(s2, buf, buf_size, s->slice_count);
static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx)
{
if (avctx->active_thread_type & FF_THREAD_SLICE)
static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx)
{
if (avctx->active_thread_type & FF_THREAD_SLICE)
AVCodec ff_mpeg_vdpau_decoder = {
.name = "mpegvideo_vdpau",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1/2 video (VDPAU acceleration)"),
AVCodec ff_mpeg_vdpau_decoder = {
.name = "mpegvideo_vdpau",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1/2 video (VDPAU acceleration)"),
AVCodec ff_mpeg1_vdpau_decoder = {
.name = "mpeg1video_vdpau",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video (VDPAU acceleration)"),
AVCodec ff_mpeg1_vdpau_decoder = {
.name = "mpeg1video_vdpau",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video (VDPAU acceleration)"),