Go to the documentation of this file.
23 #ifndef AVCODEC_MPEG4VIDEO_H
24 #define AVCODEC_MPEG4VIDEO_H
39 #if 0 //3IV1 is quite rare and it slows things down a tiny bit
40 #define IS_3IV1 s->codec_tag == AV_RL32("3IV1")
53 int *dir_ptr,
int encoding)
66 wrap =
s->block_wrap[n];
67 dc_val =
s->dc_val[0] +
s->block_index[n];
73 b = dc_val[-1 -
wrap];
78 if (
s->first_slice_line && n != 3) {
81 if (n != 1 &&
s->mb_x ==
s->resync_mb_x)
84 if (
s->mb_x ==
s->resync_mb_x &&
s->mb_y ==
s->resync_mb_y + 1) {
85 if (n == 0 || n == 4 || n == 5)
106 if (
level & (~2047)) {
110 "dc<0 at %dx%d\n",
s->mb_x,
s->mb_y);
115 "dc overflow at %dx%d\n",
s->mb_x,
s->mb_y);
void ff_mpeg4_init_direct_mv(MpegEncContext *s)
#define AV_EF_BITSTREAM
detect bitstream specification deviations
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my)
static void scale(int *out, const int *in, const int w, const int h, const int shift)
static int ff_mpeg4_pred_dc(MpegEncContext *s, int n, int level, int *dir_ptr, int encoding)
Predict the dc.
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s)
#define AV_EF_AGGRESSIVE
consider things that a sane encoder/muxer should not do as an error
static const float pred[4]
void ff_mpeg4_clean_buffers(MpegEncContext *s)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.