/*
- * H261 encoder
+ * H.261 encoder
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
* Copyright (c) 2004 Maarten Daniels
*
#include "libavutil/attributes.h"
#include "avcodec.h"
+#include "mpegutils.h"
#include "mpegvideo.h"
#include "h263.h"
#include "h261.h"
+#include "mpegvideodata.h"
int ff_h261_get_picture_format(int width, int height)
{
put_bits(&s->pb, 1, 0); /* split screen off */
put_bits(&s->pb, 1, 0); /* camera off */
- put_bits(&s->pb, 1, 0); /* freeze picture release off */
+ put_bits(&s->pb, 1, s->pict_type == AV_PICTURE_TYPE_I); /* freeze picture release on/off */
format = ff_h261_get_picture_format(s->width, s->height);
put_bits(&s->pb, 1, format); /* 0 == QCIF, 1 == CIF */
- put_bits(&s->pb, 1, 0); /* still image mode */
- put_bits(&s->pb, 1, 0); /* reserved */
+ put_bits(&s->pb, 1, 1); /* still image mode */
+ put_bits(&s->pb, 1, 1); /* reserved */
put_bits(&s->pb, 1, 0); /* no PEI */
if (format == 0)
s->c_dc_scale_table = ff_mpeg1_dc_scale_table;
}
-FF_MPV_GENERIC_CLASS(h261)
+static const AVClass h261_class = {
+ .class_name = "h261 encoder",
+ .item_name = av_default_item_name,
+ .option = ff_mpv_generic_options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
AVCodec ff_h261_encoder = {
.name = "h261",
+ .long_name = NULL_IF_CONFIG_SMALL("H.261"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H261,
.priv_data_size = sizeof(H261Context),
- .init = ff_MPV_encode_init,
- .encode2 = ff_MPV_encode_picture,
- .close = ff_MPV_encode_end,
+ .init = ff_mpv_encode_init,
+ .encode2 = ff_mpv_encode_picture,
+ .close = ff_mpv_encode_end,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE },
- .long_name = NULL_IF_CONFIG_SMALL("H.261"),
.priv_class = &h261_class,
};