const AVOption ff_mpv_generic_options[] = {
FF_MPV_COMMON_OPTS
+#if FF_API_MPEGVIDEO_OPTS
+ FF_MPV_DEPRECATED_MPEG_QUANT_OPT
+ FF_MPV_DEPRECATED_A53_CC_OPT
+ FF_MPV_DEPRECATED_MATRIX_OPT
+ FF_MPV_DEPRECATED_BFRAME_OPTS
+#endif
{ NULL },
};
{
MpegEncContext *s = avctx->priv_data;
AVCPBProperties *cpb_props;
- int i, ret, format_supported;
+ int i, ret;
mpv_encode_defaults(s);
- switch (avctx->codec_id) {
- case AV_CODEC_ID_MPEG2VIDEO:
- if (avctx->pix_fmt != AV_PIX_FMT_YUV420P &&
- avctx->pix_fmt != AV_PIX_FMT_YUV422P) {
- av_log(avctx, AV_LOG_ERROR,
- "only YUV420 and YUV422 are supported\n");
- return AVERROR(EINVAL);
- }
- break;
- case AV_CODEC_ID_MJPEG:
- case AV_CODEC_ID_AMV:
- format_supported = 0;
- /* JPEG color space */
- if (avctx->pix_fmt == AV_PIX_FMT_YUVJ420P ||
- avctx->pix_fmt == AV_PIX_FMT_YUVJ422P ||
- avctx->pix_fmt == AV_PIX_FMT_YUVJ444P ||
- (avctx->color_range == AVCOL_RANGE_JPEG &&
- (avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
- avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
- avctx->pix_fmt == AV_PIX_FMT_YUV444P)))
- format_supported = 1;
- /* MPEG color space */
- else if (avctx->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL &&
- (avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
- avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
- avctx->pix_fmt == AV_PIX_FMT_YUV444P))
- format_supported = 1;
-
- if (!format_supported) {
- av_log(avctx, AV_LOG_ERROR, "colorspace not supported in jpeg\n");
- return AVERROR(EINVAL);
- }
- break;
- case AV_CODEC_ID_SPEEDHQ:
- if (avctx->pix_fmt != AV_PIX_FMT_YUV420P &&
- avctx->pix_fmt != AV_PIX_FMT_YUV422P &&
- avctx->pix_fmt != AV_PIX_FMT_YUV444P) {
- av_log(avctx, AV_LOG_ERROR,
- "only YUV420/YUV422/YUV444 are supported (no alpha support yet)\n");
- return AVERROR(EINVAL);
- }
- break;
- default:
- if (avctx->pix_fmt != AV_PIX_FMT_YUV420P) {
- av_log(avctx, AV_LOG_ERROR, "only YUV420 is supported\n");
- return AVERROR(EINVAL);
- }
- }
-
switch (avctx->pix_fmt) {
case AV_PIX_FMT_YUVJ444P:
case AV_PIX_FMT_YUV444P:
avctx->bits_per_raw_sample = av_clip(avctx->bits_per_raw_sample, 0, 8);
-#if FF_API_PRIVATE_OPT
-FF_DISABLE_DEPRECATION_WARNINGS
- if (avctx->rtp_payload_size)
- s->rtp_payload_size = avctx->rtp_payload_size;
- if (avctx->me_penalty_compensation)
- s->me_penalty_compensation = avctx->me_penalty_compensation;
- if (avctx->pre_me)
- s->me_pre = avctx->pre_me;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
s->bit_rate = avctx->bit_rate;
s->width = avctx->width;
s->height = avctx->height;
return AVERROR(EINVAL);
}
if ((s->codec_id == AV_CODEC_ID_H263 ||
- s->codec_id == AV_CODEC_ID_H263P) &&
+ s->codec_id == AV_CODEC_ID_H263P ||
+ s->codec_id == AV_CODEC_ID_RV20) &&
((avctx->width &3) ||
(avctx->height&3) )) {
- av_log(avctx, AV_LOG_ERROR, "w/h must be a multiple of 4\n");
- return AVERROR(EINVAL);
- }
-
- if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO &&
- (avctx->width > 4095 ||
- avctx->height > 4095 )) {
- av_log(avctx, AV_LOG_ERROR, "MPEG-1 does not support resolutions above 4095x4095\n");
- return AVERROR(EINVAL);
- }
-
- if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO &&
- (avctx->width > 16383 ||
- avctx->height > 16383 )) {
- av_log(avctx, AV_LOG_ERROR, "MPEG-2 does not support resolutions above 16383x16383\n");
+ av_log(avctx, AV_LOG_ERROR, "width and height must be a multiple of 4\n");
return AVERROR(EINVAL);
}
return AVERROR(EINVAL);
}
- if (s->codec_id == AV_CODEC_ID_RV20 &&
- (avctx->width &3 ||
- avctx->height&3 )) {
- av_log(avctx, AV_LOG_ERROR, "width and height must be a multiple of 4\n");
- return AVERROR(EINVAL);
- }
-
if ((s->codec_id == AV_CODEC_ID_WMV1 ||
s->codec_id == AV_CODEC_ID_WMV2) &&
avctx->width & 1) {
return AVERROR(EINVAL);
}
-#if FF_API_PRIVATE_OPT
- FF_DISABLE_DEPRECATION_WARNINGS
- if (avctx->mpeg_quant)
- s->mpeg_quant = avctx->mpeg_quant;
- FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
- // FIXME mpeg2 uses that too
- if (s->mpeg_quant && ( s->codec_id != AV_CODEC_ID_MPEG4
- && s->codec_id != AV_CODEC_ID_MPEG2VIDEO)) {
- av_log(avctx, AV_LOG_ERROR,
- "mpeg2 style quantization not supported by codec\n");
- return AVERROR(EINVAL);
- }
-
if ((s->mpv_flags & FF_MPV_FLAG_CBP_RD) && !avctx->trellis) {
av_log(avctx, AV_LOG_ERROR, "CBP RD needs trellis quant\n");
return AVERROR(EINVAL);
return AVERROR(EINVAL);
}
-#if FF_API_PRIVATE_OPT
-FF_DISABLE_DEPRECATION_WARNINGS
- if (avctx->scenechange_threshold)
- s->scenechange_threshold = avctx->scenechange_threshold;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
if (s->scenechange_threshold < 1000000000 &&
(avctx->flags & AV_CODEC_FLAG_CLOSED_GOP)) {
av_log(avctx, AV_LOG_ERROR,
return AVERROR_PATCHWELCOME;
}
- if (!avctx->time_base.den || !avctx->time_base.num) {
- av_log(avctx, AV_LOG_ERROR, "framerate not set\n");
- return AVERROR(EINVAL);
- }
-
-#if FF_API_PRIVATE_OPT
-FF_DISABLE_DEPRECATION_WARNINGS
- if (avctx->b_frame_strategy)
- s->b_frame_strategy = avctx->b_frame_strategy;
- if (avctx->b_sensitivity != 40)
- s->b_sensitivity = avctx->b_sensitivity;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
if (s->b_frame_strategy && (avctx->flags & AV_CODEC_FLAG_PASS2)) {
av_log(avctx, AV_LOG_INFO,
"notice: b_frame_strategy only affects the first pass\n");
avctx->delay = s->low_delay ? 0 : (s->max_b_frames + 1);
s->rtp_mode = 1;
break;
+#if CONFIG_MJPEG_ENCODER || CONFIG_AMV_ENCODER
case AV_CODEC_ID_MJPEG:
case AV_CODEC_ID_AMV:
s->out_format = FMT_MJPEG;
s->intra_only = 1; /* force intra only for jpeg */
- if (!CONFIG_MJPEG_ENCODER)
- return AVERROR_ENCODER_NOT_FOUND;
if ((ret = ff_mjpeg_encode_init(s)) < 0)
return ret;
avctx->delay = 0;
s->low_delay = 1;
break;
+#endif
case AV_CODEC_ID_SPEEDHQ:
s->out_format = FMT_SPEEDHQ;
s->intra_only = 1; /* force intra only for SHQ */
return AVERROR(EINVAL);
}
-#if FF_API_PRIVATE_OPT
- FF_DISABLE_DEPRECATION_WARNINGS
- if (avctx->noise_reduction)
- s->noise_reduction = avctx->noise_reduction;
- FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
avctx->has_b_frames = !s->low_delay;
s->encoding = 1;
s->quant_precision = 5;
-#if FF_API_PRIVATE_OPT
-FF_DISABLE_DEPRECATION_WARNINGS
- if (avctx->frame_skip_threshold)
- s->frame_skip_threshold = avctx->frame_skip_threshold;
- if (avctx->frame_skip_factor)
- s->frame_skip_factor = avctx->frame_skip_factor;
- if (avctx->frame_skip_exp)
- s->frame_skip_exp = avctx->frame_skip_exp;
- if (avctx->frame_skip_cmp != FF_CMP_DCTMAX)
- s->frame_skip_cmp = avctx->frame_skip_cmp;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
ff_set_cmp(&s->mecc, s->mecc.ildct_cmp, avctx->ildct_cmp);
ff_set_cmp(&s->mecc, s->mecc.frame_skip_cmp, s->frame_skip_cmp);
if (CONFIG_H263_ENCODER && s->out_format == FMT_H263)
ff_h263_encode_init(s);
if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version)
- if ((ret = ff_msmpeg4_encode_init(s)) < 0)
- return ret;
+ ff_msmpeg4_encode_init(s);
if ((CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER)
&& s->out_format == FMT_MPEG1)
ff_mpeg1_encode_init(s);
if ((ret = ff_rate_control_init(s)) < 0)
return ret;
-#if FF_API_PRIVATE_OPT
- FF_DISABLE_DEPRECATION_WARNINGS
- if (avctx->brd_scale)
- s->brd_scale = avctx->brd_scale;
-
- if (avctx->prediction_method)
- s->pred = avctx->prediction_method + 1;
- FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
if (s->b_frame_strategy == 2) {
for (i = 0; i < s->max_b_frames + 2; i++) {
s->tmp_frames[i] = av_frame_alloc();
ff_rate_control_uninit(s);
ff_mpv_common_end(s);
- if (CONFIG_MJPEG_ENCODER &&
+ if ((CONFIG_MJPEG_ENCODER || CONFIG_AMV_ENCODER) &&
s->out_format == FMT_MJPEG)
ff_mjpeg_encode_close(s);
return 0;
}
-static int encode_frame(AVCodecContext *c, AVFrame *frame)
+static int encode_frame(AVCodecContext *c, AVFrame *frame, AVPacket *pkt)
{
- AVPacket pkt = { 0 };
int ret;
int size = 0;
- av_init_packet(&pkt);
-
ret = avcodec_send_frame(c, frame);
if (ret < 0)
return ret;
do {
- ret = avcodec_receive_packet(c, &pkt);
+ ret = avcodec_receive_packet(c, pkt);
if (ret >= 0) {
- size += pkt.size;
- av_packet_unref(&pkt);
+ size += pkt->size;
+ av_packet_unref(pkt);
} else if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF)
return ret;
} while (ret >= 0);
static int estimate_best_b_count(MpegEncContext *s)
{
const AVCodec *codec = avcodec_find_encoder(s->avctx->codec_id);
+ AVPacket *pkt;
const int scale = s->brd_scale;
int width = s->width >> scale;
int height = s->height >> scale;
av_assert0(scale >= 0 && scale <= 3);
+ pkt = av_packet_alloc();
+ if (!pkt)
+ return AVERROR(ENOMEM);
+
//emms_c();
//s->next_picture_ptr->quality;
p_lambda = s->last_lambda_for[AV_PICTURE_TYPE_P];
break;
c = avcodec_alloc_context3(NULL);
- if (!c)
- return AVERROR(ENOMEM);
+ if (!c) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
c->width = width;
c->height = height;
if (ret < 0)
goto fail;
+
s->tmp_frames[0]->pict_type = AV_PICTURE_TYPE_I;
s->tmp_frames[0]->quality = 1 * FF_QP2LAMBDA;
- out_size = encode_frame(c, s->tmp_frames[0]);
+ out_size = encode_frame(c, s->tmp_frames[0], pkt);
if (out_size < 0) {
ret = out_size;
goto fail;
AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_B;
s->tmp_frames[i + 1]->quality = is_p ? p_lambda : b_lambda;
- out_size = encode_frame(c, s->tmp_frames[i + 1]);
+ out_size = encode_frame(c, s->tmp_frames[i + 1], pkt);
if (out_size < 0) {
ret = out_size;
goto fail;
}
/* get the delayed frames */
- out_size = encode_frame(c, NULL);
+ out_size = encode_frame(c, NULL, pkt);
if (out_size < 0) {
ret = out_size;
goto fail;
fail:
avcodec_free_context(&c);
- if (ret < 0)
- return ret;
+ av_packet_unref(pkt);
+ if (ret < 0) {
+ best_b_count = ret;
+ break;
+ }
}
+ av_packet_free(&pkt);
+
return best_b_count;
}
// input is not a shared pix -> reuse buffer for current_pix
s->current_picture_ptr = s->reordered_input_picture[0];
for (i = 0; i < 4; i++) {
- s->new_picture.f->data[i] += INPLACE_OFFSET;
+ if (s->new_picture.f->data[i])
+ s->new_picture.f->data[i] += INPLACE_OFFSET;
}
}
ff_mpeg_unref_picture(s->avctx, &s->current_picture);
s->last_lambda_for [s->pict_type] = s->current_picture_ptr->f->quality;
if (s->pict_type!= AV_PICTURE_TYPE_B)
s->last_non_b_pict_type = s->pict_type;
-
-#if FF_API_CODED_FRAME
-FF_DISABLE_DEPRECATION_WARNINGS
- av_frame_unref(s->avctx->coded_frame);
- av_frame_copy_props(s->avctx->coded_frame, s->current_picture.f);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-#if FF_API_ERROR_FRAME
-FF_DISABLE_DEPRECATION_WARNINGS
- memcpy(s->current_picture.f->error, s->current_picture.encoding_error,
- sizeof(s->current_picture.encoding_error));
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
}
static void update_noise_reduction(MpegEncContext *s)
if (ret < 0)
return -1;
-#if FF_API_STAT_BITS
-FF_DISABLE_DEPRECATION_WARNINGS
- avctx->header_bits = s->header_bits;
- avctx->mv_bits = s->mv_bits;
- avctx->misc_bits = s->misc_bits;
- avctx->i_tex_bits = s->i_tex_bits;
- avctx->p_tex_bits = s->p_tex_bits;
- avctx->i_count = s->i_count;
- // FIXME f/b_count in avctx
- avctx->p_count = s->mb_num - s->i_count - s->skip_count;
- avctx->skip_count = s->skip_count;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
frame_end(s);
- if (CONFIG_MJPEG_ENCODER && s->out_format == FMT_MJPEG)
+ if ((CONFIG_MJPEG_ENCODER || CONFIG_AMV_ENCODER) && s->out_format == FMT_MJPEG)
ff_mjpeg_encode_picture_trailer(&s->pb, s->header_bits);
if (avctx->rc_buffer_size) {
stuffing_count = ff_vbv_update(s, s->frame_bits);
s->stuffing_bits = 8*stuffing_count;
if (stuffing_count) {
- if (s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb) >> 3) <
- stuffing_count + 50) {
+ if (put_bytes_left(&s->pb, 0) < stuffing_count + 50) {
av_log(avctx, AV_LOG_ERROR, "stuffing too large\n");
return -1;
}
av_freep(&props);
return ret;
}
-
-#if FF_API_VBV_DELAY
-FF_DISABLE_DEPRECATION_WARNINGS
- avctx->vbv_delay = vbv_delay * 300;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
}
s->total_bits += s->frame_bits;
-#if FF_API_STAT_BITS
-FF_DISABLE_DEPRECATION_WARNINGS
- avctx->frame_bits = s->frame_bits;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
pkt->pts = s->current_picture.f->pts;
if (!s->low_delay && s->pict_type != AV_PICTURE_TYPE_B) {
if (CONFIG_H263_ENCODER)
ff_h263_encode_mb(s, s->block, motion_x, motion_y);
break;
+#if CONFIG_MJPEG_ENCODER || CONFIG_AMV_ENCODER
case AV_CODEC_ID_MJPEG:
case AV_CODEC_ID_AMV:
- if (CONFIG_MJPEG_ENCODER)
- ff_mjpeg_encode_mb(s, s->block);
+ ff_mjpeg_encode_mb(s, s->block);
break;
+#endif
case AV_CODEC_ID_SPEEDHQ:
if (CONFIG_SPEEDHQ_ENCODER)
ff_speedhq_encode_mb(s, s->block);
}
ff_mpeg4_stuffing(&s->pb);
- }else if(CONFIG_MJPEG_ENCODER && s->out_format == FMT_MJPEG){
+ } else if ((CONFIG_MJPEG_ENCODER || CONFIG_AMV_ENCODER) &&
+ s->out_format == FMT_MJPEG) {
ff_mjpeg_encode_stuffing(s);
} else if (CONFIG_SPEEDHQ_ENCODER && s->out_format == FMT_SPEEDHQ) {
ff_speedhq_end_slice(s);
{
if (!s->mb_info)
return;
- if (put_bits_count(&s->pb) - s->prev_mb_info*8 >= s->mb_info*8) {
+ if (put_bytes_count(&s->pb, 0) - s->prev_mb_info >= s->mb_info) {
s->mb_info_size += 12;
s->prev_mb_info = s->last_mb_info;
}
if (startcode) {
- s->prev_mb_info = put_bits_count(&s->pb)/8;
+ s->prev_mb_info = put_bytes_count(&s->pb, 0);
/* This might have incremented mb_info_size above, and we return without
* actually writing any info into that slot yet. But in that case,
* this will be called again at the start of the after writing the
return;
}
- s->last_mb_info = put_bits_count(&s->pb)/8;
+ s->last_mb_info = put_bytes_count(&s->pb, 0);
if (!s->mb_info_size)
s->mb_info_size += 12;
write_mb_info(s);
int ff_mpv_reallocate_putbitbuffer(MpegEncContext *s, size_t threshold, size_t size_increase)
{
- if ( s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < threshold
+ if (put_bytes_left(&s->pb, 0) < threshold
&& s->slice_context_count == 1
&& s->pb.buf == s->avctx->internal->byte_buffer) {
int lastgob_pos = s->ptr_lastgob - s->pb.buf;
s->ptr_lastgob = s->pb.buf + lastgob_pos;
s->vbv_delay_ptr = s->pb.buf + vbv_pos;
}
- if (s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < threshold)
+ if (put_bytes_left(&s->pb, 0) < threshold)
return AVERROR(EINVAL);
return 0;
}
+ s->mb_width*MAX_MB_BYTES;
ff_mpv_reallocate_putbitbuffer(s, MAX_MB_BYTES, size_increase);
- if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < MAX_MB_BYTES){
+ if (put_bytes_left(&s->pb, 0) < MAX_MB_BYTES){
av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n");
return -1;
}
if(s->data_partitioning){
- if( s->pb2 .buf_end - s->pb2 .buf - (put_bits_count(&s-> pb2)>>3) < MAX_MB_BYTES
- || s->tex_pb.buf_end - s->tex_pb.buf - (put_bits_count(&s->tex_pb )>>3) < MAX_MB_BYTES){
+ if (put_bytes_left(&s->pb2, 0) < MAX_MB_BYTES ||
+ put_bytes_left(&s->tex_pb, 0) < MAX_MB_BYTES) {
av_log(s->avctx, AV_LOG_ERROR, "encoded partitioned frame too large\n");
return -1;
}
if(s->rtp_mode){
int current_packet_size, is_gob_start;
- current_packet_size= ((put_bits_count(&s->pb)+7)>>3) - (s->ptr_lastgob - s->pb.buf);
+ current_packet_size = put_bytes_count(&s->pb, 1)
+ - (s->ptr_lastgob - s->pb.buf);
is_gob_start = s->rtp_payload_size &&
current_packet_size >= s->rtp_payload_size &&
current_packet_size= put_bits_ptr(&s->pb) - s->ptr_lastgob;
if (s->error_rate && s->resync_mb_x + s->resync_mb_y > 0) {
- int r= put_bits_count(&s->pb)/8 + s->picture_number + 16 + s->mb_x + s->mb_y;
+ int r = put_bytes_count(&s->pb, 0) + s->picture_number + 16 + s->mb_x + s->mb_y;
int d = 100 / s->error_rate;
if(r % d == 0){
current_packet_size=0;
}
}
-#if FF_API_RTP_CALLBACK
-FF_DISABLE_DEPRECATION_WARNINGS
- if (s->avctx->rtp_callback){
- int number_mb = (mb_y - s->resync_mb_y)*s->mb_width + mb_x - s->resync_mb_x;
- s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, current_packet_size, number_mb);
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
update_mb_info(s, 1);
switch(s->codec_id){
write_slice_end(s);
-#if FF_API_RTP_CALLBACK
-FF_DISABLE_DEPRECATION_WARNINGS
- /* Send the last GOB if RTP */
- if (s->avctx->rtp_callback) {
- int number_mb = (mb_y - s->resync_mb_y)*s->mb_width - s->resync_mb_x;
- int pdif = put_bits_ptr(&s->pb) - s->ptr_lastgob;
- /* Call the RTP callback to send the last GOB */
- emms_c();
- s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, pdif, number_mb);
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
return 0;
}
s->mb_x = s->mb_y = 0;
s->last_bits= put_bits_count(&s->pb);
switch(s->out_format) {
+#if CONFIG_MJPEG_ENCODER || CONFIG_AMV_ENCODER
case FMT_MJPEG:
- if (CONFIG_MJPEG_ENCODER && s->huffman != HUFFMAN_TABLE_OPTIMAL)
+ /* s->huffman == HUFFMAN_TABLE_OPTIMAL can only be true for MJPEG. */
+ if (!CONFIG_MJPEG_ENCODER || s->huffman != HUFFMAN_TABLE_OPTIMAL)
ff_mjpeg_encode_picture_header(s->avctx, &s->pb, &s->intra_scantable,
s->pred, s->intra_matrix, s->chroma_intra_matrix);
break;
+#endif
case FMT_SPEEDHQ:
if (CONFIG_SPEEDHQ_ENCODER)
ff_speedhq_encode_picture_header(s);
{ "obmc", "use overlapped block motion compensation.", OFFSET(obmc), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
{ "mb_info", "emit macroblock info for RFC 2190 packetization, the parameter value is the maximum payload size", OFFSET(mb_info), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
FF_MPV_COMMON_OPTS
+#if FF_API_MPEGVIDEO_OPTS
+ FF_MPV_DEPRECATED_MPEG_QUANT_OPT
+ FF_MPV_DEPRECATED_A53_CC_OPT
+ FF_MPV_DEPRECATED_MATRIX_OPT
+ FF_MPV_DEPRECATED_BFRAME_OPTS
+#endif
{ NULL },
};
.version = LIBAVUTIL_VERSION_INT,
};
-AVCodec ff_h263_encoder = {
+const AVCodec ff_h263_encoder = {
.name = "h263",
.long_name = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996"),
.type = AVMEDIA_TYPE_VIDEO,
.init = ff_mpv_encode_init,
.encode2 = ff_mpv_encode_picture,
.close = ff_mpv_encode_end,
- .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.pix_fmts= (const enum AVPixelFormat[]){AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE},
.priv_class = &h263_class,
};
{ "obmc", "use overlapped block motion compensation.", OFFSET(obmc), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
{ "structured_slices", "Write slice start position at every GOB header instead of just GOB number.", OFFSET(h263_slice_structured), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE},
FF_MPV_COMMON_OPTS
+#if FF_API_MPEGVIDEO_OPTS
+ FF_MPV_DEPRECATED_MPEG_QUANT_OPT
+ FF_MPV_DEPRECATED_A53_CC_OPT
+ FF_MPV_DEPRECATED_MATRIX_OPT
+ FF_MPV_DEPRECATED_BFRAME_OPTS
+#endif
{ NULL },
};
static const AVClass h263p_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-AVCodec ff_h263p_encoder = {
+const AVCodec ff_h263p_encoder = {
.name = "h263p",
.long_name = NULL_IF_CONFIG_SMALL("H.263+ / H.263-1998 / H.263 version 2"),
.type = AVMEDIA_TYPE_VIDEO,
.encode2 = ff_mpv_encode_picture,
.close = ff_mpv_encode_end,
.capabilities = AV_CODEC_CAP_SLICE_THREADS,
- .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
.priv_class = &h263p_class,
};
.version = LIBAVUTIL_VERSION_INT,
};
-AVCodec ff_msmpeg4v2_encoder = {
+const AVCodec ff_msmpeg4v2_encoder = {
.name = "msmpeg4v2",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"),
.type = AVMEDIA_TYPE_VIDEO,
.init = ff_mpv_encode_init,
.encode2 = ff_mpv_encode_picture,
.close = ff_mpv_encode_end,
- .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
.priv_class = &msmpeg4v2_class,
};
.version = LIBAVUTIL_VERSION_INT,
};
-AVCodec ff_msmpeg4v3_encoder = {
+const AVCodec ff_msmpeg4v3_encoder = {
.name = "msmpeg4",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"),
.type = AVMEDIA_TYPE_VIDEO,
.init = ff_mpv_encode_init,
.encode2 = ff_mpv_encode_picture,
.close = ff_mpv_encode_end,
- .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
.priv_class = &msmpeg4v3_class,
};
.version = LIBAVUTIL_VERSION_INT,
};
-AVCodec ff_wmv1_encoder = {
+const AVCodec ff_wmv1_encoder = {
.name = "wmv1",
.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 7"),
.type = AVMEDIA_TYPE_VIDEO,
.init = ff_mpv_encode_init,
.encode2 = ff_mpv_encode_picture,
.close = ff_mpv_encode_end,
- .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
.priv_class = &wmv1_class,
};