您的位置:首页 > Web前端

x264_frame_t参数解析

2012-10-02 15:55 323 查看
typedef struct x264_frame

{

    /* */

    int     i_poc;

    int     i_delta_poc[2];

    int     i_type;

    int     i_qpplus1;

    int64_t i_pts;

    int64_t i_dts;

    int64_t i_reordered_pts;

    int64_t i_duration;  /* in SPS time_scale units (i.e 2 * timebase units) used for vfr */

    float   f_duration;  /* in seconds */

    int64_t i_cpb_duration;

    int64_t i_cpb_delay; /* in SPS time_scale units (i.e 2 * timebase units) */

    int64_t i_dpb_output_delay;

    x264_param_t *param;

    int     i_frame;     /* Presentation frame number */

    int     i_coded;     /* Coded frame number */

    int64_t i_field_cnt; /* Presentation field count */

    int     i_frame_num; /* 7.4.3 frame_num */

    int     b_kept_as_ref;

    int     i_pic_struct;

    int     b_keyframe;

    uint8_t b_fdec;

    uint8_t b_last_minigop_bframe; /* this frame is the last b in a sequence of bframes */

    uint8_t i_bframes;   /* number of bframes following this nonb in coded order */

    float   f_qp_avg_rc; /* QPs as decided by ratecontrol */

    float   f_qp_avg_aq; /* QPs as decided by AQ in addition to ratecontrol */

    float   f_crf_avg;   /* Average effective CRF for this frame */

    int     i_poc_l0ref0; /* poc of first refframe in L0, used to check if direct temporal is possible */

    /* YUV buffer */

    int     i_csp; /* Internal csp */

    int     i_plane;

    int     i_stride[3];

    int     i_width[3];

    int     i_lines[3];

    int     i_stride_lowres;

    int     i_width_lowres;

    int     i_lines_lowres;

    pixel *plane[3];

    pixel *plane_fld[3];

    pixel *filtered[3][4]; /* plane[0], H, V, HV */

    pixel *filtered_fld[3][4];

    pixel *lowres[4]; /* half-size copy of input frame: Orig, H, V, HV */

    uint16_t *integral;

    /* for unrestricted mv we allocate more data than needed

     * allocated data are stored in buffer */

    pixel *buffer[4];

    pixel *buffer_fld[4];

    pixel *buffer_lowres[4];

    x264_weight_t weight[X264_REF_MAX][3]; /* [ref_index][plane] */

    pixel *weighted[X264_REF_MAX]; /* plane[0] weighted of the reference frames */

    int b_duplicate;

    struct x264_frame *orig;

    /* motion data */

    int8_t  *mb_type;

    uint8_t *mb_partition;

    int16_t (*mv[2])[2];

    int16_t (*mv16x16)[2];

    int16_t (*lowres_mvs[2][X264_BFRAME_MAX+1])[2];

    uint8_t *field;

    uint8_t *effective_qp;

    /* Stored as (lists_used << LOWRES_COST_SHIFT) + (cost).

     * Doesn't need special addressing for intra cost because

     * lists_used is guaranteed to be zero in that cast. */

    uint16_t (*lowres_costs[X264_BFRAME_MAX+2][X264_BFRAME_MAX+2]);

    #define LOWRES_COST_MASK ((1<<14)-1)

    #define LOWRES_COST_SHIFT 14

    int     *lowres_mv_costs[2][X264_BFRAME_MAX+1];

    int8_t  *ref[2];

    int     i_ref[2];

    int     ref_poc[2][X264_REF_MAX];

    int16_t inv_ref_poc[2]; // inverse values of ref0 poc to avoid divisions in temporal MV prediction

    /* for adaptive B-frame decision.

     * contains the SATD cost of the lowres frame encoded in various modes

     * FIXME: how big an array do we need? */

    int     i_cost_est[X264_BFRAME_MAX+2][X264_BFRAME_MAX+2];

    int     i_cost_est_aq[X264_BFRAME_MAX+2][X264_BFRAME_MAX+2];

    int     i_satd; // the i_cost_est of the selected frametype

    int     i_intra_mbs[X264_BFRAME_MAX+2];

    int     *i_row_satds[X264_BFRAME_MAX+2][X264_BFRAME_MAX+2];

    int     *i_row_satd;

    int     *i_row_bits;

    float   *f_row_qp;

    float   *f_row_qscale;

    float   *f_qp_offset;

    float   *f_qp_offset_aq;

    int     b_intra_calculated;

    uint16_t *i_intra_cost;

    uint16_t *i_propagate_cost;

    uint16_t *i_inv_qscale_factor;

    int     b_scenecut; /* Set to zero if the frame cannot possibly be part of a real scenecut. */

    float   f_weighted_cost_delta[X264_BFRAME_MAX+2];

    uint32_t i_pixel_sum[3];

    uint64_t i_pixel_ssd[3];

    /* hrd */

    x264_hrd_t hrd_timing;

    /* vbv */

    uint8_t i_planned_type[X264_LOOKAHEAD_MAX+1];

    int i_planned_satd[X264_LOOKAHEAD_MAX+1];

    double f_planned_cpb_duration[X264_LOOKAHEAD_MAX+1];

    int64_t i_coded_fields_lookahead;

    int64_t i_cpb_delay_lookahead;

    /* threading */

    int     i_lines_completed; /* in pixels */

    int     i_lines_weighted; /* FIXME: this only supports weighting of one reference frame */

    int     i_reference_count; /* number of threads using this frame (not necessarily the number of pointers) */

    x264_pthread_mutex_t mutex;

    x264_pthread_cond_t  cv;

    /* periodic intra refresh */

    float   f_pir_position;

    int     i_pir_start_col;

    int     i_pir_end_col;

    int     i_frames_since_pir;

    /* interactive encoder control */

    int     b_corrupt;

    /* user sei */

    x264_sei_t extra_sei;

    /* user data */

    void *opaque;

    /* user frame properties */

    uint8_t *mb_info;

    void (*mb_info_free)( void* );

} x264_frame_t;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息