]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpegvideo.h
Check available size before writing in decode_frame()
[ffmpeg] / libavcodec / mpegvideo.h
index 69fee86d98b92cd617b4d7ece06632e5afd88840..255e1f20807d9071c174ce233a4fd04d32e1c93f 100644 (file)
@@ -45,8 +45,6 @@ enum OutputFormat {
     FMT_H264,
 };
 
-#define EDGE_WIDTH 16
-
 #define MPEG_BUF_SIZE (16 * 1024)
 
 #define QMAT_SHIFT_MMX 16
@@ -63,13 +61,6 @@ enum OutputFormat {
 #define ME_MAP_SHIFT 3
 #define ME_MAP_MV_BITS 11
 
-#define I_TYPE FF_I_TYPE  ///< Intra
-#define P_TYPE FF_P_TYPE  ///< Predicted
-#define B_TYPE FF_B_TYPE  ///< Bi-dir predicted
-#define S_TYPE FF_S_TYPE  ///< S(GMC)-VOP MPEG4
-#define SI_TYPE FF_SI_TYPE  ///< Switching Intra
-#define SP_TYPE FF_SP_TYPE  ///< Switching Predicted
-
 #define MAX_MB_BYTES (30*16*16*3/8 + 120)
 
 #define INPLACE_OFFSET 16
@@ -127,8 +118,8 @@ typedef struct Picture{
     int pic_id;                 /**< h264 pic_num (short -> no wrap version of pic_num,
                                      pic_num & max_pic_num; long -> long_pic_num) */
     int long_ref;               ///< 1->long term reference 0->short term reference
-    int ref_poc[2][16];         ///< h264 POCs of the frames used as reference
-    int ref_count[2];           ///< number of entries in ref_poc
+    int ref_poc[2][2][16];      ///< h264 POCs of the frames used as reference (FIXME need per slice)
+    int ref_count[2][2];        ///< number of entries in ref_poc              (FIXME need per slice)
 
     int mb_var_sum;             ///< sum of MB variance for current frame
     int mc_mb_var_sum;          ///< motion compensated MB variance for current frame
@@ -318,7 +309,7 @@ typedef struct MpegEncContext {
     int *lambda_table;
     int adaptive_quant;         ///< use adaptive quantization
     int dquant;                 ///< qscale difference to prev qscale
-    int pict_type;              ///< I_TYPE, P_TYPE, B_TYPE, ...
+    int pict_type;              ///< FF_I_TYPE, FF_P_TYPE, FF_B_TYPE, ...
     int last_pict_type; //FIXME removes
     int last_non_b_pict_type;   ///< used for mpeg4 gmc b-frames & ratecontrol
     int dropable;
@@ -750,7 +741,7 @@ int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type);
 void ff_fix_long_p_mvs(MpegEncContext * s);
 void ff_fix_long_mvs(MpegEncContext * s, uint8_t *field_select_table, int field_select,
                      int16_t (*mv_table)[2], int f_code, int type, int truncate);
-void ff_init_me(MpegEncContext *s);
+int ff_init_me(MpegEncContext *s);
 int ff_pre_estimate_p_frame_motion(MpegEncContext * s, int mb_x, int mb_y);
 int ff_epzs_motion_search(MpegEncContext * s, int *mx_ptr, int *my_ptr,
                              int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],