]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpegvideo.h
Fix compilation when MMX is disabled.
[ffmpeg] / libavcodec / mpegvideo.h
index 011678a42d506c7be92e6f3851b290e1cfdf6a1c..5313edc62e04a82c551e254a05c58bdc5f9cf2d5 100644 (file)
@@ -76,6 +76,16 @@ enum OutputFormat {
 
 #define INPLACE_OFFSET 16
 
+/* Start codes. */
+#define SEQ_END_CODE            0x000001b7
+#define SEQ_START_CODE          0x000001b3
+#define GOP_START_CODE          0x000001b8
+#define PICTURE_START_CODE      0x00000100
+#define SLICE_MIN_START_CODE    0x00000101
+#define SLICE_MAX_START_CODE    0x000001af
+#define EXT_START_CODE          0x000001b5
+#define USER_START_CODE         0x000001b2
+
 /**
  * Scantable.
  */
@@ -162,7 +172,11 @@ typedef struct MotionEstContext{
     uint32_t *score_map;               ///< map to store the scores
     int map_generation;
     int pre_penalty_factor;
-    int penalty_factor;
+    int penalty_factor;                /*!< an estimate of the bits required to
+                                        code a given mv value, e.g. (1,0) takes
+                                        more bits than (0,0). We have to
+                                        estimate whether any reduction in
+                                        residual is worth the extra bits. */
     int sub_penalty_factor;
     int mb_penalty_factor;
     int flags;
@@ -324,6 +338,7 @@ typedef struct MpegEncContext {
     int dropable;
     int frame_rate_index;
     int last_lambda_for[5];     ///< last lambda for a specific pict type
+    int skipdct;                ///< skip dct and code zero residual
 
     /* motion compensation */
     int unrestricted_mv;        ///< mv can point outside of the coded picture
@@ -376,7 +391,7 @@ typedef struct MpegEncContext {
     MotionEstContext me;
 
     int no_rounding;  /**< apply no rounding to motion compensation (MPEG4, msmpeg4, ...)
-                        for b-frames rounding mode is allways 0 */
+                        for b-frames rounding mode is always 0 */
 
     int hurry_up;     /**< when set to 1 during decoding, b frames will be skipped
                          when set to 2 idct/dequant will be skipped too */
@@ -402,6 +417,8 @@ typedef struct MpegEncContext {
 #define CANDIDATE_MB_TYPE_BACKWARD_I 0x400
 #define CANDIDATE_MB_TYPE_BIDIR_I    0x800
 
+#define CANDIDATE_MB_TYPE_DIRECT0    0x1000
+
     int block_index[6]; ///< index to current MB in block based arrays with edges
     int block_wrap[6];
     uint8_t *dest[3];
@@ -572,8 +589,6 @@ typedef struct MpegEncContext {
     struct MJpegContext *mjpeg_ctx;
     int mjpeg_vsample[3];       ///< vertical sampling factors, default = {2, 1, 1}
     int mjpeg_hsample[3];       ///< horizontal sampling factors, default = {2, 1, 1}
-    int mjpeg_write_tables;     ///< do we want to have quantisation- and huffmantables in the jpeg file ?
-    int mjpeg_data_only_frames; ///< frames only with SOI, SOS and EOI markers
 
     /* MSMPEG4 specific */
     int mv_table_index;
@@ -770,6 +785,7 @@ inline int ff_get_mb_score(MpegEncContext * s, int mx, int my, int src_index,
 extern const uint16_t ff_mpeg1_default_intra_matrix[64];
 extern const uint16_t ff_mpeg1_default_non_intra_matrix[64];
 extern const uint8_t ff_mpeg1_dc_scale_table[128];
+extern const AVRational ff_frame_rate_tab[];
 
 void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number);
 void mpeg1_encode_mb(MpegEncContext *s,
@@ -778,35 +794,9 @@ void mpeg1_encode_mb(MpegEncContext *s,
 void ff_mpeg1_encode_init(MpegEncContext *s);
 void ff_mpeg1_encode_slice_header(MpegEncContext *s);
 void ff_mpeg1_clean_buffers(MpegEncContext *s);
+int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size);
 
-
-/** RLTable. */
-typedef struct RLTable {
-    int n;                         ///< number of entries of table_vlc minus 1
-    int last;                      ///< number of values for last = 0
-    const uint16_t (*table_vlc)[2];
-    const int8_t *table_run;
-    const int8_t *table_level;
-    uint8_t *index_run[2];         ///< encoding only
-    int8_t *max_level[2];          ///< encoding & decoding
-    int8_t *max_run[2];            ///< encoding & decoding
-    VLC vlc;                       ///< decoding only deprected FIXME remove
-    RL_VLC_ELEM *rl_vlc[32];       ///< decoding only
-} RLTable;
-
-void init_rl(RLTable *rl, int use_static);
-void init_vlc_rl(RLTable *rl, int use_static);
-
-static inline int get_rl_index(const RLTable *rl, int last, int run, int level)
-{
-    int index;
-    index = rl->index_run[last][run];
-    if (index >= rl->n)
-        return rl->n;
-    if (level > rl->max_level[last][run])
-        return rl->n;
-    return index + level - 1;
-}
+#include "rl.h"
 
 extern const uint8_t ff_mpeg4_y_dc_scale_table[32];
 extern const uint8_t ff_mpeg4_c_dc_scale_table[32];
@@ -915,14 +905,5 @@ void ff_wmv2_encode_mb(MpegEncContext * s,
                        DCTELEM block[6][64],
                        int motion_x, int motion_y);
 
-/* mjpeg.c */
-int mjpeg_init(MpegEncContext *s);
-void mjpeg_close(MpegEncContext *s);
-void mjpeg_encode_mb(MpegEncContext *s,
-                     DCTELEM block[6][64]);
-void mjpeg_picture_header(MpegEncContext *s);
-void mjpeg_picture_trailer(MpegEncContext *s);
-void ff_mjpeg_stuffing(PutBitContext * pbc);
-
 #endif /* AVCODEC_MPEGVIDEO_H */