34#define WMV2_EXTRADATA_SIZE 4
57 put_bits(&pb, 5,
s->c.avctx->time_base.den /
s->c.avctx->time_base.num);
64 put_bits(&pb, 1,
w->top_left_mv_flag = 0);
70 s->slice_height =
s->c.mb_height /
code;
103 if (
w->per_mb_rl_bit)
113 s->c.inter_intra_pred = 0;
131 if (
w->per_mb_rl_bit)
141 s->c.inter_intra_pred = 0;
143 s->esc3_level_length = 0;
153 int motion_x,
int motion_y)
156 int cbp, coded_cbp,
i;
158 uint8_t *coded_block;
162 if (!
s->c.mb_intra) {
165 for (
i = 0;
i < 6;
i++)
166 if (
s->c.block_last_index[
i] >= 0)
183 for (
i = 0;
i < 6;
i++) {
184 int val = (
s->c.block_last_index[
i] >= 1);
186 cbp |=
val << (5 -
i);
193 coded_cbp |=
val << (5 -
i);
205 if (
s->c.inter_intra_pred) {
206 s->c.h263_aic_dir = 0;
214 for (
i = 0;
i < 6;
i++)
static double val(void *priv, double ch)
const FFCodec ff_wmv2_encoder
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Libavcodec external API header.
#define i(width, name, range_min, range_max)
#define CODEC_PIXFMTS(...)
#define FF_CODEC_ENCODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
@ AV_PICTURE_TYPE_I
Intra.
int16_t * ff_h263_pred_motion(MpegEncContext *s, int block, int dir, int *px, int *py)
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
Memory handling functions.
const AVClass ff_mpv_enc_class
av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
int ff_mpv_encode_picture(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic_arg, int *got_packet)
av_cold int ff_mpv_encode_end(AVCodecContext *avctx)
static int get_bits_diff(MPVEncContext *s)
int ff_msmpeg4_coded_block_pred(MpegEncContext *s, int n, uint8_t **coded_block_ptr)
const uint16_t ff_msmp4_mb_i_table[64][2]
const uint8_t ff_table_inter_intra[4][2]
const uint32_t(*const [WMV2_INTER_CBP_TABLE_COUNT] ff_wmv2_inter_table)[2]
void ff_msmpeg4_encode_motion(MSMPEG4EncContext *const ms, int mx, int my)
void ff_msmpeg4_encode_block(MPVEncContext *const s, int16_t *block, int n)
void ff_msmpeg4_code012(PutBitContext *pb, int n)
void ff_msmpeg4_handle_slices(MPVEncContext *const s)
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static void put_bits_assume_flushed(const PutBitContext *s)
Inform the compiler that a PutBitContext is flushed (i.e.
static const float pred[4]
main external API structure.
uint8_t * extradata
Out-of-band global headers that may be used by some codecs.
MPVEncContext s
The main slicecontext.
int rl_chroma_table_index
MSMPEG4EncContext msmpeg4
static av_always_inline int wmv2_get_cbp_table_index(int qscale, int cbp_index)
#define WMV2_EXTRADATA_SIZE
static int encode_ext_header(WMV2EncContext *w)
static int wmv2_encode_picture_header(MPVMainEncContext *const m)
static av_cold int wmv2_encode_init(AVCodecContext *avctx)
static void wmv2_encode_mb(MPVEncContext *const s, int16_t block[][64], int motion_x, int motion_y)