blob: 4df31b672bcade246121086c69285abd3cc7c400 [file] [log] [blame]
/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Code Aurora Forum, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef _VCD_DRIVER_PROPERTY_H_
#define _VCD_DRIVER_PROPERTY_H_
#define VCD_START_BASE 0x0
#define VCD_I_LIVE (VCD_START_BASE + 0x1)
#define VCD_I_CODEC (VCD_START_BASE + 0x2)
#define VCD_I_FRAME_SIZE (VCD_START_BASE + 0x3)
#define VCD_I_METADATA_ENABLE (VCD_START_BASE + 0x4)
#define VCD_I_METADATA_HEADER (VCD_START_BASE + 0x5)
#define VCD_I_PROFILE (VCD_START_BASE + 0x6)
#define VCD_I_LEVEL (VCD_START_BASE + 0x7)
#define VCD_I_BUFFER_FORMAT (VCD_START_BASE + 0x8)
#define VCD_I_FRAME_RATE (VCD_START_BASE + 0x9)
#define VCD_I_TARGET_BITRATE (VCD_START_BASE + 0xA)
#define VCD_I_MULTI_SLICE (VCD_START_BASE + 0xB)
#define VCD_I_ENTROPY_CTRL (VCD_START_BASE + 0xC)
#define VCD_I_DEBLOCKING (VCD_START_BASE + 0xD)
#define VCD_I_RATE_CONTROL (VCD_START_BASE + 0xE)
#define VCD_I_QP_RANGE (VCD_START_BASE + 0xF)
#define VCD_I_SESSION_QP (VCD_START_BASE + 0x10)
#define VCD_I_INTRA_PERIOD (VCD_START_BASE + 0x11)
#define VCD_I_VOP_TIMING (VCD_START_BASE + 0x12)
#define VCD_I_SHORT_HEADER (VCD_START_BASE + 0x13)
#define VCD_I_SEQ_HEADER (VCD_START_BASE + 0x14)
#define VCD_I_HEADER_EXTENSION (VCD_START_BASE + 0x15)
#define VCD_I_INTRA_REFRESH (VCD_START_BASE + 0x16)
#define VCD_I_POST_FILTER (VCD_START_BASE + 0x17)
#define VCD_I_PROGRESSIVE_ONLY (VCD_START_BASE + 0x18)
#define VCD_START_REQ (VCD_START_BASE + 0x1000)
#define VCD_I_REQ_IFRAME (VCD_START_REQ + 0x1)
#define VCD_I_RESERVED_BASE (VCD_START_BASE + 0x10000)
struct vcd_property_hdr {
u32 id;
size_t sz;
};
//TODO: Remove?
struct vcd_property_live {
u32 live;
};
enum vcd_codec {
VCD_CODEC_H264 = 0x1,
VCD_CODEC_H263 = 0x2,
VCD_CODEC_MPEG1 = 0x3,
VCD_CODEC_MPEG2 = 0x4,
VCD_CODEC_MPEG4 = 0x5,
VCD_CODEC_DIVX_3 = 0x6,
VCD_CODEC_DIVX_4 = 0x7,
VCD_CODEC_DIVX_5 = 0x8,
VCD_CODEC_DIVX_6 = 0x9,
VCD_CODEC_XVID = 0xA,
VCD_CODEC_VC1 = 0xB,
VCD_CODEC_VC1_RCV = 0xC
};
struct vcd_property_codec {
enum vcd_codec codec;
};
struct vcd_property_frame_size {
u32 width;
u32 height;
u32 stride;
u32 scan_lines;
};
#define VCD_METADATA_DATANONE 0x001
#define VCD_METADATA_QCOMFILLER 0x002
#define VCD_METADATA_QPARRAY 0x004
#define VCD_METADATA_CONCEALMB 0x008
#define VCD_METADATA_SEI 0x010
#define VCD_METADATA_VUI 0x020
#define VCD_METADATA_VC1 0x040
#define VCD_METADATA_PASSTHROUGH 0x080
#define VCD_METADATA_ENC_SLICE 0x100
struct vcd_property_meta_data_enable {
u32 meta_data_enable_flag;
};
struct vcd_property_metadata_hdr {
u32 meta_data_id_type;
u32 version;
u32 port_index;
u32 type;
};
struct vcd_property_frame_rate {
u32 fps_denominator;
u32 fps_numerator;
};
struct vcd_property_target_bitrate {
u32 target_bitrate;
};
enum vcd_yuv_buffer_format_type {
VCD_BUFFER_FORMAT_NV12 = 0x1,
VCD_BUFFER_FORMAT_TILE_4x2 = 0x2,
VCD_BUFFER_FORMAT_NV12_16M2KA = 0x3
};
struct vcd_property_buffer_format {
enum vcd_yuv_buffer_format_type buffer_format;
};
struct vcd_property_post_filter {
u32 post_filter;
};
enum vcd_codec_profile_type {
VCD_PROFILE_UNKNOWN = 0x0,
VCD_PROFILE_MPEG4_SP = 0x1,
VCD_PROFILE_MPEG4_ASP = 0x2,
VCD_PROFILE_H264_BASELINE = 0x3,
VCD_PROFILE_H264_MAIN = 0x4,
VCD_PROFILE_H264_HIGH = 0x5,
VCD_PROFILE_H263_BASELINE = 0x6,
VCD_PROFILE_VC1_SIMPLE = 0x7,
VCD_PROFILE_VC1_MAIN = 0x8,
VCD_PROFILE_VC1_ADVANCE = 0x9,
VCD_PROFILE_MPEG2_MAIN = 0xA,
VCD_PROFILE_MPEG2_SIMPLE = 0xB
};
struct vcd_property_profile {
enum vcd_codec_profile_type profile;
};
enum vcd_codec_level_type {
VCD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0x42,
VCD_LEVEL_VC1_0 = 0x43,
VCD_LEVEL_VC1_1 = 0x44,
VCD_LEVEL_VC1_2 = 0x45,
VCD_LEVEL_VC1_3 = 0x46,
VCD_LEVEL_VC1_4 = 0x47,
VCD_LEVEL_VC1_X = 0x48
};
struct vcd_property_level {
enum vcd_codec_level_type level;
};
enum vcd_m_slice_sel_type {
VCD_MSLICE_OFF = 0x1,
VCD_MSLICE_BY_MB_COUNT = 0x2,
VCD_MSLICE_BY_BYTE_COUNT = 0x3,
VCD_MSLICE_BY_GOB = 0x4
};
struct vcd_property_multi_slice {
enum vcd_m_slice_sel_type m_slice_sel;
u32 m_slice_size;
};
enum vcd_entropy_sel_type {
VCD_ENTROPY_SEL_CAVLC = 0x1,
VCD_ENTROPY_SEL_CABAC = 0x2
};
enum vcd_cabac_model_type {
VCD_CABAC_MODEL_NUMBER_0 = 0x1,
VCD_CABAC_MODEL_NUMBER_1 = 0x2,
VCD_CABAC_MODEL_NUMBER_2 = 0x3
};
struct vcd_property_entropy_control {
enum vcd_entropy_sel_type entropy_sel;
enum vcd_cabac_model_type cabac_model;
};
enum vcd_db_config_type {
VCD_DB_ALL_BLOCKING_BOUNDARY = 0x1,
VCD_DB_DISABLE = 0x2,
VCD_DB_SKIP_SLICE_BOUNDARY = 0x3
};
struct vcd_property_db_config {
enum vcd_db_config_type db_config;
u32 slice_alpha_offset;
u32 slice_beta_offset;
};
enum vcd_rate_control_type {
VCD_RATE_CONTROL_OFF = 0x1,
VCD_RATE_CONTROL_VBR_VFR = 0x2,
VCD_RATE_CONTROL_VBR_CFR = 0x3,
VCD_RATE_CONTROL_CBR_VFR = 0x4,
VCD_RATE_CONTROL_CBR_CFR = 0x5
};
struct vcd_property_rate_control {
enum vcd_rate_control_type rate_control;
};
struct vcd_property_qp_range {
u32 max_qp;
u32 min_qp;
};
struct vcd_property_session_qp {
u32 iframe_qp;
u32 frame_qp;
u32 bframe_qp;
};
struct vcd_property_i_period {
u32 frames;
u32 bframes;
};
struct vcd_property_vop_timing {
u32 vop_time_resolution;
};
struct vcd_property_short_header {
u32 short_header;
};
struct vcd_property_intra_refresh_mb_number {
u32 cir_mb_number;
};
struct vcd_property_req_i_frame {
u32 req_i_frame;
};
struct vcd_frame_rect {
u32 left;
u32 top;
u32 right;
u32 bottom;
};
struct vcd_property_dec_output_buffer {
struct vcd_frame_rect disp_frm;
};
#endif