set.h 3.79 KB
Newer Older
Laurent Aimar's avatar
Laurent Aimar committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
/*****************************************************************************
 * set.h: h264 encoder
 *****************************************************************************
 * Copyright (C) 2003 Laurent Aimar
 * $Id: set.h,v 1.1 2004/06/03 19:27:07 fenrir Exp $
 *
 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
 *****************************************************************************/

#ifndef _SET_H
#define _SET_H 1

enum profile_e
{
    PROFILE_BASELINE = 66,
30
    PROFILE_MAIN     = 77,
31
    PROFILE_EXTENTED = 88,
32 33
    PROFILE_HIGH    = 100,
    PROFILE_HIGH10  = 110,
34 35
    PROFILE_HIGH422 = 122,
    PROFILE_HIGH444 = 144
Laurent Aimar's avatar
Laurent Aimar committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
};

typedef struct
{
    int i_id;

    int i_profile_idc;
    int i_level_idc;

    int b_constraint_set0;
    int b_constraint_set1;
    int b_constraint_set2;

    int i_log2_max_frame_num;

    int i_poc_type;
    /* poc 0 */
    int i_log2_max_poc_lsb;
    /* poc 1 */
    int b_delta_pic_order_always_zero;
    int i_offset_for_non_ref_pic;
    int i_offset_for_top_to_bottom_field;
    int i_num_ref_frames_in_poc_cycle;
    int i_offset_for_ref_frame[256];

    int i_num_ref_frames;
    int b_gaps_in_frame_num_value_allowed;
    int i_mb_width;
    int i_mb_height;
    int b_frame_mbs_only;
    int b_mb_adaptive_frame_field;
    int b_direct8x8_inference;

    int b_crop;
    struct
    {
        int i_left;
        int i_right;
        int i_top;
        int i_bottom;
    } crop;

    int b_vui;
    struct
    {
Måns Rullgård's avatar
Måns Rullgård committed
81
        int b_aspect_ratio_info_present;
Laurent Aimar's avatar
Laurent Aimar committed
82 83
        int i_sar_width;
        int i_sar_height;
Måns Rullgård's avatar
Måns Rullgård committed
84 85 86 87 88 89

        int b_timing_info_present;
        int i_num_units_in_tick;
        int i_time_scale;
        int b_fixed_frame_rate;

90 91 92 93 94 95 96 97 98
        int b_bitstream_restriction;
        int b_motion_vectors_over_pic_boundaries;
        int i_max_bytes_per_pic_denom;
        int i_max_bits_per_mb_denom;
        int i_log2_max_mv_length_horizontal;
        int i_log2_max_mv_length_vertical;
        int i_num_reorder_frames;
        int i_max_dec_frame_buffering;

Laurent Aimar's avatar
Laurent Aimar committed
99 100 101 102 103 104 105 106 107 108 109 110 111 112
        /* FIXME to complete */
    } vui;
} x264_sps_t;

typedef struct
{
    int i_id;
    int i_sps_id;

    int b_cabac;

    int b_pic_order;
    int i_num_slice_groups;

113 114 115
#if 0
    /* FIXME: if this stuff is ever needed, move SPS/PPS from x264_t
     * to the heap, to avoid excessive memcpy'ing with threads. */
Laurent Aimar's avatar
Laurent Aimar committed
116 117 118 119 120 121 122 123 124 125 126 127
    int i_slice_group_map_type;
    /* i_slice_group_map_type == 0 */
    int i_run_length[256];      /* FIXME */
    /* i_slice_group_map_type == 2 */
    int i_top_left[256];        /* FIXME */
    int i_bottom_right[256];    /* FIXME */
    /* i_slice_group_map_type == 3, 4, 5 */
    int b_slice_group_change_direction;
    int i_slice_group_change_rate;
    /* i_slice_group_map_type == 6 */
    int i_pic_size_in_map_units;
    int i_slice_group_id[256];  /* FIXME */
128
#endif
Laurent Aimar's avatar
Laurent Aimar committed
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143

    int i_num_ref_idx_l0_active;
    int i_num_ref_idx_l1_active;

    int b_weighted_pred;
    int b_weighted_bipred;

    int i_pic_init_qp;
    int i_pic_init_qs;

    int i_chroma_qp_index_offset;

    int b_deblocking_filter_control;
    int b_constrained_intra_pred;
    int b_redundant_pic_cnt;
144 145 146

    int b_transform_8x8_mode;

Laurent Aimar's avatar
Laurent Aimar committed
147 148 149
} x264_pps_t;

#endif